sentence-splitter
Advanced tools
Comparing version 2.0.0 to 2.1.0
@@ -26,2 +26,10 @@ // LICENSE : MIT | ||
}; | ||
/** | ||
* @param {string} text | ||
* @param {{ | ||
* charRegExp: ?Object, | ||
* newLineCharacters: ?String | ||
* }} options | ||
* @returns {Array} | ||
*/ | ||
function split(text) { | ||
@@ -37,3 +45,3 @@ var options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1]; | ||
var slicedText = text.slice(start, end); | ||
var node = undefined; | ||
var node = void 0; | ||
if (type === Syntax.WhiteSpace) { | ||
@@ -86,2 +94,8 @@ node = createWhiteSpaceNode(slicedText, location, range); | ||
} | ||
/** | ||
* @param {string} text | ||
* @param {Object} loc | ||
* @param {number[]} range | ||
* @returns {{type: string, raw: string, value: string, loc: Object, range: number[]}} | ||
*/ | ||
function createWhiteSpaceNode(text, loc, range) { | ||
@@ -96,2 +110,8 @@ return { | ||
} | ||
/** | ||
* @param {string} text | ||
* @param {Object} loc | ||
* @param {number[]} range | ||
* @returns {{type: string, raw: string, value: string, loc: Object, range: number[]}} | ||
*/ | ||
function createSentenceNode(text, loc, range) { | ||
@@ -98,0 +118,0 @@ return { |
@@ -14,5 +14,8 @@ { | ||
}, | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "split {japanese, english} text into sentences.", | ||
"main": "lib/sentence-splitter.js", | ||
"bin": { | ||
"sentence-splitter": "bin/cmd.js" | ||
}, | ||
"files": [ | ||
@@ -26,3 +29,3 @@ "lib", | ||
"scripts": { | ||
"build": "babel src --out-dir lib --source-maps", | ||
"build": "NODE_ENV=production babel src --out-dir lib --source-maps", | ||
"watch": "babel src --out-dir lib --watch --source-maps", | ||
@@ -38,2 +41,3 @@ "prepublish": "npm run --if-present build", | ||
"dependencies": { | ||
"concat-stream": "^1.5.2", | ||
"structured-source": "^3.0.2" | ||
@@ -43,2 +47,3 @@ }, | ||
"babel-cli": "^6.1.18", | ||
"babel-plugin-jsdoc-to-assert": "^1.3.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.1.18", | ||
@@ -45,0 +50,0 @@ "babel-preset-es2015": "^6.1.18", |
@@ -9,2 +9,10 @@ # sentence-splitter | ||
### CLI | ||
$ npm install -g sentence-splitter | ||
$ echo "This is a pen.But This is not pen" | sentence-splitter | ||
This is a pen. | ||
But This is not pen | ||
## Usage | ||
@@ -11,0 +19,0 @@ |
@@ -12,2 +12,10 @@ // LICENSE : MIT | ||
}; | ||
/** | ||
* @param {string} text | ||
* @param {{ | ||
* charRegExp: ?Object, | ||
* newLineCharacters: ?String | ||
* }} options | ||
* @returns {Array} | ||
*/ | ||
export function split(text, options = {}) { | ||
@@ -69,2 +77,8 @@ const matchChar = options.charRegExp || defaultOptions.charRegExp; | ||
} | ||
/** | ||
* @param {string} text | ||
* @param {Object} loc | ||
* @param {number[]} range | ||
* @returns {{type: string, raw: string, value: string, loc: Object, range: number[]}} | ||
*/ | ||
export function createWhiteSpaceNode(text, loc, range) { | ||
@@ -79,2 +93,8 @@ return { | ||
} | ||
/** | ||
* @param {string} text | ||
* @param {Object} loc | ||
* @param {number[]} range | ||
* @returns {{type: string, raw: string, value: string, loc: Object, range: number[]}} | ||
*/ | ||
export function createSentenceNode(text, loc, range) { | ||
@@ -81,0 +101,0 @@ return { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19864
217
246
2
7
+ Addedconcat-stream@^1.5.2
+ Addedbuffer-from@1.1.2(transitive)
+ Addedconcat-stream@1.6.2(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedtypedarray@0.0.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)