Example:
на Усебеларускі народны сход
…is detected as a mistake (which it is), and a correction is suggested as follows:
на Усебеларўскі народны сход
…which does not eliminate the mistake and introduces another one.
The correct variant:
на Ўсебеларускі народны сход
…i. e. it is the first letter У that must be changed to Ў (because the preceding one is a vowel).
The rule in question is as follows:
<rule>
<pattern>
<token regexp="yes">.*[уеыаоэяіюё]</token>
<token regexp="yes">у.*</token>
</pattern>
<message>Пасьля галoсных літараў замест 'у' трэба пісаць 'ў': <suggestion><match no="1" /> <match no="2" regexp_match="у(.*)" regexp_replace="ў$1" /></suggestion></message>
<short>У замест ў</short>
<example>да ўвагі</example>
<example correction="да ўвагі"><marker>да увагі</marker></example>
</rule>
<rule>
I tried modifying the rule as follows:
<rule>
<pattern>
<token regexp="yes">.*[уеыаоэяіюё]</token>
<token regexp="yes">у.*</token>
</pattern>
<message>Пасьля галoсных літараў замест 'у' трэба пісаць 'ў': <suggestion><match no="1" /> <match no="2" regexp_match="[Уу](.*)" regexp_replace="ў$1" /></suggestion></message>
<short>У замест ў</short>
<example>да ўвагі</example>
<example correction="да ўвагі"><marker>да увагі</marker></example>
</rule>
Now, the suggestion is as follows:
на ўсебеларускі…
i. e. the right letter У is corrected, but the letter case is not kept.
Then I tried:
<rule>
<pattern>
<token regexp="yes">.*[уеыаоэяіюё]</token>
<token regexp="yes">у.*</token>
</pattern>
<message>Пасьля галoсных літараў замест 'у' трэба пісаць 'ў': <suggestion><match no="1" /> <match no="2" regexp_match="[Уу](.*)" case_conversion="preserve" regexp_replace="ў$1" /></suggestion></message>
<short>У замест ў</short>
<example>да ўвагі</example>
<example correction="да ўвагі"><marker>да увагі</marker></example>
</rule>
…with the same result.
I’m stuck, because the limit of my understanding of the rules syntax has been reached. Can anyone point to any kind of documentation that can clarify possible ways of improving the rule? And yes, I read tips and tricks, but can’t see any pointer for my case.