Skip to content

Commit

Permalink
fix issues with verbConjugation failing by assuming that we would get…
Browse files Browse the repository at this point in the history
… simple verb conjugation results
  • Loading branch information
adueck committed Aug 6, 2024
1 parent dee417a commit 8455f26
Show file tree
Hide file tree
Showing 11 changed files with 287 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-inflections.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache: "yarn"
- name: run script
run: |
yarn install-r
Expand Down
12 changes: 11 additions & 1 deletion check-all-inflections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ async function checkAll() {
err: e.toString(),
});
}
if (tp.isVerbEntry(entry)) {
if (tp.isVerbDictionaryEntry(entry)) {
const complement = entry.l
? entries.find((e) => e.ts === entry.l)
: undefined;
Expand All @@ -41,6 +41,16 @@ async function checkAll() {
err: "verb complement missing",
});
} else {
try {
conjugateVerb(entry, complement);
} catch (e) {
errors.push({
ts: entry.ts,
p: entry.p,
f: entry.f,
err: e,
});
}
}
}
});
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "7.4.0",
"version": "7.4.1",
"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",
Expand Down Expand Up @@ -79,4 +79,4 @@
]
},
"dependencies": {}
}
}
4 changes: 2 additions & 2 deletions src/components/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/ps-react",
"version": "7.4.0",
"version": "7.4.1",
"description": "Pashto inflector library module with React components",
"main": "dist/components/library.js",
"module": "dist/components/library.js",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lingdocs/inflect",
"version": "7.4.0",
"version": "7.4.1",
"description": "Pashto inflector library",
"main": "dist/index.js",
"types": "dist/lib/library.d.ts",
Expand Down
224 changes: 224 additions & 0 deletions src/lib/src/dyn-comp-aux-verbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,4 +576,228 @@ export const dynamicAuxVerbs: Array<{
ec: "send,sends,sending,sent,sent",
},
},
{
entry: {
ts: 1577299232429,
i: 1770,
p: "بدلول",
f: "badlawúl",
g: "badlawul",
e: "to change, to adapt, exchange, replace",
r: 4,
c: "v. stat. comp. trans.",
l: 1577299160732,
ec: "change",
a: 1,
},
complement: {
ts: 1577299160732,
i: 1761,
p: "بدل",
f: "badál",
g: "badal",
e: "changed, different, exchanged",
r: 4,
c: "adj.",
a: 1,
},
},
{
entry: {
ts: 1527812856,
i: 14629,
p: "لیکل",
f: "leekúl",
g: "leekul",
e: "to write, draw",
r: 3,
c: "v. trans./gramm. trans.",
ec: "write,writes,writing,wrote,written",
a: 1,
},
},
{
entry: {
ts: 1527812280,
i: 1425,
p: "اېښودل",
f: "exodúl",
g: "exodul",
e: "to put, put down, set in place, install, plant, plug in, invest, lay/build",
r: 4,
c: "v. trans.",
psp: "ږد",
psf: "Gd",
noOo: true,
a: 1,
},
},
{
entry: {
ts: 1527811395,
i: 6849,
p: "خپرول",
f: "khparawul",
g: "khparawul",
e: "to spread, disperse, open, unfold, publicize, distribute",
r: 3,
c: "v. stat. comp. trans.",
l: 1527816071,
ec: "spread,spreads,spreading,spread",
},
complement: {
ts: 1527816071,
i: 6874,
p: "خپور",
f: "khpor",
g: "khpor",
e: "spread, dispersed, publicized, published",
r: 4,
c: "adj.",
infap: "خپاره",
infaf: "khpaaru",
infbp: "خپر",
infbf: "khpar",
},
},
{
entry: {
ts: 1527818218,
i: 18245,
p: "ویستل",
f: "weestul",
g: "weestul",
e: "to take out, throw out, drive out, discard, chuck, toss, extract",
r: 4,
c: "v. trans.",
psp: "باس",
psf: "báas",
ssp: "وباس",
ssf: "óobaas",
diacExcept: true,
a: 1,
},
complement: {
ts: 1527818218,
i: 18245,
p: "ویستل",
f: "weestul",
g: "weestul",
e: "to take out, throw out, drive out, discard, chuck, toss, extract",
r: 4,
c: "v. trans.",
psp: "باس",
psf: "báas",
ssp: "وباس",
ssf: "óobaas",
diacExcept: true,
a: 1,
},
},
{
entry: {
ts: 1527811293,
i: 10992,
p: "ښودل",
f: "xodúl",
g: "xodul",
e: "to show; to teach; to suit, look good with (fig.), befit",
r: 4,
c: "v. trans.",
psp: "ښای",
psf: "xaay",
ec: "show,shows,showing,showed,shown",
a: 1,
},
},
{
entry: {
ts: 1527816012,
i: 14685,
p: "ماتول",
f: "maatawúl",
g: "maatawul",
e: "to break, split, defeat",
r: 4,
c: "v. stat. comp. trans.",
l: 1527816011,
ec: "break,breaks,breaking,broke,broken",
a: 1,
},
complement: {
ts: 1527816011,
i: 14677,
p: "مات",
f: "maat",
g: "maat",
e: "broken, split, defeated",
r: 4,
c: "adj.",
a: 1,
},
},
{
entry: {
ts: 1527812222,
i: 6879,
p: "ختمول",
f: "khatumawúl",
g: "khatumawul",
e: "to finish, complete, end, use up, destroy, kill",
r: 4,
c: "v. stat. comp. trans.",
l: 1527812221,
ec: "finish",
a: 1,
},
complement: {
ts: 1527812221,
i: 6878,
p: "ختم",
f: "khátum",
g: "khatum",
e: "finished, completed, ended, done",
r: 4,
c: "adj.",
a: 1,
},
},
{
entry: {
ts: 1527821309,
i: 2173,
p: "بندول",
f: "bandawúl",
g: "bandawul",
e: "to close, block, stop, barricade, cut off, restrain, hold back",
r: 3,
c: "v. stat. comp. trans.",
l: 1577301753727,
ec: "close",
a: 1,
},
complement: {
ts: 1577301753727,
i: 2158,
p: "بند",
f: "band",
g: "band",
e: "closed, blocked, stopped",
c: "adj.",
a: 1,
},
},
{
entry: {
ts: 1527817750,
i: 9964,
p: "سکل",
f: "skul",
g: "skul",
e: "to drink",
r: 3,
c: "v. trans.",
ec: "drink,drinks,drinking,drank,drank",
},
},
];
4 changes: 4 additions & 0 deletions src/lib/src/misc-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ export function ensureNonComboVerbInfo(i: T.VerbInfo): T.NonComboVerbInfo {
return "stative" in i ? i.stative : "transitive" in i ? i.transitive : i;
}

export function ensureVerbConjugation(o: T.VerbOutput): T.VerbConjugation {
return "stative" in o ? o.stative : "transitive" in o ? o.transitive : o;
}

export function pickPersInf<T>(
s: T.OptionalPersonInflections<T>,
persInf: T.PersonInflectionsField
Expand Down
Loading

0 comments on commit 8455f26

Please sign in to comment.