Comparing version 0.0.11 to 0.0.12
@@ -93,6 +93,4 @@ import { includedIn, join, letIn, lowercase, max, nonempty, pipe, range, replace, reverse, sort, split, take, trim, trimWhitespace, } from "gamla"; | ||
const allEnglishWordsAsSet = new Set(englishWords); | ||
const fixMissingSpaceInOneWord = (x) => allEnglishWordsAsSet.has(x) | ||
? x | ||
: letIn(range(1, x.length - 1).find((index) => allEnglishWordsAsSet.has(x.slice(0, index)) && | ||
allEnglishWordsAsSet.has(x.slice(index))), (location) => location ? [x.slice(0, location), x.slice(location)].join(" ") : x); | ||
const fixMissingSpaceInOneWord = (x) => allEnglishWordsAsSet.has(x) ? x : letIn(range(1, x.length - 1).find((index) => allEnglishWordsAsSet.has(x.slice(0, index)) && | ||
allEnglishWordsAsSet.has(x.slice(index))), (location) => location ? [x.slice(0, location), x.slice(location)].join(" ") : x); | ||
const missingSpace = (x) => x.split(/\s/).map(fixMissingSpaceInOneWord).join(" "); | ||
@@ -147,3 +145,3 @@ const removeNonSemanticDifferences = pipe(lowercase, missingSpace, simplify, replace(/\bthe\b\s*/g, "")); | ||
const hyphen = /[―-]/; | ||
const boundry = [/[@.-\s:/בלה[\]?&%$#=*,!()]/, /^/, /$/].reduce(regExpOr); // \b doesn't work for non ascii | ||
const boundry = [/[_@.-\s:/בלה[\]?&%$#=*,!()]/, /^/, /$/].reduce(regExpOr); // \b doesn't work for non ascii | ||
const speaker = [optional(hyphen), personName, /\s?:/, boundry].reduce(concatRegexp); | ||
@@ -150,0 +148,0 @@ const speakerInEnd = [hyphen, /\s*/, personName, /$/].reduce(concatRegexp); |
{ | ||
"name": "silly-nlp", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"description": "Silly nlp utils", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -102,6 +102,4 @@ "use strict"; | ||
const allEnglishWordsAsSet = new Set(englishWords_js_1.englishWords); | ||
const fixMissingSpaceInOneWord = (x) => allEnglishWordsAsSet.has(x) | ||
? x | ||
: (0, gamla_1.letIn)((0, gamla_1.range)(1, x.length - 1).find((index) => allEnglishWordsAsSet.has(x.slice(0, index)) && | ||
allEnglishWordsAsSet.has(x.slice(index))), (location) => location ? [x.slice(0, location), x.slice(location)].join(" ") : x); | ||
const fixMissingSpaceInOneWord = (x) => allEnglishWordsAsSet.has(x) ? x : (0, gamla_1.letIn)((0, gamla_1.range)(1, x.length - 1).find((index) => allEnglishWordsAsSet.has(x.slice(0, index)) && | ||
allEnglishWordsAsSet.has(x.slice(index))), (location) => location ? [x.slice(0, location), x.slice(location)].join(" ") : x); | ||
const missingSpace = (x) => x.split(/\s/).map(fixMissingSpaceInOneWord).join(" "); | ||
@@ -166,3 +164,3 @@ const removeNonSemanticDifferences = (0, gamla_1.pipe)(gamla_1.lowercase, missingSpace, exports.simplify, (0, gamla_1.replace)(/\bthe\b\s*/g, "")); | ||
const hyphen = /[―-]/; | ||
const boundry = [/[@.-\s:/בלה[\]?&%$#=*,!()]/, /^/, /$/].reduce(exports.regExpOr); // \b doesn't work for non ascii | ||
const boundry = [/[_@.-\s:/בלה[\]?&%$#=*,!()]/, /^/, /$/].reduce(exports.regExpOr); // \b doesn't work for non ascii | ||
const speaker = [optional(hyphen), personName, /\s?:/, boundry].reduce(exports.concatRegexp); | ||
@@ -169,0 +167,0 @@ const speakerInEnd = [hyphen, /\s*/, personName, /$/].reduce(exports.concatRegexp); |
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
9550525
3639