textlint-rule-ja-no-redundant-expression
Version:
317 lines (314 loc) • 10.1 kB
JavaScript
// MIT © 2016 azu
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ExpectedType = exports.Dictionary = void 0;
var punctuations = ["、", "、", ",", ","];
/**
* _capture_to_expectedで返すことが特殊な値
* @type {{STOP_REPLACE: string}}
*/
var ExpectedType = {
// Expectedへの変換自体を取りやめる
STOP_REPLACE: "STOP_REPLACE"
};
exports.ExpectedType = ExpectedType;
var Dictionary = [{
// https://azu.github.io/morpheme-match/?text=省略(することが可能)。
id: "dict1",
disabled: false,
allows: [],
message: "\"\u3059\u308B$2$3$4$5$1\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"\u3059\u308B$2$3$4\"\u3092\u7701\u304D\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
url: "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: "スル"
}, {
pos: "名詞",
reading: "コト",
_capture: "$2",
_readme: "こと"
}, {
pos: "助詞",
_capture: "$3",
_readme: "[助詞]"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$4"
}, {
basic_form: ["可", "可能", "不可能", "不能", "不可"],
_capture: "$5",
_readme: "(不)可能"
}, {
pos: "助動詞",
_capture: "$1"
}]
}, {
// https://azu.github.io/morpheme-match/?text=解析(することができます)。
id: "dict2",
disabled: false,
allows: [],
message: "\"\u3059\u308B$4$3$5$1$2\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"\u3059\u308B$4$3$5\"\u3092\u7701\u304D\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
url: "http://qiita.com/takahi-i/items/a93dc2ff42af6b93f6e0",
expected: "$3$1$2",
tokens: [{
surface_form: "する",
pos: "動詞",
pos_detail_1: "自立",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "サ変・スル",
conjugated_form: "基本形",
basic_form: "する",
reading: "スル",
pronunciation: "スル"
}, {
pos: "名詞",
reading: "コト",
_capture: "$4",
_readme: "こと"
}, {
pos: "助詞",
_capture: "$3",
_capture_to_expected: actualToken => {
// 誤検知しにくい「が」のみ修正する
if (actualToken.surface_form === "が") {
return "";
}
return ExpectedType.STOP_REPLACE;
},
_readme: "[助詞]"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$5"
}, {
pos: "動詞",
pos_detail_1: "自立",
pos_detail_2: "*",
pos_detail_3: "*",
basic_form: "できる",
_capture: "$1"
}, {
_capture: "$2"
}]
}, {
// https://azu.github.io/morpheme-match/?text=必要(であると言えます)
id: "dict3",
disabled: false,
allows: [],
message: "\"\u3067$1$6\u3068$5$2\u307E\u3059\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"\u3067\u3042\u308B$6\" \u307E\u305F\u306F \"\u3068$5\u8A00\u3048\u307E\u3059\"\u3092\u7701\u304D\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
url: "https://web.archive.org/web/20170608111205/http://www.sekaihaasobiba.com/entry/2014/10/24/204024",
tokens: [{
surface_form: "で",
pos: "助動詞",
pos_detail_1: "*",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "特殊・ダ",
conjugated_form: "連用形",
basic_form: "だ",
reading: "デ",
pronunciation: "デ"
}, {
reading: "アル",
_capture: "$1",
_readme: "ある"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$6"
}, {
surface_form: "と",
pos: "助詞"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$5"
}, {
pos: "動詞",
pos_detail_1: "自立",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "一段",
conjugated_form: "連用形",
reading: "イエ",
pronunciation: "イエ",
_capture: "$2",
_readme: "言え"
}, {
surface_form: "ます",
pos: "助動詞",
pos_detail_1: "*",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "特殊・マス",
conjugated_form: "基本形",
basic_form: "ます",
reading: "マス",
pronunciation: "マス"
}]
}, {
// https://azu.github.io/morpheme-match/?text=必要(であると考えている)
id: "dict4",
disabled: false,
allows: [],
message: "\"\u3067\u3042\u308B$7\u3068$5\u8003\u3048\u3066$6\u3044\u308B\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"\u3067\u3042\u308B$7\" \u307E\u305F\u306F \"\u3068$5\u8003\u3048\u3066$6\u3044\u308B\"\u3092\u7701\u304D\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
url: "http://www.atmarkit.co.jp/ait/articles/1001/19/news106_2.html",
expected: "である",
tokens: [{
surface_form: "で",
pos: "助動詞",
pos_detail_1: "*",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "特殊・ダ",
conjugated_form: "連用形",
basic_form: "だ",
reading: "デ",
pronunciation: "デ"
}, {
reading: "アル",
_capture: "$1",
_readme: "ある"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$7"
}, {
surface_form: "と",
pos: "助詞"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$5"
}, {
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: punctuations,
_skippable: true,
_capture: "$6"
}, {
pos: "動詞",
pos_detail_1: "非自立",
pos_detail_2: "*",
pos_detail_3: "*",
basic_form: "いる"
}, {
surface_form: "ます",
pos: "助動詞",
conjugated_type: "特殊・マス",
conjugated_form: "基本形",
basic_form: "ます",
reading: "マス",
pronunciation: "マス",
_skippable: true
}]
}, {
// https://azu.github.io/morpheme-match/?text=動作の(確認を行わなければ)ならない
id: "dict5",
disabled: false,
allows: ["/^処理を行[ぁ-ん]/", "/^[ァ-ヶ]+を.?行[ぁ-ん]/", "/^[a-zA-Z]+を.?行[ぁ-ん]/"],
message: "\"$1\u3092$5\u884C\u3046\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"$1\u3059\u308B\"\u306A\u3069\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
description: "[\u30B5\u5909\u540D\u8A5E]\u3068\u306F\u300C[\u540D\u8A5E]\u3059\u308B\u300D\u3068\u3044\u3046\u3088\u3046\u306B\u300C\u3059\u308B\u300D\u304C\u5F8C\u308D\u306B\u3064\u3044\u305F\u5834\u5408\u306B\u3001\u52D5\u8A5E\u306E\u50CD\u304D\u3092\u3059\u308B\u540D\u8A5E\u3067\u3059\u3002\n\n\u4F8B\uFF09\u300C\u884C\u52D5\uFF08\u3059\u308B\uFF09\u300D\u3001\u300C\u30D7\u30ED\u30B0\u30E9\u30E0\uFF08\u3059\u308B\uFF09\u300D\n\n",
url: "http://www.atmarkit.co.jp/ait/articles/1001/19/news106_2.html",
tokens: [{
pos: "名詞",
pos_detail_1: "サ変接続",
_capture: "$1",
_readme: "[サ変名詞]"
}, {
surface_form: "を",
pos: "助詞",
pos_detail_1: "格助詞",
pos_detail_2: "一般",
pos_detail_3: "*",
conjugated_type: "*",
conjugated_form: "*",
basic_form: "を",
reading: "ヲ",
pronunciation: "ヲ"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$5"
}, {
pos: "動詞",
pos_detail_1: "自立",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "五段・ワ行促音便",
basic_form: "行う"
}]
}, {
id: "dict6",
disabled: false,
allows: ["/^処理を実行/", "/^[ァ-ヶ]+を.?実行/", "/^[a-zA-Z]+を.?実行/"],
message: "\"$1\u3092$5\u5B9F\u884C\"\u306F\u5197\u9577\u306A\u8868\u73FE\u3067\u3059\u3002\"$1\u3059\u308B\"\u306A\u3069\u7C21\u6F54\u306A\u8868\u73FE\u306B\u3059\u308B\u3068\u6587\u7AE0\u304C\u660E\u77AD\u306B\u306A\u308A\u307E\u3059\u3002",
description: "[\u30B5\u5909\u540D\u8A5E]\u3068\u306F\u300C[\u540D\u8A5E]\u3059\u308B\u300D\u3068\u3044\u3046\u3088\u3046\u306B\u300C\u3059\u308B\u300D\u304C\u5F8C\u308D\u306B\u3064\u3044\u305F\u5834\u5408\u306B\u3001\u52D5\u8A5E\u306E\u50CD\u304D\u3092\u3059\u308B\u540D\u8A5E\u3067\u3059\u3002\n\n\u4F8B\uFF09\u300C\u884C\u52D5\uFF08\u3059\u308B\uFF09\u300D\u3001\u300C\u30D7\u30ED\u30B0\u30E9\u30E0\uFF08\u3059\u308B\uFF09\u300D\n\n",
url: "http://www.atmarkit.co.jp/ait/articles/1001/19/news106_2.html",
tokens: [{
pos: "名詞",
pos_detail_1: "サ変接続",
_capture: "$1",
_readme: "[サ変名詞]"
}, {
surface_form: "を",
pos: "助詞",
pos_detail_1: "格助詞",
pos_detail_2: "一般",
pos_detail_3: "*",
conjugated_type: "*",
conjugated_form: "*",
basic_form: "を",
reading: "ヲ",
pronunciation: "ヲ"
}, {
surface_form: punctuations,
_skippable: true,
_capture: "$5"
}, {
surface_form: "実行",
pos: "名詞",
pos_detail_1: "サ変接続",
pos_detail_2: "*",
pos_detail_3: "*",
conjugated_type: "*",
conjugated_form: "*",
basic_form: "実行",
reading: "ジッコウ",
pronunciation: "ジッコー"
}]
}];
exports.Dictionary = Dictionary;
//# sourceMappingURL=dictionary.js.map