From e6e35cc0ec1eb5b60bdf50a018337d40c6b57bdf Mon Sep 17 00:00:00 2001 From: lingdocs <71590811+lingdocs@users.noreply.github.com> Date: Tue, 14 Sep 2021 20:54:27 -0400 Subject: [PATCH] testing for plural inflections set --- package.json | 2 +- src/components/InflectionsTable.tsx | 2 +- src/lib/p-text-helpers.ts | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d6d75e6..0dba303 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/pashto-inflector", - "version": "1.0.2", + "version": "1.0.3", "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/components/InflectionsTable.tsx b/src/components/InflectionsTable.tsx index b2b2ecc..036998b 100644 --- a/src/components/InflectionsTable.tsx +++ b/src/components/InflectionsTable.tsx @@ -62,7 +62,7 @@ const InflectionTable = ({ inf, textOptions }: { - {(!isPluralInfs ? ["Plain", "1st", "2nd"] : ["Plural", "2nd"]).map((title, i) => ( + {(!isPluralInfs ? ["Plain", "1st", "2nd"] : ["Plural", "2nd Inf."]).map((title, i) => ( {title} {"masc" in inf && } diff --git a/src/lib/p-text-helpers.ts b/src/lib/p-text-helpers.ts index 612df88..1a4ff0e 100644 --- a/src/lib/p-text-helpers.ts +++ b/src/lib/p-text-helpers.ts @@ -255,10 +255,19 @@ export function isVerbBlock(x: unknown): x is T.VerbBlock { ); } +export function isPluralInflectionSet(x: any): x is T.PluralInflectionSet { + return ( + Array.isArray(x) + && (x.length === 2) + && "p" in x[0][0] + ); +} + export function isImperativeBlock(x: unknown): x is T.ImperativeBlock { return ( Array.isArray(x) && (x.length === 2) && + !("p" in x[0][0]) && "p" in x[0][0][0] ); }