java.lang.Object
org.apache.lucene.analysis.hunspell.ModifyingSuggester

class ModifyingSuggester extends Object
A class that modifies the given misspelled word in various ways to get correct suggestions
  • Field Details

  • Constructor Details

  • Method Details

    • suggest

      boolean suggest()
      Returns:
      whether any of the added suggestions are considered "good"
    • createSuggestion

      private Suggestion createSuggestion(String candidate)
    • capitalizeAfterSpace

      private Suggestion capitalizeAfterSpace(String candidate)
    • tryVariationsOf

      private boolean tryVariationsOf(String word)
    • tryRep

    • enumerateMapReplacements

      private void enumerateMapReplacements(String word, String accumulated, int offset)
    • checkSimpleWord

      private boolean checkSimpleWord(String part)
    • trySwappingChars

      private void trySwappingChars(String word)
    • tryDoubleSwapForShortWords

      private void tryDoubleSwapForShortWords(String word, int length)
    • tryNeighborKeys

      private void tryNeighborKeys(String word)
    • tryModifiedSuggestions

      private void tryModifiedSuggestions(int modOffset, String candidate)
    • tryLongSwap

      private void tryLongSwap(String word)
    • tryRemovingChar

      private void tryRemovingChar(String word)
    • tryAddingChar

      private void tryAddingChar(String word)
    • tryMovingChar

      private void tryMovingChar(String word)
    • tryReplacingChar

      private void tryReplacingChar(String word)
    • tryTwoDuplicateChars

      private void tryTwoDuplicateChars(String word)
    • checkDictionaryForSplitSuggestions

      private List<Suggestion> checkDictionaryForSplitSuggestions(String word)
    • trySplitting

      private void trySplitting(String word)
    • shouldSplitByDash

      private boolean shouldSplitByDash()
    • trySuggestion

      private boolean trySuggestion(String candidate)