issue splitting psWords like óo`arzee
This commit is contained in:
parent
f25ebaaf62
commit
2cd82bfde4
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.7.5",
|
||||
"version": "5.7.6",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.7.5",
|
||||
"version": "5.7.6",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "pashto-inflector",
|
||||
"version": "5.7.5",
|
||||
"version": "5.7.6",
|
||||
"author": "lingdocs.com",
|
||||
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
||||
"homepage": "https://verbs.lingdocs.com",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/ps-react",
|
||||
"version": "5.7.5",
|
||||
"version": "5.7.6",
|
||||
"description": "Pashto inflector library module with React components",
|
||||
"main": "dist/components/library.js",
|
||||
"module": "dist/components/library.js",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/inflect",
|
||||
"version": "5.7.5",
|
||||
"version": "5.7.6",
|
||||
"description": "Pashto inflector library",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/lib/library.d.ts",
|
||||
|
|
|
@ -90,6 +90,17 @@ const toTest: {
|
|||
input: { p: "د ... په شان", f: "du ... pu shaan" },
|
||||
result: [{ p: "د", f: "du" }, { p: "په", f: "pu" }, { p: "شان", f: "shaan" }],
|
||||
},
|
||||
{
|
||||
input: { p: "و ارزي", f: "óo`arzee" },
|
||||
result: [{ p: "و ارزي", f: "óo`arzee" }],
|
||||
},
|
||||
{
|
||||
input: { p: "هغه و ارزي", f: "hagha óo`arzee" },
|
||||
result: [
|
||||
{ p: "هغه", f: "hagha" },
|
||||
{ p: "و ارزي", f: "óo`arzee" },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
test("splitPsString should work", () => {
|
||||
|
|
|
@ -34,6 +34,15 @@ export function splitPsString(ps: T.PsStringNoFVars): T.PsWord[] {
|
|||
fIndex++;
|
||||
}
|
||||
while (pIndex < pWords.length && fIndex < fWords.length) {
|
||||
if (pWords[pIndex] === "و" && pWords[pIndex+1] && fWords[fIndex].startsWith("óo`")) {
|
||||
psWords.push({
|
||||
p: `${pWords[pIndex]} ${pWords[pIndex+1]}`,
|
||||
f: fWords[fIndex],
|
||||
});
|
||||
pIndex += 2;
|
||||
fIndex++;
|
||||
continue;
|
||||
}
|
||||
if (fWords[fIndex] === "..." && pWords[pIndex] === "...") {
|
||||
pIndex++;
|
||||
fIndex++;
|
||||
|
|
Loading…
Reference in New Issue