Subject Verb Agreement
- Der Hund sind schön.
- Der Text sind gut.
- Die Autos ist schnell.
For now (2/2015) this is only implemented for the verb forms "ist", "war", "sind", "waren".
Three steps are required to make this detection work:
- Unification in disambiguation.xml. This step will remove invalid readings. For example, the word "Mann" has nominative, accusative, and dative readings. But in the phrase "ein Mann", only the nominative reading is correct. Unification makes sure only this reading is kept. (For cases where someone actually uses an incorrect reading in the text, see below at "Agreement inside noun phrases".)
- Noun phrase detection in GermanChunker. This step adds noun phrases to the internal analysis of the text. First, it detects noun phrases and then it assigns singular/plural information to these phrases.
- The actual rule is SubjectVerbAgreementRule. It basically detects "plural noun phrase" + "ist" and "singular noun phrase" + "sind", and it knows about some special cases to avoid false alarms (not all false alarms can be avoided yet).
As a developer, you can debug problems with this rule like this:
- Check the affected sentence with the standard LanguageTool command line client and option -v. This will print the disambiguator log. Make sure the tokens inside noun phrases get unified as expected.
- Open SubjectVerbAgreementRuleTest in your IDE and add the problematic sentence to testTemp() (see comments there). When running the test you will get debugging output of the steps in GermanChunker. You might need to add rules to GermanChunker so that more noun phrases get detected, including the fact whether they are singular or plural. The rule syntax used inside GermanChunker is documented in the source code (it is from openregex).
Errors like "Max bin da" and "Ich bist zuhause" are detected by VerbAgreementRule.
Agreement inside noun phrases
- eine Fahrrad
- das grün Haus
- ein langer schöne Sonntagabend (not yet detected as of 2/2015)
This is implemented in AgreementRule.