Class MorfologikMultiSpeller


  • public class MorfologikMultiSpeller
    extends Object
    Morfologik speller that merges results from binary (.dict) and plain text (.txt) dictionaries.
    Since:
    2.9
    • Constructor Detail

      • 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 file
        plainTextPaths - 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 file
        plainTextReader - 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