Class TopoReplaceRule

java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.br.TopoReplaceRule

public class TopoReplaceRule extends org.languagetool.rules.Rule
A rule that matches place names in French which should be translated in Breton. Loads the list of words from rules/br/topo.txt. This class is mostly copied from ro/SimpleReplaceRules.java.
  • Field Details

  • Constructor Details

  • Method Details

    • getId

      public final String getId()
      Specified by:
      getId in class org.languagetool.rules.Rule
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.languagetool.rules.Rule
    • getShort

      public String getShort()
    • getSuggestion

      public String getSuggestion()
    • getSuggestionsSeparator

      public String getSuggestionsSeparator()
      Returns:
      the word used to separate multiple suggestions; used only before last suggestion, the rest are comma-separated.
    • isCaseSensitive

      public boolean isCaseSensitive()
    • getLocale

      public Locale getLocale()
      locale used on case-conversion
    • getWrongWords

      public List<Map<String,String>> getWrongWords()
      Returns:
      the list of wrong words for which this rule can suggest correction. The list cannot be modified.
    • loadWords

      private static List<Map<String,String>> loadWords(InputStream stream)
      Load the list of words. Same as AbstractSimpleReplaceRule.loadFromPath(java.lang.String) but allows multiple words.
      Parameters:
      stream - the stream to load.
      Returns:
      the list of maps containing the error-corrections pairs. The n-th map contains key strings of (n+1) words.
    • addToQueue

      private void addToQueue(org.languagetool.AnalyzedTokenReadings token, Queue<org.languagetool.AnalyzedTokenReadings> prevTokens)
    • match

      public org.languagetool.rules.RuleMatch[] match(org.languagetool.AnalyzedSentence sentence)
      Specified by:
      match in class org.languagetool.rules.Rule