Skip to content

Commit

Permalink
add-character
Browse files Browse the repository at this point in the history
  • Loading branch information
uriva committed Apr 10, 2024
1 parent e510c2c commit 5ae5458
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ const testUnaryFn =
testUnaryFn(
"someKewyordMatches",
someKewyordMatches(["בדסמ"]),
)([["חוזרים ליסודות בהרצאת “מבוא לבדסמ” במענטש, ב-15/01/24", true]]);
)([
["חוזרים ליסודות בהרצאת “מבוא לבדסמ” במענטש, ב-15/01/24", true],
["בדסמ+", true],
]);

testFn(
"prefixesWithSuffix",
Expand Down
7 changes: 3 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export const replaceSmartQuotes = pipe(
replace(/[]/g, '"'),
);

const replaceDidgitNames = pipe(
const replaceDigitNames = pipe(
replace(/\bten\b/g, "10"),
replace(/\bnine\b/g, "9"),
replace(/\beight\b/g, "8"),
Expand All @@ -183,11 +183,10 @@ export const simplify: (x: string) => string = pipe(
(x: string) => x.trim(),
replaceSmartQuotes,
lowercase,
replace(/\s/g, " "),
replaceDidgitNames,
replaceDigitNames,
replace(/\[.*\]/, ""),
replace(/[*:'"]/g, ""),
replace(/[,.?!\n-]/g, " "),
replace(/[,.?!\n-+]/g, " "),
replace(/\s+/g, " "),
replace(/<\/?i>/g, ""),
replace(/\bdoctor\b/g, "dr"),
Expand Down

0 comments on commit 5ae5458

Please sign in to comment.