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"],
["otsedul", "osedul"],
["ghaara", "ghaaRa"],
["maafiat", "maafiyat"],
],
nonMatches: [
["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?
return options.simplifiedLatin
? section
: `${section}[|'|\`]?${options.allowSpacesInWords ? " ?" : ""}`;
? `${section}y?`
: `${section}[|'|\`|y]?${options.allowSpacesInWords ? " ?" : ""}`;
});
}
@ -145,6 +145,5 @@ export function fuzzifyPashto(input: string, options: IFuzzifyOptions = {}): str
}
const beginning = prepareBeginning(options);
const ending = prepareEnding(options);
const logic = `${beginning}${mainRegexLogic}${ending}`;
return logic;
return `${beginning}${mainRegexLogic}${ending}`;
}