fixed english participle generation and removed h elements from NP picker etc

This commit is contained in:
adueck 2023-02-18 13:28:00 +05:00
parent 540b9d91dd
commit ba44f4704e
13 changed files with 23 additions and 14 deletions

4
package-lock.json generated
View File

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

View File

@ -1,6 +1,6 @@
{
"name": "pashto-inflector",
"version": "5.7.17",
"version": "5.7.18",
"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.7.17",
"version": "5.7.18",
"description": "Pashto inflector library module with React components",
"main": "dist/components/library.js",
"module": "dist/components/library.js",

View File

@ -35,9 +35,14 @@ function EntrySelect<E extends T.DictionaryEntry | T.VerbEntry>(props: {
isVerbSelect?: boolean,
opts: T.TextOptions,
style?: StyleHTMLAttributes<HTMLDivElement>,
placeholder?: string,
}) {
const divStyle = props.style || { width: "13rem" };
const placeholder = "entries" in props ? "Select…" : "Search Pashto";
const placeholder = "placeholder" in props
? props.placeholder
: "search" in props.entryFeeder
? "Search Pashto"
: "Select…";
function makeOption(e: E | T.DictionaryEntry) {
if ("entry" in e) {
return (props.isVerbSelect ? makeVerbSelectOption : makeSelectOption)(e, props.opts);

View File

@ -15,7 +15,7 @@ function AdverbPicker(props: {
props.onChange(makeAdverbSelection(entry));
}
return <div style={{ maxWidth: "225px", minWidth: "125px" }}>
<h6>Adverb</h6>
<div className="h6">Adverb</div>
<div>
<EntrySelect
value={props.adjective?.entry}

View File

@ -15,7 +15,7 @@ function LocativeAdverbPicker(props: {
props.onChange(makeLocativeAdverbSelection(entry));
}
return <div style={{ maxWidth: "225px", minWidth: "125px" }}>
<h6>Locative Adverb</h6>
<div className="h6">Locative Adverb</div>
<div>
<EntrySelect
value={props.adjective?.entry}

View File

@ -77,7 +77,7 @@ function AdjectiveManager(props: {
<div>Adjective</div>
<div className="d-flex flex-row align-items-baseline">
{!!props.adjectives.length && !adding && <div>
<h6 className="clickable" onClick={() => setAdding(true)}>+ Adj.</h6>
<div className="clickable h6" onClick={() => setAdding(true)}>+ Adj.</div>
</div>}
<div onClick={deleteAdj(i)} className="ml-4">
<div className="fas fa-trash" />
@ -94,9 +94,9 @@ function AdjectiveManager(props: {
onChange={handleChange(i)}
/>
</div>)}
{!adding && !props.adjectives.length && <h6 className="clickable" style={{ float: "right" }}>
{!adding && !props.adjectives.length && <div className="h6 clickable" style={{ float: "right" }}>
<div className="clickable" onClick={() => setAdding(true)}>+ Adj.</div>
</h6>}
</div>}
{/* {!addingDemonstrative && !props.demonstrative && <h6 className="clickable mr-2" style={{ float: "right" }}>
<div className="clickable" onClick={() => setAddingDemonstrative(true)}>+ Demons.</div>
</h6>} */}

View File

@ -45,7 +45,7 @@ function AdjectivePicker(props: {
/>}
<div className="d-flex flex-row justify-content-between align-items-baseline">
{!props.noTitle && <div>
<h6>Adjective</h6>
<div className="h6">Adjective</div>
</div>}
{/* not ready for sandwiches on adjectives */}
{/* {(!addingSandwich && props.adjective && !props.adjective?.sandwich)

View File

@ -117,7 +117,7 @@ function NPNounPicker(props: {
onChange={handelAdjectivesUpdate}
onDemonstrativeChange={handleDemonstrativeUpdate}
/>}
<h6>Noun</h6>
<div className="h6">Noun</div>
{!(props.noun && props.noun.dynamicComplement) ? <div>
<EntrySelect
value={props.noun?.entry}

View File

@ -16,7 +16,7 @@ function NPParticiplePicker(props: {
props.onChange(makeParticipleSelection(entry));
}
return <div style={{ maxWidth: "225px" }}>
<h6>Participle</h6>
<div className="h6">Participle</div>
<EntrySelect
value={props.participle?.verb}
entryFeeder={props.entryFeeder}

View File

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

View File

@ -70,6 +70,9 @@ export function getEnglishParticiple(entry: T.DictionaryEntry): string {
throw new Error("no english information for participle");
}
const ec = parseEc(entry.ec);
if (entry.ep && ec[0] === "am") {
return `to be/being ${entry.ep}`;
}
const participle = `${ec[2]} / to ${ec[0]}`;
return (entry.ep)
? `${participle} ${entry.ep}`

View File

@ -656,6 +656,7 @@ function getMatrixBlock<U>(f: {
femSing: T.SingleOrLengthOpts<U>;
femPlur: T.SingleOrLengthOpts<U>;
} | T.SingleOrLengthOpts<U>, objectPerson: T.Person | undefined, kingPerson: T.Person): T.SingleOrLengthOpts<U> {
// @ts-ignore
if (!("mascSing" in f)) {
return f;
}