This commit is contained in:
Bill D 2021-03-10 20:51:40 +04:00
parent 952bca1f80
commit 1f8011eb26
3 changed files with 22 additions and 1 deletions

View File

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

@ -193,6 +193,19 @@ export function isSentenceForm(f: any): boolean {
return Array.isArray(f) && "p" in f[0];
}
export function isNounAdjOrVerb(entry: T.DictionaryEntry): "nounAdj" | "verb" | false {
if (!entry.c) {
return false;
}
if (entry.c.includes("adj.") || entry.c.includes("n. m.") || entry.c.includes("n. f.")) {
return "nounAdj";
}
if (entry.c.slice(0, 3) === "v. ") {
return "verb";
}
return false;
}
// not being used
// export function isImperativeBlock(f: any): boolean {
// function isPersonLine(g: any): boolean {

View File

@ -50,6 +50,12 @@ import {
readDictionaryInfo,
writeDictionaryInfo,
} from "./lib/protobuf";
import {
pashtoConsonants,
} from "./lib/pashto-consonants";
import {
isNounAdjOrVerb,
} from "./lib/misc-helpers";
import defaultTextOptions from "./lib/default-text-options";
import * as grammarUnits from "./lib/grammar-units";
import * as Types from "./types";
@ -67,6 +73,7 @@ export {
convertAfToPkSpelling,
convertPkToAfSpelling,
validateEntry,
isNounAdjOrVerb,
// protobuf helpers
readDictionary,
writeDictionary,
@ -86,6 +93,7 @@ export {
ButtonSelect,
// OTHER
grammarUnits,
pashtoConsonants,
defaultTextOptions,
dictionaryEntryTextFields,
dictionaryEntryNumberFields,