2023-01-13 11:09:11 +00:00
|
|
|
import {
|
2023-07-27 18:53:03 +00:00
|
|
|
Types as T,
|
|
|
|
makeNounSelection,
|
|
|
|
makeAdjectiveSelection,
|
|
|
|
randFromArray,
|
2023-01-13 11:09:11 +00:00
|
|
|
} from "@lingdocs/ps-react";
|
2023-01-18 18:34:39 +00:00
|
|
|
import { makePool } from "../pool";
|
|
|
|
import { wordQuery } from "../../words/words";
|
2023-01-13 11:09:11 +00:00
|
|
|
|
|
|
|
const nouns = wordQuery("nouns", [
|
2023-07-27 18:53:03 +00:00
|
|
|
"saRay",
|
|
|
|
"xudza",
|
|
|
|
"maashoom",
|
|
|
|
"Ustaaz",
|
|
|
|
"puxtoon",
|
|
|
|
"DaakTar",
|
|
|
|
"halik",
|
|
|
|
"tajriba",
|
|
|
|
"melma",
|
|
|
|
"khabura",
|
|
|
|
"kitaab",
|
|
|
|
"oobu",
|
|
|
|
"korba",
|
|
|
|
"shpoon",
|
|
|
|
"gaawanDay",
|
|
|
|
"lmasay",
|
|
|
|
"lobghaaRay",
|
|
|
|
"sandurghaaRay",
|
|
|
|
"malguray",
|
|
|
|
"shpoonkay",
|
|
|
|
"khalk",
|
|
|
|
"ghul",
|
|
|
|
"khur",
|
2023-01-13 11:09:11 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
const adjectives = wordQuery("adjectives", [
|
2023-07-27 18:53:03 +00:00
|
|
|
"muR",
|
|
|
|
"jzwunday",
|
|
|
|
"sheen",
|
|
|
|
"soor",
|
|
|
|
"rixtoonay",
|
|
|
|
"pakhwaanay",
|
|
|
|
"stuRay",
|
|
|
|
"ooGd",
|
|
|
|
"ghuT",
|
|
|
|
"xu",
|
|
|
|
"khufa",
|
|
|
|
"takRa",
|
|
|
|
"puT",
|
|
|
|
"tuGay",
|
|
|
|
"koochnay",
|
|
|
|
"wroostay",
|
|
|
|
"praday",
|
|
|
|
"treew",
|
|
|
|
"zoR",
|
|
|
|
"moR",
|
|
|
|
"treekh",
|
|
|
|
"oom",
|
|
|
|
"khoG",
|
|
|
|
"droond",
|
|
|
|
"loomRay",
|
|
|
|
"Roond",
|
|
|
|
"prot",
|
|
|
|
"soR",
|
|
|
|
"post",
|
|
|
|
"pokh",
|
|
|
|
"rooN",
|
|
|
|
"woR",
|
|
|
|
"tod",
|
|
|
|
"khpor",
|
|
|
|
"kooN",
|
|
|
|
"koG",
|
|
|
|
"zeeG",
|
|
|
|
"naast",
|
2023-01-13 11:09:11 +00:00
|
|
|
]);
|
|
|
|
|
2023-07-27 18:53:03 +00:00
|
|
|
export function makeNPAdjGenerator(
|
|
|
|
pluralsLevel: "none" | "low" | "high"
|
|
|
|
): () => T.NPSelection {
|
|
|
|
const nounPool = makePool(nouns);
|
|
|
|
const adjPool = makePool(adjectives);
|
2023-01-13 11:09:11 +00:00
|
|
|
|
2023-07-27 18:53:03 +00:00
|
|
|
return () => {
|
|
|
|
const ns = makeNounSelection(nounPool(), undefined);
|
|
|
|
const selection: T.NounSelection = {
|
|
|
|
...ns,
|
|
|
|
adjectives: [makeAdjectiveSelection(adjPool())],
|
|
|
|
...(ns.numberCanChange && pluralsLevel !== "none"
|
|
|
|
? {
|
|
|
|
number: randFromArray(
|
|
|
|
pluralsLevel === "high"
|
|
|
|
? ["singular", "plural", "plural", "plural", "singular"]
|
|
|
|
: ["singular", "plural", "singular"]
|
|
|
|
),
|
|
|
|
}
|
|
|
|
: {}),
|
|
|
|
...(ns.genderCanChange
|
|
|
|
? {
|
|
|
|
gender: randFromArray(["masc", "fem", "fem", "fem", "masc"]),
|
|
|
|
}
|
|
|
|
: {}),
|
2023-01-13 11:09:11 +00:00
|
|
|
};
|
2023-07-27 18:53:03 +00:00
|
|
|
return {
|
|
|
|
type: "NP",
|
|
|
|
selection,
|
|
|
|
};
|
|
|
|
};
|
2023-01-13 11:09:11 +00:00
|
|
|
}
|