-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Improve normalizeAlef function to take into account another alef shape - Improve removeDiacritics by using a regex expression rather than filtering the string - Improve normalizeSuperscriptAlef by using regex test instead of match function - Change defaultNormalizeOptions so removeTatweel is true now - Add isEqual function and related tests
- Loading branch information
Showing
4 changed files
with
168 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ArabicString } from "../src/index"; | ||
|
||
test("returns true", () => { | ||
expect(ArabicString("كتب").isEqual("كتب")).toBe(true); | ||
}); | ||
|
||
test("returns true", () => { | ||
expect(ArabicString("كَتَبَ").isEqual("كتب")).toBe(true); | ||
}); | ||
|
||
test("returns false", () => { | ||
expect( | ||
ArabicString("كَتَبَ").isEqual("كتب", { ignoreDiacritics: false }) | ||
).toBe(false); | ||
}); | ||
|
||
test("returns true", () => { | ||
expect( | ||
ArabicString("كَتَبَ").isEqual("كَتب", { partialDiacritics: true }) | ||
).toBe(true); | ||
}); | ||
|
||
test("returns false", () => { | ||
expect( | ||
ArabicString("كَتَبَ").isEqual("كُتب", { partialDiacritics: true }) | ||
).toBe(false); | ||
}); | ||
|
||
test("returns true", () => { | ||
expect( | ||
ArabicString("رَكَّبَ").isEqual("ركّب", { partialDiacritics: true }) | ||
).toBe(true); | ||
}); | ||
|
||
test("returns true", () => { | ||
expect( | ||
ArabicString("رَكَّبَ").isEqual("ركَّب", { partialDiacritics: true }) | ||
).toBe(true); | ||
}); | ||
|
||
test("returns true", () => { | ||
expect( | ||
ArabicString("رَكَّبَ").isEqual("ركِّب", { partialDiacritics: true }) | ||
).toBe(false); | ||
}); |