A) A MUCH easier way might be to search the web for java resources on
thesaurus / spellcheckers.
   There must be some off-the-shelf stuff out there for you, This is really
the wrong place for you.

B) I'll give it a blast anyways.
   For a simple spell checker, Add words in to a hashtable from a dictionary
file,
   then compare the file you want checked word by word using a
StringTokenizer.
   If the word is not present in the dictionary it's misspelled (or you
dictionary is too small).

                   if(!Hashtable.containsValue(word)) {
                     // Code to report the error.
                   }
You might throw in a bit of logic to ignore words like "a, the, as, at, in "
etc...

<Possible rubbish>
A thesaurus is a tad more complicated, it might be done defining a tree
structure
of Hash ID's of the words stored in your hashtable. Hash ID's of synonym
words on the
tree represent child nodes, with the word you're checking is the parent
node. When checking a word,
do a search (bi-directional or depth first, not breadth-first as far as I
remember) on the tree
for the Hash ID of your word, and get the hash ID's of it's children.
Then user Hashtable.get(child ID) for all n children to retrieve the word
value.
Probable setup would be a hashtable containing hashtables/vectors.
Even less hassle might be a database setup.
The pain in the ass? Setting up something to determine wether something is a
synonym or not.

Get something that's already been done and license it!



Dave





-----Original Message-----
From: Muthukrishnan Giridhar [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 10, 2000 3:34 PM
To: [EMAIL PROTECTED]
Subject: [SERVLET-INTEREST] Spell Checker


Hi friends,

May be off-topic.

but, does anyone know how to implement a spell checker/thesaurus logic in
Java

Any help would be greatly appreciated

Thanks

Giridhar

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html


***********************************************************************
Privileged/confidential information may be contained in this message.
If you are not the addressee indicated in this message (or responsible
for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, you should destroy this
message and notify the sender and [EMAIL PROTECTED]
immediately.

If you or your employer do not consent to Internet E-mail messages of
this kind, please advise us immediately.

Opinions, conclusions and other information expressed in this message
 (including any attachments) are not given or endorsed by ebeon ltd
 (or ebeon inc., as applicable) unless otherwise confirmed in writing
by an authorised representative independent of this message. Any
liability arising from reliance placed on this message (including its
attachments) without such independent confirmation is hereby excluded.

This message (including attachments) is protected by copyright laws
but has no other legal or contractual standing. The presence of this
footnote indicates that this message (including its attachments) has
been processed by an automated anti-virus system; however it is the
responsiblity of the recipient to ensure that the message (and
attachments) are safe and authorised for use in their environment.
***********************************************************************

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to