Skip to content

Commit

Permalink
fix(deps): update to kuromojin@3 (#10)
Browse files Browse the repository at this point in the history
* fix(deps): update kuromojin@3

* fix: use default export

* ci: move to GitHub Actions
  • Loading branch information
bizen241 authored Apr 24, 2021
1 parent 15cdaa6 commit 73a6a7e
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 25 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: test
on: [push, pull_request]
jobs:
test:
name: "Test on Node.js ${{ matrix.node-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12, 14]
steps:
- name: checkout
uses: actions/checkout@v2
- name: setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install
- name: Test
run: yarn test
3 changes: 0 additions & 3 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# textlint-rule-ja-no-successive-word
# textlint-rule-ja-no-successive-word [![Actions Status: test](https://github.com/textlint-ja/textlint-rule-ja-no-successive-word/workflows/test/badge.svg)](https://github.com/textlint-ja/textlint-rule-ja-no-successive-word/actions?query=workflow%3A"test")

同一の単語(厳密には形態素解析した結果のToken)が間違えて連続しているのを見つけるtextlintルール。
入力ミスによる同じ単語が連続している問題を発見します。
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
},
"dependencies": {
"@textlint/regexp-string-matcher": "^1.1.0",
"kuromojin": "^2.0.0"
"kuromojin": "^3.0.0"
}
}
7 changes: 4 additions & 3 deletions src/textlint-rule-ja-no-successive-word.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// LICENSE : MIT
"use strict";
const matchPatterns = require("@textlint/regexp-string-matcher").matchPatterns;
const tokenize = require("kuromojin").tokenize;
import { matchPatterns } from "@textlint/regexp-string-matcher";
import { tokenize } from "kuromojin";

const DefaultOptions = {
// オノマトペを許可する
// 制限: オノマトペを判定する方法がないため、同じカタカナの語が連続したものをオノマトペとして扱う
Expand All @@ -18,7 +19,7 @@ function isOnomatopee(str) {
return /^[-]*$/.test(str);
}

module.exports = function(context, options = {}) {
export default function(context, options = {}) {
const allowOnomatopee = options.allowOnomatopee !== undefined ? options.allowOnomatopee
: DefaultOptions.allowOnomatopee;
const allow = options.allow || DefaultOptions.allow;
Expand Down
7 changes: 4 additions & 3 deletions test/textlint-rule-ja-no-successive-word-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const TextLintTester = require("textlint-tester");
const tester = new TextLintTester();
// rule
import TextLintTester from "textlint-tester";
import rule from "../src/textlint-rule-ja-no-successive-word";

const tester = new TextLintTester();

// ruleName, rule, { valid, invalid }
tester.run("ja-no-successive-word", rule, {
valid: [
Expand Down
34 changes: 20 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2351,21 +2351,22 @@ kind-of@^6.0.0, kind-of@^6.0.2:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

kuromoji@0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/kuromoji/-/kuromoji-0.1.1.tgz#4aabf39bcced8b8ad92d007a04a26be6da8477c9"
integrity sha1-Sqvzm8zti4rZLQB6BKJr5tqEd8k=
kuromoji@0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/kuromoji/-/kuromoji-0.1.2.tgz#293f0d6706df006112137980588d5daac26d0790"
integrity sha512-V0dUf+C2LpcPEXhoHLMAop/bOht16Dyr+mDiIE39yX3vqau7p80De/koFqpiTcL1zzdZlc3xuHZ8u5gjYRfFaQ==
dependencies:
async "^2.0.1"
doublearray "0.0.2"
zlibjs "^0.2.0"
zlibjs "^0.3.1"

kuromojin@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/kuromojin/-/kuromojin-2.0.0.tgz#23e74a5ed2578432c9703ae75a69ba0a09ccb12d"
integrity sha512-60j/yLkFSc4t4roj8tI8ZNNSiAFnrkgXw8SqXz/9nakfs6mkCvPbrd7S8LDr4YNwEt1IyLys5JQTR9EnYyGHhA==
kuromojin@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/kuromojin/-/kuromojin-3.0.0.tgz#54a1a6643110f49f741c4beb82fef400d1cd498b"
integrity sha512-3h3qnn/NVVhqoKFP4oc7e6apO2B01Atc056oiVlIY7Uoup4rhrnBe28g3y9lK1HTmLDQEejvXB+3I3qxAneF7A==
dependencies:
kuromoji "0.1.1"
kuromoji "0.1.2"
lru_map "^0.4.1"

leven@^3.1.0:
version "3.1.0"
Expand Down Expand Up @@ -2473,6 +2474,11 @@ loud-rejection@^1.0.0:
currently-unhandled "^0.4.1"
signal-exit "^3.0.0"

lru_map@^0.4.1:
version "0.4.1"
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.4.1.tgz#f7b4046283c79fb7370c36f8fca6aee4324b0a98"
integrity sha512-I+lBvqMMFfqaV8CJCISjI3wbjmwVu/VyOoU7+qtu9d7ioW5klMgsTTiUOUp+DJvfTTzKXoPbyC6YfgkNcyPSOg==

make-dir@^2.0.0, make-dir@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5"
Expand Down Expand Up @@ -3937,7 +3943,7 @@ yargs@13.3.2, yargs@^13.3.0:
y18n "^4.0.0"
yargs-parser "^13.1.2"

zlibjs@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/zlibjs/-/zlibjs-0.2.0.tgz#ae20f06243293d85c255563189f9b12f5b3ba1a0"
integrity sha1-riDwYkMpPYXCVVYxifmxL1s7oaA=
zlibjs@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/zlibjs/-/zlibjs-0.3.1.tgz#50197edb28a1c42ca659cc8b4e6a9ddd6d444554"
integrity sha1-UBl+2yihxCymWcyLTmqd3W1ERVQ=

0 comments on commit 73a6a7e

Please sign in to comment.