complement page and analytics for edit events

This commit is contained in:
lingdocs 2022-07-20 17:10:54 -05:00
parent 69b732ed37
commit 0f728dab34
9 changed files with 176 additions and 38 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": "^3.4.5",
"@lingdocs/pashto-inflector": "^3.4.7",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",

View File

@ -5,7 +5,9 @@ import {
} from "@lingdocs/pashto-inflector";
import entryFeeder from "../../lib/entry-feeder";
import { useState } from "react";
import ReactGA from "react-ga";
import { isProd } from "../../lib/isProd";
import { useUser } from "../../user-context";
export function EditIcon() {
return <i className="fas fa-edit" />;
@ -14,15 +16,28 @@ export function EditIcon() {
function EditableEPEx({ children, opts, hideOmitSubject, noEdit }: { children: T.EPSelectionState, opts: T.TextOptions, hideOmitSubject?: boolean, noEdit?: boolean }) {
const [editing, setEditing] = useState<boolean>(false);
const [eps, setEps] = useState<T.EPSelectionState>(children);
const { user } = useUser();
function handleReset() {
setEditing(false);
setEps(children);
}
function logEdit() {
if (isProd && !(user?.admin)) {
ReactGA.event({
category: "Example",
action: "edit EPex",
label: "edit EPex"
});
}
}
return <div className="mt-2 mb-4">
{!noEdit && <div
className="text-left clickable"
style={{ marginBottom: editing ? "0.5rem" : "-0.5rem" }}
onClick={editing ? handleReset : () => setEditing(true)}
onClick={editing ? handleReset : () => {
setEditing(true);
logEdit();
}}
>
{!editing ? <EditIcon /> : <i className="fas fa-undo" />}
</div>}

View File

@ -6,6 +6,9 @@ import {
} from "@lingdocs/pashto-inflector";
import entryFeeder from "../../lib/entry-feeder";
import { useState } from "react";
import ReactGA from "react-ga";
import { isProd } from "../../lib/isProd";
import { useUser } from "../../user-context";
export function EditIcon() {
return <i className="fas fa-edit" />;
@ -22,6 +25,16 @@ function EditableVPEx({ children, opts, formChoice, noEdit, length, mode }: {
const [editing, setEditing] = useState<boolean>(false);
const [selectedLength, setSelectedLength] = useState<"long" | "short">(length || "short");
const [vps, setVps] = useState<T.VPSelectionState>({ ...children });
const { user } = useUser();
function logEdit() {
if (isProd && !(user?.admin)) {
ReactGA.event({
category: "Example",
action: "edit EPex",
label: "edit EPex"
});
}
}
function handleReset() {
// TODO: this is crazy, how does children get changed after calling setVps ???
setVps(children);
@ -34,7 +47,10 @@ function EditableVPEx({ children, opts, formChoice, noEdit, length, mode }: {
{!noEdit && <div
className="text-left clickable mb-2"
style={{ marginBottom: editing ? "0.5rem" : "-0.5rem" }}
onClick={editing ? handleReset : () => setEditing(true)}
onClick={editing ? handleReset : () => {
setEditing(true);
logEdit();
}}
>
{!editing ? <EditIcon /> : <i className="fas fa-undo" />}
</div>}

View File

@ -20,6 +20,10 @@ export function EP({ text }: { text: string }) {
return <Link to="/phrase-structure/ep">{text || "EP"}</Link>;
}
export function Sandwich({ text }: { text: string}) {
return <Link to="/sandwiches/sandwiches/">{text || "sandwich"}</Link>;
}
export function KidsSection({ text }: { text: string }) {
return <Link to="/phrase-structure/blocks-and-kids/#the-kids-section">{text || "kids' section"}</Link>;
}
@ -44,6 +48,10 @@ export function Video() {
return <i className="fas fa-video" />;
}
export function BlocksIcon() {
return <i className="fas fa-cubes" />;
}
export function KingIcon() {
return <i className="mx-1 fas fa-crown" />;
}

View File

@ -9,7 +9,7 @@ import {
RootsAndStems,
getVerbInfo,
} from "@lingdocs/pashto-inflector";
import { KidsSection, VP, KingIcon, ServantIcon, PerfectiveHead, Camera, Video } from "../../components/terms-links";
import { KidsSection, VP, KingIcon, ServantIcon, PerfectiveHead, Camera, Video, Complement } from "../../components/terms-links";
import psmd from "../../lib/psmd";
import Link from "../../components/Link";
import Formula from "../../components/formula/Formula";
@ -115,7 +115,7 @@ We have:
- A **subject**: <InlinePs opts={opts} ps={{ p: "زه", f: "zu", e: "I" }} />
- A **complement**: <InlinePs opts={opts} ps={{ p: "خفه", f: "khufa", e: "sad" }} />
So with this verb we add a complement - something that the subject is *becoming*.
So with this verb we add a <Complement /> - something that the subject is *becoming*.
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.8034429811171007,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":5,"distance":"far"}}}},{"key":0.19673719282869384,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527812792,"i":5826,"p":"خوشاله","f":"khoshaala","g":"khoshaala","e":"happy, glad","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -125,7 +125,7 @@ So with this verb we add a complement - something that the subject is *becoming*
{"blocks":[{"key":0.8034429811171007,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}},{"key":0.19673719282869384,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
Notice how the **if the complement is an adjective in will inflect according to the subject**.
Notice how the **if the <Complement /> is an adjective in will inflect according to the subject**.
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.8034429811171007,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}},{"key":0.19673719282869384,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -139,23 +139,23 @@ But that's not all... Here's something **suuuuuper interesting and important** a
#### Welding / splitting the complement 👨🏻‍🏭 ⛏️
Depending on which part of the verb tree we're using (imperfective <Video />, perfective <Camera />, or past participle), the complement either gets welded onto the verb or splits off as a <PerfectiveHead />.
Depending on which part of the verb tree we're using (imperfective <Video />, perfective <Camera />, or past participle), the <Complement/> either gets welded onto the verb or splits off as a <PerfectiveHead />.
- with the imperfective / past particple we **weld** the complement onto the verb
- the complement and verb become *one block*
- with the perfective the complement **stays separate** and acts as a <PerfectiveHead />
- the complement sits in front of the verb, just like a <PerfectiveHead />, as a seperate block
- the <Complement /> and verb become *one block*
- with the perfective the <Complement /> **stays separate** and acts as a <PerfectiveHead />
- the <Complement /> sits in front of the verb, just like a <PerfectiveHead />, as a seperate block
##### Welding with the imperfective / past participle 👨🏻‍🏭
When we use the imperfective aspect / past participle, the complement is joined together with the verb in **one block**.
When we use the imperfective aspect / past participle, the <Complement /> is joined together with the verb in **one block**.
<div className="text-center mb-3">
<img src={welding} alt="" className="img-fluid" />
<div className="small text-muted">vecteezy.com</div>
</div>
Have a look at the blocks in these examples above. The complement is joined in with the same block as the verb. So if we want to add a <InlinePs opts={opts} ps={{ p: "نه", f: "nú", e: "not" }} /> in and make it negative we get:
Have a look at the blocks in these examples above. The <Complement /> is joined in with the same block as the verb. So if we want to add a <InlinePs opts={opts} ps={{ p: "نه", f: "nú", e: "not" }} /> in and make it negative we get:
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.8034429811171007,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":6,"distance":"far"}}}},{"key":0.19673719282869384,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":true,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -167,7 +167,7 @@ We **CANNOT SAY** <InlinePs opts={opts} ps={{ p: "❌ مونږ ستړي نه ک
{"blocks":[{"key":0.8034429811171007,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":6,"distance":"far"}}}},{"key":0.19673719282869384,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"perfect","transitivity":"intransitive","isCompound":false,"voice":"active","negative":true,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
We also **CANNOT SAY** <InlinePs opts={opts} ps={{ p: "❌ مونږ ستړی نه یو شوي ❌", f: "❌ moonG stúRey nú yoo shuwee ❌" }} /> because with the **past participle / perfect** the complement is welded together with the verb.
We also **CANNOT SAY** <InlinePs opts={opts} ps={{ p: "❌ مونږ ستړی نه یو شوي ❌", f: "❌ moonG stúRey nú yoo shuwee ❌" }} /> because with the **past participle / perfect** the <Complement /> is welded together with the verb.
Listen to this famous poet say:
@ -177,7 +177,7 @@ Listen to this famous poet say:
<VideoPlayer url="https://www.youtube.com/watch?v=I7dZpBFdelU" />
Notice that he does NOT say <InlinePs opts={opts} ps={{ p: "❌ زه به لېونی نه کېږم ❌", f: "❌ zu ba lewaney nú keGum ❌" }} /> because he is using an *imperfective future* and so the complement and verb are **welded together** in one block. If he was using a *perfective future* he could say,
Notice that he does NOT say <InlinePs opts={opts} ps={{ p: "❌ زه به لېونی نه کېږم ❌", f: "❌ zu ba lewaney nú keGum ❌" }} /> because he is using an *imperfective future* and so the <Complement />and verb are **welded together** in one block. If he was using a *perfective future* he could say,
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.8570804481621925,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}},{"key":0.6977993181555702,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10697,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become"}},"verbTense":"perfectiveFuture","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":true,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527820680,"i":11664,"p":"لېونی","f":"lewanéy","g":"lewaney","e":"crazy, insane, mad person","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -185,7 +185,7 @@ Notice that he does NOT say <InlinePs opts={opts} ps={{ p: "❌ زه به لېو
##### Splitting with the perfective ⛏️
When we use anything with the *perfective aspect*, the complement stays seperate and sits in front of the verb as a <PerfectiveHead />.
When we use anything with the *perfective aspect*, the <Complement />stays seperate and sits in front of the verb as a <PerfectiveHead />.
<div className="text-center mb-2">
<img src={separateBlocks} alt="" className="img-fluid" />
@ -207,8 +207,8 @@ To summarize about this verb <InlinePs opts={opts} ps={{ p: "کېدل", f: "ked
- It's intransitive, and only takes a subject (something that changes state) and a **complement**
- There is no <InlinePs opts={opts} ps={{ p: "و", f: "oo", e: "" }} /> prefix but instead we add a complement
- with the imperfective / past participle the complement is *welded together* with the verb in one, indivisible block
- with the perfective the complement sits in front of the verb in a seperate block, just like a <PerfectiveHead />
- with the imperfective / past participle the <Complement />is *welded together* with the verb in one, indivisible block
- with the perfective the <Complement />sits in front of the verb in a seperate block, just like a <PerfectiveHead />
- We will use it for **stative** compounds, because it talks about a subject changing state
## کول vs. کول
@ -286,12 +286,12 @@ Have a look at the roots and stems for <InlinePs opts={opts} ps={{ p: "کول",
label={{ p: "کول", f: "kawul", e: "to make" }}
/>
Like its brother <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to become" }} />, this verb also <strong>has no <InlinePs opts={opts} ps={{ p: "و", f: "oo", e: "" }} /> prefix</strong>. Instead we will use the complement and <Link to="#welding--splitting-the-complement--">in the exact same way as with <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to become" }} /></Link> we will:
Like its brother <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to become" }} />, this verb also <strong>has no <InlinePs opts={opts} ps={{ p: "و", f: "oo", e: "" }} /> prefix</strong>. Instead we will use the <Complement />and <Link to="#welding--splitting-the-complement--">in the exact same way as with <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to become" }} /></Link> we will:
- with the imperfective <Video /> / past participle
- 👨🏻‍🏭 weld the complement together with the verb in one block
- 👨🏻‍🏭 weld the <Complement />together with the verb in one block
- with the perfective <Camera />
- ⛏ keep the complement separate, sitting as a <PerfectiveHead /> in front of the verb
- ⛏ keep the <Complement />separate, sitting as a <PerfectiveHead /> in front of the verb
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.049217458592629715,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}},{"key":0.7895952701078488,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10631,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"transitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -301,7 +301,7 @@ Like its brother <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to
{"blocks":[{"key":0.049217458592629715,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}},{"key":0.7895952701078488,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10631,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"transitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
Notice how **if the complement is an adjective it will inflect according the object**.
Notice how **if the <Complement />is an adjective it will inflect according the object**.
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.049217458592629715,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}},{"key":0.7895952701078488,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10631,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"}},"verbTense":"perfectivePast","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"transitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -315,7 +315,7 @@ Notice how **if the complement is an adjective it will inflect according the obj
{"blocks":[{"key":0.049217458592629715,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}},{"key":0.7895952701078488,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10631,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"}},"verbTense":"imperfectivePast","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"perfect","transitivity":"transitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
Notice how with the imperfective/past participle the complement is welded together with the verb, but with the perfective it's separate.
Notice how with the imperfective/past participle the <Complement />is welded together with the verb, but with the perfective it's separate.
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.049217458592629715,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":3,"distance":"far"}}}},{"key":0.7895952701078488,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10631,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made","ep":"_____"}},"verbTense":"perfectivePast","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"transitive","isCompound":false,"voice":"active","negative":true,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7598,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
@ -333,8 +333,8 @@ To summarize about this verb <InlinePs opts={opts} ps={{ p: "کول", f: "kawúl
- It's trasinitive, so it takes a subject, object, and complement
- There is no <InlinePs opts={opts} ps={{ p: "و", f: "oo", e: "" }} /> prefix but instead we add a complement
- with the imperfective / past participle the complement is *welded together* with the verb in one, indivisible block
- with the perfective the complement sits in front of the verb in a seperate block, just like a <PerfectiveHead />
- with the imperfective / past participle the <Complement />is *welded together* with the verb in one, indivisible block
- with the perfective the <Complement />sits in front of the verb in a seperate block, just like a <PerfectiveHead />
- We will use it for **stative** compounds, because it talks about a subject changing an object into a different state
## Summary Chart

View File

@ -123,5 +123,6 @@ Phrases also might start with little directional words like:
- <InlinePs opts={opts} ps={{ p: "ورته", f: "wăr-ta", e: "to him/her/them/it" }} />
- <InlinePs opts={opts} ps={{ p: "راپسې", f: "raa-pase", e: "after me/us" }} />
- <InlinePs opts={opts} ps={{ p: "درپسې", f: "dăr-pase", e: "after you" }} />
- <InlinePs opts={opts} ps={{ p: "ورپسې", f: "wăr-pase", e: "after you" }} />
These these are often treated as connectors, but they can be blocks or connectors, depending on how they are used.

View File

@ -9,10 +9,11 @@ import {
} from "@lingdocs/pashto-inflector";
import psmd from "../../lib/psmd";
import Link from "../../components/Link";
import { NP, VP, EP } from "../../components/terms-links";
import { NP, VP, EP, BlocksIcon, Sandwich } from "../../components/terms-links";
import EditableVPEx, { EditIcon } from "../../components/phrase-diagram/EditableVPEx";
import EditableEPEx from "../../components/phrase-diagram/EditableEPEx";
import BasicBlocks from "../../components/BasicBlocks";
import VideoPlayer from "../../components/VideoPlayer";
## What's a complement?
@ -40,15 +41,108 @@ Here <InlinePs opts={opts} ps={{ p: "خفه", f: "khufa", e: "sad" }} /> is a <e
In Pashto a **complement** can be one of four things:
- <Link to="#adjectives">adjective</Link>
- <Link to="#locative-adverbs">locative adverb</Link>
- <Link to="#sandwiches">sandwich</Link>
- <Link to="#complement-nouns">complement noun</Link>
- <Link to="#adjective">adjective</Link>
- <Link to="#locative-adverb">locative adverb</Link>
- <Link to="#sandwiche">sandwich</Link>
- <Link to="#complement-noun">complement noun</Link>
### Adjectives
### Adjective
### Locative Adverbs
Adjectives seem like the most natural and common things to use as a complement. In the <NP /> section we saw how <Link to="/phrase-structure/np/#adding-adjectives">adjectives can be joined to a noun</Link> to describe it. We can also use adjectives *on their* own, as a complement, separate from the <NP />.
### Sandwiches
Click on the <BlocksIcon /> to see what the complement is in the examples below.
### Complement Nouns
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527812792,"i":5828,"p":"خوشاله","f":"khoshaala","g":"khoshaala","e":"happy, glad","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.6407963893481012,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":2,"distance":"far"}}}},{"key":0.6392166687010554,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10699,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become"}},"verbTense":"perfectivePast","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527812792,"i":5828,"p":"خوشاله","f":"khoshaala","g":"khoshaala","e":"happy, glad","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
Notice that the adjective will inflect to match the <NP /> that it is describing. Try editing <EditIcon /> the examples below and see how the adjective changes when you change the <NP /> it describes.
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":1,"distance":"far"}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7600,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.6407963893481012,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":6,"distance":"far"}}}},{"key":0.6392166687010554,"block":{"type":"objectSelection","selection":"none"}}],"verb":{"type":"verb","verb":{"entry":{"ts":1581086654898,"i":10699,"p":"کېدل","f":"kedul","g":"kedul","e":"to become _____","c":"v. intrans. irreg.","ssp":"ش","ssf":"sh","prp":"شول","prf":"shwul","pprtp":"شوی","pprtf":"shúwey","noOo":true,"ec":"become"}},"verbTense":"perfectivePast","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"intransitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":false,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7600,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
<EditableVPEx opts={opts}>{
{"blocks":[{"key":0.2936852927534954,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":2,"distance":"far"}}}},{"key":0.9001306626884367,"block":{"type":"objectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"verb":{"type":"verb","verb":{"entry":{"ts":1579015359582,"i":10633,"p":"کول","f":"kawul","g":"kawul","e":"to make ____ ____ (as in \"He's making me angry.\")","c":"v. trans. irreg.","ssp":"کړ","ssf":"kR","prp":"کړل","prf":"kRul","pprtp":"کړی","pprtf":"kúRey","noOo":true,"ec":"make,makes,making,made,made"}},"verbTense":"presentVerb","perfectTense":"presentPerfect","imperativeTense":"imperfectiveImperative","tenseCategory":"basic","transitivity":"transitive","isCompound":false,"voice":"active","negative":false,"canChangeTransitivity":false,"canChangeVoice":true,"canChangeStatDyn":false},"externalComplement":{"type":"complement","selection":{"type":"adjective","entry":{"ts":1527815306,"i":7600,"p":"ستړی","f":"stúRey","g":"stuRey","e":"tired","c":"adj."}}},"form":{"removeKing":false,"shrinkServant":false}}
}</EditableVPEx>
### Locative Adverb
You can also use an **adverb that describes a location** as a complement. These do not inflect.
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"loc. adv.","entry":{"ts":1527812558,"i":6256,"p":"دلته","f":"dălta","g":"dalta","e":"here","c":"loc. adv."}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":5,"distance":"far"}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"loc. adv.","entry":{"ts":1527812449,"i":13967,"p":"هلته","f":"hálta, álta","g":"halta,alta","e":"there","c":"loc. adv."}}}},"equative":{"tense":"past","negative":false},"omitSubject":false}
}</EditableEPEx>
### Sandwich
You can also use a <Sandwich /> as a complement to describe an <NP /> (where it is, who it's with, what it's for etc. etc.)
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"pronoun","person":0,"distance":"far"}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"sandwich","before":{"p":"له","f":"la"},"after":{"p":"سره","f":"sara"},"e":"with","inside":{"type":"NP","selection":{"type":"pronoun","person":2,"distance":"far"}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
<EditableEPEx opts={opts} hideOmitSubject>{
{"blocks":[{"key":0.7559632995928578,"block":{"type":"subjectSelection","selection":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812817,"i":10018,"p":"کتاب","f":"kitáab","g":"kitaab","e":"book","c":"n. m."},"gender":"masc","genderCanChange":false,"number":"plural","numberCanChange":true,"adjectives":[]}}}}],"predicate":{"type":"Complement","NP":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527815177,"i":2535,"p":"پلار","f":"plaar","g":"plaar","e":"father","c":"n. m. anim."},"gender":"masc","genderCanChange":false,"number":"singular","numberCanChange":true,"adjectives":[{"type":"adjective","entry":{"ts":1527815451,"i":7256,"p":"زوړ","f":"zoR","g":"zoR","e":"old","c":"adj. irreg.","infap":"زاړه","infaf":"zaaRu","infbp":"زړ","infbf":"zaR"}}],"possesor":{"np":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11709,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"masc","genderCanChange":true,"number":"plural","numberCanChange":true,"adjectives":[]}},"shrunken":false}}},"Complement":{"type":"complement","selection":{"type":"sandwich","before":{"p":"د","f":"du"},"after":{"p":"لپاره","f":"lapaara"},"e":"for","inside":{"type":"NP","selection":{"type":"noun","entry":{"ts":1527812881,"i":11715,"p":"ماشوم","f":"maashoom","g":"maashoom","e":"child, kid","c":"n. m. anim. unisex","ec":"child","ep":"children"},"gender":"fem","genderCanChange":true,"number":"singular","numberCanChange":true,"adjectives":[]}}}}},"equative":{"tense":"present","negative":false},"omitSubject":false}
}</EditableEPEx>
### Complement Noun
Here's where things get weird... In Pashto, we can use a **noun** as a complement. In English, this sounds really funny, because we're always used to having *adjectives* as complements. For example, a native English speaker would never say, "I am **confusion**. (noun)"
<VideoPlayer url="https://youtu.be/5EbnoElOJx0?t=2" />
You'd have to say, "I am **confused**. (adjective)" But Pashto doesn't play by that rule.
There are a lot of compounds (stative and dynamic) that use nouns to describe an change made to an <NP /> or action being done. These nouns can be used as complements in places where an English speaker would think we *have* to use an adjective.
For example, we have the compound <InlinePs opts={opts} ps={{ p: "حلېدل", f: "haledul", e: "to be solved" }} /> which is a combination of:
- <InlinePs opts={opts} ps={{ p: "حل", f: "hal", e: "solution" }} /> - noun
- <InlinePs opts={opts} ps={{ p: "کېدل", f: "kedúl", e: "to become" }} /> - verb
The complement noun <InlinePs opts={opts} ps={{ p: "حل", f: "hal", e: "solution" }} /> gets used almost as if it were an adjective (in an English brain).
<Examples opts={opts}>{psmd([
{
f: "مسئله **حل** شوه",
p: "masala **hal** shwa",
e: "The problem was solved",
sub: "lit. The problem became **solution**",
},
])}</Examples>
Notice this is a **noun** in this sentence, not an adjective. That means that:
- it does not inflect
- it does not mean exactly what the noun means
We also have the the dynamic compound <InlinePs opts={opts} ps={{ p: "استرحات کول", f: "istirahaat kawul", e: "to rest" }} /> which is a combination of:
- <InlinePs opts={opts} ps={{ p: "استراحات", f: "istiraháat", e: "rest/relaxation" }} />
- <InlinePs opts={opts} ps={{ p: "کول", f: "kawul", e: "to do" }} />
So we can use <InlinePs opts={opts} ps={{ p: "استراحات", f: "istiraháat", e: "rest/relaxation" }} /> as a complement noun. You might here someone say:
<Examples opts={opts}>{psmd([
{
p: "اوپخښه. ته **استرحات** وې؟",
f: "oobakhxa. tu **istiraháat** we?",
e: "Sorry. Were you resting?",
sub: "lit. Sorry. Were you **relaxation**?",
},
])}</Examples>
Again this makes absolutely no sense to the English brain, but it happens in all the time in Pashto (and many other languages), so you'll just have to accept it.

View File

@ -40,6 +40,8 @@ A **noun** is a word that we use to identify people, places, things, or ideas. O
}
}</EditableBlock>
#### Adding adjectives
We can also **extend our noun by adding *adjectives***. Let's add the *adjective* <InlinePs opts={opts} ps={{ p: "زوړ", f: "zoR", e: "old" }} /> to our NP.
<EditableBlock opts={opts}>{
@ -92,6 +94,8 @@ Now we have two words, but it's still **one NP**, one building block. We can add
}
}</EditableBlock>
#### Adding a possesor
We can also add a **possesor** by adding another NP <Link to="/sandwiches/sandwiches/">sandwiched</Link> in with a <InlinePs opts={opts} ps={{ p: "د", f: "du", e: "of"}} />. (Notice that the word sandwiched in there will <Link to="/inflection/inflection-intro/">inflect</Link> if possible.) Now we have a NP inside of an NP, but it's still all **one NP** or **one building block**.
<EditableBlock opts={opts}>{

View File

@ -1694,10 +1694,10 @@
rambda "^6.7.0"
react-select "^5.2.2"
"@lingdocs/pashto-inflector@^3.4.5":
version "3.4.5"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-3.4.5.tgz#8c42c3b80cc966a048f3d984fb03b552345453cc"
integrity sha512-PkV2xqOgMicrimuULNKWKt85iFurL9bpEsc41lfnssYxWDX245xIAo20xTRAWjw2SXaX8RRvx7SZBcUP/0Zq5w==
"@lingdocs/pashto-inflector@^3.4.6":
version "3.4.6"
resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-3.4.6.tgz#583de6c274abfb0248e10d48a1c68192156c5257"
integrity sha512-x2tjaFxbtVeYug7UWViisxkXAEsO/CNyZCLyrH5y2uBeAZKZo1kGN5UYEY67IG8b5ygwy5TzcBzalCz4Ikq9kw==
dependencies:
"@formkit/auto-animate" "^1.0.0-beta.1"
classnames "^2.2.6"