From 588b22ee1bef3562ba1982d03cdd07fc5c7128ce Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sun, 4 Jul 2021 21:50:18 +0300 Subject: [PATCH] new dictionary model for including English conjugation information --- package.json | 2 +- src/lib/dictionary-models.js | 2 ++ src/lib/dictionary.proto | 1 + src/types.ts | 4 +++- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d1abc51..ff984b7 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/lib/dictionary-models.js b/src/lib/dictionary-models.js index 7db0df0..5801f46 100644 --- a/src/lib/dictionary-models.js +++ b/src/lib/dictionary-models.js @@ -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 ======================================== diff --git a/src/lib/dictionary.proto b/src/lib/dictionary.proto index 852dab0..a7b5887 100644 --- a/src/lib/dictionary.proto +++ b/src/lib/dictionary.proto @@ -44,6 +44,7 @@ message Entry { int32 separationAtF = 32; bool diacExcept = 33; string ec = 34; + string ep = 35; } message Dictionary { diff --git a/src/types.ts b/src/types.ts index fcf4f44..35caf11 100644 --- a/src/types.ts +++ b/src/types.ts @@ -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;