Merge pull request #34248 from thatcort/master

Type definition for sbd library
This commit is contained in:
Benjamin Lichtman
2019-04-02 18:46:50 -07:00
committed by GitHub
4 changed files with 44 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
// Type definitions for sbd 1.0
// Project: http://github.com/tessmore/sbd
// Definitions by: Brian Cort <https://github.com/thatcort>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface Options {
newline_boundaries?: boolean;
html_boundaries?: boolean;
sanitize?: boolean;
allowed_tags?: false | string[];
preserve_whitespace?: boolean;
abbreviations?: string[];
}
export function sentences(text: string, options?: Options): string[];
+5
View File
@@ -0,0 +1,5 @@
import * as tokenizer from 'sbd';
const text = "On Jan. 20, former Sen. Barack Obama became the 44th President of the U.S. Millions attended the Inauguration.";
tokenizer.sentences(text);
tokenizer.sentences(text, {sanitize: true});
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"sbd-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }