urdu ه standardization

This commit is contained in:
Bill D 2021-06-17 23:01:53 +04:30
parent e41b335821
commit aae06148ad
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,8 @@ const testPairs = [
["حتیٰ", "حتیٰ"],
["چېرته دى؟", "چېرته دی؟"],
["آب", "آب"],
["مفہوم", "مفهوم"],
["مفھوم", "مفهوم"],
["راکوي؛", "راکوي؛"],
["راکوي!", "راکوي!"],
["راکوي.", "راکوي."],

View File

@ -9,8 +9,8 @@
export function standardizePashto(input: string): string {
// Replace Arabic ى with Farsi ی
return input.replace(/\u0649/g, "\u06cc")
// Replace Urdu ہ and ه with ه
.replace(/ہ|ه/g, "ه")
// Replace Urdu ہ and ھ with ه
.replace(/ھ|ہ/g, "ه")
// Replace Arabic ك with ک
.replace(/\u0643/g, "\u06a9")
// Replace Farsi گ with ګ