howto implement a word Suggester in Spell Checker

Discussion in 'Java' started by Aguilera, Dec 2, 2003.

  1. Aguilera

    Aguilera Guest

    Hello
    I have made a spell checker in java and would like to add a word
    suggester to it aswell.
    At the moment my programme can catch the incorrect words in the
    String.
    but i would like it to suggest an alternative correct word for every
    miss spelled word?
    So does anyone know how i could make my progrrame suggest a word if it
    finds some incorrect word .
     
    Aguilera, Dec 2, 2003
    #1
    1. Advertising

  2. Aguilera

    Jeffrey Palm Guest

    Aguilera wrote:
    > Hello
    > I have made a spell checker in java and would like to add a word
    > suggester to it aswell.
    > At the moment my programme can catch the incorrect words in the
    > String.
    > but i would like it to suggest an alternative correct word for every
    > miss spelled word?
    > So does anyone know how i could make my progrrame suggest a word if it
    > finds some incorrect word .


    This is quite vague. Is this a GUI thing, command-line, ???

    If it's a GUI highlight the word. For a commane-line version simply
    print a message.

    Jeff

    --
    Jeffrey Palm --> http://www.ccs.neu.edu/home/jpalm
     
    Jeffrey Palm, Dec 2, 2003
    #2
    1. Advertising

  3. Hmm...I've never personally written a spell checker or a word suggester,
    but I suspect that the concept for how they do it might go something
    like this:

    Given a dictionary D of correct words
    and given a sentence S comprised of words Ws
    For any W that is spelled wrong find a word in D that is "close"

    Now, the real question is what does "close" mean. The only thing that I
    can think of would be to compare the letters in the wrong word to every
    word in your dictionary and give some value of "closeness" to it. FOr
    example, something like every common letter between the two in the same
    order gives you a point. Then, just show the top 10 close words and let
    the user pick. Unfortunately, it's early and I can't seem to think of
    any good algorithms that would make this quick as the brute force method
    could be painfully slow if you have a large dictionary. I suspect there
    is some way to represent the words in the dictionary mathematically such
    that a comparison for closeness is very quick.

    Aguilera wrote:
    > Hello
    > I have made a spell checker in java and would like to add a word
    > suggester to it aswell.
    > At the moment my programme can catch the incorrect words in the
    > String.
    > but i would like it to suggest an alternative correct word for every
    > miss spelled word?
    > So does anyone know how i could make my progrrame suggest a word if it
    > finds some incorrect word .
     
    Matthew Zimmer, Dec 2, 2003
    #3
  4. Hi,

    You can tell how close is a word from another if you count how many letter
    does one word have to change to become the other. For example:

    Father is 1 letter away from Fater, or
    mispelled is 2 letters away from mipselled

    This way, for every incorrect word in your text, you can suggest all of
    the other words that are N steps (or letters) away from the incorrect one.
    You should ajust N to suggest words that are likely to be the correct
    word in the original text.

    Erich

    Aguilera <> wrote:
    > Hello
    > I have made a spell checker in java and would like to add a word
    > suggester to it aswell.
    > At the moment my programme can catch the incorrect words in the
    > String.
    > but i would like it to suggest an alternative correct word for every
    > miss spelled word?
    > So does anyone know how i could make my progrrame suggest a word if it
    > finds some incorrect word .
     
    Erich Reimberg N., Dec 2, 2003
    #4
  5. Aguilera

    Tim Ward Guest

    "Matthew Zimmer" <> wrote in message
    news:bqi624$22pagj$-berlin.de...
    >
    > Now, the real question is what does "close" mean.


    I think you need two sources of information:

    (a) list/description of common spelling mistakes
    (b) list/description of common typing mistakes

    and try and come up with some way of encoding them into some combination of
    algorithms and tables. Obviously you can tap into this process at any point,
    from the raw research data to using someone else's complete solution.

    For example, you could just fire up Word and use that.

    --
    Tim Ward
    Brett Ward Limited - www.brettward.co.uk
     
    Tim Ward, Dec 2, 2003
    #5
  6. Aguilera

    GaryM Guest

    Matthew Zimmer <> wrote in news:bqi624$22pagj$1@ID-
    186863.news.uni-berlin.de:

    > Now, the real question is what does "close" mean.


    Just a throw in suggestion. There is a an algorithm called Soundex
    which derives a code for english spoken works. Good for munged words so
    long as target words and entered words sound the same.
     
    GaryM, Dec 2, 2003
    #6
  7. Aguilera

    Phillip Lord Guest

    >>>>> "Aguilera" == Aguilera <> writes:

    Aguilera> Hello I have made a spell checker in java and would like
    Aguilera> to add a word suggester to it aswell. At the moment my
    Aguilera> programme can catch the incorrect words in the String.
    Aguilera> but i would like it to suggest an alternative correct word
    Aguilera> for every miss spelled word? So does anyone know how i
    Aguilera> could make my progrrame suggest a word if it finds some
    Aguilera> incorrect word .


    1) Try not to. Always best to use some one else for a thing such as
    this.

    2) If you choose to the phoentic algorithms (based on the sounds of
    words) generally work better than lexical algorithms (based on the
    letters in the word). Have a look at the "aspell" web page. It has
    a link to the algorithms (and implementations of them) that it
    uses.

    Phil
     
    Phillip Lord, Dec 2, 2003
    #7
  8. Phillip Lord wrote:
    > 2) If you choose to the phoentic algorithms (based on the sounds of
    > words) generally work better than lexical algorithms (based on the
    > letters in the word).


    I think that neither will do well alone, since a phonetic algorithm
    will often not do well on typos.
     
    Michael Borgwardt, Dec 2, 2003
    #8
  9. "Aguilera" <> wrote in message
    news:...
    > Hello
    > I have made a spell checker in java and would like to add a word
    > suggester to it aswell.
    > At the moment my programme can catch the incorrect words in the
    > String.
    > but i would like it to suggest an alternative correct word for every
    > miss spelled word?
    > So does anyone know how i could make my progrrame suggest a word if it
    > finds some incorrect word .


    You might try a phonetic lookup, based on the idea that people tend to
    make misspellings that make phonetic sense. Naturally this takes a big
    dictionary.
    Here is a simple example that uses the "Metaphone" algorithm
    http://www.wbrogden.com/java/Phonetic/index.html




    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    William Brogden, Dec 2, 2003
    #9
  10. Aguilera

    Phillip Lord Guest

    >>>>> "Michael" == Michael Borgwardt <> writes:

    Michael> Phillip Lord wrote:
    >> 2) If you choose to the phoentic algorithms (based on the sounds
    >> of
    >> words) generally work better than lexical algorithms (based on
    >> the letters in the word).


    Michael> I think that neither will do well alone, since a phonetic
    Michael> algorithm will often not do well on typos.

    The links on the aspell page cover the combination of the two.

    Phil
     
    Phillip Lord, Dec 2, 2003
    #10
  11. "GaryM" <> wrote in message
    news:Xns944561B4FADA5R3344324357788499939@216.168.3.44...
    > Matthew Zimmer <> wrote in news:bqi624$22pagj$1@ID-
    > 186863.news.uni-berlin.de:
    >
    > > Now, the real question is what does "close" mean.

    >
    > Just a throw in suggestion. There is a an algorithm called Soundex
    > which derives a code for english spoken works. Good for munged words so
    > long as target words and entered words sound the same.


    Unfortunately, Soundex depends on getting the first letter right. This
    falls apart on many sound-alikes. Metaphone is better because it attempts
    to match the sound rather than the letter.

    Bill




    ----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
    ---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
     
    William Brogden, Dec 2, 2003
    #11
  12. Aguilera

    DreamCoder Guest

    First of all , i want ot know he method that you use to check the spelling.
     
    DreamCoder, Dec 3, 2003
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Max
    Replies:
    6
    Views:
    3,410
  2. =?Utf-8?B?QUNhdW50ZXI=?=

    asp.net Spell Checker

    =?Utf-8?B?QUNhdW50ZXI=?=, Dec 14, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,311
    =?Utf-8?B?SmVk?=
    Dec 15, 2004
  3. msnews.microsoft.com

    Help Regarding Spell Checker

    msnews.microsoft.com, Jul 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    332
    Mark Rae
    Jul 25, 2005
  4. tshad

    MS Spell Checker

    tshad, Nov 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    469
    Karl Seguin
    Nov 30, 2005
  5. Chris Marsh

    spell checker

    Chris Marsh, Mar 7, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    379
    Chris Marsh
    Mar 7, 2006
Loading...

Share This Page