analyze-desumasu-dearu
Advanced tools
Comparing version 4.0.1 to 5.0.0
@@ -5,12 +5,12 @@ { | ||
"type": "git", | ||
"url": "git+https://github.com/azu/analyze-desumasu-dearu.git" | ||
"url": "git+https://github.com/textlint-ja/analyze-desumasu-dearu.git" | ||
}, | ||
"author": "azu", | ||
"email": "azuciao@gmail.com", | ||
"homepage": "https://github.com/azu/analyze-desumasu-dearu", | ||
"homepage": "https://github.com/textlint-ja/analyze-desumasu-dearu", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/azu/analyze-desumasu-dearu/issues" | ||
"url": "https://github.com/textlint-ja/analyze-desumasu-dearu/issues" | ||
}, | ||
"version": "4.0.1", | ||
"version": "5.0.0", | ||
"description": "文の敬体(ですます調)、常体(である調)を解析", | ||
@@ -31,3 +31,4 @@ "main": "lib/analyze.js", | ||
"example": "cd example && npm it", | ||
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"" | ||
"prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"", | ||
"prepare": "git config --local core.hooksPath .githook" | ||
}, | ||
@@ -39,15 +40,13 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/cli": "^7.0.0", | ||
"@babel/core": "^7.0.0", | ||
"@babel/preset-env": "^7.0.0", | ||
"@babel/register": "^7.0.0", | ||
"babel-preset-power-assert": "^3.0.0", | ||
"husky": "^1.0.1", | ||
"lint-staged": "^7.3.0", | ||
"mocha": "^5.2.0", | ||
"power-assert": "^1.4.4", | ||
"prettier": "^1.10.2" | ||
"@babel/cli": "^7.13.16", | ||
"@babel/core": "^7.13.16", | ||
"@babel/preset-env": "^7.13.15", | ||
"@babel/register": "^7.13.16", | ||
"husky": "^6.0.0", | ||
"lint-staged": "^10.5.4", | ||
"mocha": "^8.3.2", | ||
"prettier": "^2.2.1" | ||
}, | ||
"dependencies": { | ||
"kuromojin": "^2.0.0" | ||
"kuromojin": "^3.0.0" | ||
}, | ||
@@ -57,16 +56,10 @@ "prettier": { | ||
"printWidth": 120, | ||
"tabWidth": 4 | ||
"tabWidth": 4, | ||
"trailingComma": "none" | ||
}, | ||
"lint-staged": { | ||
"*.{js,jsx,ts,tsx,css}": [ | ||
"prettier --write", | ||
"git add" | ||
"prettier --write" | ||
] | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"post-commit": "git reset", | ||
"pre-commit": "lint-staged" | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# analyze-desumasu-dearu [![Build Status](https://travis-ci.org/azu/analyze-desumasu-dearu.svg?branch=master)](https://travis-ci.org/azu/analyze-desumasu-dearu) | ||
# analyze-desumasu-dearu [![Actions Status: test](https://github.com/textlint-ja/analyze-desumasu-dearu/workflows/test/badge.svg)](https://github.com/textlint-ja/analyze-desumasu-dearu/actions?query=workflow%3A"test") | ||
@@ -3,0 +3,0 @@ 文の敬体(ですます調)、常体(である調)を解析するライブラリ |
@@ -59,4 +59,4 @@ // LICENSE : MIT | ||
*/ | ||
const isDesumasuType = type => type === Types.desu || type === Types.masu; | ||
const isDearuType = type => type === Types.dearu; | ||
const isDesumasuType = (type) => type === Types.desu || type === Types.masu; | ||
const isDearuType = (type) => type === Types.dearu; | ||
@@ -92,3 +92,3 @@ /** | ||
const postTokens = allTokens.slice(indexOfTargetToken + 1); | ||
return postTokens.find(token => { | ||
return postTokens.find((token) => { | ||
// 接続、末尾なので切る | ||
@@ -114,3 +114,3 @@ if (PUNCTUATION.test(token["surface_form"])) { | ||
*/ | ||
const mapToAnalyzedResult = tokens => { | ||
const mapToAnalyzedResult = (tokens) => { | ||
/** | ||
@@ -126,3 +126,3 @@ * @param {AnalyzedToken} token | ||
const valueTokens = tokens.slice(indexOfTargetToken, nextTokenIndex + 1); | ||
const value = valueTokens.map(token => token["surface_form"]).join(""); | ||
const value = valueTokens.map((token) => token["surface_form"]).join(""); | ||
return { | ||
@@ -151,3 +151,3 @@ type: token["conjugated_type"], | ||
options.ignoreConjunction !== undefined ? options.ignoreConjunction : defaultOptions.ignoreConjunction; | ||
return getTokenizer().then(tokenizer => { | ||
return getTokenizer().then((tokenizer) => { | ||
const tokens = _tokensCacheMap[text] ? _tokensCacheMap[text] : tokenizer.tokenizeForSentence(text); | ||
@@ -194,3 +194,3 @@ _tokensCacheMap[text] = tokens; | ||
export function analyzeDesumasu(text, options = defaultOptions) { | ||
return analyze(text, options).then(results => results.filter(isDesumasu)); | ||
return analyze(text, options).then((results) => results.filter(isDesumasu)); | ||
} | ||
@@ -205,3 +205,3 @@ | ||
export function analyzeDearu(text, options = defaultOptions) { | ||
return analyze(text, options).then(results => results.filter(isDearu)); | ||
return analyze(text, options).then((results) => results.filter(isDearu)); | ||
} |
Sorry, the diff of this file is not supported yet
36479
8
+ Addedkuromoji@0.1.2(transitive)
+ Addedkuromojin@3.0.0(transitive)
+ Addedlru_map@0.4.1(transitive)
+ Addedzlibjs@0.3.1(transitive)
- Removedkuromoji@0.1.1(transitive)
- Removedkuromojin@2.1.1(transitive)
- Removedzlibjs@0.2.0(transitive)
Updatedkuromojin@^3.0.0