type and function for getting the entry from FullEntry form

This commit is contained in:
adueck 2022-11-09 13:49:54 +05:00
parent eb271bf08b
commit 5805ee423b
7 changed files with 14 additions and 5 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "pashto-inflector",
"version": "5.1.9",
"version": "5.1.10",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "pashto-inflector",
"version": "5.1.9",
"version": "5.1.10",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "5.1.9",
"version": "5.1.10",
"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

@ -1,6 +1,6 @@
{
"name": "@lingdocs/ps-react",
"version": "5.1.9",
"version": "5.1.10",
"description": "Pashto inflector library module with React components",
"main": "dist/components/library.js",
"module": "dist/components/library.js",

View File

@ -105,6 +105,7 @@ import {
blank,
kidsBlank,
ensureNonComboVerbInfo,
entryOfFull,
} from "./src/misc-helpers";
import {
simplifyPhonetics,
@ -237,6 +238,7 @@ export {
kidsBlank,
isPashtoScript,
getInflectionPattern,
entryOfFull,
// protobuf helpers
readDictionary,
writeDictionary,

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/inflect",
"version": "5.1.9",
"version": "5.1.10",
"description": "Pashto inflector library",
"main": "dist/index.js",
"types": "dist/lib/library.d.ts",

View File

@ -14,6 +14,10 @@ export const blank: T.PsString = {
};
export const kidsBlank: T.PsString = { p: "___", f: "___" };
export function entryOfFull(e: T.FullEntry): T.DictionaryEntry {
return "entry" in e ? e.entry : e;
}
// just for type safety
export function noPersInfs(s: T.OptionalPersonInflections<T.LengthOptions<T.PsString>>): T.LengthOptions<T.PsString>;
export function noPersInfs(s: T.FullForm<T.PsString>): T.SingleOrLengthOpts<T.PsString>;

View File

@ -500,6 +500,9 @@ export type VerbEntry = {
complement?: DictionaryEntry,
};
/** A dictionary entry that will include the complement / verb entry structure if it's a verb */
export type FullEntry = VerbEntry | DictionaryEntry;
export enum InflectionPattern {
None = 0,
Basic = 1,