add inflection for weedu
This commit is contained in:
parent
745a7333ba
commit
ffcae9bdaa
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@lingdocs/pashto-inflector",
|
||||
"version": "0.9.0",
|
||||
"version": "0.9.1",
|
||||
"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",
|
||||
|
|
|
@ -164,6 +164,30 @@ const adjectives: Array<{
|
|||
],
|
||||
},
|
||||
},
|
||||
// adjective ending in u
|
||||
{
|
||||
in: {
|
||||
ts: 1527812791,
|
||||
p: "ویده",
|
||||
f: "weedú",
|
||||
g: "weedu",
|
||||
e: "asleep",
|
||||
c: "adj.",
|
||||
i: 1,
|
||||
},
|
||||
out: {
|
||||
masc: [
|
||||
[{p: "ویده", f: "weedú"}],
|
||||
[{p: "ویده", f: "weedú"}],
|
||||
[{p: "ویدو", f: "weedó"}],
|
||||
],
|
||||
fem: [
|
||||
[{p: "ویده", f: "weedá"}],
|
||||
[{p: "ویدې", f: "weedé"}],
|
||||
[{p: "ویدو", f: "weedó"}],
|
||||
],
|
||||
},
|
||||
},
|
||||
// adjective non-inflecting
|
||||
{
|
||||
in: {
|
||||
|
|
|
@ -11,7 +11,11 @@ import {
|
|||
concatInflections,
|
||||
splitDoubleWord,
|
||||
ensureUnisexInflections,
|
||||
makePsString,
|
||||
} from "./p-text-helpers";
|
||||
import {
|
||||
removeAccents,
|
||||
} from "./accent-helpers";
|
||||
import * as T from "../types";
|
||||
|
||||
const endingInSingleARegex = /[^a]'?’?[aá]'?’?$/;
|
||||
|
@ -61,6 +65,9 @@ function handleUnisexWord(word: T.DictionaryEntry): T.Inflections | false {
|
|||
if (pEnd === "ی" && f.slice(-2) === "ey") {
|
||||
return inflectRegularYeyUnisex(word.p, f);
|
||||
}
|
||||
if (pEnd === "ه" && word.g.slice(-1) === "u") {
|
||||
return inflectRegularShwaEndingUnisex(word.p, f);
|
||||
}
|
||||
if (pEnd === "ی" && f.slice(-2) === "éy") {
|
||||
return inflectEmphasizedYeyUnisex(word.p, f);
|
||||
}
|
||||
|
@ -166,6 +173,24 @@ export function inflectRegularYeyUnisex(p: string, f: string): T.UnisexInflectio
|
|||
};
|
||||
}
|
||||
|
||||
export function inflectRegularShwaEndingUnisex(pr: string, fr: string): T.UnisexInflections {
|
||||
const { p, f } = removeAccents(makePsString(pr, fr));
|
||||
const baseP = p.slice(0, -1);
|
||||
const baseF = f.slice(0, -1);
|
||||
return {
|
||||
masc: [
|
||||
[{p: `${baseP}ه`, f: `${baseF}ú`}],
|
||||
[{p: `${baseP}ه`, f: `${baseF}ú`}],
|
||||
[{p: `${baseP}و`, f: `${baseF}ó`}],
|
||||
],
|
||||
fem: [
|
||||
[{p: `${baseP}ه`, f: `${baseF}á`}],
|
||||
[{p: `${baseP}ې`, f: `${baseF}é`}],
|
||||
[{p: `${baseP}و`, f: `${baseF}ó`}],
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
function inflectEmphasizedYeyUnisex(p: string, f: string): T.UnisexInflections {
|
||||
const baseP = p.slice(0, -1);
|
||||
const baseF = f.slice(0, -2);
|
||||
|
|
Loading…
Reference in New Issue