fix ability issue with tlul verbs

This commit is contained in:
lingdocs 2022-07-28 15:59:39 -05:00
parent 0008f18e85
commit 4228878017
6 changed files with 16 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@lingdocs/pashto-inflector", "name": "@lingdocs/pashto-inflector",
"version": "3.6.0", "version": "3.6.1",
"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

@ -25,6 +25,7 @@ import {
isNounEntry, isNounEntry,
isPattern4Entry, isPattern4Entry,
isPerfectTense, isPerfectTense,
isTlulVerb,
} from "../type-predicates"; } from "../type-predicates";
import { renderEnglishVPBase } from "./english-vp-rendering"; import { renderEnglishVPBase } from "./english-vp-rendering";
import { personGender } from "../../lib/misc-helpers"; import { personGender } from "../../lib/misc-helpers";
@ -498,6 +499,7 @@ export function isStativeHelper(v: T.VerbEntry): boolean {
} }
function splitUpIfModal(v: T.VerbRenderedBlock): [T.VerbRenderedBlock] | [T.ModalVerbBlock, T.ModalVerbKedulPart] { function splitUpIfModal(v: T.VerbRenderedBlock): [T.VerbRenderedBlock] | [T.ModalVerbBlock, T.ModalVerbKedulPart] {
console.log("in split up", v);
if (!isModalTense(v.block.tense)) { if (!isModalTense(v.block.tense)) {
return [v]; return [v];
} }
@ -555,7 +557,9 @@ function getPsVerbConjugation(conj: T.VerbConjugation, vs: T.VerbSelectionComple
if (perfective) { if (perfective) {
const past = isPastTense(vs.tense); const past = isPastTense(vs.tense);
const splitInfo = conj.info[(past || isModalTense(vs.tense)) ? "root" : "stem"].perfectiveSplit; const splitInfo = conj.info[(past || isModalTense(vs.tense)) ? "root" : "stem"].perfectiveSplit;
if (!splitInfo) return { ps: { head: undefined, rest: removeBaFromForm(verbForm) }, hasBa }; if (!splitInfo || (isTlulVerb(vs.verb.entry) && isModalTense(vs.tense))) {
return { ps: { head: undefined, rest: removeBaFromForm(verbForm) }, hasBa };
}
// TODO: Either solve this in the inflector or here, it seems silly (or redundant) // TODO: Either solve this in the inflector or here, it seems silly (or redundant)
// to have a length option in the perfective split stem?? // to have a length option in the perfective split stem??
const [splitHead] = getLong(getMatrixBlock(splitInfo, objectPerson, person)); const [splitHead] = getLong(getMatrixBlock(splitInfo, objectPerson, person));

View File

@ -3,6 +3,10 @@ import { pashtoConsonants } from "./pashto-consonants";
import { endsWith } from "../lib/p-text-helpers"; import { endsWith } from "../lib/p-text-helpers";
import { countSyllables } from "../lib/accent-helpers"; import { countSyllables } from "../lib/accent-helpers";
export function isTlulVerb(e: T.VerbEntry | T.VerbDictionaryEntry): boolean {
const entry = "entry" in e ? e.entry : e;
return entry.f === "tlul" || entry.p === "راتلل" || entry.p === "درتلل" || entry.p === "ورتلل";
}
export function isNounEntry(e: T.Entry | T.DictionaryEntry): e is T.NounEntry { export function isNounEntry(e: T.Entry | T.DictionaryEntry): e is T.NounEntry {
if ("entry" in e) return false; if ("entry" in e) return false;

View File

@ -58,6 +58,7 @@ import {
noPersInfs, noPersInfs,
} from "./misc-helpers"; } from "./misc-helpers";
import * as T from "../types"; import * as T from "../types";
import { isTlulVerb } from "./type-predicates";
const eyEndingUnaccented: T.PsString = { p: "ی", f: "ey" }; const eyEndingUnaccented: T.PsString = { p: "ی", f: "ey" };
@ -986,7 +987,9 @@ function makeDynamicPerfectiveSplit(comp: T.PsString, auxSplit: T.SplitInfo): T.
} }
export function getAbilityRootsAndStems(info: T.NonComboVerbInfo): T.AbilityRootsAndStems { export function getAbilityRootsAndStems(info: T.NonComboVerbInfo): T.AbilityRootsAndStems {
const isIntransitiveStativeCompound = info.type === "stative compound" && info.transitivity === "intransitive" const isIntransitiveStativeCompound =
(info.type === "stative compound" && info.transitivity === "intransitive")
|| isTlulVerb(info.entry);
const roots = getAbilityRoots(info.root, isIntransitiveStativeCompound); const roots = getAbilityRoots(info.root, isIntransitiveStativeCompound);
return addAbilityHelperRootsAndStems(roots, isIntransitiveStativeCompound); return addAbilityHelperRootsAndStems(roots, isIntransitiveStativeCompound);
} }

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@
*/ */
module.exports = [ module.exports = [
1527815216, // راتلل - to come
1527813473, // الوتل - to fly 1527813473, // الوتل - to fly
1527814012, // اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon 1527814012, // اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon
1527822843, // برېښېدل - to appear, seem; to shine, sparkle; to smart, have a pricking pain 1527822843, // برېښېدل - to appear, seem; to shine, sparkle; to smart, have a pricking pain