Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sentence-splitter

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sentence-splitter - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

22

lib/sentence-splitter.js

@@ -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 {

9

package.json

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc