diff --git a/types/sbd/index.d.ts b/types/sbd/index.d.ts new file mode 100644 index 0000000000..0934ba937c --- /dev/null +++ b/types/sbd/index.d.ts @@ -0,0 +1,15 @@ +// Type definitions for sbd 1.0 +// Project: http://github.com/tessmore/sbd +// Definitions by: Brian Cort +// 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[]; diff --git a/types/sbd/sbd-tests.ts b/types/sbd/sbd-tests.ts new file mode 100644 index 0000000000..53f6cd9d14 --- /dev/null +++ b/types/sbd/sbd-tests.ts @@ -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}); diff --git a/types/sbd/tsconfig.json b/types/sbd/tsconfig.json new file mode 100644 index 0000000000..8374644d40 --- /dev/null +++ b/types/sbd/tsconfig.json @@ -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" + ] +} diff --git a/types/sbd/tslint.json b/types/sbd/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/sbd/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }