public class MorfologikMultiSpeller extends Object
Constructor and Description |
---|
MorfologikMultiSpeller(String binaryDictPath,
BufferedReader plainTextReader,
List<String> plainTextReaderPath,
BufferedReader languageVariantPlainTextReader,
String languageVariantPlainTextPath,
UserConfig userConfig,
int maxEditDistance) |
MorfologikMultiSpeller(String binaryDictPath,
List<String> plainTextPaths,
String languageVariantPlainTextPath,
int maxEditDistance) |
MorfologikMultiSpeller(String binaryDictPath,
List<String> plainTextPaths,
String languageVariantPlainTextPath,
UserConfig userConfig,
int maxEditDistance) |
Modifier and Type | Method and Description |
---|---|
static void |
clearUserDictCache()
for tests only
|
boolean |
convertsCase()
Determines whether the dictionary uses case conversions.
|
int |
getFrequency(String word)
Get the frequency of use of a word (0-27) from the dictionary
|
List<String> |
getSuggestions(String word)
The suggestions from all dictionaries (without duplicates).
|
List<String> |
getSuggestionsFromDefaultDicts(String word) |
List<String> |
getSuggestionsFromUserDicts(String word) |
boolean |
isMisspelled(String word)
Accept the word if at least one of the dictionaries accepts it as not misspelled.
|
public MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, int maxEditDistance) throws IOException
IOException
public MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, UserConfig userConfig, int maxEditDistance) throws IOException
binaryDictPath
- path in classpath to a .dict
binary Morfologik fileplainTextPaths
- paths in classpath to plain text .txt
files (like spelling.txt)maxEditDistance
- maximum edit distance for accepting suggestionsIOException
public MorfologikMultiSpeller(String binaryDictPath, BufferedReader plainTextReader, List<String> plainTextReaderPath, BufferedReader languageVariantPlainTextReader, String languageVariantPlainTextPath, UserConfig userConfig, int maxEditDistance) throws IOException
binaryDictPath
- path in classpath to a .dict
binary Morfologik fileplainTextReader
- reader with to a plain text .txt
file (like from spelling.txt)maxEditDistance
- maximum edit distance for accepting suggestionsIOException
public boolean isMisspelled(String word)
public int getFrequency(String word)
public List<String> getSuggestions(String word)
public List<String> getSuggestionsFromUserDicts(String word)
word
- misspelled wordpublic List<String> getSuggestionsFromDefaultDicts(String word)
word
- misspelled wordpublic boolean convertsCase()
public static void clearUserDictCache()