Class MorfologikMultiSpeller
- java.lang.Object
-
- org.languagetool.rules.spelling.morfologik.MorfologikMultiSpeller
-
public class MorfologikMultiSpeller extends Object
Morfologik speller that merges results from binary (.dict) and plain text (.txt) dictionaries.- Since:
- 2.9
-
-
Constructor Summary
Constructors Constructor Description MorfologikMultiSpeller(String binaryDictPath, BufferedReader plainTextReader, List<String> plainTextReaderPath, BufferedReader languageVariantPlainTextReader, String languageVariantPlainTextPath, List<String> userWords, int maxEditDistance)
MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, int maxEditDistance)
MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, UserConfig userConfig, int maxEditDistance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
convertsCase()
Determines whether the dictionary uses case conversions.int
getFrequency(String word)
Get the frequency of use of a word (0-27) form the dictionaryList<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.
-
-
-
Constructor Detail
-
MorfologikMultiSpeller
public MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, int maxEditDistance) throws IOException
- Throws:
IOException
-
MorfologikMultiSpeller
@Experimental public MorfologikMultiSpeller(String binaryDictPath, List<String> plainTextPaths, String languageVariantPlainTextPath, UserConfig userConfig, int maxEditDistance) throws IOException
- Parameters:
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 suggestions- Throws:
IOException
- Since:
- 4.2
-
MorfologikMultiSpeller
public MorfologikMultiSpeller(String binaryDictPath, BufferedReader plainTextReader, List<String> plainTextReaderPath, BufferedReader languageVariantPlainTextReader, String languageVariantPlainTextPath, List<String> userWords, int maxEditDistance) throws IOException
- Parameters:
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 suggestions- Throws:
IOException
- Since:
- 3.0
-
-
Method Detail
-
isMisspelled
public boolean isMisspelled(String word)
Accept the word if at least one of the dictionaries accepts it as not misspelled.
-
getFrequency
public int getFrequency(String word)
Get the frequency of use of a word (0-27) form the dictionary
-
getSuggestions
public List<String> getSuggestions(String word)
The suggestions from all dictionaries (without duplicates).
-
getSuggestionsFromUserDicts
@Experimental public List<String> getSuggestionsFromUserDicts(String word)
- Parameters:
word
- misspelled word- Returns:
- suggestions from users personal dictionary
- Since:
- 4.5
-
getSuggestionsFromDefaultDicts
@Experimental public List<String> getSuggestionsFromDefaultDicts(String word)
- Parameters:
word
- misspelled word- Returns:
- suggestions from built-in dictionaries
- Since:
- 4.5
-
convertsCase
public boolean convertsCase()
Determines whether the dictionary uses case conversions.- Returns:
- True when the speller uses spell conversions.
- Since:
- 2.5
-
-