pashto-inflector/src/lib/pashto-inflector.test.ts

1113 lines
33 KiB
TypeScript
Raw Normal View History

2021-03-09 12:39:13 +00:00
/**
* Copyright (c) 2021 lingdocs.com
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
// TODO: See if there are animate feminine words ending in ي and test
import {
inflectRegularYeyUnisex,
inflectWord,
} from "./pashto-inflector";
import * as T from "../types";
const adjectives: Array<{
in: T.DictionaryEntry,
2021-09-07 11:49:57 +00:00
out: T.InflectorOutput,
2021-03-09 12:39:13 +00:00
}> = [
// irregular adj.
{
in: {
ts: 1527815451,
p: "زوړ",
f: "zoR",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "old",
c: "adj. irreg.",
i: 6264,
infap: "زاړه",
infaf: "zaaRu",
infbp: "زړ",
infbf: "zaR",
},
out: {
2021-09-07 11:49:57 +00:00
inflections:{
masc: [
[{p: "زوړ", f: "zoR"}],
[{p: "زاړه", f: "zaaRu"}],
[{p: "زړو", f: "zaRo"}],
],
fem: [
[{p: "زړه", f: "zaRa"}],
[{p: "زړې", f: "zaRe"}],
[{p: "زړو", f: "zaRo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// regular adjective ending in ی
{
in: {
ts: 1527815306,
p: "ستړی",
f: "stúRey",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "tired",
c: "adj.",
i: 6564,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "ستړی", f: "stúRey"}],
[{p: "ستړي", f: "stúRee"}],
[{p: "ستړیو", f: "stúRiyo"}, {p: "ستړو", f: "stúRo"}],
],
fem: [
[{p: "ستړې", f: "stúRe"}],
[{p: "ستړې", f: "stúRe"}],
[{p: "ستړو", f: "stúRo"}],
],
}
2021-03-09 12:39:13 +00:00
},
},
// regular adjective ending in ی with stress on the end
{
in: {
ts: 1527813636,
p: "وروستی",
f: "wroostéy",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "last, latest, recent",
c: "adj.",
i: 12026,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "وروستی", f: "wroostéy"}],
[{p: "وروستي", f: "wroostée"}],
[{p: "وروستیو", f: "wroostiyo"}, {p: "وروستو", f: "wroostó"}],
],
fem: [
[{p: "وروستۍ", f: "wroostúy"}],
[{p: "وروستۍ", f: "wroostúy"}],
[{p: "وروستیو", f: "wroostúyo"}, {p: "وروستو", f: "wroostó"}],
],
}
2021-03-09 12:39:13 +00:00
},
},
// regular adjective ending in a consonant
{
in: {
ts: 1527813498,
p: "سپک",
f: "spuk",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "light; dishonorable, not respectable",
c: "adj.",
i: 6502,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "سپک", f: "spuk"}],
[{p: "سپک", f: "spuk"}],
[{p: "سپکو", f: "spuko"}],
],
fem: [
[{p: "سپکه", f: "spuka"}],
[{p: "سپکې", f: "spuke"}],
[{p: "سپکو", f: "spuko"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
{
in: {
ts: 1527812862,
p: "لوی",
f: "looy",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "big, great, large",
c: "adj.",
i: 9945,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "لوی", f: "looy"}],
[{p: "لوی", f: "looy"}],
[{p: "لویو", f: "looyo"}],
],
fem: [
[{p: "لویه", f: "looya"}],
[{p: "لویې", f: "looye"}],
[{p: "لویو", f: "looyo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
{
in: {
ts: 1527811469,
p: "پوه",
f: "poh",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "understanding, having understood; intelligent, quick, wise, clever; expert",
c: "adj.",
i: 2430,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "پوه", f: "poh"}],
[{p: "پوه", f: "poh"}],
[{p: "پوهو", f: "poho"}],
],
fem: [
[{p: "پوهه", f: "poha"}],
[{p: "پوهې", f: "pohe"}],
[{p: "پوهو", f: "poho"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
2021-08-31 09:34:18 +00:00
// adjective ending in u
{
in: {
ts: 1527812791,
p: "ویده",
f: "weedú",
g: "weedu",
e: "asleep",
c: "adj.",
i: 1,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "ویده", f: "weedú"}],
[{p: "ویده", f: "weedú"}],
[{p: "ویدو", f: "weedó"}],
],
fem: [
[{p: "ویده", f: "weedá"}],
[{p: "ویدې", f: "weedé"}],
[{p: "ویدو", f: "weedó"}],
],
2021-09-22 17:21:59 +00:00
},
},
},
2021-10-09 13:47:46 +00:00
// numbers should inflect just like adjectives
{
in: {"ts":1588688995113,"i":8176,"p":"شپږ","f":"shpuG","g":"shpug","e":"six","c":"num."},
out: {
inflections: {
masc: [
[{ p: "شپږ", f: "shpuG" }],
[{ p: "شپږ", f: "shpuG" }],
[{ p: "شپږو", f: "shpuGo" }],
],
fem: [
[{ p: "شپږه", f: "shpuGa" }],
[{ p: "شپږې", f: "shpuGe" }],
[{ p: "شپږو", f: "shpuGo" }],
],
},
},
},
2021-09-22 17:21:59 +00:00
// without accents
{
in: {"ts":1527812796,"i":8574,"p":"ښه","f":"xu","g":"xu","e":"good","c":"adj."},
out: {
inflections: {
masc: [
[{ p: "ښه", f: "xu" }],
[{ p: "ښه", f: "xu" }],
[{ p: "ښو", f: "xo" }],
],
fem: [
[{ p: "ښه", f: "xa" }],
[{ p: "ښې", f: "xe" }],
[{ p: "ښو", f: "xo" }],
],
2021-09-07 11:49:57 +00:00
},
2021-08-31 09:34:18 +00:00
},
},
2021-03-09 12:39:13 +00:00
// adjective non-inflecting
{
in: {
ts: 1527812798,
p: "خفه",
f: "khufa",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "sad, upset, angry; choked, suffocated",
c: "adj.",
i: 4631,
},
out: false,
},
{
in: {
ts: 1527814727,
p: "اجباري",
f: "ijbaaree",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "compulsory, obligatory",
c: "adj.",
i: 167,
},
out: false,
},
2021-05-25 09:47:02 +00:00
// double adjective
{
in: {
ts: 123,
p: "ګډ وډ",
f: "guD wuD",
g: "guDwuD",
e: "mixed up",
c: "adj. doub.",
i: 1,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{ p: "ګډ وډ", f: "guD wuD" }],
[{ p: "ګډ وډ", f: "guD wuD" }],
[{ p: "ګډو وډو", f: "guDo wuDo" }],
],
fem: [
[{ p: "ګډه وډه", f: "guDa wuDa" }],
[{ p: "ګډې وډې", f: "guDe wuDe" }],
[{ p: "ګډو وډو", f: "guDo wuDo" }],
],
},
},
},
2021-03-09 12:39:13 +00:00
];
const nouns: Array<{
in: T.DictionaryEntry,
2021-09-07 11:49:57 +00:00
out: T.InflectorOutput,
2021-03-09 12:39:13 +00:00
}> = [
// ## UNISEX
// Unisex noun irregular
{
in: {
ts: 1527812908,
p: "مېلمه",
f: "melmá",
e: "guest",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
c: "n. m. irreg. unisex",
i: 11244,
infap: "مېلمانه",
infaf: "melmaanu",
infbp: "مېلمن",
infbf: "melman",
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "مېلمه", f: "melmá"}],
[{p: "مېلمانه", f: "melmaanu"}],
[{p: "مېلمنو", f: "melmano"}],
],
fem: [
[{p: "مېلمنه", f: "melmana"}],
[{p: "مېلمنې", f: "melmane"}],
[{p: "مېلمنو", f: "melmano"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Unisex noun ending with ی
{
in: {
ts: 1527814159,
p: "ملګری",
f: "malgúrey",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "friend, companion",
c: "n. m. unisex",
i: 10943,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "ملګری", f: "malgúrey"}],
[{p: "ملګري", f: "malgúree"}],
[{p: "ملګریو", f: "malgúriyo"}, {p: "ملګرو", f: "malgúro"}],
],
fem: [
[{p: "ملګرې", f: "malgúre"}],
[{p: "ملګرې", f: "malgúre"}],
[{p: "ملګرو", f: "malgúro"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Unisex noun ending on ی with emphasis on the end
{
2021-09-08 10:30:23 +00:00
in: {"i":3319,"ts":1527816431,"p":"ترورزی","f":"trorzéy","g":"trorzey","e":"cousin (of paternal aunt)","c":"n. m. unisex","ppp":"ترورزامن","ppf":"trorzaamun"},
2021-03-09 12:39:13 +00:00
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "ترورزی", f: "trorzéy"}],
[{p: "ترورزي", f: "trorzée"}],
[{p: "ترورزیو", f: "trorziyo"}, {p: "ترورزو", f: "trorzó"}],
],
fem: [
[{p: "ترورزۍ", f: "trorzúy"}],
[{p: "ترورزۍ", f: "trorzúy"}],
[{p: "ترورزیو", f: "trorzúyo"}, {p: "ترورزو", f: "trorzó"}],
],
},
2021-09-08 10:30:23 +00:00
plural: {
masc: [
[{ p: "ترورزامن", f: "trorzaamun" }],
[{ p: "ترورزامنو", f: "trorzaamuno" }],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Unisex noun ending with a consanant
{
in: {
ts: 1527820043,
p: "چرګ",
f: "churg",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "rooster, cock; chicken, poultry",
2021-09-07 11:49:57 +00:00
c: "n. m. unisex anim.",
2021-03-09 12:39:13 +00:00
i: 4101,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "چرګ", f: "churg"}],
[{p: "چرګ", f: "churg"}],
[{p: "چرګو", f: "churgo"}],
],
fem: [
[{p: "چرګه", f: "churga"}],
[{p: "چرګې", f: "churge"}],
[{p: "چرګو", f: "churgo"}],
],
},
plural: {
masc: [
[{p: "چرګان", f: "churgáan"}],
[{p: "چرګانو", f: "churgáano"}],
],
fem: [
[{p: "چرګانې", f: "churgáane"}],
[{p: "چرګانو", f: "churgáano"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// ## MASCULINE
// Masculine regular ending in ی
{
in: {
ts: 1527815251,
p: "سړی",
f: "saRey",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "man",
c: "n. m.",
i: 6750,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "سړی", f: "saRey"}],
[{p: "سړي", f: "saRee"}],
[{p: "سړیو", f: "saRiyo"}, {p: "سړو", f: "saRo"}],
],
}
2021-03-09 12:39:13 +00:00
},
},
// Masculine regular ending in ی with emphasis on end
{
in: {
ts: 1527818511,
p: "ترېلی",
f: "treléy",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "pool, reservoir",
c: "n. m.",
i: 2931,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "ترېلی", f: "treléy"}],
[{p: "ترېلي", f: "trelée"}],
[{p: "ترېلیو", f: "treliyo"}, {p: "ترېلو", f: "trelo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Masculine ending in tob
{
in: {
i: 11998,
ts: 1586760783536,
p: "مشرتوب",
f: "mushurtob",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "leadership, authority, presidency",
c: "n. m.",
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "مشرتوب", f: "mushurtob"}],
[{p: "مشرتابه", f: "mushurtaabu"}],
[{p: "مشرتبو", f: "mushurtabo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Masculine irregular
{
2021-09-14 14:25:04 +00:00
in: {"ts":1527813809,"i":11318,"p":"لمونځ","f":"lamoondz","g":"lamoondz","e":"Muslim ritual prayers (namaz, salah, salat)","c":"n. m. irreg.","infap":"لمانځه","infaf":"lamaandzu","infbp":"لمنځ","infbf":"lamandz","ppp":"لمونځونه","ppf":"lamoondzóona"},
2021-03-09 12:39:13 +00:00
out: {
2021-09-07 11:49:57 +00:00
inflections: {
masc: [
[{p: "لمونځ", f: "lamoondz"}],
[{p: "لمانځه", f: "lamaandzu"}],
[{p: "لمنځو", f: "lamandzo"}],
],
},
2021-09-14 14:25:04 +00:00
plural: {
masc: [
[{ p: "لمونځونه", f: "lamoondzóona" }],
[{ p: "لمونځونو", f: "lamoondzóono" }],
],
},
2021-03-09 12:39:13 +00:00
},
},
2021-09-08 10:30:23 +00:00
// Masculine short squish
{
2021-09-14 14:25:04 +00:00
in: {"i":9049,"ts":1527813593,"p":"غر","f":"ghar, ghur","g":"ghar,ghur","e":"mountain","c":"n. m.","infap":"غره","infaf":"ghru","infbp":"غر","infbf":"ghr"},
2021-09-08 10:30:23 +00:00
out: {
inflections: {
masc: [
[{ p: "غر", f: "ghar" }],
[{ p: "غره", f: "ghru" }],
[{ p: "غرو", f: "ghro" }],
],
},
plural: {
masc: [
[{ p: "غرونه", f: "ghróona" }],
[{ p: "غرونو", f: "ghróono" }],
],
},
},
},
// should also do the oona plural with the squish nouns, even if it's animate
{
in: {"i":5465,"ts":1527812802,"p":"خر","f":"khur","g":"khur","e":"donkey","c":"n. m. unisex irreg.","infap":"خره","infaf":"khru","infbp":"خر","infbf":"khr"},
out: {
inflections: {
masc: [
[{ p: "خر", f: "khur" }],
[{ p: "خره", f: "khru" }],
[{ p: "خرو", f: "khro" }],
],
2021-09-14 14:25:04 +00:00
fem: [
[{ p: "خره", f: "khra" }],
[{ p: "خرې", f: "khre" }],
[{ p: "خرو", f: "khro" }],
],
2021-09-08 10:30:23 +00:00
},
plural: {
masc: [
[{ p: "خرونه", f: "khróona" }],
[{ p: "خرونو", f: "khróono" }],
],
},
},
},
// masc plural
{
in: {"i":6063,"ts":1527815739,"p":"دروغ","f":"drogh, darwagh","g":"drogh,darwagh","e":"lie, falsehood","c":"n. m. pl."},
out: {
plural: {
masc: [
[{ p: "دروغ", f: "drogh" }],
[{ p: "دروغو", f: "drogho" }],
],
},
},
},
{
in: {"i":9191,"ts":1527817330,"p":"غنم","f":"ghanúm","g":"ghanum","e":"wheat","c":"n. m. pl."},
out: {
plural: {
masc: [
[{ p: "غنم", f: "ghanúm" }],
[{ p: "غنمو", f: "ghanúmo" }],
],
},
},
},
// fem plural
{
in: {"ts":1527815129,"i":1013,"p":"اوبه","f":"oobú","g":"oobu","e":"water","c":"n. f. pl."},
out: {
plural: {
fem: [
[{ p: "اوبه", f: "oobú" }],
[{ p: "اوبو", f: "oobó" }],
],
},
},
},
{
in: {"ts":1527815008,"i":8421,"p":"شودې","f":"shoodé","g":"shoode","e":"milk","c":"n. f. pl."},
out: {
plural: {
fem: [
[{ p: "شودې", f: "shoodé" }],
[{ p: "شودو", f: "shoodó" }],
]
}
}
},
{
in: {"ts":1527815008,"i":8421,"p":"شودې","f":"shoode","g":"shoode","e":"milk","c":"n. f. pl."},
out: {
plural: {
fem: [
[{ p: "شودې", f: "shoode" }],
[{ p: "شودو", f: "shoodo" }],
]
}
}
},
2021-03-09 12:39:13 +00:00
// Masculine non-inflecting
{
in: {
ts: 1527812817,
p: "کتاب",
f: "kitaab",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "book",
c: "n. m.",
i: 8640,
},
2021-09-07 11:49:57 +00:00
out: {
plural: {
masc: [
[{ p: "کتابونه", f: "kitaabóona" }],
[{ p: "کتابونو", f: "kitaabóono" }],
],
},
},
2021-03-09 12:39:13 +00:00
},
2021-09-08 10:30:23 +00:00
{
2021-09-14 14:25:04 +00:00
in: {"ts":1527815394,"i":13991,"p":"واده","f":"waadú","g":"waadu","e":"wedding, marriage","c":"n. m.","ppp":"ودونه","ppf":"wadóona"},
2021-09-08 10:30:23 +00:00
out: {
plural: {
masc: [
2021-09-14 14:25:04 +00:00
[{ p: "ودونه", f: "wadóona" }],
[{ p: "ودونو", f: "wadóono" }],
2021-09-08 10:30:23 +00:00
],
},
},
},
{
in: {"ts":1527817768,"i":9791,"p":"کارګه","f":"kaargu","g":"kaargu","e":"raven, crow","c":"n. m. anim."},
out: {
plural: {
masc: [
[{ p: "کارګان", f: "kaargáan" }],
[{ p: "کارګانو", f: "kaargáano" }],
],
},
},
},
2021-09-07 12:02:01 +00:00
{
in: {"i":11352,"ts":1527813995,"p":"لو","f":"law, lau","g":"law,lau","e":"harvesting, reaping, hay-making; mowed, reaped, harvested","c":"n. m."},
out: {
plural: {
masc: [
[{ p: "لوونه", f: "lawóona" }],
[{ p: "لوونو", f: "lawóono" }],
],
},
},
},
2021-03-09 12:39:13 +00:00
// ## FEMININE
// Feminine regular ending in ه
{
in: {
ts: 1527812797,
p: "ښځه",
f: "xudza",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "woman, wife",
c: "n. f.",
i: 7444,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "ښځه", f: "xudza"}],
[{p: "ښځې", f: "xudze"}],
[{p: "ښځو", f: "xudzo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
{
in: {
ts: 1527821380,
p: "اره",
f: "ará",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "saw (the tool)",
c: "n. f.",
i: 365,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "اره", f: "ará"}],
2021-09-14 14:25:04 +00:00
[{p: "ارې", f: "aré"}],
[{p: "ارو", f: "aró"}],
2021-09-07 11:49:57 +00:00
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine regular ending in ع - a'
{
in: {
ts: 1527820693,
p: "مرجع",
f: "marja'",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "reference, authority, body, place to go (for help, shelter, etc.)",
c: "n. f.",
i: 10661,
app: "مراجع",
2021-09-14 14:25:04 +00:00
apf: "maraají'",
2021-03-09 12:39:13 +00:00
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "مرجع", f: "marja'"}],
[{p: "مرجعې", f: "marje"}],
[{p: "مرجعو", f: "marjo"}],
],
},
2021-09-14 14:25:04 +00:00
arabicPlural: {
fem: [
[{ p: "مراجع", f: "maraají'" }],
[{ p: "مراجو", f: "maraajó" }],
],
},
2021-03-09 12:39:13 +00:00
},
},
{
in: {
ts: 1527820212,
p: "منبع",
f: "manbá",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "source, origin, resource, cause",
c: "n. f.",
i: 11201,
app: "منابع",
apf: "manaabí",
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "منبع", f: "manbá"}],
2021-09-14 14:25:04 +00:00
[{p: "منبعې", f: "manbé"}],
[{p: "منبعو", f: "manbó"}],
],
},
arabicPlural: {
fem: [
[{ p: "منابع", f: "manaabí" }],
[{ p: "منابو", f: "manaabó" }],
],
},
},
},
{
in: {"ts":1527823093,"i":13207,"p":"نبي","f":"nabee","g":"nabee","e":"prophet","c":"n. m. anim.","app":"انبیا","apf":"ambiyáa"},
out: {
arabicPlural: {
masc: [
[{ p: "انبیا", f: "ambiyáa" }],
[{ p: "انبیاوو", f: "ambiyáawo" }],
],
},
}
},
{
in: {"ts":1527819536,"i":3063,"p":"تبع","f":"taba'","g":"taba","e":"follower, adherent, supporter, subject, national","c":"n. m. unisex anim.","app":"اتباع","apf":"atbaa"},
out: {
arabicPlural: {
masc: [
[{ p: "اتباع", f: "atbaa" }],
[{ p: "اتباعوو", f: "atbaawo" }],
],
},
},
},
{
in: {"ts":1527816113,"i":3072,"p":"تبلیغ","f":"tableegh","g":"tableegh","e":"propaganda; preaching, evangelism","c":"n. m.","app":"تبلیغات","apf":"tableegháat"},
out: {
plural: {
masc: [
[{ p: "تبلیغونه", f: "tableeghóona" }],
[{ p: "تبلیغونو", f: "tableeghóono" }],
],
},
arabicPlural: {
masc: [
[{ p: "تبلیغات", f: "tableegháat" }],
[{ p: "تبلیغاتو", f: "tableegháato" }],
],
},
},
},
{
in: {"ts":1527815921,"i":3844,"p":"توقع","f":"tawaqqU","g":"tawakkU","e":"expectation, hope, anticipation","c":"n. f.","app":"توقعات","apf":"tawaqqUaat"},
out: {
arabicPlural: {
masc: [
[{ p: "توقعات", f: "tawaqqUaat" }],
[{ p: "توقعاتو", f: "tawaqqUaato" }],
],
},
},
},
{
in: {"ts":1527815820,"i":5177,"p":"حادثه","f":"haadisá","g":"haadisa","e":"accident, event","c":"n. f.","app":"حوادث, حادثات","apf":"hawaadis, haadisaat"},
out: {
inflections: {
fem: [
[{ p: "حادثه", f: "haadisá" }],
[{ p: "حادثې", f: "haadisé" }],
[{ p: "حادثو", f: "haadisó" }],
],
},
arabicPlural: {
masc: [
[{ p: "حوادث", f: "hawaadis"}, { p: "حادثات", f: "haadisaat" }],
[{ p: "حوادثو", f: "hawaadiso"}, { p: "حادثاتو", f: "haadisaato" }],
],
},
},
},
{
in: {"ts":1527815329,"i":3097,"p":"تجربه","f":"tajrabá, tajribá","g":"tajraba,tajriba","e":"experience","c":"n. f.","app":"تجارب","apf":"tajaarib"},
out: {
inflections: {
fem: [
[{ p: "تجربه", f: "tajrabá" }],
[{ p: "تجربې", f: "tajrabé" }],
[{ p: "تجربو", f: "tajrabó" }],
],
},
arabicPlural: {
masc: [
[{ p: "تجارب", f: "tajaarib"}],
[{ p: "تجاربو", f: "tajaaribo"}],
],
},
},
},
{
in: {"ts":1527814069,"i":5194,"p":"حال","f":"haal","g":"haal","e":"state, condition, circumstance","c":"n. m.","app":"احوال","apf":"ahwáal"},
out: {
plural: {
masc: [
[{ p: "حالونه", f: "haalóona" }],
[{ p: "حالونو", f: "haalóono" }],
],
},
arabicPlural: {
masc: [
[{ p: "احوال", f: "ahwáal" }],
[{ p: "احوالو", f: "ahwáalo" }],
],
},
},
},
{
in: {"ts":1527819536,"i":3063,"p":"تبع","f":"taba'","g":"taba","e":"follower, adherent, supporter, subject, national","c":"n. m. unisex anim.","app":"اتباع","apf":"atbáa'"},
out: {
arabicPlural: {
masc: [
[{ p: "اتباع", f: "atbáa'" }],
[{ p: "اتباعوو", f: "atbáawo" }],
2021-09-07 11:49:57 +00:00
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine regular ending in ح - a
{
in: {
ts: 1527815506,
p: "ذبح",
f: "zabha",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "slaughter, killing, butchering",
c: "n. f.",
i: 5813,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "ذبح", f: "zabha"}],
[{p: "ذبحې", f: "zabhe"}],
[{p: "ذبحو", f: "zabho"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine inanimate regular with missing ه
{
in: {
ts: 1527814150,
p: "لار",
f: "laar",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "road, way, path",
c: "n. f.",
i: 9593,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "لار", f: "laar"}],
[{p: "لارې", f: "laare"}],
[{p: "لارو", f: "laaro"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine animate ending in a consonant
2021-09-07 11:49:57 +00:00
// TODO: ALLOW FOR MULTIPLE PLURAL POSSIBILITIES میندې, میېنې etc.
2021-03-09 12:39:13 +00:00
{
in: {
ts: 1527812928,
p: "مور",
f: "mor",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "mother, mom",
c: "n. f. anim.",
2021-09-07 11:49:57 +00:00
ppp: "میندې",
ppf: "meynde",
2021-03-09 12:39:13 +00:00
i: 11113,
},
2021-09-07 11:49:57 +00:00
out: {
plural: {
fem: [
[{ p: "میندې", f: "meynde" }],
[{ p: "میندو", f: "meyndo" }],
],
},
},
2021-03-09 12:39:13 +00:00
},
// Feminine regular inanimate ending in ي
{
in: {
ts: 1527811877,
p: "دوستي",
f: "dostee",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "friendship",
c: "n. f.",
i: 5503,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "دوستي", f: "dostee"}],
[{p: "دوستۍ", f: "dostuy"}],
[{p: "دوستیو", f: "dostuyo"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine regular ending in ۍ
{
in: {
ts: 1527814203,
p: "کرسۍ",
f: "kUrsuy",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "chair, seat, stool",
c: "n. f.",
i: 8718,
},
out: {
2021-09-07 11:49:57 +00:00
inflections: {
fem: [
[{p: "کرسۍ", f: "kUrsuy"}],
[{p: "کرسۍ", f: "kUrsuy"}],
[{p: "کرسیو", f: "kUrsuyo"}, { p: "کرسو", f: "kUrso"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
// Feminine regular ending in ا
{
in: {
ts: 1527812456,
p: "اړتیا",
2021-09-07 11:49:57 +00:00
f: "aRtiyáa, aRtyáa",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "need, necessity",
c: "n. f.",
i: 376,
},
out: {
2021-09-07 11:49:57 +00:00
plural: {
fem: [
[{p: "اړتیاوې", f: "aRtiyáawe"}, { p: "اړتیاګانې", f:"aRtiyaagáane"}],
[{p: "اړتیاوو", f: "aRtiyáawo"}, { p: "اړتیاګانو", f:"aRtiyaagáano"}],
],
},
2021-03-09 12:39:13 +00:00
},
},
2021-09-07 12:02:01 +00:00
// Feminine regular ending in و
{
in: {"i":2899,"ts":1527815163,"p":"پیشو","f":"peeshó","g":"peesho","e":"cat","c":"n. f. anim."},
out: {
plural: {
fem: [
[{ p: "پیشووې", f: "peeshówe" }, { p: "پیشوګانې", f: "peeshogáane" }],
[{ p: "پیشووو", f: "peeshówo" }, { p: "پیشوګانو", f: "peeshogáano" }],
],
},
},
},
2021-03-09 12:39:13 +00:00
// Feminine regular ending in اع
{
in: {
ts: 1527821388,
p: "وداع",
f: "widáa'",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "farewell, goodbye",
c: "n. f.",
i: 12205,
},
2021-09-14 14:25:04 +00:00
out: {
plural: {
fem: [
[{p: "وداع وې", f: "widáawe"}, {p: "وداع ګانې", f: "widaagáane"}],
[{p: "وداع وو", f: "widáawo"}, {p: "وداع ګانو", f: "widaagáano"}],
],
},
},
2021-03-09 12:39:13 +00:00
},
2021-09-16 20:41:50 +00:00
// 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."},
out: {
inflections: {
masc: [
[{ p: "شی", f: "shey" }],
[{ p: "شي", f: "shee" }],
[{ p: "شیو", f: "shiyo" }, { p: "شو", f: "sho" }],
],
},
plural: {
masc: [
[{ p: "شیان", f: "sheyáan" }, { p: "شیونه", f: "sheyóona" }],
[{ p: "شیانو", f: "sheyáano" }, { p: "شیونو", f: "sheyóono" }],
],
},
},
},
2021-09-07 12:02:01 +00:00
// TODO: Plaar plaroona paaraan - wrooNa
2021-03-09 12:39:13 +00:00
// Word with no inflections
{
in: {
ts: 1527815402,
p: "وړ",
f: "waR",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "worthy of, deserving, -able",
c: "suff. / adj.",
i: 12045,
noInf: true,
},
out: false,
},
];
const others: T.DictionaryEntry[] = [
{
ts: 1527812612,
p: "ګنډل",
f: "ganDul",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "to sew, mend, make, knit",
c: "v. trans.",
i: 9448,
},
{
ts: 1527812457,
p: "اصلاً",
f: "aslan",
2021-03-16 13:35:41 +00:00
g: "",
2021-03-09 12:39:13 +00:00
e: "actually",
c: "adv.",
i: 550,
},
];
adjectives.forEach((word) => {
test(`${word.in.p} should inflect properly`, () => {
expect(inflectWord(word.in)).toEqual(word.out);
});
});
nouns.forEach((word) => {
2021-09-14 14:25:04 +00:00
// if (word.in.p !== "نبي") return;
2021-03-09 12:39:13 +00:00
test(`${word.in.p} should inflect properly`, () => {
expect(inflectWord(word.in)).toEqual(word.out);
});
});
others.forEach((word) => {
test(`${word.p} should return false`, () => {
expect(inflectWord(word)).toEqual(false);
});
});
test(`inflectRegularYeyUnisex should work`, () => {
expect(inflectRegularYeyUnisex("لیدونکی", "leedóonkey")).toEqual({
masc: [
[{p: "لیدونکی", f: "leedóonkey" }],
[{p: "لیدونکي", f: "leedóonkee" }],
[{p: "لیدونکیو", f: "leedóonkiyo" }, {p: "لیدونکو", f: "leedóonko"}],
],
fem: [
[{p: "لیدونکې", f: "leedóonke" }],
[{p: "لیدونکې", f: "leedóonke" }],
[{p: "لیدونکو", f: "leedóonko"}],
],
});
2021-09-14 14:25:04 +00:00
});