Skip to content

Commit 98a993d

Browse files
committed
add-test-and-boundry-letter
1 parent 019f649 commit 98a993d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/index.test.ts

+6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
ngramsOfAtLeastNWords,
77
prefixesWithSuffix,
88
quotedTexts,
9+
someKewyordMatches,
910
suffixesWithPrefix,
1011
} from "./index.ts";
1112

@@ -25,6 +26,11 @@ const testUnaryFn =
2526
(cases: [Parameters<F>[0], ReturnType<F>][]) =>
2627
testFn(name, f)(cases.map(([x, y]) => [[x] as Parameters<F>, y]));
2728

29+
testUnaryFn(
30+
"someKewyordMatches",
31+
someKewyordMatches(["בדסמ"]),
32+
)([["חוזרים ליסודות בהרצאת “מבוא לבדסמ” במענטש, ב-15/01/24", true]]);
33+
2834
testFn(
2935
"prefixesWithSuffix",
3036
prefixesWithSuffix,

src/index.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import {
1616
} from "https://deno.land/x/gamla@39.0.0/src/index.ts";
1717

1818
import { fuzzySearch as fs } from "npm:levenshtein-search";
19-
import { stopWords } from "./stopWords.ts";
2019
import { englishWords } from "./englishWords.ts";
20+
import { stopWords } from "./stopWords.ts";
2121
export type FuzzyMatch = { start: number; end: number };
2222

2323
export const fuzzySearch = (
@@ -285,7 +285,7 @@ const personName = [zeroOrMore(/'?[A-Z]\w*\.?'?\s/), /\w+/].reduce(
285285

286286
const hyphen = /[-]/;
287287

288-
const boundry = [/[@.-\s:/בה[\]?&%$#=*,!()]/, /^/, /$/].reduce(regExpOr); // \b doesn't work for non ascii
288+
const boundry = [/[@.-\s:/בלה[\]?&%$#=*,!()]/, /^/, /$/].reduce(regExpOr); // \b doesn't work for non ascii
289289

290290
const speaker = globalize(
291291
[boundry, optional(hyphen), personName, /\s?:/, boundry].reduce(concatRegexp),

0 commit comments

Comments
 (0)