You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
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

to
4.4.1

20

lib/package.json
{
"name": "sentence-splitter",
"version": "4.4.0",
"version": "4.4.1",
"description": "split {japanese, english} text into sentences.",

@@ -59,16 +59,16 @@ "keywords": [

"dependencies": {
"@textlint/ast-node-types": "^13.2.0",
"@textlint/ast-node-types": "^13.4.1",
"structured-source": "^4.0.0"
},
"devDependencies": {
"@textlint/markdown-to-ast": "^13.2.0",
"@types/mocha": "^10.0.1",
"@types/node": "^18.13.0",
"lint-staged": "^13.1.1",
"@textlint/markdown-to-ast": "^13.4.1",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.0",
"lint-staged": "^15.1.0",
"mocha": "^10.2.0",
"prettier": "^2.8.4",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"tsconfig-to-dual-package": "^1.1.1",
"typescript": "^4.9.5",
"vite": "^4.1.1"
"tsconfig-to-dual-package": "^1.2.0",
"typescript": "^5.3.2",
"vite": "^5.0.2"
},

@@ -75,0 +75,0 @@ "packageManager": "yarn@1.22.19",

@@ -6,8 +6,8 @@ "use strict";

separatorCharacters: [
".",
".",
"。",
"?",
"!",
"?",
".", // period
".", // (ja) zenkaku-period
"。", // (ja) 句点
"?", // question mark
"!", // exclamation mark
"?", // (ja) zenkaku question mark
"!" // (ja) zenkaku exclamation mark

@@ -14,0 +14,0 @@ ]

import type { TxtParagraphNode, TxtParentNode, TxtStrNode, TxtTextNode } from "@textlint/ast-node-types";
import { DefaultOptions as DefaultSentenceSplitterOptions, SeparatorParserOptions } from "./parser/SeparatorParser.js";
import { DefaultOptions as DefaultAbbrMarkerOptions, AbbrMarkerOptions } from "./parser/AbbrMarker.js";
import { AbbrMarkerOptions, DefaultOptions as DefaultAbbrMarkerOptions } from "./parser/AbbrMarker.js";
export declare const SentenceSplitterSyntax: {

@@ -25,3 +25,4 @@ readonly WhiteSpace: "WhiteSpace";

};
export type TxtSentenceNode = Omit<TxtParentNode, "type"> & {
export type TxtSentenceNodeChildren = TxtParentNode["children"][number] | TxtWhiteSpaceNode | TxtPunctuationNode | TxtStrNode;
export type TxtSentenceNode = Omit<TxtParentNode, "type" | "children"> & {
readonly type: "Sentence";

@@ -33,2 +34,3 @@ /**

readonly contexts: SentencePairMarkContext[];
children: TxtSentenceNodeChildren[];
};

@@ -35,0 +37,0 @@ export type TxtWhiteSpaceNode = Omit<TxtTextNode, "type"> & {

{
"name": "sentence-splitter",
"version": "4.4.0",
"version": "4.4.1",
"description": "split {japanese, english} text into sentences.",

@@ -59,16 +59,16 @@ "keywords": [

"dependencies": {
"@textlint/ast-node-types": "^13.2.0",
"@textlint/ast-node-types": "^13.4.1",
"structured-source": "^4.0.0"
},
"devDependencies": {
"@textlint/markdown-to-ast": "^13.2.0",
"@types/mocha": "^10.0.1",
"@types/node": "^18.13.0",
"lint-staged": "^13.1.1",
"@textlint/markdown-to-ast": "^13.4.1",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.0",
"lint-staged": "^15.1.0",
"mocha": "^10.2.0",
"prettier": "^2.8.4",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"tsconfig-to-dual-package": "^1.1.1",
"typescript": "^4.9.5",
"vite": "^4.1.1"
"tsconfig-to-dual-package": "^1.2.0",
"typescript": "^5.3.2",
"vite": "^5.0.2"
},

@@ -75,0 +75,0 @@ "packageManager": "yarn@1.22.19",

export const DefaultOptions = {
separatorCharacters: [
".",
".",
"。",
"?",
"!",
"?",
".", // period
".", // (ja) zenkaku-period
"。", // (ja) 句点
"?", // question mark
"!", // exclamation mark
"?", // (ja) zenkaku question mark
"!" // (ja) zenkaku exclamation mark

@@ -10,0 +10,0 @@ ]

import type { TxtParagraphNode, TxtParentNode, TxtStrNode, TxtTextNode } from "@textlint/ast-node-types";
import { DefaultOptions as DefaultSentenceSplitterOptions, SeparatorParserOptions } from "./parser/SeparatorParser.js";
import { DefaultOptions as DefaultAbbrMarkerOptions, AbbrMarkerOptions } from "./parser/AbbrMarker.js";
import { AbbrMarkerOptions, DefaultOptions as DefaultAbbrMarkerOptions } from "./parser/AbbrMarker.js";
export declare const SentenceSplitterSyntax: {

@@ -25,3 +25,4 @@ readonly WhiteSpace: "WhiteSpace";

};
export type TxtSentenceNode = Omit<TxtParentNode, "type"> & {
export type TxtSentenceNodeChildren = TxtParentNode["children"][number] | TxtWhiteSpaceNode | TxtPunctuationNode | TxtStrNode;
export type TxtSentenceNode = Omit<TxtParentNode, "type" | "children"> & {
readonly type: "Sentence";

@@ -33,2 +34,3 @@ /**

readonly contexts: SentencePairMarkContext[];
children: TxtSentenceNodeChildren[];
};

@@ -35,0 +37,0 @@ export type TxtWhiteSpaceNode = Omit<TxtTextNode, "type"> & {

@@ -7,3 +7,3 @@ import { ASTNodeTypes } from "@textlint/ast-node-types";

import { AnyValueParser } from "./parser/AnyValueParser.js";
import { DefaultOptions as DefaultAbbrMarkerOptions, AbbrMarker } from "./parser/AbbrMarker.js";
import { AbbrMarker, DefaultOptions as DefaultAbbrMarkerOptions } from "./parser/AbbrMarker.js";
import { PairMaker } from "./parser/PairMaker.js";

@@ -10,0 +10,0 @@ import { nodeLog } from "./logger.js";

{
"name": "sentence-splitter",
"version": "4.4.0",
"version": "4.4.1",
"description": "split {japanese, english} text into sentences.",

@@ -86,16 +86,16 @@ "keywords": [

"dependencies": {
"@textlint/ast-node-types": "^13.2.0",
"@textlint/ast-node-types": "^13.4.1",
"structured-source": "^4.0.0"
},
"devDependencies": {
"@textlint/markdown-to-ast": "^13.2.0",
"@types/mocha": "^10.0.1",
"@types/node": "^18.13.0",
"lint-staged": "^13.1.1",
"@textlint/markdown-to-ast": "^13.4.1",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.0",
"lint-staged": "^15.1.0",
"mocha": "^10.2.0",
"prettier": "^2.8.4",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"tsconfig-to-dual-package": "^1.1.1",
"typescript": "^4.9.5",
"vite": "^4.1.1"
"tsconfig-to-dual-package": "^1.2.0",
"typescript": "^5.3.2",
"vite": "^5.0.2"
},

@@ -102,0 +102,0 @@ "packageManager": "yarn@1.22.19",

@@ -1,2 +0,2 @@

import type { TxtNode, TxtParagraphNode, TxtParentNode, TxtStrNode, TxtTextNode } from "@textlint/ast-node-types";
import type { TxtParagraphNode, TxtParentNode, TxtStrNode, TxtTextNode } from "@textlint/ast-node-types";
import { ASTNodeTypes } from "@textlint/ast-node-types";

@@ -14,3 +14,3 @@

import { AnyValueParser } from "./parser/AnyValueParser.js";
import { DefaultOptions as DefaultAbbrMarkerOptions, AbbrMarker, AbbrMarkerOptions } from "./parser/AbbrMarker.js";
import { AbbrMarker, AbbrMarkerOptions, DefaultOptions as DefaultAbbrMarkerOptions } from "./parser/AbbrMarker.js";
import { PairMaker } from "./parser/PairMaker.js";

@@ -41,3 +41,10 @@ import { nodeLog } from "./logger.js";

};
export type TxtSentenceNode = Omit<TxtParentNode, "type"> & {
// SentenceNode does not have sentence
// Nested SentenceNode is not allowed
export type TxtSentenceNodeChildren =
| TxtParentNode["children"][number]
| TxtWhiteSpaceNode
| TxtPunctuationNode
| TxtStrNode;
export type TxtSentenceNode = Omit<TxtParentNode, "type" | "children"> & {
readonly type: "Sentence";

@@ -49,2 +56,4 @@ /**

readonly contexts: SentencePairMarkContext[];
children: TxtSentenceNodeChildren[];
};

@@ -77,3 +86,3 @@ export type TxtWhiteSpaceNode = Omit<TxtTextNode, "type"> & {

pushNodeToCurrent(node: TxtParentNodeWithSentenceNodeContent) {
pushNodeToCurrent(node: TxtSentenceNodeChildren) {
const current = this.current;

@@ -129,3 +138,3 @@ if (current) {

}
const firstChildNode: TxtNode = currentNode.children[0];
const firstChildNode = currentNode.children[0];
const endNow = this.source.now();

@@ -311,3 +320,3 @@ // update Sentence node's location and range

},
range: [startPosition.offset, endPosition.offset]
range: [startPosition.offset, endPosition.offset] as const
};

@@ -314,0 +323,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet