textlint-plugin-latex2e icon indicating copy to clipboard operation
textlint-plugin-latex2e copied to clipboard

In the itemize environment, \item is not considered as the end of the sentence.

Open t4t5u0 opened this issue 3 years ago • 3 comments

This problem occurs when used in conjunction with ja-technical-writing.

In the itemize and description environments, lines beginning with \item are recognized as a single sentence.

I have checked this issue with no-double-joshi and max-length.

1b99cee114c74432642f571226358a88.png (1481×499)

t4t5u0 avatar Nov 04 '21 03:11 t4t5u0

Caused by this ?

https://github.com/textlint/textlint-plugin-latex2e/issues/84

t4t5u0 avatar Nov 04 '21 03:11 t4t5u0

I've confirmed that the problem has been reproduced.

$ echo << EOF > package.json
{
  "name": "issue262",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "textlint": "^12.0.2",
    "textlint-plugin-latex2e": "^1.1.4",
    "textlint-rule-preset-ja-technical-writing": "^7.0.0"
  }
}
EOF
$ echo << EOF > .textlintrc
{
    "plugins": ["latex2e"],
    "rules": {
        "preset-ja-technical-writing": {
            "no-doubled-joshi": {
                "min_interval": 1,
                "separatorCharacters": [".", ".", "。", "?", "!", "?", "!"]
            }
        }
    }
}
EOF
$ echo << EOF > sample.tex
\begin{description}
    \item{item1} これはサンプル。
    \item{item2} これはサンプル。
    \item{item2} これはサンプル。
\end{description}
\begin{itemize}
    \item これはサンプル。
    \item これはサンプル。
    \item これはサンプル。
\end{itemize}
EOF
$ npm install
$ npx textlint sample.tex
/path/to/sample.tex
  3:20  error  一文に二回以上利用されている助詞 "は" がみつかりました。  ja-technical-writing/no-doubled-joshi
  4:20  error  一文に二回以上利用されている助詞 "は" がみつかりました。  ja-technical-writing/no-doubled-joshi
  7:13  error  一文に二回以上利用されている助詞 "は" がみつかりました。  ja-technical-writing/no-doubled-joshi
  8:13  error  一文に二回以上利用されている助詞 "は" がみつかりました。  ja-technical-writing/no-doubled-joshi
  9:13  error  一文に二回以上利用されている助詞 "は" がみつかりました。  ja-technical-writing/no-doubled-joshi

✖ 5 problems (5 errors, 0 warnings)

@t4t5u0 As you pointed out, the current implementation is incomplete and may be causing these false positives due to problems of parsing.

Normally, if sentences containing the same joshi are punctuated within a paragraph, no problem will be detected, as shown below. Therefore, it is not a problem with these detection rules, but with this plugin.

$ cat << EOF > sample2.tex
\begin{section}
これはサンプルです。
これはサンプルです。
\end{section}
EOF
$ npx textlint sample2.tex
$ echo $?
0

We will try to solve the problem. The current workaround is to disable certain detection rules at certain places. textlint-filter-rule-comments will help you. https://github.com/textlint/textlint-filter-rule-comments

pddg avatar Nov 04 '21 04:11 pddg

Thank you for reply. In my environment, rules ignore works too.

t4t5u0 avatar Nov 08 '21 21:11 t4t5u0