Back to LanguageTool Homepage - Privacy - Imprint

Russian rule does not work when first letter is capital

I am trying to create a rule for Russian to spot the expression of “заедание суда”. Here, both words are spelled correctly but the whole expression does not make sense as it means (roughly) “court jam”, and the right one should be “заседание суда” (“court session”).

Since I use LanguageTool with LibreOffice, I downloaded the latest (of 3rd September 2020) snapshot of the LO extension, installed, found LT files in the user profile, found grammar.xml and added a piece of code as follows:

    <rulegroup id="ZASEDANIJE_ZAJEDANIJE" name="Логические ошибки: «заседание» или «заедание»">
        <rule>
            <pattern>
                <token inflected="yes">заедание</token>
                <token inflected="no">суда</token>
            </pattern>
            <message>Имелось в виду <suggestion><match no="1"  regexp_match="заедани(.*)"  regexp_replace="заседани$1" /> <match no="2" /></suggestion>?</message>
            <short>Логическая ошибка</short>
            <example correction="заседание суда"><marker>Заседание суда</marker> перенесено на завтра.</example>
        </rule>
    </rulegroup>

(I tried to attach the resulting grammar.xml but could not).

I have created a simple test file (again, tried to attach but could not) with faulty sentences. My rule seems to work, the error is detected in all cases, with the word “заседание” inflected, and a correct expression is suggested as a replacement.

But in a sentence, where the expression is written with the first letter capitalized (i. e. “Заседание суда”), the correction suggestion is wrong, it simply repeats the error.

What am I missing?

You can try:

<rule id="ZASEDANIJE_ZAJEDANIJE" name="Логические ошибки: «заседание» или «заедание»">
        <pattern>
            <token inflected="yes">заедание</token>
            <token inflected="no">суда</token>
        </pattern>
        <message>Имелось в виду <suggestion><match no="1" regexp_match="([зЗ])аедани(.*)" regexp_replace="$1аседани$2" /> <match no="2" /></suggestion>?</message>
        <short>Логическая ошибка</short>
        <example correction="Заседание суда"><marker>Заедание суда</marker> перенесено на завтра.</example>
</rule>

Thank you, Yakov!

Now, the rule works fine.

I suggest to incorporate the rule into the LT rule set. Will you?

Ok.