トークンに単語と句読点の組み合わせが含まれるルールの書き方がわかりません。
LanguageTool
ルールの句読点はどのように処理すればよいですか?
私はオンラインで見て、いくつかのことを試してみましたが、役に立ちませんでした。
たとえば、両方 1)
<rule id="THAT_AND_THAN_DOT" name="that and than dot">
<pattern>
<token>that</token>
<token regexp="yes">
another.|
himself.|
herself.|
itself.</token>
</pattern>
<message>Did you mean <suggestion>than \2.</suggestion>?</message>
<example correction='than another.'>Yes, better <marker>than another. </marker></example>
</rule>
2)
<rule id="THAT_AND_THAN_DOT" name="that and than dot">
<pattern>
<token>that</token>
<token regexp="yes">
another|
himself|
herself|
itself</token>
<token regexp="yes">
[.]</token>
</pattern>
<message>Did you mean <suggestion>than \2.</suggestion>?</message>
<example correction='than another.'>Yes, better <marker>than another. </marker></example>
</rule>
そして 3)
<rule id="THAT_AND_THAN_DOT" name="that and than dot">
<pattern>
<token>that</token>
<token regexp="yes">
another|
himself|
herself|
itself</token>
<token regexp="yes">
[:punct:]</token>
</pattern>
<message>Did you mean <suggestion>than \2.</suggestion>?</message>
<example correction='than another.'>Yes, better <marker>than another. </marker></example>
</rule>
失敗した。一方で
<rule id="THAT_AND_THAN_DOT" name="that and than dot">
<pattern>
<token>that</token>
<token regexp="yes">
another|
himself|
herself|
itself</token>
</pattern>
<message>Did you mean <suggestion>than \2.</suggestion>?</message>
<example correction='than another.'>Yes, better <marker>than another. </marker></example>
</rule>
私がやりたいドットを考慮しなくても、動作します。
注:私はLanguageTool
内側で使用していTexstudio
ます。