| Modifier and Type | Method and Description |
|---|---|
List<Rule> |
JLanguageTool.getAllActiveOfficeRules()
Works like getAllActiveRules but overrides defaults by office defaults
|
List<Rule> |
JLanguageTool.getAllActiveRules()
Get all active (not disabled) rules for the current language that are built-in or that
have been added using e.g.
|
List<Rule> |
JLanguageTool.getAllRules()
Get all rules for the current language that are built-in or that have been
added using
JLanguageTool.addRule(Rule). |
List<Rule> |
Language.getRelevantLanguageModelCapableRules(ResourceBundle messages,
LanguageModel languageModel,
GlobalConfig globalConfig,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages)
Get a list of rules that can optionally use a
LanguageModel. |
List<Rule> |
Language.getRelevantLanguageModelRules(ResourceBundle messages,
LanguageModel languageModel,
UserConfig userConfig)
Get a list of rules that require a
LanguageModel. |
List<Rule> |
Language.getRelevantRemoteRules(ResourceBundle messageBundle,
List<RemoteRuleConfig> configs,
GlobalConfig globalConfig,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages,
boolean inputLogging)
For rules that depend on a remote server; based on
RemoteRule
will be executed asynchronously, with timeout, retries, etc. |
abstract List<Rule> |
Language.getRelevantRules(ResourceBundle messages,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages)
Get the rules classes that should run for texts in this language.
|
List<Rule> |
Language.getRelevantRulesGlobalConfig(ResourceBundle messages,
GlobalConfig globalConfig,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages)
Get the rules classes that should run for texts in this language.
|
Function<Rule,Rule> |
Language.getRemoteEnhancedRules(ResourceBundle messageBundle,
List<RemoteRuleConfig> configs,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages,
boolean inputLogging)
For rules whose results are extended using some remote service, e.g.
|
Function<Rule,Rule> |
Language.getRemoteEnhancedRules(ResourceBundle messageBundle,
List<RemoteRuleConfig> configs,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages,
boolean inputLogging)
For rules whose results are extended using some remote service, e.g.
|
List<Rule> |
UserConfig.getRules() |
| Modifier and Type | Method and Description |
|---|---|
void |
JLanguageTool.addRule(Rule rule)
Add a rule to be used by the next call to the check methods like
JLanguageTool.check(String). |
int |
Language.getRulePriority(Rule rule)
Returns a priority for Rule (default: 0).
|
abstract boolean |
Premium.isPremiumRule(Rule rule) |
boolean |
PremiumOff.isPremiumRule(Rule rule) |
static boolean |
Premium.isTempNotPremium(Rule rule) |
void |
LinguServices.setThesaurusRelevantRule(Rule rule)
Set a thesaurus relevant rule
|
| Modifier and Type | Method and Description |
|---|---|
List<RuleMatch> |
JLanguageTool.checkAnalyzedSentence(JLanguageTool.ParagraphHandling paraMode,
List<Rule> rules,
AnalyzedSentence analyzedSentence)
Deprecated.
use one of the
JLanguageTool.check(java.lang.String) methods instead. |
List<RuleMatch> |
JLanguageTool.checkAnalyzedSentence(JLanguageTool.ParagraphHandling paraMode,
List<Rule> rules,
AnalyzedSentence analyzedSentence,
boolean checkRemoteRules)
This is an internal method that's public only for technical reasons, please use one
of the
JLanguageTool.check(String) methods instead. |
| Constructor and Description |
|---|
UserConfig(List<String> userSpecificSpellerWords,
List<Rule> userSpecificRules,
Map<String,Object[]> ruleValues,
int maxSpellingSuggestions,
Long premiumUid,
String userDictName,
Long userDictCacheSize,
LinguServices linguServices,
boolean filterDictionaryMatches,
List<String> abTest,
Long textSessionId,
boolean hidePremiumMatches,
List<String> preferredLanguages) |
UserConfig(List<String> userSpecificSpellerWords,
List<Rule> userSpecificRules,
Map<String,Object[]> ruleValues,
int maxSpellingSuggestions,
Long premiumUid,
String userDictName,
Long userDictCacheSize,
LinguServices linguServices,
boolean filterDictionaryMatches,
List<String> abTest,
Long textSessionId,
boolean hidePremiumMatches,
List<String> preferredLanguages,
boolean trustedSource) |
| Modifier and Type | Method and Description |
|---|---|
List<Rule> |
NoopLanguage.getRelevantRules(ResourceBundle messages,
UserConfig userConfig,
Language motherTongue,
List<Language> altLanguages) |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractCheckCaseRule
A rule that checks case in phrases
|
class |
AbstractCompoundRule
Checks that compounds (if in the list) are not written as separate words.
|
class |
AbstractDashRule
Another use of the compounds file -- check for compounds written with
dashes instead of hyphens (for example, Rabka — Zdrój).
|
class |
AbstractFillerWordsRule
A rule that gives hints about the use of filler words.
|
class |
AbstractPunctuationCheckRule
A rule that matches "
|
class |
AbstractRepeatedWordsRule |
class |
AbstractSimpleReplaceRule
A rule that matches words which should not be used and suggests
correct ones instead.
|
class |
AbstractSimpleReplaceRule2
A rule that matches words which should not be used and suggests correct ones instead.
|
class |
AbstractSpaceBeforeRule
An abstract rule that checks if there is a missing space before some conjunctions.
|
class |
AbstractSpecificCaseRule
A rule that matches words which need a specific upper/lowercase spelling.
|
class |
AbstractStatisticSentenceStyleRule
A rule that gives hints when a defined condition is fulfilled
and the percentage of hints in the text exceeds the given limit.
|
class |
AbstractStatisticStyleRule
A rule that gives hints when a defined condition is fulfilled
and the percentage of hints in the text exceeds the given limit.
|
class |
AbstractStyleRepeatedWordRule
An abstract rule checks the appearance of same words in a sentence or in two consecutive sentences.
|
class |
AbstractStyleTooOftenUsedWordRule
The method gives stylistic hints that a word is being used too often
when the set percentage has been exceeded.
|
class |
AbstractUnitConversionRule
Base class providing support for detecting, parsing and converting between measurements in different units
|
class |
AbstractWordCoherencyRule
A rule that matches words for which two different spellings are used
throughout the document.
|
class |
AdvancedWordRepeatRule
Rule for detecting same words in the sentence but not just in a row.
|
class |
BERTSuggestionRanking
reorder suggestions from another rule using BERT as a LM
|
class |
CommaWhitespaceRule
A rule that matches periods, commas and closing parenthesis preceded by whitespace and
opening parenthesis followed by whitespace.
|
class |
DemoRule
A simple demo rule as an example for how to implement your own Java-based
rule in LanguageTool.
|
class |
DoublePunctuationRule
A rule that matches ".."
|
class |
EmptyLineRule
A rule that checks for empty lines.
|
class |
FakeRule |
class |
GenericUnpairedBracketsRule
Rule that finds unpaired quotes, brackets etc.
|
class |
GenericUnpairedQuotesRule
Rule that finds unpaired quotes
|
class |
GRPCRule
Base class fur rules running on external servers;
see gRPC service definition in languagetool-core/src/main/proto/ml_server.proto
See #create(Language, ResourceBundle, RemoteRuleConfig, boolean, String, String, Map) for an easy way to add rules; return rule in Language::getRelevantRemoteRules
add it like this:
public List<Rule> getRelevantRemoteRules(ResourceBundle messageBundle, List<RemoteRuleConfig> configs, GlobalConfig globalConfig, UserConfig userConfig, Language motherTongue, List<Language> altLanguages) throws IOException {
List<Rule> rules = new ArrayList<>(super.getRelevantRemoteRules(
messageBundle, configs, globalConfig, userConfig, motherTongue, altLanguages));
Rule exampleRule = GRPCRule.create(messageBundle,
RemoteRuleConfig.getRelevantConfig("EXAMPLE_ID", configs),
"EXAMPLE_ID", "example_rule_id",
Collections.singletonMap("example_match_id", "example_rule_message"));
rules.add(exampleRule);
return rules;
}
|
static class |
GRPCRule.GRPCSubRule
Internal rule to create rule matches with IDs based on Match Sub-IDs
|
class |
LongParagraphRule
A rule that warns on long paragraphs.
|
class |
LongSentenceRule
A rule that warns on long sentences.
|
class |
MultipleWhitespaceRule
Check if there is duplicated whitespace in a sentence.
|
class |
ParagraphRepeatBeginningRule
Check if to paragraphs begin with the same word.
|
class |
PunctuationMarkAtParagraphEnd
A rule that checks for a punctuation mark at the end of a paragraph.
|
class |
PunctuationMarkAtParagraphEnd2
A rule that checks for a punctuation mark at the end of a paragraph.
|
class |
ReadabilityRule
A rule that checks the readability of English text (using the Flesch-Reading-Ease Formula)
If tooEasyTest == true, the rule tests if paragraph level > level (readability is too easy)
If tooEasyTest == false, the rule tests if paragraph level < level (readability is too difficult)
|
class |
RemoteRule |
class |
SentenceWhitespaceRule
Checks that there's whitespace between sentences.
|
class |
SpecificIdRule |
class |
TestRemoteRule |
class |
TextLevelRule
A rule that considers the complete text, not just one sentence after
the other.
|
class |
UppercaseSentenceStartRule
Checks that a sentence starts with an uppercase letter.
|
class |
WhiteSpaceAtBeginOfParagraph
A rule that checks for WhiteSpaces at the begin of a paragraph
|
class |
WhiteSpaceBeforeParagraphEnd
A rule that checks for a whitespace at the end of a paragraph
|
class |
WhitespaceBeforePunctuationRule
A rule that matches several punctuation signs such as
: ; and % preceded by whitespace. |
class |
WordRepeatBeginningRule
Check if three successive sentences begin with the same word, e.g.
|
class |
WordRepeatRule
Check if a word is repeated, e.g.
|
class |
WrongWordInContextRule
Check if there is a confusion of two words (which might have a similar spelling) depending on the context.
|
| Modifier and Type | Method and Description |
|---|---|
Rule |
RuleMatch.getRule() |
| Constructor and Description |
|---|
BERTSuggestionRanking(Language language,
Rule rule,
RemoteRuleConfig config,
boolean inputLogging) |
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
int patternStartPos,
int patternEndPos,
String message,
String shortMessage)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
int patternFromPos,
int patternToPos,
String message,
String shortMessage,
boolean startWithUppercase,
boolean isAllUppercase,
String suggestionsOutMsg,
boolean setOriginalErrorStr)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
int patternFromPos,
int patternToPos,
String message,
String shortMessage,
boolean startWithUppercase,
String suggestionsOutMsg) |
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
String message)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
String message,
String shortMessage)
Creates a RuleMatch object, taking the rule that triggered
this match, position of the match and an explanation message.
|
RuleMatch(Rule rule,
AnalyzedSentence sentence,
int fromPos,
int toPos,
String message,
String shortMessage,
List<String> suggestions)
Create a rule match with any suggestions in the message overridden by the given suggestions
|
RuleMatch(Rule rule,
int fromPos,
int toPos,
String message)
Deprecated.
use a constructor that also takes an
AnalyzedSentence parameter (deprecated since 4.0) |
RuleMatch(Rule rule,
int fromPos,
int toPos,
String message,
String shortMessage,
boolean startWithUppercase,
String suggestionsOutMsg)
Deprecated.
use a constructor that also takes an
AnalyzedSentence parameter (deprecated since 4.0) |
SuggestionFilter(Rule rule,
Language lang) |
| Modifier and Type | Class and Description |
|---|---|
class |
BitextRule
Abstract bitext rule class.
|
class |
DifferentLengthRule
Checks if the translation has a really different length than the source
(smaller than 30% or longer by 250%).
|
class |
DifferentPunctuationRule
Checks if the translation has the same ending punctuation as the source.
|
class |
SameTranslationRule
Checks if the translation for segments that have more than two words
is different.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ConfusionProbabilityRule
LanguageTool's homophone confusion check that uses ngram lookups
to decide which word in a confusion set (from
confusion_sets.txt) suits best. |
class |
NgramProbabilityRule
LanguageTool's probability check that uses ngram lookups
to decide if an ngram of the input text is so rare in our
ngram index that it should be considered an error.
|
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractPatternRule
An Abstract Pattern Rule that describes a pattern of words or part-of-speech tags
used for PatternRule and DisambiguationPatternRule.
|
class |
AbstractTokenBasedRule
A base class for
PatternToken-based rules. |
class |
ConsistencyPatternRuleTransformer.ConsistencyPatternRule
Wrapper for loaded
AbstractPatternRule instances to act as text-level rules |
class |
FalseFriendPatternRule
A pattern rule for finding false friends.
|
class |
PatternRule
A Rule that describes a language error as a simple pattern of words or of
part-of-speech tags.
|
class |
RegexPatternRule
Matches 'regexp' elements from XML rules against sentences.
|
class |
RepeatedPatternRuleTransformer.RepeatedPatternRule
Wrapper for loaded
AbstractPatternRule instances to act as text-level rules |
| Modifier and Type | Method and Description |
|---|---|
abstract List<Rule> |
RuleSet.allRules() |
List<Rule> |
PatternRuleTransformer.TransformedRules.getTransformedRules() |
abstract List<Rule> |
RuleSet.rulesForSentence(AnalyzedSentence sentence) |
| Modifier and Type | Method and Description |
|---|---|
static RuleSet |
RuleSet.plain(List<Rule> rules) |
static RuleSet |
RuleSet.textHinted(List<? extends Rule> rules) |
static RuleSet |
RuleSet.textLemmaHinted(List<? extends Rule> rules) |
| Constructor and Description |
|---|
TransformedRules(List<AbstractPatternRule> remainingRules,
List<Rule> transformedRules) |
| Modifier and Type | Class and Description |
|---|---|
class |
BitextPatternRule
A bitext pattern rule class.
|
| Modifier and Type | Class and Description |
|---|---|
class |
SpellingCheckRule
An abstract rule for spellchecking rules.
|
class |
SymSpellRule
spell checking using SymSpell algorithm, implementation from
https://github.com/Lundez/JavaSymSpell in org.languagetool.rules.spelling.symspell.implementation
potential faster alternative to Morfologik, especially in generating suggestions
|
| Modifier and Type | Method and Description |
|---|---|
Rule |
RuleWithLanguage.getRule() |
| Constructor and Description |
|---|
RuleWithLanguage(Rule rule,
Language language) |
| Modifier and Type | Class and Description |
|---|---|
class |
CompoundAwareHunspellRule
A spell checker that combines Hunspell and Morfologik spell checking
to support compound words and offer fast suggestions for some misspelled
compound words.
|
class |
HunspellNoSuggestionRule
Like
HunspellRule, but does not offer suggestions for incorrect words
as that is very slow with Hunspell. |
class |
HunspellRule
A hunspell-based spellchecking-rule.
|
| Modifier and Type | Class and Description |
|---|---|
class |
MorfologikSpellerRule |
| Modifier and Type | Class and Description |
|---|---|
class |
DisambiguationPatternRule
A Rule that describes a pattern of words or part-of-speech tags used for
disambiguation.
|
| Modifier and Type | Method and Description |
|---|---|
static int |
Tools.profileRulesOnLine(String contents,
JLanguageTool lt,
Rule rule) |