Class MorfologikSpeller

java.lang.Object
org.languagetool.rules.spelling.morfologik.MorfologikSpeller

public class MorfologikSpeller extends Object
Morfologik-based spell checker.
  • Field Details

    • dictCache

      private static final com.google.common.cache.LoadingCache<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 Details

    • MorfologikSpeller

      public MorfologikSpeller(String fileInClassPath, int maxEditDistance)
      Creates a speller with the given maximum edit distance.
      Parameters:
      fileInClassPath - path in classpath to morfologik dictionary
    • MorfologikSpeller

      public MorfologikSpeller(String fileInClassPath) throws IOException
      Creates a speller with a maximum edit distance of one.
      Parameters:
      fileInClassPath - path in classpath to morfologik dictionary
      Throws:
      IOException
    • MorfologikSpeller

      MorfologikSpeller(morfologik.stemming.Dictionary dictionary, int maxEditDistance)
      Since:
      2.9
  • Method Details

    • isMisspelled

      public boolean isMisspelled(String word)
    • getSuggestions

      public List<String> getSuggestions(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 String toString()
      Overrides:
      toString in class Object
    • getFrequency

      public int getFrequency(String word)