Class MorfologikSpeller
- java.lang.Object
-
- org.languagetool.rules.spelling.morfologik.MorfologikSpeller
-
public class MorfologikSpeller extends java.lang.Object
Morfologik-based spell checker.
-
-
Field Summary
Fields Modifier and Type Field Description private static com.google.common.cache.LoadingCache<java.lang.String,morfologik.stemming.Dictionary>
dictCache
private morfologik.stemming.Dictionary
dictionary
private int
maxEditDistance
private morfologik.speller.Speller
speller
-
Constructor Summary
Constructors Constructor Description MorfologikSpeller(java.lang.String fileInClassPath)
Creates a speller with a maximum edit distance of one.MorfologikSpeller(java.lang.String fileInClassPath, int maxEditDistance)
Creates a speller with the given maximum edit distance.MorfologikSpeller(morfologik.stemming.Dictionary dictionary, 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(java.lang.String word)
java.util.List<java.lang.String>
getSuggestions(java.lang.String word)
boolean
isMisspelled(java.lang.String word)
java.lang.String
toString()
-
-
-
Field Detail
-
dictCache
private static final com.google.common.cache.LoadingCache<java.lang.String,morfologik.stemming.Dictionary> dictCache
-
dictionary
private final morfologik.stemming.Dictionary dictionary
-
speller
private final morfologik.speller.Speller speller
-
maxEditDistance
private final int maxEditDistance
-
-
Constructor Detail
-
MorfologikSpeller
public MorfologikSpeller(java.lang.String fileInClassPath, int maxEditDistance)
Creates a speller with the given maximum edit distance.- Parameters:
fileInClassPath
- path in classpath to morfologik dictionary
-
MorfologikSpeller
public MorfologikSpeller(java.lang.String fileInClassPath) throws java.io.IOException
Creates a speller with a maximum edit distance of one.- Parameters:
fileInClassPath
- path in classpath to morfologik dictionary- Throws:
java.io.IOException
-
MorfologikSpeller
MorfologikSpeller(morfologik.stemming.Dictionary dictionary, int maxEditDistance)
- Since:
- 2.9
-
-
Method Detail
-
isMisspelled
public boolean isMisspelled(java.lang.String word)
-
getSuggestions
public java.util.List<java.lang.String> getSuggestions(java.lang.String word)
-
convertsCase
public boolean convertsCase()
Determines whether the dictionary uses case conversions.- Returns:
- True when the speller uses spell conversions.
- Since:
- 2.5
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getFrequency
public int getFrequency(java.lang.String word)
-
-