Professional Documents
Culture Documents
Online Dictionary
SUBMITTED IN PARTIAL FULFILMENT OF THE DEGREE OF
BACHELOR OF TECHNOLOGY
by
Online Dictionary
is a bonafide report of the project presented by
Jagannath Hemram
Manas Ranjan Paramanik
Bachelor of Technology
under our guidance
_______________________________________________________________
Acknowledgement
We are deeply indebted to Mrs. Priya Chandran, Asst. Professor of Computer Science and Engineering, for all help, guidance and encouragement given for the project. We would like to express our sincere gratitude to our friends who have been constantly source of help and encouragement. Jagannath Hemram Manas Ranjan Paramanik
Abstract
A good online dictionary can be fast, efficient, and more current than print editions. Better still, consulting an online dictionary may be more convenient than unearthing the cumbersome desk dictionary from a growing mound of journals and manuscripts. Whether print or online, dictionaries are helpful only if they include the words that users are seeking. Unfortunately, many dictionaries available on the Web are not so good. After selecting 15 uncommonbut not quite obscurewords from various fields of science, editing, publishing, and emerging technologies, we entered them into the search field of each dictionary. Some online dictionaries like WordNet (Princeton University), the Free Online Dictionary of Computing, and CancerWEBs Online Medical Dictionary are devoted to single dictionaries and do not provide the variety of additional resources. But our Online Dictionary providing three types of dictionaries, general English dictionary, Medical dictionary and Computer dictionary. Along with this we are also providing the feature of spelling check of the word, which will be typed.
ii
Contents
1 Introduction 2 Problem Definition 2.1 Motivation 3 Overview of Servlets 3.1 Use Servlets instead of CGI Scripts 3.2 Other Uses for Servlets 3.3 Architecture of the Servlet Package 3.4 Interface Servlet and the Servlet Lifecycle 3.5 HttpServlet class 3.6 HttpServletRequest Interface 3.7 HttpServletResponse Interface 4 Java Database Connectivity 4.1 JDBC-ODBC Bridge 4.2 The SQL (Structured Query Language) Language 5 Installing a JSP Container Jakarta Tomcat 5.1 Installation 5.2 Starting and Stopping Tomcat 5.3 Setting Environment Variables 5.4 Configuring Tomcat to Work with Apache 6 Design of Project 6.1 Implementation Decision and Justification 6.2 Implementation of Database 6.2.1 Creating the Database 6.2.2 Creating a Table 6.2.3 Creating a Table Using JDBC 6.2.4 Deleting or Dropping a Table 6.2.5 The INSERT Statement 6.2.6 The UPDATE Statement 6.2.7 Searching the Word 6.2.8 Spelling Check 7 Conclusion References 1 1 1 2 2 2 3 3 4 4 4 4 5 5 6 6 6 7 7 8 8 8 8 9 9 10 10 10 12 12 14 15
iii
1 Introduction
When a general online dictionary just doesnt suffice, it may be time to look at some of the specialized dictionaries available on the Web. There are online dictionaries and glossaries devoted to almost every branch of science and technology. For example, the University of Texas hosts BioTech Life Science Dictionary (biotech.icmb.utexas.edu/search/dict-search.html), a searchable collection of terms specific to the life sciences. In a search for specialized dictionaries, yourDictionary.com is a good place to start. In addition to its quick reference dictionary and thesaurus, this web site is a resource center for a wide variety of specialty dictionaries in numerous languages. Dictionaries are grouped into categories, including computer, medical, general english. Some dictionary softwares which also used all over world, provide the meaning of a word, pronunciation information, word derivations, histories, or etymologies, illustrations, usage guidance, and examples in sentences. But they are not updatable according to user requirements. In this project we provide a software package that fulfills all above mentioned features. This project is implementing using Java and SQL (Structured Query Language) in the windows operating system. Project Online Dictionary mainly consists of three features. These are 1. a text editor, which take input as text and find incorrect word and provide the possible correct words of the incorrect words. 2. A search for the meaning of the word. 3. Update to update the dictionary database. This will be done off line. Only administrator can do the necessary modification in the dictionary database.
2 Problem Definition
A dictionary is a list of words with their definitions, a list of characters with its glyph or a list of words with corresponding words in other languages. Many dictionaries also provide pronunciation information, word derivations, histories, or etymologies, illustrations, usage guidance, and examples in sentences. To implement all these things in a single dictionary with some new features is the goal of this project.
2.1 Motivation
Our project topic is "Online Dictionary". Therefore we want to use Java servlet technology. The HTTP (Hyper Text Transfer Protocol) that forms the basis of the World Wide Web uses URLs (Uniform Resource Locator) to locate resources on the internet. Common URLs represents files or directories and can represent complex task such as database lookups and internal searches. JavaServer Pages technology is an extension of servlet technology. Servlets commonly are used when a small portion of the content send to the client a static text or markup. In most cases servlet and JSP technologies are interchangeable. The servlets are used to communicate between clients and servers via the HTTP protocol. A client sends and HTTP request to the server. The servlet container receives the request and directs it to be processed by the appropriate servlet. The servlet does its processing, which may include interacting with a database or other server side components such as other servlets. The servlet returns its results to the clientnormally in the form of a HTML, XHTML or XML documents to display in the browser. Using this browser a user can communicate to the dictionary database that is present in the server side program. A user can enter his query here that will retrieve from the database and display the result to the client through the servlet. We are also providing a text editor where a user can edit his required document and save in his computer. In the text editor we will implement "open", "close", "save", copy, paste to do the same to a file. Also we are providing some functions like font style and its sizes, bold, italic, font colours etc. And also there will be an option to check spelling. When some words or sentences are given in the text editor as input then as output it will highlight the incorrect word (i.e. which is not present in 1
the dictionary database). When some words are given in the text editor as input that will read one by one by the getText() function. This can be done using threading where getText() function will read the word after certain time interval and client will send that word to the server where server will check whether the word is present in the dictionary database or not. If match is not found server will call doHighlight() function which is present in the client side and highlight that word. Another important feature of our project is update the dictionary, only administrator can update the dictionary. This updating will be done offline.
3 Overview of Servlets
Servlets are modules that extend request/response-oriented servers, such as Java-enabled web servers. For example, a servlet might be responsible for taking data in an HTML order-entry form and applying the business logic used to update a company's order database.
Servlets are to servers what applets are to browsers. Unlike applets, however, servlets have no graphical user interface. Servlets can be embedded in many different servers because the servlet API, which you use to write servlets, assumes nothing about the server's environment or protocol. Servlets have become most widely used within HTTP servers; many web servers support the Servlet API.
Forwarding requests. Servlets can forward requests to other servers and servlets. Thus servlets can be
used to balance load among several servers that mirror the same content, and to partition a single logical service over several servers, according to task type or organizational boundaries.
Unlike Java and most other computer languages, SQL is declarative rather than procedural. In other words, instead of writing a class to perform some task, in SQL issuing a statement that updates a table or returns a group of records.
Tomcat 5.0.19 is the next generation of Tomcat. The 5.0.19 servlet container has been developed from the ground up for flexibility and performance. Version 5.0.19 implements the final released version of the Servlet 2.3 and JSP 1.2 specifications. As required by the specifications, Tomcat 5.0.19 also supports Web applications build for the Servlet 2.2 and JSP 1.1 specifications with no changes.
5.1 Installation
To unzip and install Tomcat, simply click on the Tomcat zip file, and Winzip opens a dialog box and prompts you to select the install directory and then guides you through the installation. The actual installation takes place in a subdirectory called jacarta-tomcat-5.0.19. We prefer to install Tomcat in its own directory, either directly under C:\ or under Apache, since Tomcat and Apache are designed to work well together.
Script tomcat
startup shutdown
Purpose Sets the environment variables, including CLASSPATH, TOMCAT_HOME and JAVA_HOME, and starts Tomcat with the proper comment-line parameters. Starts tomcat in the back ground Stops tomcat
The most important of these scripts is (tomcat .sh/tomcat.bat). This other scripts serve as a simplified, single task-oriented entry point to the Tomcat script (set different command-line parameters and so on).
JAVA_HOME points to the root directory of our JDK hierarchy, and we should type the following On Win32, type set JAVA_HOME= c:\java\jdk1.4.2
PATH points to the javac executable, we should type the following On Win32, type path=c:\java\jdk1.4.2;%PATH%
CLASSPATH points to the java classes required by Tomcat and we should type the following On Win32, type SET CLASSPATH =.;C:\apache\tomcat\lib\servlet.jar; SET CLASSPATH= %CLASSPATH%;C:\apache\tomcat\lib\jasper.jar; The easiest way to do all this is to create our own script file containing these lines: PATH=C:\JAVA\JDK1.4.2\BIN;%PATH% SET TOMCAT_HOME=C:\APACHE\TOMCAT SET JAVA_HOME=C:\JAVA\JDK1.4.2 SET CLASSPATH =.;C:\apache\tomcat\lib\servlet.jar; SET CLASSPATH= %CLASSPATH%;C:\apache\tomcat\lib\jasper.jar; STARTUP The final command, STARTUP, runs Tomcats own startup.bat script. Save this script as tcstart.bat. Now start Tomcat by typing tcstart.
Check and see if a certain request belongs to a servlet, and, if s o, let Tomcat take the request and handle it. Tomcat needs to know what request it is going to serve, usually based on some pattern in the request URL and where to direct this request
6 Design of Project
As discussed in section 2.1 the design of the project is shown in the following section with the UML/Data flow diagram.
UML diagram for searching the meaning of the word and checking the spelling
If you are running a common line DBMS such as MySQL, start the package; at the command prompt, type the following: CREATE DATABASE DICTIONARY;
DriverManager
The DirverManager is responsible for loading JDBC drivers and for returning a connection to the appropriate driver. The DriverManager locates suitable driver for the URL provided in the getConnectin() call by polling the registered drivers.
Driver
The first thing we do is load the com.mysql.jdbc.Driver by name, using class.forName (). Then we register it with the DriverManager, using this command: DriverManager.registerDriver(new JdbcOdbcDriver());
Connection
We next request a connection to the database from the DriverManager using the following command: getConnection(jdbc:driverName:databaseName); The DriverManager polls on registered drivers to find the first one that can create a connection to the URL. Variations on this command let you give the database user name or pass a Java Properties object with the URL: getConnection(String url, String user, String password); getConnection(String url, properties info); A connection represents session with a specific database, providing the context in which our SQL statements are executed and results are returned. In our project we have used com.mysql.jdbc.Driver driver.
Statement
The term Statement refers to the Java class that passes the SQL Query to the database via the connection rather than to the SQL Query itself. A Statement object is used for executing a static SQL statement and obtaining the results it produces.
quotation is optional. When you submit the word and its meaning first it check in the database whether the word is present or not, if the word is present it will give an error message word is already resent otherwise it will update the dictionary.
11
12
13
7 Conclusion
A dictionary is a list of words with their definitions, a list of characters with its glyph or a list of words with corresponding words in other languages. Our project online dictionaries provide pronunciation information, word derivations, histories, or etymologies, illustrations, usage guidance, and examples in sentences. Dictionaries are grouped into categories, including computer, medical, english. Later we can increase the categories in geology, medicine, physics, rhetoric, publishing, printing, and shipping etc. If any use found any new words they can contact us with the details of that word and they may also send their suggestions.
14
References
[1] John O'Donahue, "Java Database Programming Bible", New Delhi, Wiley Publishing, Inc. [2] Herbert Schildt, "The Complete Reference JAVA 2 Fourth Edition", New Delhi: 110 008, Tata McGraw-Hill. [3] PETER van der LINDEN, "Just JAVA 2 Fourth Edition", Delhi: 110 040, The Sun Microsystems Press. [4] Jamie Jaworski, Java 2 Platform Unleashed, New Delhi:110 002, Techmedia.
15