Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
t4t5u0 opened this issue Nov 4, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@t4t5u0
Copy link

t4t5u0 commented Nov 4, 2021

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
Copy link
Author

t4t5u0 commented Nov 4, 2021

Caused by this ?

#84

@pddg
Copy link
Member

pddg commented Nov 4, 2021

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

@t4t5u0
Copy link
Author

t4t5u0 commented Nov 8, 2021

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

@pddg pddg added the bug Something isn't working label Nov 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants