Class ArabicNumberPhraseFilter
java.lang.Object
org.languagetool.rules.patterns.RuleFilter
org.languagetool.rules.ar.filters.ArabicNumberPhraseFilter
Filter that maps suggestion for numeric phrases.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ArabicSynthesizerprivate static final ArabicTagManager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionacceptRuleMatch(RuleMatch match, Map<String, String> arguments, int patternTokenPos, AnalyzedTokenReadings[] patternTokens, List<Integer> tokenPositions) Returns the original rule match or a modified one, ornullif the rule match is filtered out.private static booleangetFemininCase(AnalyzedTokenReadings[] patternTokens, int nextPos) private static StringgetInflectedCase(AnalyzedTokenReadings[] patternTokens, int previousPos, String inflect) private static intgetNextPos(Map<String, String> args, int size) private static intgetPreviousPos(Map<String, String> args) inflectUnit(AnalyzedTokenReadings unit, Map<String, String> sugMap) prepareSuggestion(String numPhrase, String previousWord, AnalyzedTokenReadings nextWord, boolean feminin, boolean attached, String inflection) prepareSuggestionWithUnits(String numPhrase, String previousWord, AnalyzedTokenReadings nextWord, boolean feminin, boolean attached, String inflection) Methods inherited from class org.languagetool.rules.patterns.RuleFilter
getLanguageFromRuleMatch, getOptional, getOptional, getPosition, getRequired, getSkipCorrectedReference, getSynthesizerFromRuleMatch, isMatchAtSentenceStart, matches
-
Field Details
-
tagmanager
-
synthesizer
-
-
Constructor Details
-
ArabicNumberPhraseFilter
public ArabicNumberPhraseFilter()
-
-
Method Details
-
acceptRuleMatch
@Nullable public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, int patternTokenPos, AnalyzedTokenReadings[] patternTokens, List<Integer> tokenPositions) Description copied from class:RuleFilterReturns the original rule match or a modified one, ornullif the rule match is filtered out.- Specified by:
acceptRuleMatchin classRuleFilter- Parameters:
arguments- the resolved argument from theargsattribute in the XML. Resolved means that e.g.\1has been resolved to the actual string at that match position.patternTokens- those tokens of the text that correspond the matched pattern- Returns:
nullif this rule match should be removed, or any other RuleMatch (e.g. the one from the arguments) that properly describes the detected error
-
getInflectedCase
private static String getInflectedCase(AnalyzedTokenReadings[] patternTokens, int previousPos, String inflect) -
getFemininCase
-
prepareSuggestion
-
prepareSuggestionWithUnits
-
inflectUnit
-
getPreviousPos
-
getNextPos
-