new dictionary model for including English conjugation information

This commit is contained in:
lingdocs 2021-07-04 21:50:18 +03:00
parent 7a571f0348
commit 588b22ee1b
4 changed files with 7 additions and 2 deletions

View File

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

@ -66,6 +66,7 @@ Entry._readField = function (tag, obj, pbf) {
else if (tag === 32) obj.separationAtF = pbf.readVarint(true);
else if (tag === 33) obj.diacExcept = pbf.readBoolean();
else if (tag === 34) obj.ec = pbf.readString();
else if (tag === 35) obj.ep = pbf.readString();
};
Entry.write = function (obj, pbf) {
if (obj.ts) pbf.writeVarintField(1, obj.ts);
@ -102,6 +103,7 @@ Entry.write = function (obj, pbf) {
if (obj.separationAtF) pbf.writeVarintField(32, obj.separationAtF);
if (obj.diacExcept) pbf.writeBooleanField(33, obj.diacExcept);
if (obj.ec) pbf.writeStringField(34, obj.ec);
if (obj.ep) pbf.writeStringField(35, obj.ep);
};
// Dictionary ========================================

View File

@ -44,6 +44,7 @@ message Entry {
int32 separationAtF = 32;
bool diacExcept = 33;
string ec = 34;
string ep = 35;
}
message Dictionary {

View File

@ -110,9 +110,11 @@ export type DictionaryEntry = {
/** the English conjugations of a verb comma seperated set of 5 ie. "see,sees,seeing,saw,seen" or single word ie. "walk" if regular */
ec?: string;
/** the English partical of a English phrasal verb */
ep?: string;
}
export type DictionaryEntryTextField = "p" | "f" | "e" | "c" | "infap" | "infaf" | "infbp" | "infbf" | "app" | "apf" | "ppp" | "ppf" | "psp" | "psf" | "ssp" | "ssf" | "prp" | "prf" | "pprtp" | "pprtf" | "tppp" | "tppf" | "ec";
export type DictionaryEntryTextField = "p" | "f" | "e" | "c" | "infap" | "infaf" | "infbp" | "infbf" | "app" | "apf" | "ppp" | "ppf" | "psp" | "psf" | "ssp" | "ssf" | "prp" | "prf" | "pprtp" | "pprtf" | "tppp" | "tppf" | "ec" | "ep";
export type DictionaryEntryBooleanField = "noInf" | "shortIntrans" | "noOo" | "sepOo" | "diacExcept";
export type DictionaryEntryNumberField = "ts" | "i" | "l" | "separationAtP" | "separationAtF";
export type DictionaryEntryField = DictionaryEntryTextField | DictionaryEntryBooleanField | DictionaryEntryNumberField;