org.languagetool.rules.km
Class KhmerSimpleReplaceRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.km.KhmerSimpleReplaceRule
public class KhmerSimpleReplaceRule
- extends Rule
A rule that matches words which should not be used and suggests correct ones instead.
Romanian implementations. Loads the list of words from
/km/coherency.txt.
Unlike AbstractSimpleReplaceRule, supports multiple words (Ex: "aqua forte" => "acvaforte").
Note: Merge this into AbstractSimpleReplaceRule eventually and simply extend from AbstractSimpleReplaceRule.
- Version:
- $Id: SimpleReplaceRule.java,v 1.9 2010/10/03 13:21:16 archeus Exp $
- Author:
- Ionuț Păduraru
| Fields inherited from class org.languagetool.rules.Rule |
messages |
| Methods inherited from class org.languagetool.rules.Rule |
addRuleMatch, clearMatches, getCategory, getCorrectExamples, getIncorrectExamples, getLocQualityIssueType, getMatches, getMatchesIndex, getUrl, isDefaultOff, isInMatches, isInRemoved, isParagraphBackTrack, isSpellingRule, setAsDeleted, setCategory, setCorrectExamples, setDefaultOff, setIncorrectExamples, setLocQualityIssueType, setParagraphBackTrack, setUrl, supportsLanguage, toRuleMatchArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KHMER_SIMPLE_REPLACE_RULE
public static final String KHMER_SIMPLE_REPLACE_RULE
- See Also:
- Constant Field Values
KhmerSimpleReplaceRule
public KhmerSimpleReplaceRule(ResourceBundle messages)
throws IOException
- Throws:
IOException
getFileName
public final String getFileName()
getId
public final String getId()
- Specified by:
getId in class Rule
getDescription
public String getDescription()
- Specified by:
getDescription in class 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()
- use case-insensitive matching.
getLocale
public Locale getLocale()
- locale used on case-conversion
getEncoding
public String getEncoding()
getWordTokenizer
protected Tokenizer getWordTokenizer()
- Returns:
- the word tokenizer used for tokenization on loading words.
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.
match
public RuleMatch[] match(AnalyzedSentence text)
- Specified by:
match in class Rule
reset
public void reset()
- Specified by:
reset in class Rule
Copyright © 2013. All Rights Reserved.