Skip to content

Commit

Permalink
fix(dict2): fixで"[助詞]"が省略されない問題を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Jan 4, 2019
1 parent 45865e1 commit 8ff730e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/dictionary.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ module.exports = [
_capture: "$3",
_capture_to_expected: function(actualToken) {
if (actualToken.surface_form === "も") {
return "";
return "";
} else if (actualToken.surface_form === "は") {
return "";
return "";
}
return "";
},
Expand Down
28 changes: 25 additions & 3 deletions test/index-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,28 @@ tester.run("textlint-rule-ja-no-redundant-expression", rule, {
}
]
},
{
text: "ES5では`class`は予約語であるため、構文エラーとなり実行することはできません。",
output: "ES5では`class`は予約語であるため、構文エラーとなり実行できません。",
errors: [
{
message: `【dict2】 "することはできませ"は冗長な表現です。"することは"を省き簡潔な表現にすると文章が明瞭になります。
解説: https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression#dict2`,
index: 32
}
]
},
{
text: "たとえば`window.document`プロパティは、グローバル変数の`document`としてアクセスすることもできます。",
output: "たとえば`window.document`プロパティは、グローバル変数の`document`としてアクセスできます。",
errors: [
{
message: `【dict2】 "することもできます"は冗長な表現です。"することも"を省き簡潔な表現にすると文章が明瞭になります。
解説: https://github.com/textlint-ja/textlint-rule-ja-no-redundant-expression#dict2`,
index: 53
}
]
},
{
text: "必要なら解析することが,できます。",
output: "必要なら解析できます。",
Expand All @@ -193,7 +215,7 @@ tester.run("textlint-rule-ja-no-redundant-expression", rule, {
},
{
text: "解析することもできますよ。",
output: "解析もできますよ。",
output: "解析できますよ。",
errors: [
{
message: `【dict2】 "することもできます"は冗長な表現です。"することも"を省き簡潔な表現にすると文章が明瞭になります。
Expand All @@ -204,7 +226,7 @@ tester.run("textlint-rule-ja-no-redundant-expression", rule, {
},
{
text: "解析することはできますよ。",
output: "解析はできますよ。",
output: "解析できますよ。",
errors: [
{
message: `【dict2】 "することはできます"は冗長な表現です。"することは"を省き簡潔な表現にすると文章が明瞭になります。
Expand All @@ -215,7 +237,7 @@ tester.run("textlint-rule-ja-no-redundant-expression", rule, {
},
{
text: "解析する事はできますよ。",
output: "解析はできますよ。",
output: "解析できますよ。",
errors: [
{
message: `【dict2】 "する事はできます"は冗長な表現です。"する事は"を省き簡潔な表現にすると文章が明瞭になります。
Expand Down

0 comments on commit 8ff730e

Please sign in to comment.