proper inflection in charts for stative compounds

This commit is contained in:
adueck 2022-09-26 16:20:29 +04:00
parent c3b24f4c53
commit 4a2b46e05e
4 changed files with 74 additions and 61 deletions

View File

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

View File

@ -142,6 +142,16 @@ export function removeAccents(s: T.PsString | string | T.PsString[]): T.PsString
});
}
export function removeAccentsFromInflections(inf: T.UnisexInflections): T.UnisexInflections {
function removeFromSide(inf: T.InflectionSet): T.InflectionSet {
return inf.map(removeAccents) as T.ArrayFixed<T.ArrayOneOrMore<T.PsString>, 3>;
}
return {
masc: removeFromSide(inf.masc),
fem: removeFromSide(inf.fem),
};
}
/**
* Determines if a string has any accents on it
*

View File

@ -1050,7 +1050,7 @@ const kawulHypothetical: T.VerbForm = {
export const kawulStat: T.VerbConjugation = {
info: {
entry: {
entry: {"ts":1579015359582,"i":10579,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"} as T.VerbDictionaryEntry,
entry: {"ts":1579015359582,"i":10579,"p":"کول","f":"kawúl","g":"kawúl","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"} as T.VerbDictionaryEntry,
},
transitivity: "transitive",
type: "simple",
@ -1084,20 +1084,20 @@ export const kawulStat: T.VerbConjugation = {
},
imperfective: {
nonImperative: [
[[{p: "کوم", f: "kawum"}], [{p: "کوو", f: "kawoo"}]],
[[{p: "کوم", f: "kawum"}], [{p: "کوو", f: "kawoo"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کوي", f: "kawee"}], [{p: "کوي", f: "kawee"}]],
[[{p: "کوي", f: "kawee"}], [{p: "کوي", f: "kawee"}]],
[[{p: "کوم", f: "kawúm"}], [{p: "کوو", f: "kawóo"}]],
[[{p: "کوم", f: "kawúm"}], [{p: "کوو", f: "kawóo"}]],
[[{p: "کوې", f: "kawé"}], [{p: "کوئ", f: "kawéyy"}]],
[[{p: "کوې", f: "kawé"}], [{p: "کوئ", f: "kawéyy"}]],
[[{p: "کوي", f: "kawée"}], [{p: "کوي", f: "kawée"}]],
[[{p: "کوي", f: "kawée"}], [{p: "کوي", f: "kawée"}]],
],
future: [
[[{p: "به کوم", f: "ba kawum"}], [{p: "به کوو", f: "ba kawoo"}]],
[[{p: "به کوم", f: "ba kawum"}], [{p: "به کوو", f: "ba kawoo"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کوي", f: "ba kawee"}], [{p: "به کوي", f: "ba kawee"}]],
[[{p: "به کوي", f: "ba kawee"}], [{p: "به کوي", f: "ba kawee"}]],
[[{p: "به کوم", f: "ba kawúm"}], [{p: "به کوو", f: "ba kawóo"}]],
[[{p: "به کوم", f: "ba kawúm"}], [{p: "به کوو", f: "ba kawóo"}]],
[[{p: "به کوې", f: "ba kawé"}], [{p: "به کوئ", f: "ba kawéyy"}]],
[[{p: "به کوې", f: "ba kawé"}], [{p: "به کوئ", f: "ba kawéyy"}]],
[[{p: "به کوي", f: "ba kawée"}], [{p: "به کوي", f: "ba kawée"}]],
[[{p: "به کوي", f: "ba kawée"}], [{p: "به کوي", f: "ba kawée"}]],
],
imperative: [
[[{ p: "کوه", f: "kawá" }], [{ p: "کوئ", f: "kawéyy" }]],
@ -1105,38 +1105,38 @@ export const kawulStat: T.VerbConjugation = {
],
past: {
short: [
[[{p: "کوم", f: "kawum"}], [{p: "کوو", f: "kawoo"}]],
[[{p: "کوم", f: "kawum"}], [{p: "کوو", f: "kawoo"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کاوه", f: "kaawu"}], [{p: "کول", f: "kawul"}]],
[[{p: "کوه", f: "kawa"}], [{p: "کوې", f: "kawe"}]],
[[{p: "کوم", f: "kawúm"}], [{p: "کوو", f: "kawóo"}]],
[[{p: "کوم", f: "kawúm"}], [{p: "کوو", f: "kawóo"}]],
[[{p: "کوې", f: "kawé"}], [{p: "کوئ", f: "kawéyy"}]],
[[{p: "کوې", f: "kawé"}], [{p: "کوئ", f: "kawéyy"}]],
[[{p: "کاوه", f: "kaawú"}], [{p: "کول", f: "kawúl"}]],
[[{p: "کوه", f: "kawá"}], [{p: "کوې", f: "kawé"}]],
],
long: [
[[{p: "کولم", f: "kawulum"}], [{p: "کولو", f: "kawuloo"}]],
[[{p: "کولم", f: "kawulum"}], [{p: "کولو", f: "kawuloo"}]],
[[{p: "کولې", f: "kawule"}], [{p: "کولئ", f: "kawuleyy"}]],
[[{p: "کولې", f: "kawule"}], [{p: "کولئ", f: "kawuleyy"}]],
[[{p: "کوله", f: "kawulu"}, {p: "کولو", f: "kawulo"}], [{p: "کول", f: "kawul"}]],
[[{p: "کوله", f: "kawula"}], [{p: "کولې", f: "kawule"}]],
[[{p: "کولم", f: "kawúlum"}], [{p: "کولو", f: "kawúloo"}]],
[[{p: "کولم", f: "kawúlum"}], [{p: "کولو", f: "kawúloo"}]],
[[{p: "کولې", f: "kawúle"}], [{p: "کولئ", f: "kawúleyy"}]],
[[{p: "کولې", f: "kawúle"}], [{p: "کولئ", f: "kawúleyy"}]],
[[{p: "کوله", f: "kawúlu"}, {p: "کولو", f: "kawúlo"}], [{p: "کول", f: "kawúl"}]],
[[{p: "کوله", f: "kawúla"}], [{p: "کولې", f: "kawúle"}]],
],
},
habitualPast: {
short: [
[[{p: "به کوم", f: "ba kawum"}], [{p: "به کوو", f: "ba kawoo"}]],
[[{p: "به کوم", f: "ba kawum"}], [{p: "به کوو", f: "ba kawoo"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کاوه", f: "ba kaawu"}], [{p: "به کول", f: "ba kawul"}]],
[[{p: "به کوه", f: "ba kawa"}], [{p: "به کوې", f: "ba kawe"}]],
[[{p: "به کوم", f: "ba kawúm"}], [{p: "به کوو", f: "ba kawóo"}]],
[[{p: "به کوم", f: "ba kawúm"}], [{p: "به کوو", f: "ba kawóo"}]],
[[{p: "به کوې", f: "ba kawé"}], [{p: "به کوئ", f: "ba kawéyy"}]],
[[{p: "به کوې", f: "ba kawé"}], [{p: "به کوئ", f: "ba kawéyy"}]],
[[{p: "به کاوه", f: "ba kaawú"}], [{p: "به کول", f: "ba kawúl"}]],
[[{p: "به کوه", f: "ba kawá"}], [{p: "به کوې", f: "ba kawé"}]],
],
long: [
[[{p: "به کولم", f: "ba kawulum"}], [{p: "به کولو", f: "ba kawuloo"}]],
[[{p: "به کولم", f: "ba kawulum"}], [{p: "به کولو", f: "ba kawuloo"}]],
[[{p: "به کولې", f: "ba kawule"}], [{p: "به کولئ", f: "ba kawuleyy"}]],
[[{p: "به کولې", f: "ba kawule"}], [{p: "به کولئ", f: "ba kawuleyy"}]],
[[{p: "به کوله", f: "ba kawulu"}, {p: "به کولو", f: "ba kawulo"}], [{p: "به کول", f: "ba kawul"}]],
[[{p: "به کوله", f: "ba kawula"}], [{p: "به کولې", f: "ba kawule"}]],
[[{p: "به کولم", f: "ba kawúlum"}], [{p: "به کولو", f: "ba kawúloo"}]],
[[{p: "به کولم", f: "ba kawúlum"}], [{p: "به کولو", f: "ba kawúloo"}]],
[[{p: "به کولې", f: "ba kawúle"}], [{p: "به کولئ", f: "ba kawúleyy"}]],
[[{p: "به کولې", f: "ba kawúle"}], [{p: "به کولئ", f: "ba kawúleyy"}]],
[[{p: "به کوله", f: "ba kawúlu"}, {p: "به کولو", f: "ba kawúlo"}], [{p: "به کول", f: "ba kawúl"}]],
[[{p: "به کوله", f: "ba kawúla"}], [{p: "به کولې", f: "ba kawúle"}]],
],
},
modal: kawulImperfectiveModal,
@ -1519,7 +1519,7 @@ export const kawulStat: T.VerbConjugation = {
export const kawulDyn: T.VerbConjugation = {
info: {
entry: {
entry: {"ts":1527812752,"i":10578,"p":"کول","f":"kawul","g":"kawul","e":"to do (an action or activity)","c":"v. trans. irreg.","ssp":"وکړ","ssf":"óokR","prp":"وکړل","prf":"óokRul","pprtp":"کړی","pprtf":"kúRey","diacExcept":true,"ec":"do,does,doing,did,done"} as T.VerbDictionaryEntry,
entry: {"ts":1527812752,"i":10578,"p":"کول","f":"kawúl","g":"kawúl","e":"to do (an action or activity)","c":"v. trans. irreg.","ssp":"وکړ","ssf":"óokR","prp":"وکړل","prf":"óokRul","pprtp":"کړی","pprtf":"kúRey","diacExcept":true,"ec":"do,does,doing,did,done"} as T.VerbDictionaryEntry,
},
transitivity: "transitive",
type: "simple",
@ -1587,16 +1587,16 @@ export const kawulDyn: T.VerbConjugation = {
[[{p: "کوم", f: "kawum"}], [{p: "کوو", f: "kawoo"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کوې", f: "kawe"}], [{p: "کوئ", f: "kaweyy"}]],
[[{p: "کاوه", f: "kaawu"}], [{p: "کول", f: "kawul"}]],
[[{p: "کاوه", f: "kaawu"}], [{p: "کول", f: "kawúl"}]],
[[{p: "کوه", f: "kawa"}], [{p: "کوې", f: "kawe"}]],
],
long: [
[[{p: "کولم", f: "kawulum"}], [{p: "کولو", f: "kawuloo"}]],
[[{p: "کولم", f: "kawulum"}], [{p: "کولو", f: "kawuloo"}]],
[[{p: "کولې", f: "kawule"}], [{p: "کولئ", f: "kawuleyy"}]],
[[{p: "کولې", f: "kawule"}], [{p: "کولئ", f: "kawuleyy"}]],
[[{p: "کوله", f: "kawulu"}, {p: "کولو", f: "kawulo"}], [{p: "کول", f: "kawul"}]],
[[{p: "کوله", f: "kawula"}], [{p: "کولې", f: "kawule"}]],
[[{p: "کولم", f: "kawúlum"}], [{p: "کولو", f: "kawúloo"}]],
[[{p: "کولم", f: "kawúlum"}], [{p: "کولو", f: "kawúloo"}]],
[[{p: "کولې", f: "kawúle"}], [{p: "کولئ", f: "kawúleyy"}]],
[[{p: "کولې", f: "kawúle"}], [{p: "کولئ", f: "kawúleyy"}]],
[[{p: "کوله", f: "kawúlu"}, {p: "کولو", f: "kawúlo"}], [{p: "کول", f: "kawúl"}]],
[[{p: "کوله", f: "kawúla"}], [{p: "کولې", f: "kawúle"}]],
],
},
habitualPast: {
@ -1605,16 +1605,16 @@ export const kawulDyn: T.VerbConjugation = {
[[{p: "به کوم", f: "ba kawum"}], [{p: "به کوو", f: "ba kawoo"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کوې", f: "ba kawe"}], [{p: "به کوئ", f: "ba kaweyy"}]],
[[{p: "به کاوه", f: "ba kaawu"}], [{p: "به کول", f: "ba kawul"}]],
[[{p: "به کاوه", f: "ba kaawu"}], [{p: "به کول", f: "ba kawúl"}]],
[[{p: "به کوه", f: "ba kawa"}], [{p: "به کوې", f: "ba kawe"}]],
],
long: [
[[{p: "به کولم", f: "ba kawulum"}], [{p: "به کولو", f: "ba kawuloo"}]],
[[{p: "به کولم", f: "ba kawulum"}], [{p: "به کولو", f: "ba kawuloo"}]],
[[{p: "به کولې", f: "ba kawule"}], [{p: "به کولئ", f: "ba kawuleyy"}]],
[[{p: "به کولې", f: "ba kawule"}], [{p: "به کولئ", f: "ba kawuleyy"}]],
[[{p: "به کوله", f: "ba kawulu"}, {p: "به کولو", f: "ba kawulo"}], [{p: "به کول", f: "ba kawul"}]],
[[{p: "به کوله", f: "ba kawula"}], [{p: "به کولې", f: "ba kawule"}]],
[[{p: "به کولم", f: "ba kawúlum"}], [{p: "به کولو", f: "ba kawúloo"}]],
[[{p: "به کولم", f: "ba kawúlum"}], [{p: "به کولو", f: "ba kawúloo"}]],
[[{p: "به کولې", f: "ba kawúle"}], [{p: "به کولئ", f: "ba kawúleyy"}]],
[[{p: "به کولې", f: "ba kawúle"}], [{p: "به کولئ", f: "ba kawúleyy"}]],
[[{p: "به کوله", f: "ba kawúlu"}, {p: "به کولو", f: "ba kawúlo"}], [{p: "به کول", f: "ba kawúl"}]],
[[{p: "به کوله", f: "ba kawúla"}], [{p: "به کولې", f: "ba kawúle"}]],
],
},
modal: kawulImperfectiveModal,

View File

@ -32,7 +32,7 @@ import {
inflectYey,
} from "./pashto-inflector";
import {
accentOnNFromEnd, removeAccents,
accentOnNFromEnd, removeAccents, removeAccentsFromInflections,
} from "./accent-helpers";
import { pashtoConsonants } from "./pashto-consonants";
import {
@ -288,17 +288,20 @@ function makeJoinedModalContent(info: T.NonComboVerbInfo, aspectIn: T.Aspect): T
function makeStativeCompoundSeperatedAspectContent(info: T.StativeCompoundVerbInfo, aspect: T.Aspect): T.AspectContent {
const transitivity = getTransitivity(info);
const presentComplement = (transitivity === "transitive" && complementInflects(info.complement))
? unisexInfToObjectMatrix(info.complement) // transitive verb requires an object matrix for the complex
: info.complement; // intransitive verb doesn't require that because the complement matches the subject
const complement: T.UnisexInflections = aspect === "imperfective"
? removeAccentsFromInflections(info.complement)
: info.complement;
const presentComplement = (transitivity === "transitive" && complementInflects(complement))
? unisexInfToObjectMatrix(complement) // transitive verb requires an object matrix for the complex
: complement; // intransitive verb doesn't require that because the complement matches the subject
function makeTransitiveStativeModalContent() {
const aux = stativeAux[transitivity][aspect].modal;
const nonImperative = addToForm([presentComplement, " "], aux.nonImperative);
const future = addToForm([baParticle, " "], nonImperative);
const past = addToForm([info.complement, " "], aux.past);
const past = addToForm([complement, " "], aux.past);
const habitualPast = addToForm([baParticle, " "], past);
const hypotheticalPast = addToForm([info.complement, " "], aux.hypotheticalPast);
const hypotheticalPast = addToForm([complement, " "], aux.hypotheticalPast);
return {
nonImperative,
future,
@ -316,7 +319,7 @@ function makeStativeCompoundSeperatedAspectContent(info: T.StativeCompoundVerbIn
);
const future = addToForm([baParticle, " "], nonImperative);
const imperative = addToForm([presentComplement, " "], aux.imperative);
const past = addToForm([info.complement, " "], aux.past);
const past = addToForm([complement, " "], aux.past);
const habitualPast = addToForm([baParticle, " "], past);
return {
nonImperative,
@ -403,7 +406,7 @@ function makePerfectContent(info: T.NonComboVerbInfo): T.PerfectContent {
const pastPart: (" " | T.SingleOrLengthOpts<T.UnisexInflections> | T.SingleOrLengthOpts<T.PsString>)[] =
(info.type === "stative compound")
// for stative compounds
? [info.complement, " ", stativeAux[transitivity].participle.past]
? [removeAccentsFromInflections(info.complement), " ", stativeAux[transitivity].participle.past]
// for regular compounds
: [inflectYey(noPersInfs(info.participle.past))]