rename to getInflectionPattern

This commit is contained in:
lingdocs 2022-09-12 19:13:59 +04:00
parent cc2e5fe0bc
commit fcfbf77872
4 changed files with 13 additions and 13 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@lingdocs/pashto-inflector",
"version": "3.9.1",
"version": "3.9.2",
"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,4 +1,4 @@
import { AdjectiveEntry, InflectionCategory, NounEntry } from "../types";
import { AdjectiveEntry, InflectionPattern, NounEntry } from "../types";
import {
isFemNounEntry,
isNounEntry,
@ -10,18 +10,18 @@ import {
isPattern6FemEntry,
} from "./type-predicates";
export function getInflectionCategory(e: NounEntry | AdjectiveEntry): InflectionCategory {
export function getInflectionPattern(e: NounEntry | AdjectiveEntry): InflectionPattern {
return isPattern1Entry(e)
? InflectionCategory.Basic
? InflectionPattern.Basic
: isPattern2Entry(e)
? InflectionCategory.UnstressedEy
? InflectionPattern.UnstressedEy
: isPattern3Entry(e)
? InflectionCategory.StressedEy
? InflectionPattern.StressedEy
: isPattern4Entry(e)
? InflectionCategory.Pashtun
? InflectionPattern.Pashtun
: isPattern5Entry(e)
? InflectionCategory.Squish
? InflectionPattern.Squish
: isNounEntry(e) && isFemNounEntry(e) && isPattern6FemEntry(e)
? InflectionCategory.FemInanEe
: InflectionCategory.None;
? InflectionPattern.FemInanEe
: InflectionPattern.None;
}

View File

@ -39,7 +39,7 @@ import Block, { NPBlock, APBlock } from "./components/blocks/Block";
import { roleIcon } from "./components/vp-explorer/VPExplorerExplanationModal";
import CompiledPTextDisplay from "./components/CompiledPTextDisplay";
import RenderedBlocksDisplay from "./components/RenderedBlocksDisplay";
import { getInflectionCategory } from "./lib/inflection-category";
import { getInflectionPattern } from "./lib/inflection-category";
import {
makePsString,
removeFVarients,
@ -262,7 +262,7 @@ export {
blank,
kidsBlank,
isPashtoScript,
getInflectionCategory,
getInflectionPattern,
// protobuf helpers
readDictionary,
writeDictionary,

View File

@ -500,7 +500,7 @@ export type VerbEntry = {
complement?: DictionaryEntry,
};
export enum InflectionCategory {
export enum InflectionPattern {
None = 0,
Basic = 1,
UnstressedEy = 2,