partway into phonetics conversion
This commit is contained in:
parent
0846fee749
commit
fc97db0dd3
|
@ -42,12 +42,12 @@ test(`accentOnFront should work`, () => {
|
||||||
|
|
||||||
const toAccentPastParticiple = [
|
const toAccentPastParticiple = [
|
||||||
{
|
{
|
||||||
input: makePsString("پرېښی", "prexey"),
|
input: makePsString("پرېښی", "prexay"),
|
||||||
output: makePsString("پرېښی", "préxey"),
|
output: makePsString("پرېښی", "préxay"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: makePsString("ازمویلی", "azmoyuley"),
|
input: makePsString("ازمویلی", "azmoyulay"),
|
||||||
output: makePsString("ازمویلی", "azmóyuley"),
|
output: makePsString("ازمویلی", "azmóyulay"),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -62,8 +62,8 @@ test(`splitUpSyllables should work`, () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
test("countSyllables", () => {
|
test("countSyllables", () => {
|
||||||
expect(countSyllables("saRéy")).toEqual(2);
|
expect(countSyllables("saRáy")).toEqual(2);
|
||||||
expect(countSyllables("saRey")).toEqual(2);
|
expect(countSyllables("saRay")).toEqual(2);
|
||||||
expect(countSyllables("zRú")).toEqual(1);
|
expect(countSyllables("zRú")).toEqual(1);
|
||||||
expect(countSyllables("zRu")).toEqual(1);
|
expect(countSyllables("zRu")).toEqual(1);
|
||||||
expect(countSyllables("zRU")).toEqual(1);
|
expect(countSyllables("zRU")).toEqual(1);
|
||||||
|
@ -73,7 +73,7 @@ test("countSyllables", () => {
|
||||||
|
|
||||||
test(`accentOnFSylsOnNFromEnd should work`, () => {
|
test(`accentOnFSylsOnNFromEnd should work`, () => {
|
||||||
expect(accentFSylsOnNFromEnd(["pu", "xtaa", "nu"], 0)).toBe("puxtaanú");
|
expect(accentFSylsOnNFromEnd(["pu", "xtaa", "nu"], 0)).toBe("puxtaanú");
|
||||||
expect(accentFSylsOnNFromEnd(["leed", "ul", "ey"], 1)).toBe("leedúley");
|
expect(accentFSylsOnNFromEnd(["leed", "ul", "ay"], 1)).toBe("leedúlay");
|
||||||
});
|
});
|
||||||
|
|
||||||
test(`accentOnNFromEnd should work`, () => {
|
test(`accentOnNFromEnd should work`, () => {
|
||||||
|
@ -81,19 +81,27 @@ test(`accentOnNFromEnd should work`, () => {
|
||||||
p: "پښتانه",
|
p: "پښتانه",
|
||||||
f: "puxtaanú",
|
f: "puxtaanú",
|
||||||
});
|
});
|
||||||
expect(accentOnNFromEnd({ p: "لیدلی", f: "leedúley" }, 1)).toEqual({
|
expect(accentOnNFromEnd({ p: "لیدلی", f: "leedúlay" }, 1)).toEqual({
|
||||||
p: "لیدلی",
|
p: "لیدلی",
|
||||||
f: "leedúley",
|
f: "leedúlay",
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test(`has accents should work`, () => {
|
test(`has accents should work`, () => {
|
||||||
const accents = ["koRanúy", "wutáaq", "gÚta", "taté", "bít", "sóra", "kúcha"];
|
const accents = ["koRanúy", "wutáaq", "gÚta", "taté", "bít", "sóra", "kúcha"];
|
||||||
const noAccents = ["koRanuy", "wutaaq", "gUta", "tate", "bit", "sora", "kucha"];
|
const noAccents = [
|
||||||
|
"koRanuy",
|
||||||
|
"wutaaq",
|
||||||
|
"gUta",
|
||||||
|
"tate",
|
||||||
|
"bit",
|
||||||
|
"sora",
|
||||||
|
"kucha",
|
||||||
|
];
|
||||||
accents.forEach((x) => {
|
accents.forEach((x) => {
|
||||||
expect(hasAccents(x)).toBe(true);
|
expect(hasAccents(x)).toBe(true);
|
||||||
});
|
});
|
||||||
noAccents.forEach((x) => {
|
noAccents.forEach((x) => {
|
||||||
expect(hasAccents(x)).toBe(false);
|
expect(hasAccents(x)).toBe(false);
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
|
|
@ -38,12 +38,12 @@ export function accentOnFront(
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensures an accent on a past participle ie. leedúley, préxey, azmóyuley
|
* Ensures an accent on a past participle ie. leedúlay, préxay, azmóyulay
|
||||||
*
|
*
|
||||||
* @param s - the Pashto string (with Pashto and Phonetics) to ensure the accent on
|
* @param s - the Pashto string (with Pashto and Phonetics) to ensure the accent on
|
||||||
*/
|
*/
|
||||||
export function accentPastParticiple(s: T.PsString): T.PsString {
|
export function accentPastParticiple(s: T.PsString): T.PsString {
|
||||||
// check for accent placing in words like wáayuley and azmóyuley
|
// check for accent placing in words like wáayulay and azmóyulay
|
||||||
const accentFallsOnThirdLast = (syls: string[]) => {
|
const accentFallsOnThirdLast = (syls: string[]) => {
|
||||||
if (syls.length < 3) return false;
|
if (syls.length < 3) return false;
|
||||||
const secondLast = syls[syls.length - 2];
|
const secondLast = syls[syls.length - 2];
|
||||||
|
@ -64,7 +64,7 @@ export function accentPastParticiple(s: T.PsString): T.PsString {
|
||||||
export function splitUpSyllables(f: string): string[] {
|
export function splitUpSyllables(f: string): string[] {
|
||||||
return (
|
return (
|
||||||
f.match(
|
f.match(
|
||||||
/ |([^a|á|e|é|i|í|o|ó|u|ú| ]*(aa|áa|a|á|ey|éy|ee|ée|e|é|oo|óo|o|ó|i|í|u|ú)[^a|á|e|é|i|í|o|ó|u|ú| ]*)/gi
|
/ |([^a|á|e|é|i|í|o|ó|u|ú| ]*(aa|áa|a|á|ay|áy|ee|ée|e|é|oo|óo|o|ó|i|í|u|ú)[^a|á|e|é|i|í|o|ó|u|ú| ]*)/gi
|
||||||
) || ([] as string[])
|
) || ([] as string[])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,17 +10,49 @@ import * as T from "../../types";
|
||||||
|
|
||||||
// TODO: Automatice syncing of aux verbs from dictionary
|
// TODO: Automatice syncing of aux verbs from dictionary
|
||||||
|
|
||||||
export const dynamicAuxVerbs: Array<
|
export const dynamicAuxVerbs: Array<{
|
||||||
|
entry: T.DictionaryEntry;
|
||||||
|
complement?: T.DictionaryEntry;
|
||||||
|
}> = [
|
||||||
{
|
{
|
||||||
entry: T.DictionaryEntry,
|
entry: {
|
||||||
complement?: T.DictionaryEntry,
|
ts: 1527812752,
|
||||||
}
|
i: 11033,
|
||||||
> = [
|
p: "کول",
|
||||||
{
|
f: "kawul",
|
||||||
entry: {"ts":1527812752,"i":11033,"p":"کول","f":"kawul","g":"kawul","e":"to do (an action or activity)","r":4,"c":"v. trans./gramm. trans.","ssp":"وکړ","ssf":"óokR","prp":"وکړل","prf":"óokRul","pprtp":"کړی","pprtf":"kúRey","separationAtP":1,"separationAtF":2,"diacExcept":true,"ec":"do,does,doing,did,done"},
|
g: "kawul",
|
||||||
|
e: "to do (an action or activity)",
|
||||||
|
r: 4,
|
||||||
|
c: "v. trans./gramm. trans.",
|
||||||
|
ssp: "وکړ",
|
||||||
|
ssf: "óokR",
|
||||||
|
prp: "وکړل",
|
||||||
|
prf: "óokRul",
|
||||||
|
pprtp: "کړی",
|
||||||
|
pprtf: "kúRay",
|
||||||
|
separationAtP: 1,
|
||||||
|
separationAtF: 2,
|
||||||
|
diacExcept: true,
|
||||||
|
ec: "do,does,doing,did,done",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":10122,"ts":1527812754,g: "","p":"کېدل","f":"kedul","e":"to happen, occur","c":"v. intrans. irreg. aux. dyn.","ssp":"وش","ssf":"óosh","prp":"وشول","prf":"óoshwul","pprtp":"شوی","pprtf":"shúwey","diacExcept":true},
|
entry: {
|
||||||
|
i: 10122,
|
||||||
|
ts: 1527812754,
|
||||||
|
g: "",
|
||||||
|
p: "کېدل",
|
||||||
|
f: "kedul",
|
||||||
|
e: "to happen, occur",
|
||||||
|
c: "v. intrans. irreg. aux. dyn.",
|
||||||
|
ssp: "وش",
|
||||||
|
ssf: "óosh",
|
||||||
|
prp: "وشول",
|
||||||
|
prf: "óoshwul",
|
||||||
|
pprtp: "شوی",
|
||||||
|
pprtf: "shúway",
|
||||||
|
diacExcept: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -44,10 +76,30 @@ export const dynamicAuxVerbs: Array<
|
||||||
l: 1527813139,
|
l: 1527813139,
|
||||||
i: 3459,
|
i: 3459,
|
||||||
},
|
},
|
||||||
complement: {"i":3774,"ts":1527813139,g: "","p":"تېر","f":"ter","e":"last, past, previous, passed, gone over","c":"adj."},
|
complement: {
|
||||||
|
i: 3774,
|
||||||
|
ts: 1527813139,
|
||||||
|
g: "",
|
||||||
|
p: "تېر",
|
||||||
|
f: "ter",
|
||||||
|
e: "last, past, previous, passed, gone over",
|
||||||
|
c: "adj.",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"ts":1527815399,"i":15049,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","r":4,"c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"},
|
entry: {
|
||||||
|
ts: 1527815399,
|
||||||
|
i: 15049,
|
||||||
|
p: "وهل",
|
||||||
|
f: "wahul",
|
||||||
|
g: "wahul",
|
||||||
|
e: "to hit",
|
||||||
|
r: 4,
|
||||||
|
c: "v. trans.",
|
||||||
|
tppp: "واهه",
|
||||||
|
tppf: "waahu",
|
||||||
|
ec: "hit,hits,hitting,hit,hit",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -80,7 +132,7 @@ export const dynamicAuxVerbs: Array<
|
||||||
e: "to touch, join, use, take, place",
|
e: "to touch, join, use, take, place",
|
||||||
c: "v. trans.",
|
c: "v. trans.",
|
||||||
i: 9794,
|
i: 9794,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {
|
entry: {
|
||||||
|
@ -413,19 +465,81 @@ export const dynamicAuxVerbs: Array<
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":6731,"ts":1527815240,"p":"ساتل","f":"saatul",g: "","e":"to keep, protect, watch over; to hold","c":"v. trans."},
|
entry: {
|
||||||
|
i: 6731,
|
||||||
|
ts: 1527815240,
|
||||||
|
p: "ساتل",
|
||||||
|
f: "saatul",
|
||||||
|
g: "",
|
||||||
|
e: "to keep, protect, watch over; to hold",
|
||||||
|
c: "v. trans.",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":11782,"ts":1527814053,"p":"موندل","f":"moondúl",g: "","e":"to find, acquire, discover, get","c":"v. trans. irreg.","psp":"موم","psf":"moom"},
|
entry: {
|
||||||
|
i: 11782,
|
||||||
|
ts: 1527814053,
|
||||||
|
p: "موندل",
|
||||||
|
f: "moondúl",
|
||||||
|
g: "",
|
||||||
|
e: "to find, acquire, discover, get",
|
||||||
|
c: "v. trans. irreg.",
|
||||||
|
psp: "موم",
|
||||||
|
psf: "moom",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":4212,"ts":1527812712,"p":"جوړول",g: "","f":"joRawul","e":"to make, form, build, mend","l":1527812711,"c":"v. stat. comp. trans."},
|
entry: {
|
||||||
complement: {"i":4206,"ts":1527812711,g: "","p":"جوړ","f":"joR","e":"well, healthy, whole, made","c":"adj."},
|
i: 4212,
|
||||||
|
ts: 1527812712,
|
||||||
|
p: "جوړول",
|
||||||
|
g: "",
|
||||||
|
f: "joRawul",
|
||||||
|
e: "to make, form, build, mend",
|
||||||
|
l: 1527812711,
|
||||||
|
c: "v. stat. comp. trans.",
|
||||||
|
},
|
||||||
|
complement: {
|
||||||
|
i: 4206,
|
||||||
|
ts: 1527812711,
|
||||||
|
g: "",
|
||||||
|
p: "جوړ",
|
||||||
|
f: "joR",
|
||||||
|
e: "well, healthy, whole, made",
|
||||||
|
c: "adj.",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":13869,"ts":1527816865,g: "","p":"وړل","f":"wuRúl, oRúl, wRul","e":"to take, carry, bear, move (inanimate objects); to win, earn (subjunctive یوسي - yósee or ویسي - wéesee, simple past یو یې وړلو - yo ye wRulo)","separationAtP":2,"separationAtF":2,"c":"v. trans. irreg.","ssp":"یوس","ssf":"yos","prp":"یوړل","prf":"yóRul","noOo":true,"diacExcept":true},
|
entry: {
|
||||||
|
i: 13869,
|
||||||
|
ts: 1527816865,
|
||||||
|
g: "",
|
||||||
|
p: "وړل",
|
||||||
|
f: "wuRúl, oRúl, wRul",
|
||||||
|
e: "to take, carry, bear, move (inanimate objects); to win, earn (subjunctive یوسي - yósee or ویسي - wéesee, simple past یو یې وړلو - yo ye wRulo)",
|
||||||
|
separationAtP: 2,
|
||||||
|
separationAtF: 2,
|
||||||
|
c: "v. trans. irreg.",
|
||||||
|
ssp: "یوس",
|
||||||
|
ssf: "yos",
|
||||||
|
prp: "یوړل",
|
||||||
|
prf: "yóRul",
|
||||||
|
noOo: true,
|
||||||
|
diacExcept: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
entry: {"i":6503,"ts":1527815214,g: "","p":"راوړل","f":"raawRúl","e":"to bring, deliver (inanimate objects)","separationAtP":2,"separationAtF":3,"c":"v. trans. irreg.","noOo":true},
|
entry: {
|
||||||
|
i: 6503,
|
||||||
|
ts: 1527815214,
|
||||||
|
g: "",
|
||||||
|
p: "راوړل",
|
||||||
|
f: "raawRúl",
|
||||||
|
e: "to bring, deliver (inanimate objects)",
|
||||||
|
separationAtP: 2,
|
||||||
|
separationAtF: 3,
|
||||||
|
c: "v. trans. irreg.",
|
||||||
|
noOo: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,13 +10,15 @@ import {
|
||||||
isPattern6FemEntry,
|
isPattern6FemEntry,
|
||||||
} from "./type-predicates";
|
} from "./type-predicates";
|
||||||
|
|
||||||
export function getInflectionPattern(e: T.NounEntry | T.AdjectiveEntry): T.InflectionPattern {
|
export function getInflectionPattern(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): T.InflectionPattern {
|
||||||
return isPattern1Entry(e)
|
return isPattern1Entry(e)
|
||||||
? T.InflectionPattern.Basic
|
? T.InflectionPattern.Basic
|
||||||
: isPattern2Entry(e)
|
: isPattern2Entry(e)
|
||||||
? T.InflectionPattern.UnstressedEy
|
? T.InflectionPattern.UnstressedAy
|
||||||
: isPattern3Entry(e)
|
: isPattern3Entry(e)
|
||||||
? T.InflectionPattern.StressedEy
|
? T.InflectionPattern.StressedAy
|
||||||
: isPattern4Entry(e)
|
: isPattern4Entry(e)
|
||||||
? T.InflectionPattern.Pashtun
|
? T.InflectionPattern.Pashtun
|
||||||
: isPattern5Entry(e)
|
: isPattern5Entry(e)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -2,41 +2,250 @@ import * as T from "../../../types";
|
||||||
import { makeVerbSelection } from "./make-verb-selection";
|
import { makeVerbSelection } from "./make-verb-selection";
|
||||||
import { vEntry } from "./rs-helpers";
|
import { vEntry } from "./rs-helpers";
|
||||||
|
|
||||||
const wahul = vEntry({"ts":1527815399,"i":15049,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","r":4,"c":"v. trans.","tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"});
|
const wahul = vEntry({
|
||||||
const kawulDyn = vEntry({"ts":1527812752,"i":11033,"p":"کول","f":"kawul","g":"kawul","e":"to do (an action or activity)","r":4,"c":"v. trans./gramm. trans.","ssp":"وکړ","ssf":"óokR","prp":"وکړل","prf":"óokRul","pprtp":"کړی","pprtf":"kúRey","diacExcept":true,"ec":"do,does,doing,did,done","separationAtP":1,"separationAtF":2});
|
ts: 1527815399,
|
||||||
const wahulNoC = vEntry({"ts":1527815399,"i":15049,"p":"وهل","f":"wahul","g":"wahul","e":"to hit","r":4,"tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"});
|
i: 15049,
|
||||||
const wahulNoC2 = vEntry({"ts":1527815399,"i":15049,"p":"وهل","f":"wahul","g":"wahul",c:"v","e":"to hit","r":4,"tppp":"واهه","tppf":"waahu","ec":"hit,hits,hitting,hit,hit"});
|
p: "وهل",
|
||||||
const khandul = vEntry({"ts":1527812767,"i":5896,"p":"خندل","f":"khandul","g":"khandul","e":"to laugh","r":4,"c":"v. gramm. trans.","psp":"خاند","psf":"khaand","ec":"laugh"});
|
f: "wahul",
|
||||||
const leedul = vEntry({"ts":1527812275,"i":12053,"p":"لیدل","f":"leedul","g":"leedul","e":"to see","r":4,"c":"v. trans./gramm. trans.","psp":"وین","psf":"ween","tppp":"لید","tppf":"leed","ec":"see,sees,seeing,saw,seen"});
|
g: "wahul",
|
||||||
const ghadzedul = vEntry({"ts":1527812615,"i":9500,"p":"غځېدل","f":"ghadzedul","g":"ghadzedul","e":"stretch out, lie, be extended, expand","r":3,"c":"v. intrans.","ec":"stretch","ep":"out"});
|
e: "to hit",
|
||||||
|
r: 4,
|
||||||
|
c: "v. trans.",
|
||||||
|
tppp: "واهه",
|
||||||
|
tppf: "waahu",
|
||||||
|
ec: "hit,hits,hitting,hit,hit",
|
||||||
|
});
|
||||||
|
const kawulDyn = vEntry({
|
||||||
|
ts: 1527812752,
|
||||||
|
i: 11033,
|
||||||
|
p: "کول",
|
||||||
|
f: "kawul",
|
||||||
|
g: "kawul",
|
||||||
|
e: "to do (an action or activity)",
|
||||||
|
r: 4,
|
||||||
|
c: "v. trans./gramm. trans.",
|
||||||
|
ssp: "وکړ",
|
||||||
|
ssf: "óokR",
|
||||||
|
prp: "وکړل",
|
||||||
|
prf: "óokRul",
|
||||||
|
pprtp: "کړی",
|
||||||
|
pprtf: "kúRay",
|
||||||
|
diacExcept: true,
|
||||||
|
ec: "do,does,doing,did,done",
|
||||||
|
separationAtP: 1,
|
||||||
|
separationAtF: 2,
|
||||||
|
});
|
||||||
|
const wahulNoC = vEntry({
|
||||||
|
ts: 1527815399,
|
||||||
|
i: 15049,
|
||||||
|
p: "وهل",
|
||||||
|
f: "wahul",
|
||||||
|
g: "wahul",
|
||||||
|
e: "to hit",
|
||||||
|
r: 4,
|
||||||
|
tppp: "واهه",
|
||||||
|
tppf: "waahu",
|
||||||
|
ec: "hit,hits,hitting,hit,hit",
|
||||||
|
});
|
||||||
|
const wahulNoC2 = vEntry({
|
||||||
|
ts: 1527815399,
|
||||||
|
i: 15049,
|
||||||
|
p: "وهل",
|
||||||
|
f: "wahul",
|
||||||
|
g: "wahul",
|
||||||
|
c: "v",
|
||||||
|
e: "to hit",
|
||||||
|
r: 4,
|
||||||
|
tppp: "واهه",
|
||||||
|
tppf: "waahu",
|
||||||
|
ec: "hit,hits,hitting,hit,hit",
|
||||||
|
});
|
||||||
|
const khandul = vEntry({
|
||||||
|
ts: 1527812767,
|
||||||
|
i: 5896,
|
||||||
|
p: "خندل",
|
||||||
|
f: "khandul",
|
||||||
|
g: "khandul",
|
||||||
|
e: "to laugh",
|
||||||
|
r: 4,
|
||||||
|
c: "v. gramm. trans.",
|
||||||
|
psp: "خاند",
|
||||||
|
psf: "khaand",
|
||||||
|
ec: "laugh",
|
||||||
|
});
|
||||||
|
const leedul = vEntry({
|
||||||
|
ts: 1527812275,
|
||||||
|
i: 12053,
|
||||||
|
p: "لیدل",
|
||||||
|
f: "leedul",
|
||||||
|
g: "leedul",
|
||||||
|
e: "to see",
|
||||||
|
r: 4,
|
||||||
|
c: "v. trans./gramm. trans.",
|
||||||
|
psp: "وین",
|
||||||
|
psf: "ween",
|
||||||
|
tppp: "لید",
|
||||||
|
tppf: "leed",
|
||||||
|
ec: "see,sees,seeing,saw,seen",
|
||||||
|
});
|
||||||
|
const ghadzedul = vEntry({
|
||||||
|
ts: 1527812615,
|
||||||
|
i: 9500,
|
||||||
|
p: "غځېدل",
|
||||||
|
f: "ghadzedul",
|
||||||
|
g: "ghadzedul",
|
||||||
|
e: "stretch out, lie, be extended, expand",
|
||||||
|
r: 3,
|
||||||
|
c: "v. intrans.",
|
||||||
|
ec: "stretch",
|
||||||
|
ep: "out",
|
||||||
|
});
|
||||||
const bandawul = vEntry(
|
const bandawul = vEntry(
|
||||||
{"ts":1527821309,"i":1792,"p":"بندول","f":"bandawul","g":"bandawul","e":"to close, block, stop, barricade, cut off, restrain, hold back","r":3,"c":"v. stat. comp. trans.","l":1577301753727,"ec":"close"},
|
{
|
||||||
{"ts":1577301753727,"i":1780,"p":"بند","f":"band","g":"band","e":"closed, blocked, stopped","c":"adj."},
|
ts: 1527821309,
|
||||||
|
i: 1792,
|
||||||
|
p: "بندول",
|
||||||
|
f: "bandawul",
|
||||||
|
g: "bandawul",
|
||||||
|
e: "to close, block, stop, barricade, cut off, restrain, hold back",
|
||||||
|
r: 3,
|
||||||
|
c: "v. stat. comp. trans.",
|
||||||
|
l: 1577301753727,
|
||||||
|
ec: "close",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1577301753727,
|
||||||
|
i: 1780,
|
||||||
|
p: "بند",
|
||||||
|
f: "band",
|
||||||
|
g: "band",
|
||||||
|
e: "closed, blocked, stopped",
|
||||||
|
c: "adj.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const bandedul = vEntry(
|
const bandedul = vEntry(
|
||||||
{"ts":1588781671306,"i":1796,"p":"بندېدل","f":"bandedúl","g":"bandedul","e":"to be closed, blocked, stopped","r":4,"c":"v. stat. comp. intrans.","l":1577301753727,"ec":"be","ep":"closed"},
|
{
|
||||||
{"ts":1577301753727,"i":1780,"p":"بند","f":"band","g":"band","e":"closed, blocked, stopped","c":"adj."},
|
ts: 1588781671306,
|
||||||
|
i: 1796,
|
||||||
|
p: "بندېدل",
|
||||||
|
f: "bandedúl",
|
||||||
|
g: "bandedul",
|
||||||
|
e: "to be closed, blocked, stopped",
|
||||||
|
r: 4,
|
||||||
|
c: "v. stat. comp. intrans.",
|
||||||
|
l: 1577301753727,
|
||||||
|
ec: "be",
|
||||||
|
ep: "closed",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1577301753727,
|
||||||
|
i: 1780,
|
||||||
|
p: "بند",
|
||||||
|
f: "band",
|
||||||
|
g: "band",
|
||||||
|
e: "closed, blocked, stopped",
|
||||||
|
c: "adj.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const mundaWahul = vEntry(
|
const mundaWahul = vEntry(
|
||||||
{"ts":1527812939,"i":13322,"p":"منډه وهل","f":"munDa wahul","g":"munDawahul","e":"to run","r":4,"c":"v. dyn. comp. trans.","l":1527815805,"ec":"run,runs,running,ran,run"},
|
{
|
||||||
{"ts":1527815805,"i":13321,"p":"منډه","f":"múnDa","g":"munDa","e":"run, running","r":4,"c":"n. f."},
|
ts: 1527812939,
|
||||||
|
i: 13322,
|
||||||
|
p: "منډه وهل",
|
||||||
|
f: "munDa wahul",
|
||||||
|
g: "munDawahul",
|
||||||
|
e: "to run",
|
||||||
|
r: 4,
|
||||||
|
c: "v. dyn. comp. trans.",
|
||||||
|
l: 1527815805,
|
||||||
|
ec: "run,runs,running,ran,run",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1527815805,
|
||||||
|
i: 13321,
|
||||||
|
p: "منډه",
|
||||||
|
f: "múnDa",
|
||||||
|
g: "munDa",
|
||||||
|
e: "run, running",
|
||||||
|
r: 4,
|
||||||
|
c: "n. f.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const istreeKawul = vEntry(
|
const istreeKawul = vEntry(
|
||||||
{"ts":1658796089458,"i":519,"p":"استري کول","f":"istree kawul","g":"istreekawul","e":"to iron (clothes etc.)","r":4,"c":"v. dyn./stat. comp. trans.","l":1658795458148,"ec":"iron"},
|
{
|
||||||
{"ts":1658795458148,"i":518,"p":"استري","f":"istree","g":"istree","e":"iron (for ironing clothes)","r":4,"c":"n. f."},
|
ts: 1658796089458,
|
||||||
|
i: 519,
|
||||||
|
p: "استري کول",
|
||||||
|
f: "istree kawul",
|
||||||
|
g: "istreekawul",
|
||||||
|
e: "to iron (clothes etc.)",
|
||||||
|
r: 4,
|
||||||
|
c: "v. dyn./stat. comp. trans.",
|
||||||
|
l: 1658795458148,
|
||||||
|
ec: "iron",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1658795458148,
|
||||||
|
i: 518,
|
||||||
|
p: "استري",
|
||||||
|
f: "istree",
|
||||||
|
g: "istree",
|
||||||
|
e: "iron (for ironing clothes)",
|
||||||
|
r: 4,
|
||||||
|
c: "n. f.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const cheeghKawul = vEntry(
|
const cheeghKawul = vEntry(
|
||||||
{"ts":1608137130992,"i":5190,"p":"چیغه کول","f":"chéegha kawul","g":"cheeghakawul","e":"to yell, scream, cry out","r":3,"c":"v. gen. stat./dyn. comp. trans.","l":1527813972},
|
{
|
||||||
{"ts":1527813972,"i":5189,"p":"چیغه","f":"chéegha","g":"cheegha","e":"yell, scream, cry","r":3,"c":"n. f."},
|
ts: 1608137130992,
|
||||||
|
i: 5190,
|
||||||
|
p: "چیغه کول",
|
||||||
|
f: "chéegha kawul",
|
||||||
|
g: "cheeghakawul",
|
||||||
|
e: "to yell, scream, cry out",
|
||||||
|
r: 3,
|
||||||
|
c: "v. gen. stat./dyn. comp. trans.",
|
||||||
|
l: 1527813972,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1527813972,
|
||||||
|
i: 5189,
|
||||||
|
p: "چیغه",
|
||||||
|
f: "chéegha",
|
||||||
|
g: "cheegha",
|
||||||
|
e: "yell, scream, cry",
|
||||||
|
r: 3,
|
||||||
|
c: "n. f.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
const kaarKawul = vEntry(
|
const kaarKawul = vEntry(
|
||||||
{"ts":1527812732,"i":10270,"p":"کار کول","f":"kaar kawul","g":"kaarkawul","e":"to work","r":4,"c":"v. dyn. comp. trans.","l":1527822084,"ec":"work"},
|
{
|
||||||
{"ts":1527822084,"i":10268,"p":"کار","f":"kaar","g":"kaar","e":"work, job, business, stuff to do","r":4,"c":"n. m."},
|
ts: 1527812732,
|
||||||
|
i: 10270,
|
||||||
|
p: "کار کول",
|
||||||
|
f: "kaar kawul",
|
||||||
|
g: "kaarkawul",
|
||||||
|
e: "to work",
|
||||||
|
r: 4,
|
||||||
|
c: "v. dyn. comp. trans.",
|
||||||
|
l: 1527822084,
|
||||||
|
ec: "work",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
ts: 1527822084,
|
||||||
|
i: 10268,
|
||||||
|
p: "کار",
|
||||||
|
f: "kaar",
|
||||||
|
g: "kaar",
|
||||||
|
e: "work, job, business, stuff to do",
|
||||||
|
r: 4,
|
||||||
|
c: "n. m.",
|
||||||
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const tests: {
|
const tests: {
|
||||||
verb: T.VerbEntry,
|
verb: T.VerbEntry;
|
||||||
result: T.NewVerbSelection,
|
result: T.NewVerbSelection;
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
verb: wahul,
|
verb: wahul,
|
||||||
|
@ -216,8 +425,7 @@ const tests: {
|
||||||
|
|
||||||
test("verb selection", () => {
|
test("verb selection", () => {
|
||||||
tests.forEach(({ verb, result }) => {
|
tests.forEach(({ verb, result }) => {
|
||||||
expect(makeVerbSelection(verb))
|
expect(makeVerbSelection(verb)).toEqual(result);
|
||||||
.toEqual(result);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -229,5 +437,3 @@ test("verb selection failures", () => {
|
||||||
makeVerbSelection(wahulNoC2);
|
makeVerbSelection(wahulNoC2);
|
||||||
}).toThrow();
|
}).toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,6 @@
|
||||||
import { renderVerb } from "./render-verb";
|
import { renderVerb } from "./render-verb";
|
||||||
import { vEntry } from "./rs-helpers";
|
import { vEntry } from "./rs-helpers";
|
||||||
import * as T from "../../../types";
|
import * as T from "../../../types";
|
||||||
import { negate } from "rambda";
|
|
||||||
import { personToGenNum } from "../misc-helpers";
|
|
||||||
import { getTransitivity } from "../verb-info";
|
|
||||||
|
|
||||||
const wahul = vEntry({
|
const wahul = vEntry({
|
||||||
ts: 1527815399,
|
ts: 1527815399,
|
||||||
|
@ -72,7 +69,7 @@ const kawulStat = vEntry({
|
||||||
prp: "کړل",
|
prp: "کړل",
|
||||||
prf: "kRul",
|
prf: "kRul",
|
||||||
pprtp: "کړی",
|
pprtp: "کړی",
|
||||||
pprtf: "kúRey",
|
pprtf: "kúRay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "make,makes,making,made,made",
|
ec: "make,makes,making,made,made",
|
||||||
});
|
});
|
||||||
|
@ -90,7 +87,7 @@ const kawulDyn = vEntry({
|
||||||
prp: "وکړل",
|
prp: "وکړل",
|
||||||
prf: "óokRul",
|
prf: "óokRul",
|
||||||
pprtp: "کړی",
|
pprtp: "کړی",
|
||||||
pprtf: "kúRey",
|
pprtf: "kúRay",
|
||||||
diacExcept: true,
|
diacExcept: true,
|
||||||
ec: "do,does,doing,did,done",
|
ec: "do,does,doing,did,done",
|
||||||
separationAtP: 1,
|
separationAtP: 1,
|
||||||
|
@ -110,7 +107,7 @@ const kedulStat = vEntry({
|
||||||
prp: "شول",
|
prp: "شول",
|
||||||
prf: "shwul",
|
prf: "shwul",
|
||||||
pprtp: "شوی",
|
pprtp: "شوی",
|
||||||
pprtf: "shúwey",
|
pprtf: "shúway",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "become",
|
ec: "become",
|
||||||
});
|
});
|
||||||
|
@ -128,7 +125,7 @@ const kedulDyn = vEntry({
|
||||||
prp: "وشول",
|
prp: "وشول",
|
||||||
prf: "óoshwul",
|
prf: "óoshwul",
|
||||||
pprtp: "شوی",
|
pprtp: "شوی",
|
||||||
pprtf: "shúwey",
|
pprtf: "shúway",
|
||||||
diacExcept: true,
|
diacExcept: true,
|
||||||
ec: "happen",
|
ec: "happen",
|
||||||
separationAtP: 1,
|
separationAtP: 1,
|
||||||
|
@ -150,9 +147,9 @@ const raatlul = vEntry({
|
||||||
prp: "راغلل",
|
prp: "راغلل",
|
||||||
prf: "ráaghlul",
|
prf: "ráaghlul",
|
||||||
pprtp: "راغلی",
|
pprtp: "راغلی",
|
||||||
pprtf: "raaghúley",
|
pprtf: "raaghúlay",
|
||||||
tppp: "راغی",
|
tppp: "راغی",
|
||||||
tppf: "ráaghey",
|
tppf: "ráaghay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
separationAtP: 2,
|
separationAtP: 2,
|
||||||
separationAtF: 3,
|
separationAtF: 3,
|
||||||
|
@ -174,9 +171,9 @@ const wartlul = vEntry({
|
||||||
prp: "ورغلل",
|
prp: "ورغلل",
|
||||||
prf: "wárghlul",
|
prf: "wárghlul",
|
||||||
pprtp: "ورغلی",
|
pprtp: "ورغلی",
|
||||||
pprtf: "wărghúley",
|
pprtf: "wărghúlay",
|
||||||
tppp: "ورغی",
|
tppp: "ورغی",
|
||||||
tppf: "wărghey",
|
tppf: "wărghay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
separationAtP: 2,
|
separationAtP: 2,
|
||||||
separationAtF: 3,
|
separationAtF: 3,
|
||||||
|
@ -468,13 +465,13 @@ const bandedul = vEntry(
|
||||||
c: "adj.",
|
c: "adj.",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const stureyKawul = vEntry(
|
const sturayKawul = vEntry(
|
||||||
{
|
{
|
||||||
ts: 1591033078746,
|
ts: 1591033078746,
|
||||||
i: 7877,
|
i: 7877,
|
||||||
p: "ستړی کول",
|
p: "ستړی کول",
|
||||||
f: "stuRey kawul",
|
f: "stuRay kawul",
|
||||||
g: "stuReykawul",
|
g: "stuRaykawul",
|
||||||
e: "to make tired, wear out",
|
e: "to make tired, wear out",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. stat. comp. trans.",
|
c: "v. stat. comp. trans.",
|
||||||
|
@ -486,20 +483,20 @@ const stureyKawul = vEntry(
|
||||||
ts: 1527815306,
|
ts: 1527815306,
|
||||||
i: 7876,
|
i: 7876,
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stúRey",
|
f: "stúRay",
|
||||||
g: "stuRey",
|
g: "stuRay",
|
||||||
e: "tired",
|
e: "tired",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "adj. / adv.",
|
c: "adj. / adv.",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const stureyKedul = vEntry(
|
const sturayKedul = vEntry(
|
||||||
{
|
{
|
||||||
ts: 1591033069786,
|
ts: 1591033069786,
|
||||||
i: 7878,
|
i: 7878,
|
||||||
p: "ستړی کېدل",
|
p: "ستړی کېدل",
|
||||||
f: "stuRey kedul",
|
f: "stuRay kedul",
|
||||||
g: "stuReykedul",
|
g: "stuRaykedul",
|
||||||
e: "to get tired, fatigued",
|
e: "to get tired, fatigued",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. stat. comp. intrans.",
|
c: "v. stat. comp. intrans.",
|
||||||
|
@ -511,8 +508,8 @@ const stureyKedul = vEntry(
|
||||||
ts: 1527815306,
|
ts: 1527815306,
|
||||||
i: 7876,
|
i: 7876,
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stúRey",
|
f: "stúRay",
|
||||||
g: "stuRey",
|
g: "stuRay",
|
||||||
e: "tired",
|
e: "tired",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "adj. / adv.",
|
c: "adj. / adv.",
|
||||||
|
@ -1055,7 +1052,7 @@ test("special endings", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "غی", f: "ghey" }],
|
ps: [{ p: "غی", f: "ghay" }],
|
||||||
person: T.Person.ThirdSingMale,
|
person: T.Person.ThirdSingMale,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1069,7 +1066,7 @@ test("special endings", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "غی", f: "ghey" }],
|
ps: [{ p: "غی", f: "ghay" }],
|
||||||
person: T.Person.ThirdSingMale,
|
person: T.Person.ThirdSingMale,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1259,7 +1256,7 @@ test("imperative tenses", () => {
|
||||||
})
|
})
|
||||||
).toEqual({
|
).toEqual({
|
||||||
hasBa: false,
|
hasBa: false,
|
||||||
vbs: [[], [{ type: "VB", ps: [{ p: "وهئ", f: "wahéyy" }], person: 8 }]],
|
vbs: [[], [{ type: "VB", ps: [{ p: "وهئ", f: "wahéy" }], person: 8 }]],
|
||||||
});
|
});
|
||||||
expect(
|
expect(
|
||||||
renderVerb({
|
renderVerb({
|
||||||
|
@ -1272,7 +1269,7 @@ test("imperative tenses", () => {
|
||||||
})
|
})
|
||||||
).toEqual({
|
).toEqual({
|
||||||
hasBa: false,
|
hasBa: false,
|
||||||
vbs: [[ooPh], [{ type: "VB", ps: [{ p: "وهئ", f: "waheyy" }], person: 9 }]],
|
vbs: [[ooPh], [{ type: "VB", ps: [{ p: "وهئ", f: "wahey" }], person: 9 }]],
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1295,11 +1292,11 @@ test("ability tenses", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "وهلی", f: "wahúley" },
|
{ p: "وهلی", f: "wahúlay" },
|
||||||
{ p: "وهلای", f: "wahúlaay" },
|
{ p: "وهلای", f: "wahúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "وهی", f: "wahéy" },
|
{ p: "وهی", f: "waháy" },
|
||||||
{ p: "وهای", f: "waháay" },
|
{ p: "وهای", f: "waháay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1331,7 +1328,7 @@ test("perfect tenses", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "وهلی", f: "wahúley" }],
|
ps: [{ p: "وهلی", f: "wahúlay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1359,7 +1356,7 @@ test("perfect tenses", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "وهلی", f: "wahúley" }],
|
ps: [{ p: "وهلی", f: "wahúlay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1387,7 +1384,7 @@ test("perfect tenses", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "وهلی", f: "wahúley" }],
|
ps: [{ p: "وهلی", f: "wahúlay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1443,7 +1440,7 @@ test("perfect tenses", () => {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "وهلی", f: "wahúley" }],
|
ps: [{ p: "وهلی", f: "wahúlay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1541,7 +1538,7 @@ test("perfect tenses", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [
|
ps: [
|
||||||
{ p: "وای", f: "waay" },
|
{ p: "وای", f: "waay" },
|
||||||
{ p: "وی", f: "wey" },
|
{ p: "وی", f: "way" },
|
||||||
],
|
],
|
||||||
person: T.Person.SecondSingFemale,
|
person: T.Person.SecondSingFemale,
|
||||||
},
|
},
|
||||||
|
@ -1572,7 +1569,7 @@ test("perfect tenses", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [
|
ps: [
|
||||||
{ p: "وای", f: "waay" },
|
{ p: "وای", f: "waay" },
|
||||||
{ p: "وی", f: "wey" },
|
{ p: "وی", f: "way" },
|
||||||
],
|
],
|
||||||
person: T.Person.SecondSingFemale,
|
person: T.Person.SecondSingFemale,
|
||||||
},
|
},
|
||||||
|
@ -1584,7 +1581,7 @@ test("perfect tenses", () => {
|
||||||
test("ending on complex verbs", () => {
|
test("ending on complex verbs", () => {
|
||||||
expect(
|
expect(
|
||||||
renderVerb({
|
renderVerb({
|
||||||
verb: stureyKawul,
|
verb: sturayKawul,
|
||||||
tense: "presentVerbModal",
|
tense: "presentVerbModal",
|
||||||
subject: T.Person.SecondSingMale,
|
subject: T.Person.SecondSingMale,
|
||||||
object: T.Person.ThirdSingFemale,
|
object: T.Person.ThirdSingFemale,
|
||||||
|
@ -1611,11 +1608,11 @@ test("ending on complex verbs", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "کولی", f: "kawúley" },
|
{ p: "کولی", f: "kawúlay" },
|
||||||
{ p: "کولای", f: "kawúlaay" },
|
{ p: "کولای", f: "kawúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "کوی", f: "kawéy" },
|
{ p: "کوی", f: "kawáy" },
|
||||||
{ p: "کوای", f: "kawáay" },
|
{ p: "کوای", f: "kawáay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1631,7 +1628,7 @@ test("ending on complex verbs", () => {
|
||||||
});
|
});
|
||||||
expect(
|
expect(
|
||||||
renderVerb({
|
renderVerb({
|
||||||
verb: stureyKawul,
|
verb: sturayKawul,
|
||||||
tense: "presentVerb",
|
tense: "presentVerb",
|
||||||
subject: T.Person.SecondSingMale,
|
subject: T.Person.SecondSingMale,
|
||||||
voice: "active",
|
voice: "active",
|
||||||
|
|
|
@ -230,7 +230,7 @@ function addEnding({
|
||||||
if (vb.ps.short[0].f === "ghl" && pastThird && basicForm) {
|
if (vb.ps.short[0].f === "ghl" && pastThird && basicForm) {
|
||||||
return {
|
return {
|
||||||
...vb,
|
...vb,
|
||||||
ps: [{ p: "غی", f: "ghey" }],
|
ps: [{ p: "غی", f: "ghay" }],
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const endLong = getLength(end, "long");
|
const endLong = getLength(end, "long");
|
||||||
|
|
|
@ -53,7 +53,7 @@ const kawulStat = vEntry({
|
||||||
prp: "کړل",
|
prp: "کړل",
|
||||||
prf: "kRul",
|
prf: "kRul",
|
||||||
pprtp: "کړی",
|
pprtp: "کړی",
|
||||||
pprtf: "kúRey",
|
pprtf: "kúRay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "make,makes,making,made,made",
|
ec: "make,makes,making,made,made",
|
||||||
});
|
});
|
||||||
|
@ -71,7 +71,7 @@ const kawulDyn = vEntry({
|
||||||
prp: "وکړل",
|
prp: "وکړل",
|
||||||
prf: "óokRul",
|
prf: "óokRul",
|
||||||
pprtp: "کړی",
|
pprtp: "کړی",
|
||||||
pprtf: "kúRey",
|
pprtf: "kúRay",
|
||||||
diacExcept: true,
|
diacExcept: true,
|
||||||
ec: "do,does,doing,did,done",
|
ec: "do,does,doing,did,done",
|
||||||
separationAtP: 1,
|
separationAtP: 1,
|
||||||
|
@ -91,7 +91,7 @@ const kedulStat = vEntry({
|
||||||
prp: "شول",
|
prp: "شول",
|
||||||
prf: "shwul",
|
prf: "shwul",
|
||||||
pprtp: "شوی",
|
pprtp: "شوی",
|
||||||
pprtf: "shúwey",
|
pprtf: "shúway",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "become",
|
ec: "become",
|
||||||
});
|
});
|
||||||
|
@ -109,7 +109,7 @@ const kedulDyn = vEntry({
|
||||||
prp: "وشول",
|
prp: "وشول",
|
||||||
prf: "óoshwul",
|
prf: "óoshwul",
|
||||||
pprtp: "شوی",
|
pprtp: "شوی",
|
||||||
pprtf: "shúwey",
|
pprtf: "shúway",
|
||||||
diacExcept: true,
|
diacExcept: true,
|
||||||
ec: "happen",
|
ec: "happen",
|
||||||
separationAtP: 1,
|
separationAtP: 1,
|
||||||
|
@ -131,9 +131,9 @@ const raatlul = vEntry({
|
||||||
prp: "راغلل",
|
prp: "راغلل",
|
||||||
prf: "ráaghlul",
|
prf: "ráaghlul",
|
||||||
pprtp: "راغلی",
|
pprtp: "راغلی",
|
||||||
pprtf: "raaghúley",
|
pprtf: "raaghúlay",
|
||||||
tppp: "راغی",
|
tppp: "راغی",
|
||||||
tppf: "ráaghey",
|
tppf: "ráaghay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
separationAtP: 2,
|
separationAtP: 2,
|
||||||
separationAtF: 3,
|
separationAtF: 3,
|
||||||
|
@ -155,9 +155,9 @@ const wartlul = vEntry({
|
||||||
prp: "ورغلل",
|
prp: "ورغلل",
|
||||||
prf: "wárghlul",
|
prf: "wárghlul",
|
||||||
pprtp: "ورغلی",
|
pprtp: "ورغلی",
|
||||||
pprtf: "wărghúley",
|
pprtf: "wărghúlay",
|
||||||
tppp: "ورغی",
|
tppp: "ورغی",
|
||||||
tppf: "wărghey",
|
tppf: "wărghay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
separationAtP: 2,
|
separationAtP: 2,
|
||||||
separationAtF: 3,
|
separationAtF: 3,
|
||||||
|
@ -434,13 +434,13 @@ const bandedul = vEntry(
|
||||||
c: "adj.",
|
c: "adj.",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const stureyKawul = vEntry(
|
const sturayKawul = vEntry(
|
||||||
{
|
{
|
||||||
ts: 1591033078746,
|
ts: 1591033078746,
|
||||||
i: 7877,
|
i: 7877,
|
||||||
p: "ستړی کول",
|
p: "ستړی کول",
|
||||||
f: "stuRey kawul",
|
f: "stuRay kawul",
|
||||||
g: "stuReykawul",
|
g: "stuRaykawul",
|
||||||
e: "to make tired, wear out",
|
e: "to make tired, wear out",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. stat. comp. trans.",
|
c: "v. stat. comp. trans.",
|
||||||
|
@ -452,20 +452,20 @@ const stureyKawul = vEntry(
|
||||||
ts: 1527815306,
|
ts: 1527815306,
|
||||||
i: 7876,
|
i: 7876,
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stúRey",
|
f: "stúRay",
|
||||||
g: "stuRey",
|
g: "stuRay",
|
||||||
e: "tired",
|
e: "tired",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "adj. / adv.",
|
c: "adj. / adv.",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
const stureyKedul = vEntry(
|
const sturayKedul = vEntry(
|
||||||
{
|
{
|
||||||
ts: 1591033069786,
|
ts: 1591033069786,
|
||||||
i: 7878,
|
i: 7878,
|
||||||
p: "ستړی کېدل",
|
p: "ستړی کېدل",
|
||||||
f: "stuRey kedul",
|
f: "stuRay kedul",
|
||||||
g: "stuReykedul",
|
g: "stuRaykedul",
|
||||||
e: "to get tired, fatigued",
|
e: "to get tired, fatigued",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. stat. comp. intrans.",
|
c: "v. stat. comp. intrans.",
|
||||||
|
@ -477,8 +477,8 @@ const stureyKedul = vEntry(
|
||||||
ts: 1527815306,
|
ts: 1527815306,
|
||||||
i: 7876,
|
i: 7876,
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stúRey",
|
f: "stúRay",
|
||||||
g: "stuRey",
|
g: "stuRay",
|
||||||
e: "tired",
|
e: "tired",
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "adj. / adv.",
|
c: "adj. / adv.",
|
||||||
|
@ -544,7 +544,7 @@ const warkawul = vEntry({
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. trans.",
|
c: "v. trans.",
|
||||||
pprtp: "ورکړی",
|
pprtp: "ورکړی",
|
||||||
pprtf: "wărkúRey",
|
pprtf: "wărkúRay",
|
||||||
ec: "give,gives,giving,gave,given",
|
ec: "give,gives,giving,gave,given",
|
||||||
});
|
});
|
||||||
const raakawul = vEntry({
|
const raakawul = vEntry({
|
||||||
|
@ -557,7 +557,7 @@ const raakawul = vEntry({
|
||||||
r: 4,
|
r: 4,
|
||||||
c: "v. trans.",
|
c: "v. trans.",
|
||||||
pprtp: "راکړی",
|
pprtp: "راکړی",
|
||||||
pprtf: "raakúRey",
|
pprtf: "raakúRay",
|
||||||
ec: "give,gives,giving,gave,given",
|
ec: "give,gives,giving,gave,given",
|
||||||
});
|
});
|
||||||
const darkawul = vEntry({
|
const darkawul = vEntry({
|
||||||
|
@ -569,7 +569,7 @@ const darkawul = vEntry({
|
||||||
e: "to give (to second person - you, you pl.)",
|
e: "to give (to second person - you, you pl.)",
|
||||||
r: 4,
|
r: 4,
|
||||||
pprtp: "درکړی",
|
pprtp: "درکړی",
|
||||||
pprtf: "dărkúRey",
|
pprtf: "dărkúRay",
|
||||||
ec: "give,gives,giving,gave,given",
|
ec: "give,gives,giving,gave,given",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -677,7 +677,7 @@ describe("imperfective stems", () => {
|
||||||
"is welded together with the complement on seperated stative compounds",
|
"is welded together with the complement on seperated stative compounds",
|
||||||
tests: [
|
tests: [
|
||||||
{
|
{
|
||||||
verb: stureyKawul,
|
verb: sturayKawul,
|
||||||
genderNumber: { gender: "fem", number: "singular" },
|
genderNumber: { gender: "fem", number: "singular" },
|
||||||
result: [
|
result: [
|
||||||
[],
|
[],
|
||||||
|
@ -702,7 +702,7 @@ describe("imperfective stems", () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
verb: stureyKedul,
|
verb: sturayKedul,
|
||||||
genderNumber: { gender: "fem", number: "singular" },
|
genderNumber: { gender: "fem", number: "singular" },
|
||||||
result: [
|
result: [
|
||||||
[],
|
[],
|
||||||
|
@ -837,7 +837,7 @@ describe("imperfective roots", () => {
|
||||||
"is welded together with the complement on seperated stative compounds",
|
"is welded together with the complement on seperated stative compounds",
|
||||||
tests: [
|
tests: [
|
||||||
{
|
{
|
||||||
verb: stureyKawul,
|
verb: sturayKawul,
|
||||||
genderNumber: { gender: "fem", number: "singular" },
|
genderNumber: { gender: "fem", number: "singular" },
|
||||||
result: [
|
result: [
|
||||||
[],
|
[],
|
||||||
|
@ -865,7 +865,7 @@ describe("imperfective roots", () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
verb: stureyKedul,
|
verb: sturayKedul,
|
||||||
genderNumber: { gender: "fem", number: "singular" },
|
genderNumber: { gender: "fem", number: "singular" },
|
||||||
result: [
|
result: [
|
||||||
[],
|
[],
|
||||||
|
@ -1176,7 +1176,7 @@ describe("perfective stems", () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
verb: stureyKedul,
|
verb: sturayKedul,
|
||||||
genderNumber: { gender: "masc", number: "plural" },
|
genderNumber: { gender: "masc", number: "plural" },
|
||||||
result: [
|
result: [
|
||||||
[
|
[
|
||||||
|
@ -1580,7 +1580,7 @@ describe("perfective roots", () => {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
verb: stureyKedul,
|
verb: sturayKedul,
|
||||||
genderNumber: { gender: "masc", number: "plural" },
|
genderNumber: { gender: "masc", number: "plural" },
|
||||||
result: [
|
result: [
|
||||||
[
|
[
|
||||||
|
@ -1630,7 +1630,7 @@ describe("perfective roots", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("past participles", () => {
|
describe("past participles", () => {
|
||||||
test("for most verbs are just the imperfective root (imperative) plus ی - ey", () => {
|
test("for most verbs are just the imperfective root (imperative) plus ی - ay", () => {
|
||||||
expect(
|
expect(
|
||||||
getPastParticiple(rasedul, "active", {
|
getPastParticiple(rasedul, "active", {
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
|
@ -1638,7 +1638,7 @@ describe("past participles", () => {
|
||||||
})
|
})
|
||||||
).toEqual({
|
).toEqual({
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "رسېدلی", f: "rasedúley" }],
|
ps: [{ p: "رسېدلی", f: "rasedúlay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
});
|
});
|
||||||
|
@ -1739,7 +1739,7 @@ describe("past participles", () => {
|
||||||
})
|
})
|
||||||
).toEqual({
|
).toEqual({
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "کړی", f: "kúRey" }],
|
ps: [{ p: "کړی", f: "kúRay" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
});
|
});
|
||||||
|
@ -1836,7 +1836,7 @@ describe("past participles", () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
test("special passive forms for kawul verbs - kRul perfective root + shúwey", () => {
|
test("special passive forms for kawul verbs - kRul perfective root + shúway", () => {
|
||||||
expect(
|
expect(
|
||||||
getPastParticiple(kawulStat, "passive", {
|
getPastParticiple(kawulStat, "passive", {
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
|
@ -1850,7 +1850,7 @@ describe("past participles", () => {
|
||||||
},
|
},
|
||||||
right: {
|
right: {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "شوی", f: "shúwey" }],
|
ps: [{ p: "شوی", f: "shúway" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1868,7 +1868,7 @@ describe("past participles", () => {
|
||||||
},
|
},
|
||||||
right: {
|
right: {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: [{ p: "شوی", f: "shúwey" }],
|
ps: [{ p: "شوی", f: "shúway" }],
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
},
|
},
|
||||||
|
@ -1934,11 +1934,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "ختلی", f: "khatúley" },
|
{ p: "ختلی", f: "khatúlay" },
|
||||||
{ p: "ختلای", f: "khatúlaay" },
|
{ p: "ختلای", f: "khatúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "ختی", f: "khatéy" },
|
{ p: "ختی", f: "khatáy" },
|
||||||
{ p: "ختای", f: "khatáay" },
|
{ p: "ختای", f: "khatáay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1962,11 +1962,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "ختلی", f: "khatuley" },
|
{ p: "ختلی", f: "khatulay" },
|
||||||
{ p: "ختلای", f: "khatulaay" },
|
{ p: "ختلای", f: "khatulaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "ختی", f: "khatey" },
|
{ p: "ختی", f: "khatay" },
|
||||||
{ p: "ختای", f: "khataay" },
|
{ p: "ختای", f: "khataay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -1990,11 +1990,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "ختلی", f: "khatúley" },
|
{ p: "ختلی", f: "khatúlay" },
|
||||||
{ p: "ختلای", f: "khatúlaay" },
|
{ p: "ختلای", f: "khatúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "ختی", f: "khatéy" },
|
{ p: "ختی", f: "khatáy" },
|
||||||
{ p: "ختای", f: "khatáay" },
|
{ p: "ختای", f: "khatáay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2021,11 +2021,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "ختلی", f: "khatuley" },
|
{ p: "ختلی", f: "khatulay" },
|
||||||
{ p: "ختلای", f: "khatulaay" },
|
{ p: "ختلای", f: "khatulaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "ختی", f: "khatey" },
|
{ p: "ختی", f: "khatay" },
|
||||||
{ p: "ختای", f: "khataay" },
|
{ p: "ختای", f: "khataay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2057,11 +2057,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "راتللی", f: "raatlúley" },
|
{ p: "راتللی", f: "raatlúlay" },
|
||||||
{ p: "راتللای", f: "raatlúlaay" },
|
{ p: "راتللای", f: "raatlúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "راتلی", f: "raatléy" },
|
{ p: "راتلی", f: "raatláy" },
|
||||||
{ p: "راتلای", f: "raatláay" },
|
{ p: "راتلای", f: "raatláay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2085,11 +2085,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "راتللی", f: "raatlúley" },
|
{ p: "راتللی", f: "raatlúlay" },
|
||||||
{ p: "راتللای", f: "raatlúlaay" },
|
{ p: "راتللای", f: "raatlúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "راتلی", f: "raatléy" },
|
{ p: "راتلی", f: "raatláy" },
|
||||||
{ p: "راتلای", f: "raatláay" },
|
{ p: "راتلای", f: "raatláay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2118,11 +2118,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "بندېدلی", f: "bandedúley" },
|
{ p: "بندېدلی", f: "bandedúlay" },
|
||||||
{ p: "بندېدلای", f: "bandedúlaay" },
|
{ p: "بندېدلای", f: "bandedúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "بندېدی", f: "bandedéy" },
|
{ p: "بندېدی", f: "bandedáy" },
|
||||||
{ p: "بندېدای", f: "bandedáay" },
|
{ p: "بندېدای", f: "bandedáay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2158,11 +2158,11 @@ describe("ability roots and stems", () => {
|
||||||
type: "VB",
|
type: "VB",
|
||||||
ps: {
|
ps: {
|
||||||
long: [
|
long: [
|
||||||
{ p: "کېدلی", f: "kedúley" },
|
{ p: "کېدلی", f: "kedúlay" },
|
||||||
{ p: "کېدلای", f: "kedúlaay" },
|
{ p: "کېدلای", f: "kedúlaay" },
|
||||||
],
|
],
|
||||||
short: [
|
short: [
|
||||||
{ p: "کېدی", f: "kedéy" },
|
{ p: "کېدی", f: "kedáy" },
|
||||||
{ p: "کېدای", f: "kedáay" },
|
{ p: "کېدای", f: "kedáay" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -2393,7 +2393,7 @@ describe("passive roots and stems", () => {
|
||||||
]);
|
]);
|
||||||
expect(
|
expect(
|
||||||
getRootStem({
|
getRootStem({
|
||||||
verb: stureyKawul,
|
verb: sturayKawul,
|
||||||
aspect: "imperfective",
|
aspect: "imperfective",
|
||||||
type: "basic",
|
type: "basic",
|
||||||
voice: "passive",
|
voice: "passive",
|
||||||
|
@ -2416,7 +2416,7 @@ describe("passive roots and stems", () => {
|
||||||
type: "AdjComp",
|
type: "AdjComp",
|
||||||
ps: {
|
ps: {
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stuRey",
|
f: "stuRay",
|
||||||
},
|
},
|
||||||
gender: "masc",
|
gender: "masc",
|
||||||
number: "singular",
|
number: "singular",
|
||||||
|
|
|
@ -50,7 +50,7 @@ export const statVerb = {
|
||||||
prp: "شول",
|
prp: "شول",
|
||||||
prf: "shwul",
|
prf: "shwul",
|
||||||
pprtp: "شوی",
|
pprtp: "شوی",
|
||||||
pprtf: "shúwey",
|
pprtf: "shúway",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "become",
|
ec: "become",
|
||||||
}),
|
}),
|
||||||
|
@ -68,7 +68,7 @@ export const statVerb = {
|
||||||
prp: "کړل",
|
prp: "کړل",
|
||||||
prf: "kRul",
|
prf: "kRul",
|
||||||
pprtp: "کړی",
|
pprtp: "کړی",
|
||||||
pprtf: "kúRey",
|
pprtf: "kúRay",
|
||||||
noOo: true,
|
noOo: true,
|
||||||
ec: "make,makes,making,made,made",
|
ec: "make,makes,making,made,made",
|
||||||
}),
|
}),
|
||||||
|
@ -183,7 +183,7 @@ export function getPastParticiple(
|
||||||
ps: T.SingleOrLengthOpts<T.PsString[]>
|
ps: T.SingleOrLengthOpts<T.PsString[]>
|
||||||
): T.SingleOrLengthOpts<T.PsString[]> {
|
): T.SingleOrLengthOpts<T.PsString[]> {
|
||||||
return fmapSingleOrLengthOpts((x) => {
|
return fmapSingleOrLengthOpts((x) => {
|
||||||
const withTail = concatPsString(x[0], { p: "ی", f: "ey" });
|
const withTail = concatPsString(x[0], { p: "ی", f: "ay" });
|
||||||
return inflectPattern3(withTail, { gender, number });
|
return inflectPattern3(withTail, { gender, number });
|
||||||
}, ps);
|
}, ps);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
import * as T from "../../../types";
|
import * as T from "../../../types";
|
||||||
import { removeFVarients } from "../accent-and-ps-utils";
|
import { removeFVarients } from "../accent-and-ps-utils";
|
||||||
import { accentOnNFromEnd, accentPsSyllable, countSyllables, removeAccents, removeAccentsWLength } from "../accent-helpers";
|
import {
|
||||||
import { concatPsString, isUnisexSet, psStringFromEntry, trimOffPs } from "../p-text-helpers";
|
accentOnNFromEnd,
|
||||||
|
accentPsSyllable,
|
||||||
|
countSyllables,
|
||||||
|
removeAccents,
|
||||||
|
removeAccentsWLength,
|
||||||
|
} from "../accent-helpers";
|
||||||
|
import {
|
||||||
|
concatPsString,
|
||||||
|
isUnisexSet,
|
||||||
|
psStringFromEntry,
|
||||||
|
trimOffPs,
|
||||||
|
} from "../p-text-helpers";
|
||||||
import { inflectPattern1 } from "./new-inflectors";
|
import { inflectPattern1 } from "./new-inflectors";
|
||||||
import { getLength } from "../p-text-helpers";
|
import { getLength } from "../p-text-helpers";
|
||||||
import { equativeEndings } from "../grammar-units";
|
import { equativeEndings } from "../grammar-units";
|
||||||
|
@ -16,10 +27,14 @@ export function statCompImperfectiveSpace(v: T.VerbEntryNoFVars): boolean {
|
||||||
return v.entry.p.startsWith(`${v.complement?.p} `);
|
return v.entry.p.startsWith(`${v.complement?.p} `);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function makeComplement(e: T.DictionaryEntryNoFVars, { gender, number }: T.GenderNumber): T.NComp {
|
export function makeComplement(
|
||||||
|
e: T.DictionaryEntryNoFVars,
|
||||||
|
{ gender, number }: T.GenderNumber
|
||||||
|
): T.NComp {
|
||||||
if (isAdjectiveEntry(e)) {
|
if (isAdjectiveEntry(e)) {
|
||||||
const infs = inflectWord(e);
|
const infs = inflectWord(e);
|
||||||
const ps = infs && infs.inflections && isUnisexSet(infs.inflections)
|
const ps =
|
||||||
|
infs && infs.inflections && isUnisexSet(infs.inflections)
|
||||||
? infs.inflections[gender][number === "singular" ? 0 : 1][0]
|
? infs.inflections[gender][number === "singular" ? 0 : 1][0]
|
||||||
: psStringFromEntry(e);
|
: psStringFromEntry(e);
|
||||||
return {
|
return {
|
||||||
|
@ -40,18 +55,18 @@ export function makeComplement(e: T.DictionaryEntryNoFVars, { gender, number }:
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
function lightEnforceCompAccent(ps: T.PsString): T.PsString {
|
function lightEnforceCompAccent(ps: T.PsString): T.PsString {
|
||||||
return countSyllables(ps) === 1
|
return countSyllables(ps) === 1 ? accentPsSyllable(ps) : ps;
|
||||||
? accentPsSyllable(ps)
|
|
||||||
: ps;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function vEntry(e: any, c?: any): T.VerbEntryNoFVars {
|
export function vEntry(e: any, c?: any): T.VerbEntryNoFVars {
|
||||||
return {
|
return {
|
||||||
entry: removeFVarients(e),
|
entry: removeFVarients(e),
|
||||||
...c ? {
|
...(c
|
||||||
|
? {
|
||||||
complement: c,
|
complement: c,
|
||||||
} : {},
|
}
|
||||||
|
: {}),
|
||||||
} as T.VerbEntryNoFVars;
|
} as T.VerbEntryNoFVars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,12 +100,15 @@ export function vEntry(e: any, c?: any): T.VerbEntryNoFVars {
|
||||||
* @param end - the verb ending
|
* @param end - the verb ending
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function verbEndingConcat(ps: T.PsString[], end: T.PsString[]): T.PsString[] {
|
export function verbEndingConcat(
|
||||||
|
ps: T.PsString[],
|
||||||
|
end: T.PsString[]
|
||||||
|
): T.PsString[] {
|
||||||
if (ps[0].f === "shw" && end[0].f === "oo") {
|
if (ps[0].f === "shw" && end[0].f === "oo") {
|
||||||
return [{ p: "شو", f: "shoo" }];
|
return [{ p: "شو", f: "shoo" }];
|
||||||
}
|
}
|
||||||
return ps.flatMap(v => (
|
return ps.flatMap((v) =>
|
||||||
end.map(e => {
|
end.map((e) => {
|
||||||
if (v.f.charAt(v.f.length - 1) === "X") {
|
if (v.f.charAt(v.f.length - 1) === "X") {
|
||||||
// faster to do concatPsString(trimOffPs(v, 0, 1), accentSyllable(e))
|
// faster to do concatPsString(trimOffPs(v, 0, 1), accentSyllable(e))
|
||||||
// but this covers cases like adding the 3rd person no-ending to a string with the
|
// but this covers cases like adding the 3rd person no-ending to a string with the
|
||||||
|
@ -102,13 +120,22 @@ export function verbEndingConcat(ps: T.PsString[], end: T.PsString[]): T.PsStrin
|
||||||
}
|
}
|
||||||
return concatPsString(v, e);
|
return concatPsString(v, e);
|
||||||
})
|
})
|
||||||
));
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: THIS IS UGGGGLY NEED TO THINK THROUGH THE TYPING ON THE WELDING
|
// TODO: THIS IS UGGGGLY NEED TO THINK THROUGH THE TYPING ON THE WELDING
|
||||||
export function weld(left: T.Welded["left"], right: T.VBGenNum | T.WeldedGN): T.WeldedGN;
|
export function weld(
|
||||||
export function weld(left: T.Welded["left"], right: T.VBBasic | T.NComp | T.Welded): T.Welded;
|
left: T.Welded["left"],
|
||||||
export function weld(left: T.Welded["left"], right: T.VBBasic | T.VBGenNum | T.Welded | T.NComp | T.WeldedGN): T.Welded | T.WeldedGN {
|
right: T.VBGenNum | T.WeldedGN
|
||||||
|
): T.WeldedGN;
|
||||||
|
export function weld(
|
||||||
|
left: T.Welded["left"],
|
||||||
|
right: T.VBBasic | T.NComp | T.Welded
|
||||||
|
): T.Welded;
|
||||||
|
export function weld(
|
||||||
|
left: T.Welded["left"],
|
||||||
|
right: T.VBBasic | T.VBGenNum | T.Welded | T.NComp | T.WeldedGN
|
||||||
|
): T.Welded | T.WeldedGN {
|
||||||
if (right.type === "welded") {
|
if (right.type === "welded") {
|
||||||
return weld(weld(left, right.left), right.right);
|
return weld(weld(left, right.left), right.right);
|
||||||
}
|
}
|
||||||
|
@ -126,7 +153,7 @@ export function weld(left: T.Welded["left"], right: T.VBBasic | T.VBGenNum | T.W
|
||||||
return {
|
return {
|
||||||
...left,
|
...left,
|
||||||
ps: removeAccentsWLength(left.ps),
|
ps: removeAccentsWLength(left.ps),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
if (left.type === "NComp") {
|
if (left.type === "NComp") {
|
||||||
return {
|
return {
|
||||||
|
@ -154,8 +181,6 @@ export function addTrailingAccent(ps: T.PsString): T.PsString {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// TODO: could do removeEndingL (slower but safer)
|
// TODO: could do removeEndingL (slower but safer)
|
||||||
|
|
||||||
export function removeL(ps: T.PsString): T.PsString {
|
export function removeL(ps: T.PsString): T.PsString {
|
||||||
|
@ -171,12 +196,17 @@ export function vTransitivity(v: T.VerbEntry): "intransitive" | "transitive" {
|
||||||
return v.entry.c?.includes("intrans.") ? "intransitive" : "transitive";
|
return v.entry.c?.includes("intrans.") ? "intransitive" : "transitive";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function tlulPerfectiveStem(person: { gender: T.Gender, number: T.NounNumber }): [[T.PH], [T.VB]] {
|
export function tlulPerfectiveStem(person: {
|
||||||
|
gender: T.Gender;
|
||||||
|
number: T.NounNumber;
|
||||||
|
}): [[T.PH], [T.VB]] {
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
type: "PH",
|
type: "PH",
|
||||||
ps: inflectPattern1({ p: "لاړ", f: "láaR" }, person).map(x => concatPsString(x, " "))[0],
|
ps: inflectPattern1({ p: "لاړ", f: "láaR" }, person).map((x) =>
|
||||||
|
concatPsString(x, " ")
|
||||||
|
)[0],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@ -190,7 +220,7 @@ export function tlulPerfectiveStem(person: { gender: T.Gender, number: T.NounNum
|
||||||
|
|
||||||
export function addAbilityEnding(vb: T.VBA): T.VBA {
|
export function addAbilityEnding(vb: T.VBA): T.VBA {
|
||||||
const abilityEnding: T.PsString[] = [
|
const abilityEnding: T.PsString[] = [
|
||||||
{ p: "ی", f: "ey" },
|
{ p: "ی", f: "ay" },
|
||||||
{ p: "ای", f: "aay" },
|
{ p: "ای", f: "aay" },
|
||||||
];
|
];
|
||||||
if (vb.type === "welded") {
|
if (vb.type === "welded") {
|
||||||
|
@ -203,7 +233,9 @@ export function addAbilityEnding(vb: T.VBA): T.VBA {
|
||||||
function addToEnd(vb: T.VBBasic, end: T.PsString[]): T.VBBasic {
|
function addToEnd(vb: T.VBBasic, end: T.PsString[]): T.VBBasic {
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
if (!("long" in vb.ps)) {
|
if (!("long" in vb.ps)) {
|
||||||
throw new Error("should have long and short form for adding to ability ending");
|
throw new Error(
|
||||||
|
"should have long and short form for adding to ability ending"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...vb,
|
...vb,
|
||||||
|
@ -215,7 +247,6 @@ export function addAbilityEnding(vb: T.VBA): T.VBA {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBBasic>): T.VBBasic;
|
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBBasic>): T.VBBasic;
|
||||||
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA;
|
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA;
|
||||||
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA {
|
export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA {
|
||||||
|
@ -239,10 +270,16 @@ export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
const [trimP, trimF] = (infinitive.p.slice(-4) === "ښودل" && infinitive.p.length > 4 && infinitive.p !== "کېښودل" && infinitive.p !== "کښېښودل")
|
const [trimP, trimF] =
|
||||||
// special thing for اېښودل - پرېښودل
|
infinitive.p.slice(-4) === "ښودل" &&
|
||||||
? [3, 4]
|
infinitive.p.length > 4 &&
|
||||||
: (wrul.includes(infinitive.p) || (shortenableEndings.includes(infinitive.p.slice(-3)) && infinitive.p.slice(-4) !== "استل"))
|
infinitive.p !== "کېښودل" &&
|
||||||
|
infinitive.p !== "کښېښودل"
|
||||||
|
? // special thing for اېښودل - پرېښودل
|
||||||
|
[3, 4]
|
||||||
|
: wrul.includes(infinitive.p) ||
|
||||||
|
(shortenableEndings.includes(infinitive.p.slice(-3)) &&
|
||||||
|
infinitive.p.slice(-4) !== "استل")
|
||||||
? [1, 2]
|
? [1, 2]
|
||||||
: [0, 0];
|
: [0, 0];
|
||||||
if (trimP) {
|
if (trimP) {
|
||||||
|
@ -257,7 +294,6 @@ export function possiblePPartLengths(vba: T.VBNoLenghts<T.VBA>): T.VBA {
|
||||||
return vba;
|
return vba;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function getLongVB(vb: T.VBBasic): T.VBNoLenghts<T.VBBasic>;
|
export function getLongVB(vb: T.VBBasic): T.VBNoLenghts<T.VBBasic>;
|
||||||
export function getLongVB(vb: T.VBA): T.VBNoLenghts<T.VBA>;
|
export function getLongVB(vb: T.VBA): T.VBNoLenghts<T.VBA>;
|
||||||
export function getLongVB(vb: T.VBA): T.VBNoLenghts<T.VBA> {
|
export function getLongVB(vb: T.VBA): T.VBNoLenghts<T.VBA> {
|
||||||
|
@ -273,12 +309,21 @@ export function getLongVB(vb: T.VBA): T.VBNoLenghts<T.VBA> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAspect(tense: T.VerbTense | T.AbilityTense | T.ImperativeTense, negative: boolean): T.Aspect {
|
export function getAspect(
|
||||||
|
tense: T.VerbTense | T.AbilityTense | T.ImperativeTense,
|
||||||
|
negative: boolean
|
||||||
|
): T.Aspect {
|
||||||
if (isImperativeTense(tense) && negative) {
|
if (isImperativeTense(tense) && negative) {
|
||||||
return "imperfective";
|
return "imperfective";
|
||||||
}
|
}
|
||||||
const t = tense.replace("Modal", "");
|
const t = tense.replace("Modal", "");
|
||||||
const imperfectives: Parameters<typeof getAspect>[0][] = ["presentVerb", "imperfectiveFuture", "imperfectivePast", "habitualImperfectivePast", "imperfectiveImperative"];
|
const imperfectives: Parameters<typeof getAspect>[0][] = [
|
||||||
|
"presentVerb",
|
||||||
|
"imperfectiveFuture",
|
||||||
|
"imperfectivePast",
|
||||||
|
"habitualImperfectivePast",
|
||||||
|
"imperfectiveImperative",
|
||||||
|
];
|
||||||
if (imperfectives.includes(t as Parameters<typeof getAspect>[0])) {
|
if (imperfectives.includes(t as Parameters<typeof getAspect>[0])) {
|
||||||
return "imperfective";
|
return "imperfective";
|
||||||
} else {
|
} else {
|
||||||
|
@ -290,7 +335,9 @@ export function isKedul(v: T.VerbEntry): boolean {
|
||||||
return v.entry.p === "کېدل";
|
return v.entry.p === "کېدل";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function perfectTenseToEquative(t: T.PerfectTense): keyof typeof equativeEndings {
|
export function perfectTenseToEquative(
|
||||||
|
t: T.PerfectTense
|
||||||
|
): keyof typeof equativeEndings {
|
||||||
return t === "presentPerfect"
|
return t === "presentPerfect"
|
||||||
? "present"
|
? "present"
|
||||||
: t === "futurePerfect"
|
: t === "futurePerfect"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -9,7 +9,7 @@
|
||||||
// TODO: See if there are animate feminine words ending in ي and test
|
// TODO: See if there are animate feminine words ending in ي and test
|
||||||
|
|
||||||
import {
|
import {
|
||||||
inflectRegularYeyUnisex,
|
inflectRegularYayUnisex,
|
||||||
inflectWord,
|
inflectWord,
|
||||||
} from "./pashto-inflector";
|
} from "./pashto-inflector";
|
||||||
import * as T from "../../types";
|
import * as T from "../../types";
|
||||||
|
@ -53,7 +53,7 @@ const adjectives: {
|
||||||
in: {
|
in: {
|
||||||
ts: 1527815306,
|
ts: 1527815306,
|
||||||
p: "ستړی",
|
p: "ستړی",
|
||||||
f: "stúRey",
|
f: "stúRay",
|
||||||
g: "",
|
g: "",
|
||||||
e: "tired",
|
e: "tired",
|
||||||
c: "adj.",
|
c: "adj.",
|
||||||
|
@ -62,7 +62,7 @@ const adjectives: {
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "ستړی", f: "stúRey"}],
|
[{p: "ستړی", f: "stúRay"}],
|
||||||
[{p: "ستړي", f: "stúRee"}],
|
[{p: "ستړي", f: "stúRee"}],
|
||||||
[{p: "ستړیو", f: "stúRiyo"}, {p: "ستړو", f: "stúRo"}],
|
[{p: "ستړیو", f: "stúRiyo"}, {p: "ستړو", f: "stúRo"}],
|
||||||
],
|
],
|
||||||
|
@ -79,7 +79,7 @@ const adjectives: {
|
||||||
in: {
|
in: {
|
||||||
ts: 1527813636,
|
ts: 1527813636,
|
||||||
p: "وروستی",
|
p: "وروستی",
|
||||||
f: "wroostéy",
|
f: "wroostáy",
|
||||||
g: "",
|
g: "",
|
||||||
e: "last, latest, recent",
|
e: "last, latest, recent",
|
||||||
c: "adj.",
|
c: "adj.",
|
||||||
|
@ -88,7 +88,7 @@ const adjectives: {
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "وروستی", f: "wroostéy"}],
|
[{p: "وروستی", f: "wroostáy"}],
|
||||||
[{p: "وروستي", f: "wroostée"}],
|
[{p: "وروستي", f: "wroostée"}],
|
||||||
[{p: "وروستیو", f: "wroostiyo"}, {p: "وروستو", f: "wroostó"}],
|
[{p: "وروستیو", f: "wroostiyo"}, {p: "وروستو", f: "wroostó"}],
|
||||||
],
|
],
|
||||||
|
@ -374,7 +374,7 @@ const nouns: {
|
||||||
in: {
|
in: {
|
||||||
ts: 1527814159,
|
ts: 1527814159,
|
||||||
p: "ملګری",
|
p: "ملګری",
|
||||||
f: "malgúrey",
|
f: "malgúray",
|
||||||
g: "",
|
g: "",
|
||||||
e: "friend, companion",
|
e: "friend, companion",
|
||||||
c: "n. m. unisex",
|
c: "n. m. unisex",
|
||||||
|
@ -383,7 +383,7 @@ const nouns: {
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "ملګری", f: "malgúrey"}],
|
[{p: "ملګری", f: "malgúray"}],
|
||||||
[{p: "ملګري", f: "malgúree"}],
|
[{p: "ملګري", f: "malgúree"}],
|
||||||
[{p: "ملګریو", f: "malgúriyo"}, {p: "ملګرو", f: "malgúro"}],
|
[{p: "ملګریو", f: "malgúriyo"}, {p: "ملګرو", f: "malgúro"}],
|
||||||
],
|
],
|
||||||
|
@ -397,11 +397,11 @@ const nouns: {
|
||||||
},
|
},
|
||||||
// Unisex noun ending on ی with emphasis on the end
|
// Unisex noun ending on ی with emphasis on the end
|
||||||
{
|
{
|
||||||
in: {"i":3319,"ts":1527816431,"p":"ترورزی","f":"trorzéy","g":"trorzey","e":"cousin (of paternal aunt)","c":"n. m. unisex","ppp":"ترورزامن","ppf":"trorzaamun"},
|
in: {"i":3319,"ts":1527816431,"p":"ترورزی","f":"trorzáy","g":"trorzay","e":"cousin (of paternal aunt)","c":"n. m. unisex","ppp":"ترورزامن","ppf":"trorzaamun"},
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "ترورزی", f: "trorzéy"}],
|
[{p: "ترورزی", f: "trorzáy"}],
|
||||||
[{p: "ترورزي", f: "trorzée"}],
|
[{p: "ترورزي", f: "trorzée"}],
|
||||||
[{p: "ترورزیو", f: "trorziyo"}, {p: "ترورزو", f: "trorzó"}],
|
[{p: "ترورزیو", f: "trorziyo"}, {p: "ترورزو", f: "trorzó"}],
|
||||||
],
|
],
|
||||||
|
@ -463,11 +463,11 @@ const nouns: {
|
||||||
},
|
},
|
||||||
// with #3 pattern anim unisex
|
// with #3 pattern anim unisex
|
||||||
{
|
{
|
||||||
in: {"ts":1527820130,"i":2561,"p":"پلوی","f":"palawéy","g":"palawey","e":"adherent, supporter; the outside or further ox in a team of oxes grinding or threshing","c":"n. m. anim. unisex"},
|
in: {"ts":1527820130,"i":2561,"p":"پلوی","f":"palawáy","g":"palaway","e":"adherent, supporter; the outside or further ox in a team of oxes grinding or threshing","c":"n. m. anim. unisex"},
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{ p: "پلوی", f: "palawéy" }],
|
[{ p: "پلوی", f: "palawáy" }],
|
||||||
[{ p: "پلوي", f: "palawée" }],
|
[{ p: "پلوي", f: "palawée" }],
|
||||||
[{ p: "پلویو", f: "palawiyo" }, { p: "پلوو", f: "palawó" }],
|
[{ p: "پلویو", f: "palawiyo" }, { p: "پلوو", f: "palawó" }],
|
||||||
],
|
],
|
||||||
|
@ -495,7 +495,7 @@ const nouns: {
|
||||||
in: {
|
in: {
|
||||||
ts: 1527815251,
|
ts: 1527815251,
|
||||||
p: "سړی",
|
p: "سړی",
|
||||||
f: "saRéy",
|
f: "saRáy",
|
||||||
g: "",
|
g: "",
|
||||||
e: "man",
|
e: "man",
|
||||||
c: "n. m.",
|
c: "n. m.",
|
||||||
|
@ -504,7 +504,7 @@ const nouns: {
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "سړی", f: "saRéy"}],
|
[{p: "سړی", f: "saRáy"}],
|
||||||
[{p: "سړي", f: "saRée"}],
|
[{p: "سړي", f: "saRée"}],
|
||||||
[{p: "سړیو", f: "saRiyo"}, {p: "سړو", f: "saRo"}],
|
[{p: "سړیو", f: "saRiyo"}, {p: "سړو", f: "saRo"}],
|
||||||
],
|
],
|
||||||
|
@ -514,19 +514,19 @@ const nouns: {
|
||||||
// Masculine #3 anim
|
// Masculine #3 anim
|
||||||
// TODO: Also do Fem #3 anim!
|
// TODO: Also do Fem #3 anim!
|
||||||
{
|
{
|
||||||
in: {"ts":1527819801,"i":8082,"p":"سیلانی","f":"seylaanéy","g":"seylaaney","e":"tourist, sightseer, visitor","c":"n. m. anim."},
|
in: {"ts":1527819801,"i":8082,"p":"سیلانی","f":"saylaanáy","g":"saylaanay","e":"tourist, sightseer, visitor","c":"n. m. anim."},
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{ p: "سیلانی", f: "seylaanéy" }],
|
[{ p: "سیلانی", f: "saylaanáy" }],
|
||||||
[{ p: "سیلاني", f: "seylaanée" }],
|
[{ p: "سیلاني", f: "saylaanée" }],
|
||||||
[{ p: "سیلانیو", f: "seylaaniyo" }, { p: "سیلانو", f: "seylaano" }],
|
[{ p: "سیلانیو", f: "saylaaniyo" }, { p: "سیلانو", f: "saylaano" }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plural: {
|
plural: {
|
||||||
masc: [
|
masc: [
|
||||||
[{ p: "سیلانیان", f: "seylaaniyáan" }],
|
[{ p: "سیلانیان", f: "saylaaniyáan" }],
|
||||||
[{ p: "سیلانیانو", f: "seylaaniyáano" }],
|
[{ p: "سیلانیانو", f: "saylaaniyáano" }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -536,7 +536,7 @@ const nouns: {
|
||||||
in: {
|
in: {
|
||||||
ts: 1527818511,
|
ts: 1527818511,
|
||||||
p: "ترېلی",
|
p: "ترېلی",
|
||||||
f: "treléy",
|
f: "treláy",
|
||||||
g: "",
|
g: "",
|
||||||
e: "pool, reservoir",
|
e: "pool, reservoir",
|
||||||
c: "n. m.",
|
c: "n. m.",
|
||||||
|
@ -545,7 +545,7 @@ const nouns: {
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "ترېلی", f: "treléy"}],
|
[{p: "ترېلی", f: "treláy"}],
|
||||||
[{p: "ترېلي", f: "trelée"}],
|
[{p: "ترېلي", f: "trelée"}],
|
||||||
[{p: "ترېلیو", f: "treliyo"}, {p: "ترېلو", f: "trelo"}],
|
[{p: "ترېلیو", f: "treliyo"}, {p: "ترېلو", f: "trelo"}],
|
||||||
],
|
],
|
||||||
|
@ -617,9 +617,9 @@ const nouns: {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// should NOT do the oona plural with the squish nouns, when they're animate
|
// should NOT do the oona plural with the squish nouns, when thay're animate
|
||||||
{
|
{
|
||||||
in: {"i":5465,"ts":1527812802,"p":"خر","f":"khur","g":"khur","e":"donkey","c":"n. m. anim. unisex irreg.","infap":"خره","infaf":"khru","infbp":"خر","infbf":"khr"},
|
in: {"i":5465,"ts":1527812802,"p":"خر","f":"khur","g":"khur","e":"donkay","c":"n. m. anim. unisex irreg.","infap":"خره","infaf":"khru","infbp":"خر","infbf":"khr"},
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
// TODO: use smarter system using new isType5Entry predicates, to allow for not using the redundant one syllable accents with these
|
// TODO: use smarter system using new isType5Entry predicates, to allow for not using the redundant one syllable accents with these
|
||||||
|
@ -1104,14 +1104,14 @@ const nouns: {
|
||||||
e: "mother, mom",
|
e: "mother, mom",
|
||||||
c: "n. f. anim.",
|
c: "n. f. anim.",
|
||||||
ppp: "میندې",
|
ppp: "میندې",
|
||||||
ppf: "meynde",
|
ppf: "maynde",
|
||||||
i: 11113,
|
i: 11113,
|
||||||
},
|
},
|
||||||
out: {
|
out: {
|
||||||
plural: {
|
plural: {
|
||||||
fem: [
|
fem: [
|
||||||
[{ p: "میندې", f: "meynde" }],
|
[{ p: "میندې", f: "maynde" }],
|
||||||
[{ p: "میندو", f: "meyndo" }],
|
[{ p: "میندو", f: "mayndo" }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1218,19 +1218,19 @@ const nouns: {
|
||||||
},
|
},
|
||||||
// with variations on Pashto plural
|
// with variations on Pashto plural
|
||||||
{
|
{
|
||||||
in: {"ts":1527815268,"i":8475,"p":"شی","f":"shey","g":"shey","ppp":"شیان، شیونه", "ppf": "sheyáan, sheyóona","e":"thing","c":"n. m."},
|
in: {"ts":1527815268,"i":8475,"p":"شی","f":"shay","g":"shay","ppp":"شیان، شیونه", "ppf": "shayáan, shayóona","e":"thing","c":"n. m."},
|
||||||
out: {
|
out: {
|
||||||
inflections: {
|
inflections: {
|
||||||
masc: [
|
masc: [
|
||||||
[{ p: "شی", f: "shey" }],
|
[{ p: "شی", f: "shay" }],
|
||||||
[{ p: "شي", f: "shee" }],
|
[{ p: "شي", f: "shee" }],
|
||||||
[{ p: "شیو", f: "shiyo" }, { p: "شو", f: "sho" }],
|
[{ p: "شیو", f: "shiyo" }, { p: "شو", f: "sho" }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
plural: {
|
plural: {
|
||||||
masc: [
|
masc: [
|
||||||
[{ p: "شیان", f: "sheyáan" }, { p: "شیونه", f: "sheyóona" }],
|
[{ p: "شیان", f: "shayáan" }, { p: "شیونه", f: "shayóona" }],
|
||||||
[{ p: "شیانو", f: "sheyáano" }, { p: "شیونو", f: "sheyóono" }],
|
[{ p: "شیانو", f: "shayáano" }, { p: "شیونو", f: "shayóono" }],
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -1309,10 +1309,10 @@ others.forEach((word) => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test(`inflectRegularYeyUnisex should work`, () => {
|
test(`inflectRegularYayUnisex should work`, () => {
|
||||||
expect(inflectRegularYeyUnisex("لیدونکی", "leedóonkey")).toEqual({
|
expect(inflectRegularYayUnisex("لیدونکی", "leedóonkay")).toEqual({
|
||||||
masc: [
|
masc: [
|
||||||
[{p: "لیدونکی", f: "leedóonkey" }],
|
[{p: "لیدونکی", f: "leedóonkay" }],
|
||||||
[{p: "لیدونکي", f: "leedóonkee" }],
|
[{p: "لیدونکي", f: "leedóonkee" }],
|
||||||
[{p: "لیدونکیو", f: "leedóonkiyo" }, {p: "لیدونکو", f: "leedóonko"}],
|
[{p: "لیدونکیو", f: "leedóonkiyo" }, {p: "لیدونکو", f: "leedóonko"}],
|
||||||
],
|
],
|
||||||
|
|
|
@ -33,7 +33,7 @@ import * as T from "../../types";
|
||||||
import { fmapSingleOrLengthOpts } from "./fp-ps";
|
import { fmapSingleOrLengthOpts } from "./fp-ps";
|
||||||
|
|
||||||
const endingInSingleARegex = /[^a]'?’?[aá]'?’?$/;
|
const endingInSingleARegex = /[^a]'?’?[aá]'?’?$/;
|
||||||
const endingInHeyOrAynRegex = /[^ا][هع]$/;
|
const endingInHayOrAynRegex = /[^ا][هع]$/;
|
||||||
// const endingInAlefRegex = /اع?$/;
|
// const endingInAlefRegex = /اع?$/;
|
||||||
|
|
||||||
export function inflectWord(word: T.DictionaryEntry): T.InflectorOutput {
|
export function inflectWord(word: T.DictionaryEntry): T.InflectorOutput {
|
||||||
|
@ -89,8 +89,8 @@ function handleUnisexWord(word: T.DictionaryEntryNoFVars): T.InflectorOutput {
|
||||||
...plurals,
|
...plurals,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (pEnd === "ی" && word.f.slice(-2) === "ey") {
|
if (pEnd === "ی" && word.f.slice(-2) === "ay") {
|
||||||
return { inflections: inflectRegularYeyUnisex(word.p, word.f), ...plurals };
|
return { inflections: inflectRegularYayUnisex(word.p, word.f), ...plurals };
|
||||||
}
|
}
|
||||||
if (pEnd === "ه" && word.g.slice(-1) === "u") {
|
if (pEnd === "ه" && word.g.slice(-1) === "u") {
|
||||||
return {
|
return {
|
||||||
|
@ -98,9 +98,9 @@ function handleUnisexWord(word: T.DictionaryEntryNoFVars): T.InflectorOutput {
|
||||||
...plurals,
|
...plurals,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (pEnd === "ی" && word.f.slice(-2) === "éy") {
|
if (pEnd === "ی" && word.f.slice(-2) === "áy") {
|
||||||
return {
|
return {
|
||||||
inflections: inflectEmphasizedYeyUnisex(word.p, word.f),
|
inflections: inflectEmphasizedYayUnisex(word.p, word.f),
|
||||||
...plurals,
|
...plurals,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -155,12 +155,12 @@ function handleMascNoun(w: T.DictionaryEntryNoFVars): T.InflectorOutput {
|
||||||
if (isTobEnding) {
|
if (isTobEnding) {
|
||||||
return { inflections: inflectTobMasc(w.p, w.f), ...plurals };
|
return { inflections: inflectTobMasc(w.p, w.f), ...plurals };
|
||||||
}
|
}
|
||||||
if (pEnd === "ی" && fEnd === "ey") {
|
if (pEnd === "ی" && fEnd === "ay") {
|
||||||
return { inflections: inflectRegularYeyMasc(w.p, w.f), ...plurals };
|
return { inflections: inflectRegularYayMasc(w.p, w.f), ...plurals };
|
||||||
}
|
}
|
||||||
if (pEnd === "ی" && fEnd === "éy") {
|
if (pEnd === "ی" && fEnd === "áy") {
|
||||||
return {
|
return {
|
||||||
inflections: inflectRegularEmphasizedYeyMasc(w.p, w.f),
|
inflections: inflectRegularEmphasizedYayMasc(w.p, w.f),
|
||||||
...plurals,
|
...plurals,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -179,7 +179,7 @@ function handleFemNoun(word: T.DictionaryEntryNoFVars): T.InflectorOutput {
|
||||||
return !plurals ? false : { ...plurals };
|
return !plurals ? false : { ...plurals };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (endingInHeyOrAynRegex.test(word.p) && endingInSingleARegex.test(word.f)) {
|
if (endingInHayOrAynRegex.test(word.p) && endingInSingleARegex.test(word.f)) {
|
||||||
return { inflections: inflectRegularAFem(word.p, word.f), ...plurals };
|
return { inflections: inflectRegularAFem(word.p, word.f), ...plurals };
|
||||||
}
|
}
|
||||||
if (word.p.slice(-1) === "ح" && endingInSingleARegex.test(word.f)) {
|
if (word.p.slice(-1) === "ح" && endingInSingleARegex.test(word.f)) {
|
||||||
|
@ -238,7 +238,7 @@ function inflectIrregularUnisex(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export function inflectRegularYeyUnisex(
|
export function inflectRegularYayUnisex(
|
||||||
p: string,
|
p: string,
|
||||||
f: string
|
f: string
|
||||||
): T.UnisexInflections {
|
): T.UnisexInflections {
|
||||||
|
@ -283,7 +283,7 @@ export function inflectRegularShwaEndingUnisex(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function inflectEmphasizedYeyUnisex(p: string, f: string): T.UnisexInflections {
|
function inflectEmphasizedYayUnisex(p: string, f: string): T.UnisexInflections {
|
||||||
const baseP = p.slice(0, -1);
|
const baseP = p.slice(0, -1);
|
||||||
const baseF = f.slice(0, -2);
|
const baseF = f.slice(0, -2);
|
||||||
return {
|
return {
|
||||||
|
@ -325,7 +325,7 @@ function inflectConsonantEndingUnisex(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function inflectRegularYeyMasc(p: string, f: string): T.Inflections {
|
function inflectRegularYayMasc(p: string, f: string): T.Inflections {
|
||||||
const baseP = p.slice(0, -1);
|
const baseP = p.slice(0, -1);
|
||||||
const baseF = f.slice(0, -2);
|
const baseF = f.slice(0, -2);
|
||||||
return {
|
return {
|
||||||
|
@ -352,7 +352,7 @@ function inflectTobMasc(p: string, f: string): T.Inflections {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function inflectRegularEmphasizedYeyMasc(p: string, f: string): T.Inflections {
|
function inflectRegularEmphasizedYayMasc(p: string, f: string): T.Inflections {
|
||||||
const baseP = p.slice(0, -1);
|
const baseP = p.slice(0, -1);
|
||||||
const baseF = f.slice(0, -2);
|
const baseF = f.slice(0, -2);
|
||||||
return {
|
return {
|
||||||
|
@ -677,7 +677,7 @@ function makePlural(
|
||||||
plural: { masc: addMascPluralSuffix(anim, shortSquish) },
|
plural: { masc: addMascPluralSuffix(anim, shortSquish) },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (endsWith([{ p: "ی", f: "éy" }, { p: "ي" }], w, true)) {
|
if (endsWith([{ p: "ی", f: "áy" }, { p: "ي" }], w, true)) {
|
||||||
return { arabicPlural, plural: addAnimN3UnisexPluralSuffix() };
|
return { arabicPlural, plural: addAnimN3UnisexPluralSuffix() };
|
||||||
}
|
}
|
||||||
// usually shortSquish nouns would never have arabicPlurals -- so we don't have to worry about catching
|
// usually shortSquish nouns would never have arabicPlurals -- so we don't have to worry about catching
|
||||||
|
@ -696,7 +696,7 @@ function makePlural(
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (type === "masc noun" && endsWith({ p: "ی", f: "éy" }, w, true) && anim) {
|
if (type === "masc noun" && endsWith({ p: "ی", f: "áy" }, w, true) && anim) {
|
||||||
const { masc } = addAnimN3UnisexPluralSuffix();
|
const { masc } = addAnimN3UnisexPluralSuffix();
|
||||||
return {
|
return {
|
||||||
arabicPlural,
|
arabicPlural,
|
||||||
|
@ -744,8 +744,8 @@ function makePlural(
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function inflectYey(
|
export function inflectYay(
|
||||||
ps: T.SingleOrLengthOpts<T.PsString>
|
ps: T.SingleOrLengthOpts<T.PsString>
|
||||||
): T.SingleOrLengthOpts<T.UnisexInflections> {
|
): T.SingleOrLengthOpts<T.UnisexInflections> {
|
||||||
return fmapSingleOrLengthOpts((x) => inflectRegularYeyUnisex(x.p, x.f), ps);
|
return fmapSingleOrLengthOpts((x) => inflectRegularYayUnisex(x.p, x.f), ps);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,12 @@ import { countSyllables } from "./accent-helpers";
|
||||||
|
|
||||||
export function isTlulVerb(e: T.VerbEntry | T.VerbDictionaryEntry): boolean {
|
export function isTlulVerb(e: T.VerbEntry | T.VerbDictionaryEntry): boolean {
|
||||||
const entry = "entry" in e ? e.entry : e;
|
const entry = "entry" in e ? e.entry : e;
|
||||||
return entry.f === "tlul" || entry.p === "راتلل" || entry.p === "درتلل" || entry.p === "ورتلل";
|
return (
|
||||||
|
entry.f === "tlul" ||
|
||||||
|
entry.p === "راتلل" ||
|
||||||
|
entry.p === "درتلل" ||
|
||||||
|
entry.p === "ورتلل"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isKawulVerb(e: T.VerbEntry | T.VerbDictionaryEntry): boolean {
|
export function isKawulVerb(e: T.VerbEntry | T.VerbDictionaryEntry): boolean {
|
||||||
|
@ -18,67 +23,95 @@ export function isNounEntry(e: T.Entry | T.DictionaryEntry): e is T.NounEntry {
|
||||||
return !!(e.c && (e.c.includes("n. m.") || e.c.includes("n. f.")));
|
return !!(e.c && (e.c.includes("n. m.") || e.c.includes("n. f.")));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAdjectiveEntry(e: T.Entry | T.DictionaryEntry): e is T.AdjectiveEntry {
|
export function isAdjectiveEntry(
|
||||||
|
e: T.Entry | T.DictionaryEntry
|
||||||
|
): e is T.AdjectiveEntry {
|
||||||
if ("entry" in e) return false;
|
if ("entry" in e) return false;
|
||||||
return !!e.c?.includes("adj.");
|
return !!e.c?.includes("adj.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAdverbEntry(e: T.Entry | T.DictionaryEntry): e is T.AdverbEntry {
|
export function isAdverbEntry(
|
||||||
|
e: T.Entry | T.DictionaryEntry
|
||||||
|
): e is T.AdverbEntry {
|
||||||
if ("entry" in e) return false;
|
if ("entry" in e) return false;
|
||||||
return !!e.c?.includes("adv.");
|
return !!e.c?.includes("adv.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isLocativeAdverbEntry(e: T.Entry | T.DictionaryEntry): e is T.LocativeAdverbEntry {
|
export function isLocativeAdverbEntry(
|
||||||
|
e: T.Entry | T.DictionaryEntry
|
||||||
|
): e is T.LocativeAdverbEntry {
|
||||||
if ("entry" in e) return false;
|
if ("entry" in e) return false;
|
||||||
return !!e.c?.includes("loc. adv.");
|
return !!e.c?.includes("loc. adv.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isNounOrAdjEntry(e: T.Entry | T.DictionaryEntry): e is (T.NounEntry | T.AdjectiveEntry) {
|
export function isNounOrAdjEntry(
|
||||||
|
e: T.Entry | T.DictionaryEntry
|
||||||
|
): e is T.NounEntry | T.AdjectiveEntry {
|
||||||
return isNounEntry(e) || isAdjectiveEntry(e);
|
return isNounEntry(e) || isAdjectiveEntry(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isVerbDictionaryEntry(e: T.DictionaryEntry | T.DictionaryEntryNoFVars): e is T.VerbDictionaryEntry {
|
export function isVerbDictionaryEntry(
|
||||||
|
e: T.DictionaryEntry | T.DictionaryEntryNoFVars
|
||||||
|
): e is T.VerbDictionaryEntry {
|
||||||
return !!e.c?.startsWith("v.");
|
return !!e.c?.startsWith("v.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isVerbEntry(
|
export function isVerbEntry(
|
||||||
e: T.Entry | T.DictionaryEntry | { entry: T.DictionaryEntry, comp?: T.DictionaryEntry }
|
e:
|
||||||
|
| T.Entry
|
||||||
|
| T.DictionaryEntry
|
||||||
|
| { entry: T.DictionaryEntry; comp?: T.DictionaryEntry }
|
||||||
): e is T.VerbEntry {
|
): e is T.VerbEntry {
|
||||||
return "entry" in e && isVerbDictionaryEntry(e.entry);
|
return "entry" in e && isVerbDictionaryEntry(e.entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isMascNounEntry(e: T.NounEntry | T.AdjectiveEntry): e is T.MascNounEntry {
|
export function isMascNounEntry(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): e is T.MascNounEntry {
|
||||||
return !!e.c && e.c.includes("n. m.");
|
return !!e.c && e.c.includes("n. m.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isFemNounEntry(e: T.NounEntry | T.AdjectiveEntry): e is T.FemNounEntry {
|
export function isFemNounEntry(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): e is T.FemNounEntry {
|
||||||
return !!e.c && e.c.includes("n. f.");
|
return !!e.c && e.c.includes("n. f.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isUnisexNounEntry(e: T.NounEntry | T.AdjectiveEntry): e is T.UnisexNounEntry {
|
export function isUnisexNounEntry(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): e is T.UnisexNounEntry {
|
||||||
return isNounEntry(e) && e.c.includes("unisex");
|
return isNounEntry(e) && e.c.includes("unisex");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAnimNounEntry(e: T.NounEntry | T.AdverbEntry): e is T.AnimNounEntry {
|
export function isAnimNounEntry(
|
||||||
|
e: T.NounEntry | T.AdverbEntry
|
||||||
|
): e is T.AnimNounEntry {
|
||||||
return e.c.includes("anim.");
|
return e.c.includes("anim.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isUnisexAnimNounEntry(e: T.NounEntry | T.AdjectiveEntry): e is T.UnisexAnimNounEntry {
|
export function isUnisexAnimNounEntry(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): e is T.UnisexAnimNounEntry {
|
||||||
return isUnisexNounEntry(e) && isAnimNounEntry(e);
|
return isUnisexNounEntry(e) && isAnimNounEntry(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAdjOrUnisexNounEntry(e: T.Entry): e is (T.AdjectiveEntry | T.UnisexNounEntry) {
|
export function isAdjOrUnisexNounEntry(
|
||||||
return isAdjectiveEntry(e) || (
|
e: T.Entry
|
||||||
isNounEntry(e) && isUnisexNounEntry(e)
|
): e is T.AdjectiveEntry | T.UnisexNounEntry {
|
||||||
);
|
return isAdjectiveEntry(e) || (isNounEntry(e) && isUnisexNounEntry(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPattern(p: T.InflectionPattern | "all"): (entry: T.NounEntry | T.AdjectiveEntry) => boolean {
|
export function isPattern(
|
||||||
|
p: T.InflectionPattern | "all"
|
||||||
|
): (entry: T.NounEntry | T.AdjectiveEntry) => boolean {
|
||||||
if (p === 0) {
|
if (p === 0) {
|
||||||
return (e: T.NounEntry | T.AdjectiveEntry) => (
|
return (e: T.NounEntry | T.AdjectiveEntry) =>
|
||||||
!isPattern1Entry(e) && !isPattern2Entry(e) && !isPattern3Entry(e)
|
!isPattern1Entry(e) &&
|
||||||
&& !isPattern4Entry(e) && !isPattern5Entry(e) && !isPattern6FemEntry(e)
|
!isPattern2Entry(e) &&
|
||||||
)
|
!isPattern3Entry(e) &&
|
||||||
|
!isPattern4Entry(e) &&
|
||||||
|
!isPattern5Entry(e) &&
|
||||||
|
!isPattern6FemEntry(e);
|
||||||
}
|
}
|
||||||
if (p === 1) {
|
if (p === 1) {
|
||||||
return isPattern1Entry;
|
return isPattern1Entry;
|
||||||
|
@ -107,19 +140,39 @@ export function isPattern(p: T.InflectionPattern | "all"): (entry: T.NounEntry |
|
||||||
* @param e
|
* @param e
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function isPattern1Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T): e is T.Pattern1Entry<T> {
|
export function isPattern1Entry<T extends T.NounEntry | T.AdjectiveEntry>(
|
||||||
|
e: T
|
||||||
|
): e is T.Pattern1Entry<T> {
|
||||||
if (e.noInf) return false;
|
if (e.noInf) return false;
|
||||||
if (e.infap) return false;
|
if (e.infap) return false;
|
||||||
if (isFemNounEntry(e)) {
|
if (isFemNounEntry(e)) {
|
||||||
return (
|
return (
|
||||||
endsWith([{ p: "ه", f: "a" }, { p: "ح", f: "a" }], e) ||
|
endsWith(
|
||||||
|
[
|
||||||
|
{ p: "ه", f: "a" },
|
||||||
|
{ p: "ح", f: "a" },
|
||||||
|
],
|
||||||
|
e
|
||||||
|
) ||
|
||||||
(endsWith({ p: pashtoConsonants }, e) && !e.c.includes("anim."))
|
(endsWith({ p: pashtoConsonants }, e) && !e.c.includes("anim."))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
endsWith([{ p: pashtoConsonants }], e) ||
|
endsWith([{ p: pashtoConsonants }], e) ||
|
||||||
endsWith([{ p: "ه", f: "u" }, { p: "ه", f: "h" }], e) ||
|
endsWith(
|
||||||
endsWith([{ p: "ای", f: "aay" }, { p: "وی", f: "ooy" }], e)
|
[
|
||||||
|
{ p: "ه", f: "u" },
|
||||||
|
{ p: "ه", f: "h" },
|
||||||
|
],
|
||||||
|
e
|
||||||
|
) ||
|
||||||
|
endsWith(
|
||||||
|
[
|
||||||
|
{ p: "ای", f: "aay" },
|
||||||
|
{ p: "وی", f: "ooy" },
|
||||||
|
],
|
||||||
|
e
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,14 +182,16 @@ export function isPattern1Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T
|
||||||
* @param e
|
* @param e
|
||||||
* @returns T.T.T.T.
|
* @returns T.T.T.T.
|
||||||
*/
|
*/
|
||||||
export function isPattern2Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T): e is T.Pattern2Entry<T> {
|
export function isPattern2Entry<T extends T.NounEntry | T.AdjectiveEntry>(
|
||||||
|
e: T
|
||||||
|
): e is T.Pattern2Entry<T> {
|
||||||
if (e.noInf) return false;
|
if (e.noInf) return false;
|
||||||
if (e.infap) return false;
|
if (e.infap) return false;
|
||||||
if (isFemNounEntry(e)) {
|
if (isFemNounEntry(e)) {
|
||||||
return !e.c.includes("pl.") && endsWith({ p: "ې", f: "e" }, e, true);
|
return !e.c.includes("pl.") && endsWith({ p: "ې", f: "e" }, e, true);
|
||||||
}
|
}
|
||||||
// TODO: check if it's a single syllable word, in which case it would be pattern 1
|
// TODO: check if it's a single syllable word, in which case it would be pattern 1
|
||||||
return endsWith({ p: "ی", f: "ey" }, e, true) && (countSyllables(e.f) > 1);
|
return endsWith({ p: "ی", f: "ay" }, e, true) && countSyllables(e.f) > 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,15 +200,17 @@ export function isPattern2Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T
|
||||||
* @param e
|
* @param e
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function isPattern3Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T): e is T.Pattern3Entry<T> {
|
export function isPattern3Entry<T extends T.NounEntry | T.AdjectiveEntry>(
|
||||||
|
e: T
|
||||||
|
): e is T.Pattern3Entry<T> {
|
||||||
if (e.noInf) return false;
|
if (e.noInf) return false;
|
||||||
if (e.infap) return false;
|
if (e.infap) return false;
|
||||||
if (isFemNounEntry(e)) {
|
if (isFemNounEntry(e)) {
|
||||||
return endsWith({ p: "ۍ" }, e);
|
return endsWith({ p: "ۍ" }, e);
|
||||||
}
|
}
|
||||||
return (countSyllables(e.f) > 1)
|
return countSyllables(e.f) > 1
|
||||||
? endsWith({ p: "ی", f: "éy" }, e, true)
|
? endsWith({ p: "ی", f: "áy" }, e, true)
|
||||||
: endsWith({ p: "ی", f: "ey" }, e)
|
: endsWith({ p: "ی", f: "ay" }, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -162,12 +219,14 @@ export function isPattern3Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T
|
||||||
* @param e
|
* @param e
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function isPattern4Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T): e is T.Pattern4Entry<T> {
|
export function isPattern4Entry<T extends T.NounEntry | T.AdjectiveEntry>(
|
||||||
|
e: T
|
||||||
|
): e is T.Pattern4Entry<T> {
|
||||||
if (e.noInf) return false;
|
if (e.noInf) return false;
|
||||||
return (
|
return (
|
||||||
!!(e.infap && e.infaf && e.infbp && e.infbf)
|
!!(e.infap && e.infaf && e.infbp && e.infbf) &&
|
||||||
&&
|
e.infap.slice(1).includes("ا") &&
|
||||||
(e.infap.slice(1).includes("ا") && e.infap.slice(-1) === "ه")
|
e.infap.slice(-1) === "ه"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,26 +236,34 @@ export function isPattern4Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T
|
||||||
* @param e
|
* @param e
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
export function isPattern5Entry<T extends (T.NounEntry | T.AdjectiveEntry)>(e: T): e is T.Pattern5Entry<T> {
|
export function isPattern5Entry<T extends T.NounEntry | T.AdjectiveEntry>(
|
||||||
|
e: T
|
||||||
|
): e is T.Pattern5Entry<T> {
|
||||||
if (e.noInf) return false;
|
if (e.noInf) return false;
|
||||||
return (
|
return (
|
||||||
!!(e.infap && e.infaf && e.infbp && e.infbf)
|
!!(e.infap && e.infaf && e.infbp && e.infbf) &&
|
||||||
&&
|
!e.infap.slice(1).includes("ا") &&
|
||||||
(!e.infap.slice(1).includes("ا") && e.infap.slice(-1) === "ه")
|
e.infap.slice(-1) === "ه"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPattern6FemEntry(e: T.NounEntry | T.AdjectiveEntry): e is T.Pattern6FemEntry<T.FemNounEntry> {
|
export function isPattern6FemEntry(
|
||||||
|
e: T.NounEntry | T.AdjectiveEntry
|
||||||
|
): e is T.Pattern6FemEntry<T.FemNounEntry> {
|
||||||
if (!isFemNounEntry(e)) return false;
|
if (!isFemNounEntry(e)) return false;
|
||||||
if (e.c.includes("anim.")) return false;
|
if (e.c.includes("anim.")) return false;
|
||||||
return e.p.slice(-1) === "ي";
|
return e.p.slice(-1) === "ي";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPluralNounEntry<U extends T.NounEntry>(e: U): e is T.PluralNounEntry<U> {
|
export function isPluralNounEntry<U extends T.NounEntry>(
|
||||||
|
e: U
|
||||||
|
): e is T.PluralNounEntry<U> {
|
||||||
return e.c.includes("pl.");
|
return e.c.includes("pl.");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isSingularEntry<U extends T.NounEntry>(e: U): e is T.SingularEntry<U> {
|
export function isSingularEntry<U extends T.NounEntry>(
|
||||||
|
e: U
|
||||||
|
): e is T.SingularEntry<U> {
|
||||||
return !isPluralNounEntry(e);
|
return !isPluralNounEntry(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -219,7 +286,7 @@ export function isVerbTense(tense: T.Tense): tense is T.VerbTense {
|
||||||
"habitualPerfectivePast",
|
"habitualPerfectivePast",
|
||||||
"habitualImperfectivePast",
|
"habitualImperfectivePast",
|
||||||
];
|
];
|
||||||
return verbTenses.some(x => x === tense);
|
return verbTenses.some((x) => x === tense);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isAbilityTense(tense: T.Tense): tense is T.AbilityTense {
|
export function isAbilityTense(tense: T.Tense): tense is T.AbilityTense {
|
||||||
|
@ -227,7 +294,16 @@ export function isAbilityTense(tense: T.Tense): tense is T.AbilityTense {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isEquativeTense(t: T.Tense): t is T.EquativeTense {
|
export function isEquativeTense(t: T.Tense): t is T.EquativeTense {
|
||||||
return (t === "present" || t === "future" || t === "habitual" || t === "past" || t === "wouldBe" || t === "subjunctive" || t === "pastSubjunctive" || t === "wouldHaveBeen");
|
return (
|
||||||
|
t === "present" ||
|
||||||
|
t === "future" ||
|
||||||
|
t === "habitual" ||
|
||||||
|
t === "past" ||
|
||||||
|
t === "wouldBe" ||
|
||||||
|
t === "subjunctive" ||
|
||||||
|
t === "pastSubjunctive" ||
|
||||||
|
t === "wouldHaveBeen"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isImperativeTense(tense: T.Tense): tense is T.ImperativeTense {
|
export function isImperativeTense(tense: T.Tense): tense is T.ImperativeTense {
|
||||||
|
|
|
@ -28,7 +28,7 @@ import {
|
||||||
psStringEquals,
|
psStringEquals,
|
||||||
} from "./p-text-helpers";
|
} from "./p-text-helpers";
|
||||||
import { makePsString } from "./accent-and-ps-utils";
|
import { makePsString } from "./accent-and-ps-utils";
|
||||||
import { inflectYey } from "./pashto-inflector";
|
import { inflectYay } from "./pashto-inflector";
|
||||||
import { accentOnNFromEnd, removeAccents } from "./accent-helpers";
|
import { accentOnNFromEnd, removeAccents } from "./accent-helpers";
|
||||||
import { mapInflections } from "./fp-ps";
|
import { mapInflections } from "./fp-ps";
|
||||||
import { pashtoConsonants } from "./pashto-consonants";
|
import { pashtoConsonants } from "./pashto-consonants";
|
||||||
|
@ -55,7 +55,7 @@ const dummyEntry: T.DictionaryEntry = {
|
||||||
|
|
||||||
const aayTail = [
|
const aayTail = [
|
||||||
{ p: "ای", f: "aay" },
|
{ p: "ای", f: "aay" },
|
||||||
{ p: "ی", f: "ey" },
|
{ p: "ی", f: "ay" },
|
||||||
];
|
];
|
||||||
|
|
||||||
export function conjugateVerb(
|
export function conjugateVerb(
|
||||||
|
@ -508,14 +508,14 @@ function makeParticipleContent(info: T.NonComboVerbInfo): T.ParticipleContent {
|
||||||
: info.objComplement.entry,
|
: info.objComplement.entry,
|
||||||
stativeAux[transitivity].participle.past as T.UnisexInflections
|
stativeAux[transitivity].participle.past as T.UnisexInflections
|
||||||
)
|
)
|
||||||
: inflectYey(noPersInfs(info.participle.past));
|
: inflectYay(noPersInfs(info.participle.past));
|
||||||
const present =
|
const present =
|
||||||
"complement" in info && spaceInForm(info.root.imperfective)
|
"complement" in info && spaceInForm(info.root.imperfective)
|
||||||
? concatInflections(
|
? concatInflections(
|
||||||
info.complement,
|
info.complement,
|
||||||
stativeAux[transitivity].participle.present as T.UnisexInflections
|
stativeAux[transitivity].participle.present as T.UnisexInflections
|
||||||
)
|
)
|
||||||
: inflectYey(noPersInfs(info.participle.present));
|
: inflectYay(noPersInfs(info.participle.present));
|
||||||
return {
|
return {
|
||||||
present, // PRESENT PARTICIPLE inflected
|
present, // PRESENT PARTICIPLE inflected
|
||||||
past, // PAST PARTICIPLE inflected
|
past, // PAST PARTICIPLE inflected
|
||||||
|
@ -537,7 +537,7 @@ function makePerfectContent(info: T.NonComboVerbInfo): T.PerfectContent {
|
||||||
stativeAux[transitivity].participle.past,
|
stativeAux[transitivity].participle.past,
|
||||||
]
|
]
|
||||||
: // for regular compounds
|
: // for regular compounds
|
||||||
[inflectYey(noPersInfs(info.participle.past))];
|
[inflectYay(noPersInfs(info.participle.past))];
|
||||||
|
|
||||||
const halfPerfect = addToForm([...pastPart], emptyVerbBlock);
|
const halfPerfect = addToForm([...pastPart], emptyVerbBlock);
|
||||||
const past = addToForm([...pastPart, " "], equativeEndings.past.short);
|
const past = addToForm([...pastPart, " "], equativeEndings.past.short);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,7 @@ import {
|
||||||
getShort,
|
getShort,
|
||||||
} from "./p-text-helpers";
|
} from "./p-text-helpers";
|
||||||
import { makePsString, removeFVarients } from "./accent-and-ps-utils";
|
import { makePsString, removeFVarients } from "./accent-and-ps-utils";
|
||||||
import { inflectYey } from "./pashto-inflector";
|
import { inflectYay } from "./pashto-inflector";
|
||||||
import {
|
import {
|
||||||
accentOnFront,
|
accentOnFront,
|
||||||
accentOnNFromEnd,
|
accentOnNFromEnd,
|
||||||
|
@ -49,7 +49,7 @@ import {
|
||||||
import * as T from "../../types";
|
import * as T from "../../types";
|
||||||
import { isTlulVerb } from "./type-predicates";
|
import { isTlulVerb } from "./type-predicates";
|
||||||
|
|
||||||
const eyEndingUnaccented: T.PsString = { p: "ی", f: "ey" };
|
const ayEndingUnaccented: T.PsString = { p: "ی", f: "ay" };
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiles the base information (roots, stems etc.) needed in order
|
* Compiles the base information (roots, stems etc.) needed in order
|
||||||
|
@ -217,7 +217,7 @@ function getGenerativeStativeCompoundVerbInfo(
|
||||||
participle: {
|
participle: {
|
||||||
present: auxVerb.info.participle.present,
|
present: auxVerb.info.participle.present,
|
||||||
past: chooseParticipleInflection(
|
past: chooseParticipleInflection(
|
||||||
inflectYey(
|
inflectYay(
|
||||||
"mascSing" in auxVerb.info.participle.past
|
"mascSing" in auxVerb.info.participle.past
|
||||||
? // purely for type saftey, will not have mascSing
|
? // purely for type saftey, will not have mascSing
|
||||||
// in a non stative compound verb
|
// in a non stative compound verb
|
||||||
|
@ -315,7 +315,7 @@ function getDynamicCompoundInfo(
|
||||||
participle: {
|
participle: {
|
||||||
present: auxVerbInfo.participle.present,
|
present: auxVerbInfo.participle.present,
|
||||||
past: chooseParticipleInflection(
|
past: chooseParticipleInflection(
|
||||||
inflectYey(
|
inflectYay(
|
||||||
"mascSing" in auxVerbInfo.participle.past
|
"mascSing" in auxVerbInfo.participle.past
|
||||||
? // purely for type saftey, will not have mascSing
|
? // purely for type saftey, will not have mascSing
|
||||||
// in a non stative compound verb
|
// in a non stative compound verb
|
||||||
|
@ -944,7 +944,7 @@ function getParticiple(
|
||||||
removeAccentsFull(comp),
|
removeAccentsFull(comp),
|
||||||
" ",
|
" ",
|
||||||
compInflects
|
compInflects
|
||||||
? unisexInfToObjectMatrix(inflectYey(aux) as T.UnisexInflections)
|
? unisexInfToObjectMatrix(inflectYay(aux) as T.UnisexInflections)
|
||||||
: aux
|
: aux
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -962,12 +962,12 @@ function getParticiple(
|
||||||
short: accentPastPart(
|
short: accentPastPart(
|
||||||
concatPsString(
|
concatPsString(
|
||||||
ensureShortWurShwaShift(shortParticipleRoot),
|
ensureShortWurShwaShift(shortParticipleRoot),
|
||||||
eyEndingUnaccented
|
ayEndingUnaccented
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
long: accentPastPart(concatPsString(infinitive, eyEndingUnaccented)),
|
long: accentPastPart(concatPsString(infinitive, ayEndingUnaccented)),
|
||||||
}
|
}
|
||||||
: accentPastPart(concatPsString(infinitive, eyEndingUnaccented));
|
: accentPastPart(concatPsString(infinitive, ayEndingUnaccented));
|
||||||
|
|
||||||
// TODO: make this into a rule?
|
// TODO: make this into a rule?
|
||||||
const shortImperfectiveRoot =
|
const shortImperfectiveRoot =
|
||||||
|
@ -1334,7 +1334,7 @@ export function getPassiveRootsAndStems(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const passiveRootTail: T.PsString = { p: "ی", f: "ey" };
|
const passiveRootTail: T.PsString = { p: "ی", f: "ay" };
|
||||||
|
|
||||||
function getPassiveStem(
|
function getPassiveStem(
|
||||||
root: T.VerbRootSet,
|
root: T.VerbRootSet,
|
||||||
|
@ -1444,8 +1444,8 @@ function getPassiveRootPerfectiveSplit(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const abilityTail = { p: "ی", f: "ey" };
|
const abilityTail = { p: "ی", f: "ay" };
|
||||||
const abilityTailAccented = { p: "ی", f: "éy" };
|
const abilityTailAccented = { p: "ی", f: "áy" };
|
||||||
|
|
||||||
function getAbilityRoots(
|
function getAbilityRoots(
|
||||||
root: T.VerbRootSet,
|
root: T.VerbRootSet,
|
||||||
|
|
|
@ -659,8 +659,8 @@ export type FullEntry = VerbEntry | DictionaryEntry;
|
||||||
export enum InflectionPattern {
|
export enum InflectionPattern {
|
||||||
None = 0,
|
None = 0,
|
||||||
Basic = 1,
|
Basic = 1,
|
||||||
UnstressedEy = 2,
|
UnstressedAy = 2,
|
||||||
StressedEy = 3,
|
StressedAy = 3,
|
||||||
Pashtun = 4,
|
Pashtun = 4,
|
||||||
Squish = 5,
|
Squish = 5,
|
||||||
FemInanEe = 6,
|
FemInanEe = 6,
|
||||||
|
|
Loading…
Reference in New Issue