Skip to content

Commit 07a916f

Browse files
committed
fix-plurality
1 parent 41af875 commit 07a916f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/index.test.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,17 @@ const testUnaryFn =
3131
(cases: [Parameters<F>[0], ReturnType<F>][]) =>
3232
testFn(name, f)(cases.map(([x, y]) => [[x] as Parameters<F>, y]));
3333

34-
testUnaryFn(
35-
"someKewyordMatches",
36-
someKewyordMatches(["בדסמ"]),
37-
)([
34+
testUnaryFn("hebrew kw matching", someKewyordMatches(["בדסמ"]))([
3835
["חוזרים ליסודות בהרצאת “מבוא לבדסמ” במענטש, ב-15/01/24", true],
3936
["בדסמ+", true],
4037
["בדסמ🔥", true],
4138
]);
4239

40+
testUnaryFn("plurality", someKewyordMatches(["talk"]))([["talks", true], [
41+
"talk",
42+
true,
43+
]]);
44+
4345
testUnaryFn("wholeword", (x) => (wholeWord(/נתי/)).test(x))([
4446
["הבנתי", false],
4547
["ונתי", true],

src/index.ts

+3
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,8 @@ const personName = [
320320

321321
const hyphen = /[-]/;
322322

323+
const plurality = /s|ים|ות/i;
324+
323325
const allEmojis =
324326
/(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/;
325327

@@ -340,6 +342,7 @@ const boundry = [
340342
/$/,
341343
hebrewPrepositionalLetters,
342344
allEmojis,
345+
plurality,
343346
].reduce(regExpOr);
344347

345348
const speaker = [optional(hyphen), personName, /\s?:/, boundry].reduce(

0 commit comments

Comments
 (0)