khmer-segment 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -4
- package/dist/index.js +2 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -443,7 +443,7 @@ function viterbiSegment(clusters, dictionary, options) {
|
|
|
443
443
|
if (cost < dp[j]) {
|
|
444
444
|
dp[j] = cost;
|
|
445
445
|
from[j] = i;
|
|
446
|
-
fromKnown[j] =
|
|
446
|
+
fromKnown[j] = true;
|
|
447
447
|
}
|
|
448
448
|
continue;
|
|
449
449
|
}
|
|
@@ -573,15 +573,13 @@ function groupDigitTokens(tokens) {
|
|
|
573
573
|
const start = tokens[i].start;
|
|
574
574
|
let combined = tokens[i].value;
|
|
575
575
|
let end = tokens[i].end;
|
|
576
|
-
let known = tokens[i].isKnown;
|
|
577
576
|
i++;
|
|
578
577
|
while (i < tokens.length && isDigitStr(tokens[i].value)) {
|
|
579
578
|
combined += tokens[i].value;
|
|
580
579
|
end = tokens[i].end;
|
|
581
|
-
known = known || tokens[i].isKnown;
|
|
582
580
|
i++;
|
|
583
581
|
}
|
|
584
|
-
result.push({ value: combined, start, end, isKnown:
|
|
582
|
+
result.push({ value: combined, start, end, isKnown: true });
|
|
585
583
|
} else {
|
|
586
584
|
result.push(tokens[i]);
|
|
587
585
|
i++;
|
package/dist/index.js
CHANGED
|
@@ -408,7 +408,7 @@ function viterbiSegment(clusters, dictionary, options) {
|
|
|
408
408
|
if (cost < dp[j]) {
|
|
409
409
|
dp[j] = cost;
|
|
410
410
|
from[j] = i;
|
|
411
|
-
fromKnown[j] =
|
|
411
|
+
fromKnown[j] = true;
|
|
412
412
|
}
|
|
413
413
|
continue;
|
|
414
414
|
}
|
|
@@ -538,15 +538,13 @@ function groupDigitTokens(tokens) {
|
|
|
538
538
|
const start = tokens[i].start;
|
|
539
539
|
let combined = tokens[i].value;
|
|
540
540
|
let end = tokens[i].end;
|
|
541
|
-
let known = tokens[i].isKnown;
|
|
542
541
|
i++;
|
|
543
542
|
while (i < tokens.length && isDigitStr(tokens[i].value)) {
|
|
544
543
|
combined += tokens[i].value;
|
|
545
544
|
end = tokens[i].end;
|
|
546
|
-
known = known || tokens[i].isKnown;
|
|
547
545
|
i++;
|
|
548
546
|
}
|
|
549
|
-
result.push({ value: combined, start, end, isKnown:
|
|
547
|
+
result.push({ value: combined, start, end, isKnown: true });
|
|
550
548
|
} else {
|
|
551
549
|
result.push(tokens[i]);
|
|
552
550
|
i++;
|