Class SimpleReplaceRule


  • public class SimpleReplaceRule
    extends org.languagetool.rules.AbstractSimpleReplaceRule
    A rule that matches words or phrases which should not be used and suggests correct ones instead. Polish implementations. Loads the list of words from rules/pl/replace.txt.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Locale PL_LOCALE  
      static java.lang.String POLISH_SIMPLE_REPLACE_RULE  
      private static java.util.Map<java.lang.String,​java.util.List<java.lang.String>> wrongWords  
      • Fields inherited from class org.languagetool.rules.AbstractSimpleReplaceRule

        ignoreTaggedWords
      • Fields inherited from class org.languagetool.rules.Rule

        messages
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleReplaceRule​(java.util.ResourceBundle messages)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()  
      java.lang.String getId()  
      java.util.Locale getLocale()  
      java.lang.String getMessage​(java.lang.String tokenStr, java.util.List<java.lang.String> replacements)  
      java.lang.String getShort()  
      protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getWrongWords()  
      boolean isCaseSensitive()  
      • Methods inherited from class org.languagetool.rules.AbstractSimpleReplaceRule

        createRuleMatch, findMatches, isCheckLemmas, isTagged, loadFromPath, match, setCheckLemmas, setIgnoreTaggedWords
      • Methods inherited from class org.languagetool.rules.Rule

        addExamplePair, estimateContextForSureMatch, getAntiPatterns, getCategory, getConfigureText, getCorrectExamples, getDefaultValue, getErrorTriggeringExamples, getIncorrectExamples, getLocQualityIssueType, getMaxConfigurableValue, getMinConfigurableValue, getSentenceWithImmunization, getUrl, hasConfigurableValue, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isOfficeDefaultOff, isOfficeDefaultOn, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setErrorTriggeringExamples, setIncorrectExamples, setLocQualityIssueType, setOfficeDefaultOff, setOfficeDefaultOn, setUrl, supportsLanguage, toRuleMatchArray, useInOffice
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • POLISH_SIMPLE_REPLACE_RULE

        public static final java.lang.String POLISH_SIMPLE_REPLACE_RULE
        See Also:
        Constant Field Values
      • wrongWords

        private static final java.util.Map<java.lang.String,​java.util.List<java.lang.String>> wrongWords
      • PL_LOCALE

        private static final java.util.Locale PL_LOCALE
    • Constructor Detail

      • SimpleReplaceRule

        public SimpleReplaceRule​(java.util.ResourceBundle messages)
                          throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getWrongWords

        protected java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getWrongWords()
        Specified by:
        getWrongWords in class org.languagetool.rules.AbstractSimpleReplaceRule
      • getId

        public final java.lang.String getId()
        Overrides:
        getId in class org.languagetool.rules.AbstractSimpleReplaceRule
      • getDescription

        public java.lang.String getDescription()
        Overrides:
        getDescription in class org.languagetool.rules.AbstractSimpleReplaceRule
      • getShort

        public java.lang.String getShort()
        Overrides:
        getShort in class org.languagetool.rules.AbstractSimpleReplaceRule
      • getMessage

        public java.lang.String getMessage​(java.lang.String tokenStr,
                                           java.util.List<java.lang.String> replacements)
        Overrides:
        getMessage in class org.languagetool.rules.AbstractSimpleReplaceRule
      • isCaseSensitive

        public boolean isCaseSensitive()
        Overrides:
        isCaseSensitive in class org.languagetool.rules.AbstractSimpleReplaceRule
      • getLocale

        public java.util.Locale getLocale()
        Overrides:
        getLocale in class org.languagetool.rules.AbstractSimpleReplaceRule