From daddaebe30bf4afb1fc8014979a2587ceeba4ed1 Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Sun, 4 Jul 2021 13:12:04 +0300 Subject: [PATCH] update protobuffers --- src/lib/dictionary-models.js | 2 ++ src/lib/dictionary.proto | 1 + src/types.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/src/lib/dictionary-models.js b/src/lib/dictionary-models.js index 791ce06..7db0df0 100644 --- a/src/lib/dictionary-models.js +++ b/src/lib/dictionary-models.js @@ -65,6 +65,7 @@ Entry._readField = function (tag, obj, pbf) { else if (tag === 31) obj.separationAtP = pbf.readVarint(true); 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(); }; Entry.write = function (obj, pbf) { if (obj.ts) pbf.writeVarintField(1, obj.ts); @@ -100,6 +101,7 @@ Entry.write = function (obj, pbf) { if (obj.separationAtP) pbf.writeVarintField(31, obj.separationAtP); if (obj.separationAtF) pbf.writeVarintField(32, obj.separationAtF); if (obj.diacExcept) pbf.writeBooleanField(33, obj.diacExcept); + if (obj.ec) pbf.writeStringField(34, obj.ec); }; // Dictionary ======================================== diff --git a/src/lib/dictionary.proto b/src/lib/dictionary.proto index f6b8e77..852dab0 100644 --- a/src/lib/dictionary.proto +++ b/src/lib/dictionary.proto @@ -43,6 +43,7 @@ message Entry { int32 separationAtP = 31; int32 separationAtF = 32; bool diacExcept = 33; + string ec = 34; } message Dictionary { diff --git a/src/types.ts b/src/types.ts index afdb276..fcf4f44 100644 --- a/src/types.ts +++ b/src/types.ts @@ -28,6 +28,7 @@ export type Dictionary = { entries: DictionaryEntry[]; } +// TODO: BETTER TYPING OF THIS WITH RECORD TO MAKE SURE THAT THE FIELDS LINE UP export type DictionaryEntry = { // BASE REQUIRED INFO /** timestamp - used for word id */