SpellChecker

Forum
Guy
2011-10-12
2013-05-08
  • Guy
    Guy
    2011-10-12

     
  • Guy
    Guy
    2011-10-12

    hi,

              I'm new to this project, wanna ask u how to use SpellChecker in the right way ? :

    1) for example, how to add User dictionary ?

    2) how to set new dictionaries ?

    3) if i use Tokenizer, what to sent to itws constructor ?

    I used this code: (is it ok ) ? :

    SpellChecker.setUserDictionaryProvider( new FileUserDictionary());
    SpellChecker.registerDictionaries( null, null);

    Tokenizer tok =  new Tokenizer(SpellChecker.getCurrentDictionary(), SpellChecker.getCurrentLocale(), SpellChecker.getOptions());

     
  • i-net software
    i-net software
    2011-10-14

    > SpellChecker.setUserDictionaryProvider( new FileUserDictionary());
    > SpellChecker.registerDictionaries( null, null);

    This is ok.

    > Tokenizer tok = new Tokenizer(SpellChecker.getCurrentDictionary(), SpellChecker.getCurrentLocale(), SpellChecker.getOptions());

    What you want do with the tokenizer? This is a internal class.

    Volker

     
  • Guy
    Guy
    2011-10-14

    Thanks for answering :)       

    i'm using the Tokenizer for it's isInvalidWord() method………i'm getting text file and seek for invalid words…….

    my question is …… how to use FileUserDictionary…….. if i want to add a list of words to it ? ……. what it exactly does ? ///////and if i can remove words from given dictionary like …… dictionary_en.ortho ? ………

    i'm asking cause i have a file of text and i need to seek for valid English words from this txt,  but do not want to include in my findings this special list of words……… (so how can FileUserDictionary be helpful) ?

    thanks

     
  • i-net software
    i-net software
    2011-10-17

    JOrtho was design as spell checker for a swing GUI and not for a txt file. But it is open source and you can change it.

    > to seek for valid English words

    The Tokenizer search for invalid words. Not every "not invalid" word is also a valid word. Some words will be skip and not mark as invalid. But this means not that it are valid.

    > but do not want to include in my findings this special list of words……… (so how can FileUserDictionary be helpful) ?

    The SpellChecker.getCurrentDictionary() include the words from the default dictionary and from the user dictionary. I does not understand your problem. Do you does not know what a user dictionary is? Do you does not know how you can use the FileUserDictionary?