
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@textlint-ja/textlint-rule-morpheme-match
Advanced tools
形態素解析結果のTokenベースの辞書でマッチするtextlintルール。
kuromoji.js形態素解析のTokenを取得し、morpheme-match-textlintを使い辞書とTokenが一致しているかを判定しています。
textlint-rule-prhでは正規表現のマッチができますが、品詞の一致などは見れません。
textlint-rule-morpheme-match
は日本語を単語レベルでの一致でチェックするルールです。
Install with npm:
npm install @textlint-ja/textlint-rule-morpheme-match
Via .textlintrc
(Recommended)
{
"rules": {
"@textlint-ja/morpheme-match": {
"dictionaryPathList": ["./path/to/dictionary.js"]
}
}
}
dictionaryPathList
: string[]
/user/file/to/dict.js
, ~/download/dict.js
, ./path/to/dict.json
などのファイルパス形式に対応しています辞書ファイルは.js
または.json
形式で記述できます。
1つの辞書ファイルには、複数のルールを含めることが可能です。
tokens
: マッチするTokenのパターンを配列で記述します
{}
(空のオブジェクト)を置くことで実現できます_capture
というプロパティには、surface_form
をキャプチャをする正規表現の変数を指定できます。message
で$1
のように指定すると、メッセージを出すときに置換されますmessage
: tokens
にマッチした場合のエラーメッセージを記述しますexpected
: textlint --fix
で自動的に修正する結果を記述します
tokens
にマッチした箇所がexpected
に置換され、自動修正ができるようになりますmodule.exports = [
// ルール1
{
// https://azu.github.io/morpheme-match/?text=省略(することが可能)。
message: `"することが可能$1"は冗長な表現です。"することが可能"を省き簡潔な表現にすると文章が明瞭になります。
参考: http://qiita.com/takahi-i/items/a93dc2ff42af6b93f6e0`,
tokens: [
{
"surface_form": "する",
"pos": "動詞",
"pos_detail_1": "自立",
"pos_detail_2": "*",
"pos_detail_3": "*",
"conjugated_type": "サ変・スル",
"conjugated_form": "基本形",
"basic_form": "する",
"reading": "スル",
"pronunciation": "スル"
}, {
"surface_form": "こと",
"pos": "名詞",
"pos_detail_1": "非自立",
"pos_detail_2": "一般",
"pos_detail_3": "*",
"conjugated_type": "*",
"conjugated_form": "*",
"basic_form": "こと",
"reading": "コト",
"pronunciation": "コト"
}, {
"surface_form": "が",
"pos": "助詞",
"pos_detail_1": "格助詞",
"pos_detail_2": "一般",
"pos_detail_3": "*",
"conjugated_type": "*",
"conjugated_form": "*",
"basic_form": "が",
"reading": "ガ",
"pronunciation": "ガ"
}, {
"surface_form": "可能",
"pos": "名詞",
"pos_detail_1": "形容動詞語幹",
"pos_detail_2": "*",
"pos_detail_3": "*",
"conjugated_type": "*",
"conjugated_form": "*",
"basic_form": "可能",
"reading": "カノウ",
"pronunciation": "カノー"
}, {
"pos": "助動詞",
"_capture": "$1"
}
]
},
// ルール2
{
"message": "\"適用\"の誤用である可能性があります。適応 => 適用",
"expected": "を適用",
"tokens": [
{
"surface_form": "を",
"pos": "助詞",
"pos_detail_1": "格助詞",
"pos_detail_2": "一般",
"pos_detail_3": "*",
"conjugated_type": "*",
"conjugated_form": "*",
"basic_form": "を",
"reading": "ヲ",
"pronunciation": "ヲ"
},
{
"surface_form": "適応",
"pos": "名詞",
"pos_detail_1": "サ変接続",
"pos_detail_2": "*",
"pos_detail_3": "*",
"conjugated_type": "*",
"conjugated_form": "*",
"basic_form": "適応",
"reading": "テキオウ",
"pronunciation": "テキオー"
}
]
}
];
See Releases page.
Install devDependencies and Run npm test
:
npm i -d && npm test
Pull requests and stars are always welcome.
For bugs and feature requests, please create an issue.
git checkout -b my-new-feature
git commit -am 'Add some feature'
git push origin my-new-feature
MIT © azu
FAQs
形態素解析結果のTokenベースの辞書でマッチするtextlintルール
We found that @textlint-ja/textlint-rule-morpheme-match demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.