t-yng / cspell-test

0 stars 0 forks source link

スペルチェック #2

Open t-yng opened 3 years ago

t-yng commented 3 years ago

候補のスペルチェックのCLIツール

t-yng commented 3 years ago

mispellを使った感想

t-yng commented 3 years ago

cspellを使った感想

t-yng commented 3 years ago

cspellを使う

t-yng commented 3 years ago

cspellだと弱い気がしたので再検討する

t-yng commented 3 years ago

cspellは setsupport などの 複合語に対しての提案が support などになってしまうので弱い。 可能なら、 setsupport => setSupport などにしたい。

t-yng commented 3 years ago

候補

t-yng commented 3 years ago

codespell

スペルミスだと判定されるのが、かなり甘いイメージがあった。

$ codespell frontend/src/lib/validate/index.ts
frontend/src/lib/validate/index.ts:8: adn ==> and
const setsupport = (support) => console.log("hoge");

const helo = (name) => {
    const unmunt = true;
    console.log(name);
};

const adn = "";
const drodown = "";

const unSubscription = "";

helo("test");
t-yng commented 3 years ago

nodehun

hunspellのNode.jsラッパー 渡した単語に対してのスペルチェックを実施するライブラリなので、ファイルの形態素解析などは自前で実装する必要がありそう。

t-yng commented 3 years ago

eslint-plugin-spellchecker

実行結果が微妙だった

frontend/src/lib/validate/index.ts
   1:7   warning  You have a misspelled word: setsupport on Identifier  spellcheck/spell-checker
   1:45  warning  You have a misspelled word: hoge on String            spellcheck/spell-checker
   3:7   warning  You have a misspelled word: helo on Identifier        spellcheck/spell-checker
   4:11  warning  You have a misspelled word: unmunt on Identifier      spellcheck/spell-checker
   8:7   warning  You have a misspelled word: adn on Identifier         spellcheck/spell-checker
   9:7   warning  You have a misspelled word: drodown on Identifier     spellcheck/spell-checker
  11:7   warning  You have a misspelled word: un on Identifier          spellcheck/spell-checker
  13:1   warning  You have a misspelled word: helo on Identifier        spellcheck/spell-checker