Package org.languagetool.rules.en
Class AvsAnRule
java.lang.Object
org.languagetool.rules.Rule
org.languagetool.rules.en.AvsAnRule
Check if the determiner (if any) preceding a word is:
- an if the next word starts with a vowel
- a if the next word does not start with a vowel
det_a.txt and
det_an.txt (e.g. for an hour).- Author:
- Daniel Naber
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetId()match(AnalyzedSentence sentence) suggestAorAn(String origWord) Adds "a" or "an" to the English noun.Methods inherited from class org.languagetool.rules.Rule
addExamplePair, addTags, addToneTags, cacheAntiPatterns, getAntiPatterns, getCategory, getCorrectExamples, getDistanceTokens, getErrorTriggeringExamples, getFullId, getIncorrectExamples, getLocQualityIssueType, getMinPrevMatches, getPriority, getRuleOptions, getSentenceWithImmunization, getSourceFile, getSubId, getTags, getToneTags, getUrl, hasTag, hasToneTag, isDefaultOff, isDefaultTempOff, isDictionaryBasedSpellingRule, isGoalSpecific, isIncludedInErrorsCorrectedAllAtOnce, isIncludedInHiddenMatches, isOfficeDefaultOff, isOfficeDefaultOn, isPremium, makeAntiPatterns, setCategory, setCorrectExamples, setDefaultOff, setDefaultOn, setDefaultTempOff, setDistanceTokens, setErrorTriggeringExamples, setExamplePair, setGoalSpecific, setIncludedInHiddenMatches, setIncorrectExamples, setLocQualityIssueType, setMinPrevMatches, setOfficeDefaultOff, setOfficeDefaultOn, setPremium, setPriority, setTags, setToneTags, setUrl, supportsLanguage, toRuleMatchArray, useDictionaryBasedFilterForMatches, useInOffice
-
Constructor Details
-
AvsAnRule
-
-
Method Details
-
getId
-
getDescription
- Specified by:
getDescriptionin classRule
-
estimateContextForSureMatch
public int estimateContextForSureMatch()- Overrides:
estimateContextForSureMatchin classRule
-
match
-
suggestAorAn
Adds "a" or "an" to the English noun. Used for suggesting the proper form of the indefinite article. For the rare cases where both "a" and "an" are considered okay (e.g. for "historical"), "a" is returned.- Parameters:
origWord- Word that needs an article.- Returns:
- String containing the word with a determiner, or just the word if the word is an abbreviation.
-