better fuzzy

This commit is contained in:
adueck 2022-09-25 18:09:55 +04:00
parent 0b9cd681f6
commit f3c9e5452f
2 changed files with 4 additions and 4 deletions

View File

@ -109,6 +109,7 @@ const defaultLatinInfo: IDefaultInfoBlock = {
["taamul", "tahamul"], ["taamul", "tahamul"],
["otsedul", "osedul"], ["otsedul", "osedul"],
["ghaara", "ghaaRa"], ["ghaara", "ghaaRa"],
["maafiat", "maafiyat"],
], ],
nonMatches: [ nonMatches: [
["kor", "por"], ["kor", "por"],

View File

@ -64,8 +64,8 @@ function prepareMainRegexLogicLatin(sanitizedInput: string, options: IFuzzifyOpt
} }
// TODO: Should we allow ignorable letters as we do with the Pashto script? // TODO: Should we allow ignorable letters as we do with the Pashto script?
return options.simplifiedLatin return options.simplifiedLatin
? section ? `${section}y?`
: `${section}[|'|\`]?${options.allowSpacesInWords ? " ?" : ""}`; : `${section}[|'|\`|y]?${options.allowSpacesInWords ? " ?" : ""}`;
}); });
} }
@ -145,6 +145,5 @@ export function fuzzifyPashto(input: string, options: IFuzzifyOptions = {}): str
} }
const beginning = prepareBeginning(options); const beginning = prepareBeginning(options);
const ending = prepareEnding(options); const ending = prepareEnding(options);
const logic = `${beginning}${mainRegexLogic}${ending}`; return `${beginning}${mainRegexLogic}${ending}`;
return logic;
} }