more humanReadable
This commit is contained in:
parent
ad0538c737
commit
4c199b8f8b
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "@lingdocs/pashto-inflector",
|
"name": "@lingdocs/pashto-inflector",
|
||||||
"version": "3.8.1",
|
"version": "3.8.2",
|
||||||
"author": "lingdocs.com",
|
"author": "lingdocs.com",
|
||||||
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
"description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations",
|
||||||
"homepage": "https://verbs.lingdocs.com",
|
"homepage": "https://verbs.lingdocs.com",
|
||||||
|
|
|
@ -54,12 +54,22 @@ function humanReadableImperativeTense(tense: T.ImperativeTense): string {
|
||||||
: "perfective imperative";
|
: "perfective imperative";
|
||||||
}
|
}
|
||||||
|
|
||||||
export function humanReadableTense(tense: T.VerbTense | T.PerfectTense | T.ModalTense | T.ImperativeTense): string {
|
export function humanReadableVerbForm(f: T.VerbFormName): string {
|
||||||
return isModalTense(tense)
|
return isModalTense(f)
|
||||||
? humanReadableModalTense(tense)
|
? humanReadableModalTense(f)
|
||||||
: isPerfectTense(tense)
|
: isPerfectTense(f)
|
||||||
? humanReadablePerfectTense(tense)
|
? humanReadablePerfectTense(f)
|
||||||
: isImperativeTense(tense)
|
: isImperativeTense(f)
|
||||||
? humanReadableImperativeTense(tense as T.ImperativeTense)
|
? humanReadableImperativeTense(f as T.ImperativeTense)
|
||||||
: humanReadableVerbTense(tense);
|
: humanReadableVerbTense(f);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function humanReadableEquativeTense(f: T.EquativeTense): string {
|
||||||
|
return (f === "pastSubjunctive"
|
||||||
|
? "past subjunctive"
|
||||||
|
: f === "wouldBe"
|
||||||
|
? `"would be"`
|
||||||
|
: f === "wouldHaveBeen"
|
||||||
|
? `"would have been"`
|
||||||
|
: f) + " equative";
|
||||||
}
|
}
|
|
@ -157,7 +157,10 @@ import {
|
||||||
import {
|
import {
|
||||||
renderAPSelection,
|
renderAPSelection,
|
||||||
} from "./lib/phrase-building/render-ap";
|
} from "./lib/phrase-building/render-ap";
|
||||||
import { humanReadableTense } from "./lib/human-readable";
|
import {
|
||||||
|
humanReadableVerbForm,
|
||||||
|
humanReadableEquativeTense,
|
||||||
|
} from "./lib/human-readable";
|
||||||
import NPPicker from "./components/np-picker/NPPicker";
|
import NPPicker from "./components/np-picker/NPPicker";
|
||||||
import EPPicker from "./components/ep-explorer/EPPicker";
|
import EPPicker from "./components/ep-explorer/EPPicker";
|
||||||
import EPExplorer from "./components/ep-explorer/EPExplorer";
|
import EPExplorer from "./components/ep-explorer/EPExplorer";
|
||||||
|
@ -244,7 +247,8 @@ export {
|
||||||
getPashtoFromRendered,
|
getPashtoFromRendered,
|
||||||
renderAPSelection,
|
renderAPSelection,
|
||||||
getEnglishVerb,
|
getEnglishVerb,
|
||||||
humanReadableTense,
|
humanReadableVerbForm,
|
||||||
|
humanReadableEquativeTense,
|
||||||
roleIcon,
|
roleIcon,
|
||||||
vpsReducer,
|
vpsReducer,
|
||||||
makeVPSelectionState,
|
makeVPSelectionState,
|
||||||
|
|
|
@ -582,8 +582,10 @@ export type VPSelectionComplete = {
|
||||||
form: FormVersion,
|
form: FormVersion,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type VerbFormName = VerbTense | PerfectTense | ModalTense | ImperativeTense;
|
||||||
|
|
||||||
export type VerbSelectionComplete = Omit<VerbSelection, "object" | "verbTense" | "perfectTense" | "imperativeTense" | "tenseCategory"> & {
|
export type VerbSelectionComplete = Omit<VerbSelection, "object" | "verbTense" | "perfectTense" | "imperativeTense" | "tenseCategory"> & {
|
||||||
tense: VerbTense | PerfectTense | ModalTense | ImperativeTense,
|
tense: VerbFormName,
|
||||||
}
|
}
|
||||||
|
|
||||||
export type VerbSelection = {
|
export type VerbSelection = {
|
||||||
|
|
Loading…
Reference in New Issue