not fully checked get modals going for passive - is this ok? doesn't change according to aspect and also don't have this for dynamic compounds for some reason

This commit is contained in:
lingdocs 2022-03-31 18:09:17 +05:00
parent 3964ae70f2
commit aa9e2bdb2f
4 changed files with 25 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "1.6.3", "version": "1.6.4",
"author": "lingdocs.com", "author": "lingdocs.com",
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
"homepage": "https://verbs.lingdocs.com", "homepage": "https://verbs.lingdocs.com",

View File

@ -197,6 +197,7 @@ function ConjugationViewer({ entry, complement, textOptions, showOnly, highlight
return undefined; return undefined;
} }
})(); })();
console.log(conjugation);
if (conjugation === undefined) { if (conjugation === undefined) {
// don't show the conjugation viewer if the verb can't be conjugated // don't show the conjugation viewer if the verb can't be conjugated
return null; return null;

View File

@ -179,12 +179,14 @@ function conjugateDynamicCompound(info: T.DynamicCompoundVerbInfo): T.VerbConjug
const future = addToForm([baParticle, " "], nonImperative); const future = addToForm([baParticle, " "], nonImperative);
const past = addToForm([complement, " "], passive[aspect].past); const past = addToForm([complement, " "], passive[aspect].past);
const habitualPast = addToForm([baParticle, " "], past); const habitualPast = addToForm([baParticle, " "], past);
const modal = makePassiveModalSection([complement, " "], stativeAux.intransitive.imperfective.modal);
return { return {
nonImperative, nonImperative,
future, future,
past, past,
habitualPast, habitualPast,
}; modal,
}
} }
return { return {
info, info,
@ -450,11 +452,15 @@ function makePassiveContent(info: T.NonComboVerbInfo): {
stativeAux.intransitive[aspect].past, stativeAux.intransitive[aspect].past,
); );
const habitualPast = addToForm([baParticle, " "], past); const habitualPast = addToForm([baParticle, " "], past);
const modal = makePassiveModalSection([
noPersInfs(info.root.imperfective).long, " ",
], stativeAux.intransitive.imperfective.modal);
return { return {
nonImperative, nonImperative,
future, future,
past, past,
habitualPast, habitualPast,
modal,
}; };
} }
const root = noPersInfs(info.root[aspect]).long; const root = noPersInfs(info.root[aspect]).long;
@ -463,11 +469,14 @@ function makePassiveContent(info: T.NonComboVerbInfo): {
const future = addToForm([baParticle, " "], nonImperative); const future = addToForm([baParticle, " "], nonImperative);
const past = addToForm([root, " "], aux.past); const past = addToForm([root, " "], aux.past);
const habitualPast = addToForm([baParticle, " "], past); const habitualPast = addToForm([baParticle, " "], past);
const auxModal = aux.modal;
const modal = makePassiveModalSection([noPersInfs(info.root.imperfective).long, " "], auxModal);
return { return {
nonImperative, // ROOT LONG + kedulStat[aspect].nonImperative nonImperative, // ROOT LONG + kedulStat[aspect].nonImperative
future, // به ba + ROOT LONG + this.nonImperative future, // به ba + ROOT LONG + this.nonImperative
past, // ROOT LONG + kedulStat[aspect].past past, // ROOT LONG + kedulStat[aspect].past
habitualPast, habitualPast,
modal,
}; };
} }
const simpleVerbParticiple = { const simpleVerbParticiple = {
@ -488,6 +497,16 @@ function makePassiveContent(info: T.NonComboVerbInfo): {
}; };
} }
function makePassiveModalSection(base: Array<" " | T.SingleOrLengthOpts<T.PsString> | T.SingleOrLengthOpts<T.UnisexInflections> | T.SingleOrLengthOpts<T.PsString>[] | T.SingleOrLengthOpts<T.PsString[]> | T.OptionalPersonInflections<T.PsString> | T.VerbBlock>, auxModal: T.ModalContent): T.ModalContent {
return {
nonImperative: addToForm(base, auxModal.nonImperative),
future: addToForm(base, auxModal.future),
past: addToForm(base, auxModal.past),
habitualPast: addToForm(base, auxModal.habitualPast),
hypotheticalPast: addToForm(base, auxModal.hypotheticalPast),
};
}
function makePassivePerfectContent(info: T.StativeCompoundVerbInfo): T.PerfectContent { function makePassivePerfectContent(info: T.StativeCompoundVerbInfo): T.PerfectContent {
const pPart = stativeAux.intransitive.participle.past; const pPart = stativeAux.intransitive.participle.past;
// will always be transitive // will always be transitive
@ -569,6 +588,8 @@ function enforceObject(conj: T.VerbConjugation, person: T.Person): T.VerbConjuga
future: allOnePersonVerbForm(as.future, person), future: allOnePersonVerbForm(as.future, person),
past: allOnePersonVerbForm(as.past, person), past: allOnePersonVerbForm(as.past, person),
habitualPast: allOnePersonInflection(as.past, person), habitualPast: allOnePersonInflection(as.past, person),
// TODO: check if this is ok
modal: as.modal,
}); });
return { return {
...conj, ...conj,

View File

@ -317,6 +317,7 @@ export type AspectContentPassive = {
future: VerbForm; // ba + this.nonImperative future: VerbForm; // ba + this.nonImperative
past: VerbForm; // ROOT LONG + kedulStat[ASPECT].past past: VerbForm; // ROOT LONG + kedulStat[ASPECT].past
habitualPast: VerbForm; habitualPast: VerbForm;
modal: ModalContent,
} }
export type ParticipleForm = SingleOrLengthOpts<UnisexInflections> | SingleOrLengthOpts<PsString>; export type ParticipleForm = SingleOrLengthOpts<UnisexInflections> | SingleOrLengthOpts<PsString>;