more on EP page

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

View File

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

View File

@ -11,7 +11,7 @@ export function EditIcon() {
return <i className="fas fa-edit" />;
}
function EditableEPEx({ children, opts }: { children: T.EPSelectionState, opts: T.TextOptions }) {
function EditableEPEx({ children, opts, hideOmitSubject }: { children: T.EPSelectionState, opts: T.TextOptions, hideOmitSubject?: boolean }) {
const [editing, setEditing] = useState<boolean>(false);
const [eps, setEps] = useState<T.EPSelectionState>(children);
function handleReset() {
@ -36,7 +36,10 @@ function EditableEPEx({ children, opts }: { children: T.EPSelectionState, opts:
<EPDisplay
opts={opts}
eps={eps}
setOmitSubject={false}
setOmitSubject={hideOmitSubject ? false : (value) => setEps(o => ({
...o,
omitSubject: value === "true",
}))}
justify="left"
onlyOne
/>

View File

@ -61,11 +61,11 @@ Let's look at some examples using each of these kinds of complements. Click on t
An adjective is a word that describes what the subject is like. Notice that if possible, it will inflect to agree with the subject.
<EditableEPEx opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7595,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableEPEx opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":2,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"adjective","entry":{"ts":1527812792,"i":5823,"p":"خوشاله","f":"khoshaala","g":"khoshaala","e":"happy, glad","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
@ -73,11 +73,11 @@ An adjective is a word that describes what the subject is like. Notice that if p
A location adverb is a word that describes the location of the subject. Don't worry, it doesn't inflect.
<EditableEPEx opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":10,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"loc. adv.","entry":{"ts":1527812558,"i":6251,"p":"دلته","f":"dălta","g":"dalta","e":"here","c":"loc. adv."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableEPEx opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":5,"distance":"far"}}}}],"predicate":{"type":"Complement","Complement":{"type":"EQComp","selection":{"type":"loc. adv.","entry":{"ts":1527812449,"i":13954,"p":"هلته","f":"hálta, álta","g":"halta,alta","e":"there","c":"loc. adv."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
@ -85,11 +85,11 @@ A location adverb is a word that describes the location of the subject. Don't wo
You can also use any kind of sandwich to describe the subject of an EP.
<EditableEPEx opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"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 opts={opts}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"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>
@ -107,11 +107,11 @@ COMING SOON...
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}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"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}>{
<EditableEPEx opts={opts} hideOmitSubject>{
{"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>
@ -119,8 +119,20 @@ Sometimes you need to say that an <Link to="/phrase-structure/np/">NP</Link> is
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 opts={opts} hideOmitSubject>{
{"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.
## Leaving out the subject
If it's obvious who/what you're talking about you can always leave out the subject.
<EditableEPEx opts={opts}>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":5,"distance":"far"}}}}],"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":true}
}</EditableEPEx>
<EditableEPEx opts={opts}>{
{"blocks":[{"key":0.0539623363055568,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"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":1527815306,"i":7595,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":true}
}</EditableEPEx>

View File

@ -1695,10 +1695,10 @@
rambda "^6.7.0"
react-select "^5.2.2"
"@lingdocs/pashto-inflector@^2.9.0":
version "2.9.0"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-2.9.0.tgz#92a9ae28bd18983d2e44b37d34ad03bcfa61f925"
integrity sha512-gEZWPZWvDSOnNkbJ0ew3NXLViy4vYSlOyvg0vwDLfAzbQLEN3/tzrp/17LT8H+7aHPa8SRiiaJIG0A4HpTuKxw==
"@lingdocs/pashto-inflector@^2.9.1":
version "2.9.1"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-2.9.1.tgz#ae20d95ff1549dafe4930c9b85f9b28c801aa1f5"
integrity sha512-bEu4NdXigdnBp3RZjzkJ1dbIejUGZZx6KbnyCwZc6C6xiLaaYJGyz+m/PCTfiTZUQ9/8w9kCV95fQL1ncVzp0A==
dependencies:
"@formkit/auto-animate" "^1.0.0-beta.1"
classnames "^2.2.6"