polly-text-split
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -0,3 +1,3 @@ | ||
exports.HARD_LIMIT = 1500 | ||
exports.SOFT_LIMIT = 1000 | ||
exports.HARD_LIMIT = 1500 | ||
exports.EXTRA_SPLIT_CHARS = ',;' |
@@ -17,5 +17,5 @@ const { ValidationError } = require('./errors') | ||
*/ | ||
constructor(softLimit, hardLimit, extraSplitChars) { | ||
constructor(hardLimit, softLimit, extraSplitChars) { | ||
this._hardLimit = hardLimit | ||
this._softLimit = softLimit | ||
this._hardLimit = hardLimit | ||
this._extraSplitChars = extraSplitChars | ||
@@ -30,5 +30,5 @@ this._batches = [] | ||
* @param {Object} options Object with configuration options. | ||
* @param {number=1000} options.softLimit Limit of a min batch size. | ||
* @param {number=1500} options.hardLimit Limit of a max possible batch size. | ||
* @param {string=",;"} [options.extraSplitChars] String with characters, that can be used as split markers. Optional parameter. | ||
* @param {number} options.hardLimit=1500 Limit of a max possible batch size. | ||
* @param {number} options.softLimit=1000 Limit of a min batch size. | ||
* @param {string} [options.extraSplitChars=,;] String with characters, that can be used as split markers. Optional parameter. | ||
*/ | ||
@@ -52,3 +52,3 @@ configure(options) { | ||
/** | ||
* Splits text for batches of <1500 chars or of custom size set by configure(). | ||
* Splits text for batches of <=1500 chars or of custom size set by configure(). | ||
* | ||
@@ -102,3 +102,3 @@ * @param {string} text Text input for splitting. | ||
if (!splitIdx) { | ||
// no split chars found - split by nearest space char | ||
// no split chars found - split by the nearest space char | ||
i = this._hardLimit | ||
@@ -117,2 +117,2 @@ while (i > this._softLimit) { | ||
module.exports = new TextSplit(SOFT_LIMIT, HARD_LIMIT, EXTRA_SPLIT_CHARS) | ||
module.exports = new TextSplit(HARD_LIMIT, SOFT_LIMIT, EXTRA_SPLIT_CHARS) |
{ | ||
"name": "polly-text-split", | ||
"version": "0.1.0", | ||
"description": "Text splitter for working with AWS Polly TTS.", | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/oleglegun/polly-text-split.git" | ||
}, | ||
"keywords": [ | ||
"polly", | ||
"aws", | ||
"tts" | ||
], | ||
"author": "Oleg Legun <oleg.legun@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/oleglegun/polly-text-split/issues" | ||
}, | ||
"homepage": "https://github.com/oleglegun/polly-text-split#readme", | ||
"devDependencies": { | ||
"tap": "^11.1.3" | ||
} | ||
"name": "polly-text-split", | ||
"version": "0.1.1", | ||
"description": "Text splitter for working with AWS Polly TTS.", | ||
"main": "index.js", | ||
"directories": { | ||
"lib": "lib" | ||
}, | ||
"scripts": { | ||
"test": "tap test/*.js", | ||
"cover": "tap test/*.js --coverage" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/oleglegun/polly-text-split.git" | ||
}, | ||
"keywords": ["polly", "aws", "tts"], | ||
"author": "Oleg Legun <oleg.legun@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/oleglegun/polly-text-split/issues" | ||
}, | ||
"homepage": "https://github.com/oleglegun/polly-text-split#readme", | ||
"devDependencies": { | ||
"tap": "^11.1.3" | ||
} | ||
} |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
13217
10
1
91