more on EP page

This commit is contained in:
lingdocs 2022-06-11 17:32:21 -04:00
parent 9f90b12fcc
commit 56e1bff441
4 changed files with 40 additions and 11 deletions

View File

@ -6,7 +6,7 @@
"@formkit/auto-animate": "^1.0.0-beta.1", "@formkit/auto-animate": "^1.0.0-beta.1",
"@fortawesome/fontawesome-free": "^5.15.4", "@fortawesome/fontawesome-free": "^5.15.4",
"@lingdocs/lingdocs-main": "^0.3.1", "@lingdocs/lingdocs-main": "^0.3.1",
"@lingdocs/pashto-inflector": "^2.8.8", "@lingdocs/pashto-inflector": "^2.9.0",
"@testing-library/jest-dom": "^5.11.4", "@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0", "@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10", "@testing-library/user-event": "^12.1.10",

View File

@ -18,9 +18,10 @@ function EditableEPEx({ children, opts }: { children: T.EPSelectionState, opts:
setEditing(false); setEditing(false);
setEps(children); setEps(children);
} }
return <div> return <div className="mt-2 mb-4">
<div <div
className="text-right clickable" className="text-left clickable"
style={{ marginBottom: editing ? "0.5rem" : "-0.5rem" }}
onClick={editing ? handleReset : () => setEditing(true)} onClick={editing ? handleReset : () => setEditing(true)}
> >
{!editing ? <EditIcon /> : <i className="fas fa-undo" />} {!editing ? <EditIcon /> : <i className="fas fa-undo" />}
@ -32,7 +33,13 @@ function EditableEPEx({ children, opts }: { children: T.EPSelectionState, opts:
eps={eps} eps={eps}
onChange={setEps} onChange={setEps}
/>} />}
<EPDisplay opts={opts} eps={eps} setOmitSubject={false} /> <EPDisplay
opts={opts}
eps={eps}
setOmitSubject={false}
justify="left"
onlyOne
/>
</div>; </div>;
} }

View File

@ -11,7 +11,7 @@ import {
import psmd from "../../lib/psmd"; import psmd from "../../lib/psmd";
import Link from "../../components/Link"; import Link from "../../components/Link";
import EquativeIllustration from "../../components/EquativeIllustration"; import EquativeIllustration from "../../components/EquativeIllustration";
import EditableEPEx from "../../components/phrase-diagram/EditableEPEx"; import EditableEPEx, { EditIcon } from "../../components/phrase-diagram/EditableEPEx";
import BasicBlocks from "../../components/BasicBlocks" import BasicBlocks from "../../components/BasicBlocks"
@ -55,7 +55,7 @@ An **EP complement** is one of four things:
- sandwich - sandwich
- complement noun - complement noun
Let's look at some examples using each of these kinds of complements. Let's look at some examples using each of these kinds of complements. Click on the <i className="fas fa-cubes" /> to see how the phrase in divided into blocks and click on the <EditIcon /> to change things and play around with the phrase.
#### With an adjective #### With an adjective
@ -83,6 +83,8 @@ A location adverb is a word that describes the location of the subject. Don't wo
#### With a sandwich #### With a sandwich
You can also use any kind of sandwich to describe the subject of an EP.
<EditableEPEx opts={opts}>{ <EditableEPEx opts={opts}>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"sandwich","before":{"p":"له","f":"la"},"after":{"p":"سره","f":"sara"},"e":"with","inside":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false} {"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"sandwich","before":{"p":"له","f":"la"},"after":{"p":"سره","f":"sara"},"e":"with","inside":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx> }</EditableEPEx>
@ -91,9 +93,10 @@ A location adverb is a word that describes the location of the subject. Don't wo
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":4,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"sandwich","before":{"p":"په","f":"pu"},"after":{"p":"کې","f":"ke"},"e":"in","inside":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812828,"i":10540,"p":"کور","f":"kor","g":"kor","e":"house, home","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[]}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false} {"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":4,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"sandwich","before":{"p":"په","f":"pu"},"after":{"p":"کې","f":"ke"},"e":"in","inside":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812828,"i":10540,"p":"کور","f":"kor","g":"kor","e":"house, home","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[]}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx> }</EditableEPEx>
#### With a complement noun #### With a complement noun
COMING SOON...
## 2. NP + NP ## 2. NP + NP
<BasicBlocks large blocks={[ <BasicBlocks large blocks={[
@ -102,3 +105,22 @@ A location adverb is a word that describes the location of the subject. Don't wo
{ bottom: "Equative", inside: "=" }, { bottom: "Equative", inside: "=" },
]} /> ]} />
Sometimes you need to say that an <Link to="/phrase-structure/np/">NP</Link> is an <Link to="/phrase-structure/np/">NP</Link>. When you do this, the equative always agrees with the <em>last</em> <Link to="/phrase-structure/np/">NP</Link>.
<EditableEPEx opts={opts}>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812817,"i":10010,"p":"کتاب","f":"kitáab","g":"kitaab","e":"book","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"plural","numberCanChange":true,"adjectives":[]}}}}],"predicate":{"type":"NP","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527819521,"i":5824,"p":"خوشالي","f":"khoshaalee","g":"khoshaalee","e":"happiness (خوشحالي)","c":"n. f."},"gender":"fem","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[]}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableEPEx opts={opts}>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527819521,"i":5824,"p":"خوشالي","f":"khoshaalee","g":"khoshaalee","e":"happiness (خوشحالي)","c":"n. f."},"gender":"fem","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[]}}}}],"predicate":{"type":"NP","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812817,"i":10010,"p":"کتاب","f":"kitáab","g":"kitaab","e":"book","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"plural","numberCanChange":true,"adjectives":[]}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
## Adding APs
You can add as many <Link to="/phrase-structure/ap/">APs</Link> as you like to a phrase. For example if we wanted to say that the weather is good <strong>here</strong> we can add the <Link to="/phrase-structure/ap/">APs</Link> <InlinePs opts={opts} ps={{ p: "دلته", f: "dalta", e: "here - adverb" }} />.
<EditableEPEx opts={opts}>{
{"blocks":[{"key":0.925654634890972,"block":{"type":"AP","selection":{"type":"adverb","entry":{"ts":1527812558,"i":6251,"p":"دلته","f":"dălta","g":"dalta","e":"here","c":"loc. adv."}}}},{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812672,"i":14045,"p":"هوا","f":"hawaa","g":"hawaa","e":"air, atmosphere; weather","c":"n. f."},"gender":"fem","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[]}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812817,"i":10010,"p":"کتاب","f":"kitáab","g":"kitaab","e":"book","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"plural","numberCanChange":true,"adjectives":[]}},"Complement":{"type":"EQComp","selection":{"type":"adjective","entry":{"ts":1527812796,"i":8655,"p":"ښه","f":"xu","g":"xu","e":"good","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
Try adding clicking the <EditIcon /> and adding other <Link to="/phrase-structure/ap/">APs</Link> to this or other examples above.

View File

@ -1695,10 +1695,10 @@
rambda "^6.7.0" rambda "^6.7.0"
react-select "^5.2.2" react-select "^5.2.2"
"@lingdocs/pashto-inflector@^2.8.8": "@lingdocs/pashto-inflector@^2.9.0":
version "2.8.8" version "2.9.0"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-2.8.8.tgz#4d33dae9716a7284f57aa1aa4ded8c0468b9740f" resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-2.9.0.tgz#92a9ae28bd18983d2e44b37d34ad03bcfa61f925"
integrity sha512-IiM+6upS96S0pm/0ewkqG8EVM7c6A6+LaBmJ2kbiKCyNHhv4V8WOE9wFT1oSCJMeWuCJsJL3MZaeDifCFqXBjQ== integrity sha512-gEZWPZWvDSOnNkbJ0ew3NXLViy4vYSlOyvg0vwDLfAzbQLEN3/tzrp/17LT8H+7aHPa8SRiiaJIG0A4HpTuKxw==
dependencies: dependencies:
"@formkit/auto-animate" "^1.0.0-beta.1" "@formkit/auto-animate" "^1.0.0-beta.1"
classnames "^2.2.6" classnames "^2.2.6"