@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) { // less rules than processors (depending on the machine), should at least not crash return Arrays.asList( new UppercaseSentenceStartRule(messages, this), new MultipleWhitespaceRule(messages, this) ); } });
/** @since 3.3 */ public UppercaseSentenceStartRule(ResourceBundle messages, Language language, IncorrectExample incorrectExample, CorrectExample correctExample) { super(messages); super.setCategory(Categories.CASING.getCategory(messages)); this.language = language; setLocQualityIssueType(ITSIssueType.Typographical); if (incorrectExample != null && correctExample != null) { addExamplePair(incorrectExample, correctExample); } }
return toRuleMatchArray(ruleMatches); AnalyzedTokenReadings[] tokens = getSentenceWithImmunization(sentence).getTokensWithoutWhitespace(); if (tokens.length < 2) { return toRuleMatchArray(ruleMatches); String thirdToken = null; if (tokens.length >= 3 && isQuoteStart(firstToken)) { matchTokenPos = 2; secondToken = tokens[matchTokenPos].getToken(); String firstDutchToken = dutchSpecialCase(firstToken, secondToken, tokens); if (firstDutchToken != null) { thirdToken = firstDutchToken; preventError = true; if (!SENTENCE_END1.matcher(lastParagraphString).matches() && !isSentenceEnd(lastToken)) { preventError = true; if (isUrl(checkToken) || isEMail(checkToken) || firstTokenObj.isImmunized()) { preventError = true; return toRuleMatchArray(ruleMatches);
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "\"", "”"), Arrays.asList("]", ")", "}", "\"", "”")), new HunspellNoSuggestionRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), // abbreviation exceptions, done in DanishSentenceTokenizer // "WORD_REPEAT_RULE" implemented in grammar.xml new MultipleWhitespaceRule(messages, this) ); }
return toRuleMatchArray(ruleMatches); AnalyzedTokenReadings[] tokens = getSentenceWithImmunization(sentence).getTokensWithoutWhitespace(); if (tokens.length < 2) { return toRuleMatchArray(ruleMatches); String thirdToken = null; if (tokens.length >= 3 && isQuoteStart(firstToken)) { matchTokenPos = 2; secondToken = tokens[matchTokenPos].getToken(); String firstDutchToken = dutchSpecialCase(firstToken, secondToken, tokens); if (firstDutchToken != null) { thirdToken = firstDutchToken; preventError = true; if (!SENTENCE_END1.matcher(lastParagraphString).matches() && !isSentenceEnd(lastToken)) { preventError = true; if (isUrl(checkToken) || isEMail(checkToken) || firstTokenObj.isImmunized()) { preventError = true; return toRuleMatchArray(ruleMatches);
/** @since 3.3 */ public UppercaseSentenceStartRule(ResourceBundle messages, Language language, IncorrectExample incorrectExample, CorrectExample correctExample) { super(messages); super.setCategory(Categories.CASING.getCategory(messages)); this.language = language; setLocQualityIssueType(ITSIssueType.Typographical); if (incorrectExample != null && correctExample != null) { addExamplePair(incorrectExample, correctExample); } }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new UppercaseSentenceStartRule(messages, this), new MultipleWhitespaceRule(messages, this), // specific to Tagalog: new MorfologikTagalogSpellerRule(messages, this, userConfig, altLanguages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new MorfologikAsturianSpellerRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), new MultipleWhitespaceRule(messages, this) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "“", "«", "»", "¿", "¡"), Arrays.asList("]", ")", "}", "”", "»", "«", "?", "!")), new MorfologikSpanishSpellerRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this), new SpanishWikipediaRule(messages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new MorfologikLithuanianSpellerRule(messages, this), new UppercaseSentenceStartRule(messages, this), new MultipleWhitespaceRule(messages, this) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new WhitespaceBeforePunctuationRule(messages), new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "»", "«" /*"‘"*/), Arrays.asList("]", ")", "}", "«", "»" /*"’"*/)), new MorfologikItalianSpellerRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), new ItalianWordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{" /*"«", "‘"*/), Arrays.asList("]", ")", "}" /*"»", French dialog can contain multiple sentences. */ /*"’" used in "d’arm" and many other words */)), new MorfologikYourLanguageSpellerRule(messages, this), new UppercaseSentenceStartRule(messages, this), new MultipleWhitespaceRule(messages, this), new SentenceWhitespaceRule(messages), // specific to French: new CompoundRule(messages), new QuestionWhitespaceRule(messages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new MorfologikMalayalamSpellerRule(messages, this), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "„", "»", "«", "\""), Arrays.asList("]", ")", "}", "“", "«", "»", "\"")), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this), // specific to Slovak: new CompoundRule(messages), new MorfologikSlovakSpellerRule(messages, this, userConfig, altLanguages) //new SlovakVesRule(messages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new HunspellNoSuggestionRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this), new SentenceWhitespaceRule(messages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages), new HunspellRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this), new CompoundRule(messages) ); }
protected List<Rule> getBasicRules(ResourceBundle messages) { return Arrays.asList( new CommaWhitespaceRule(messages, Example.wrong("Није шија<marker> ,</marker> него врат."), Example.fixed("Није шија<marker>,</marker> него врат.")), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "„", "„", "\""), Arrays.asList("]", ")", "}", "”", "“", "\"")), new UppercaseSentenceStartRule(messages, this, Example.wrong("Почела је школа. <marker>ђаци</marker> су поново сели у клупе."), Example.fixed("Почела је школа. <marker>Ђаци</marker> су поново сели у клупе.")), new MultipleWhitespaceRule(messages, this), new SentenceWhitespaceRule(messages), new WordRepeatRule(messages, this) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new DoublePunctuationRule(messages), new GenericUnpairedBracketsRule(messages, Arrays.asList("[", "(", "{", "“", "‹", "“", "„", "\""), Arrays.asList("]", ")", "}", "”", "›", "”", "”", "\"")), new UppercaseSentenceStartRule(messages, this), new MorfologikDutchSpellerRule(messages, this, userConfig, altLanguages), new MultipleWhitespaceRule(messages, this), new CompoundRule(messages), new DutchWrongWordInContextRule(messages), new WordCoherencyRule(messages), new SimpleReplaceRule(messages), new LongSentenceRule(messages, userConfig, -1, true), new PreferredWordRule(messages) ); }
@Override public List<Rule> getRelevantRules(ResourceBundle messages, UserConfig userConfig, List<Language> altLanguages) throws IOException { return Arrays.asList( new CommaWhitespaceRule(messages), new UppercaseSentenceStartRule(messages, this), new WordRepeatRule(messages, this), new MultipleWhitespaceRule(messages, this), new SentenceWhitespaceRule(messages), // specific to Polish: new PolishUnpairedBracketsRule(messages, this), new MorfologikPolishSpellerRule(messages, this, userConfig, altLanguages), new PolishWordRepeatRule(messages), new CompoundRule(messages), new SimpleReplaceRule(messages), new DashRule() ); }
Arrays.asList("]", ")", "}", "”", "»", "«", "’", "\"", "'")), new HunspellRule(messages, this, userConfig, altLanguages), new UppercaseSentenceStartRule(messages, this, Example.wrong("Esta casa é vella. <marker>foi</marker> construida en 1950."), Example.fixed("Esta casa é vella. <marker>Foi</marker> construida en 1950.")),