sidemt
January 31, 2025, 2:15pm
1
Hi. I saw this GitHub issue:
opened 03:37AM - 01 Jul 20 UTC
The checker wrongly suggests that we should replace the verb 「表示する *to show*」 wi… th 「軽蔑する *to look down on*」 for the example Japanese sentence on the checker 「\*間違いの詳細の表示する *to show the detail of the error*」. In this sentence, the verb 「表示する *to show*」 is actually correct and appropriate. Rather, the dative marker 「の」in 「\*間違いの詳細【の】表示する *to show the detail of the error*」 must be replaced with the accusative marker 「を」. Therefore, the correct sentence has to be 「間違いの詳細【を】表示する」 and the checker ought to warn only the error of the case marker selection.

The rule with id="NO_SURU"
is causing the problem. The following code should fix it:
<rule id="NO_SURU" name="助詞「の」→「を」">
<pattern>
<token postag='名詞.*' postag_regexp='yes'></token>
<marker>
<token postag='助詞-連体化'>の</token>
</marker>
<token postag='名詞-サ変接続'>表示</token>
<token inflected='yes' postag='動詞-自立'>する</token>
</pattern>
<message>目的語を表すには<suggestion>を</suggestion>を使用します。</message>
<example correction='を'>詳細<marker>の</marker>表示する</example>
<example>詳細を表示する</example>
</rule>
I have tested the new rule with the LanguageTool Rule Editor, .\testrules.bat ja
, and languagetool.jar
, and confirmed it works as expected.
Additional information:
It would be better if the rule could also detect the error for other transitive verbs than “表示する”. However, as far as I checked the part-of-speech values in the text analyzer, I couldn’t find a way to distinguish between intransitive and transitive verbs.
If I make it match any verbs in the form of “名詞-サ変接続” + “する”, it will result in many false-positive results for intransitive verbs such as “存在する” (e.g. ファイルの存在するディレクトリ) or “関連する” (e.g. 他の関連するページ). So I kept it to match only “表示する”.
dnaber
(Daniel Naber)
February 4, 2025, 2:16pm
2
sidemt
February 5, 2025, 2:45pm
3
Sure. Now I’m reading this page for new committers, and it says I should add this text to the commit message.
Should I do that? I couldn’t find other contributors doing so.
sidemt
February 10, 2025, 4:14pm
5
Thank you. I’ve submitted a PR:
master
← sidemt:ja-fix-no_suru
opened 04:03PM - 10 Feb 25 UTC
Fix #3190
This is a change I suggested in the forum:
https://forum.language… tool.org/t/fix-japanese-rule-id-no-suru-github-issue-3190/10908
Note:
The Japanese `grammar.xml` file had all the line endings in CRLF. They were force updated to LF because the `.editorconfig` in the root has `end_of_line = lf` setting.
The commit named `[ja] use LF line endings` has changes made by `.editorconfig`. See `[ja] fix rule id="NO_SURU"` for my changes to the rule.
Please note that the line ending characters were updated by .editorconfig
. You can find details in my description in the PR.