diff --git a/package.json b/package.json index 443c430..b8404e0 100644 --- a/package.json +++ b/package.json @@ -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.6.4", + "@lingdocs/pashto-inflector": "^2.6.5", "@testing-library/jest-dom": "^5.11.4", "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", diff --git a/src/components/phrase-diagram/EditablePhraseDiagram.tsx b/src/components/phrase-diagram/EditablePhraseDiagram.tsx index f066543..20a13ab 100644 --- a/src/components/phrase-diagram/EditablePhraseDiagram.tsx +++ b/src/components/phrase-diagram/EditablePhraseDiagram.tsx @@ -33,6 +33,7 @@ function EditablePhraseDiagram({ opts, children }: { type: "AP", block: T.APSelection | undefined, }>(block); + console.log({ block }); if (children.length === 0) return null; function handleNPChange(np: T.NPSelection | undefined) { setEdited({ type: "NP", block: np }); @@ -69,7 +70,6 @@ function EditablePhraseDiagram({ opts, children }: { onChange={handleAPChange} entryFeeder={entryFeeder} phraseIsComplete={false} - cantClear onRemove={() => null} /> } diff --git a/src/components/phrase-diagram/PhraseDiagram.tsx b/src/components/phrase-diagram/PhraseDiagram.tsx index 2cecf52..9d0627c 100644 --- a/src/components/phrase-diagram/PhraseDiagram.tsx +++ b/src/components/phrase-diagram/PhraseDiagram.tsx @@ -65,7 +65,31 @@ function AP({ opts, children, english }: { ; } return
- Will implement sandwich +
Sandwich 🥪
+
+
+ {ap.inside.type !== "pronoun" ? ap.inside.possesor : undefined} +
{ap.before ? ap.before.f : ""}
+
+ {ap.inside} +
+
{ap.after ? ap.after.f : ""}
+
+
+
AP
+ {english &&
{english}
}
; } diff --git a/src/content/inflection/inflection-intro.mdx b/src/content/inflection/inflection-intro.mdx index 67ea743..4053ffb 100644 --- a/src/content/inflection/inflection-intro.mdx +++ b/src/content/inflection/inflection-intro.mdx @@ -134,7 +134,3 @@ Once a word gets inflected, you can push or bend it even further a second time. null, ], ]} - -## Exceptions - -There are a few exceptions where words may avoid certain inflections... more will be written on that later. \ No newline at end of file diff --git a/src/content/inflection/inflection-patterns.mdx b/src/content/inflection/inflection-patterns.mdx index 2fbc8d2..cc4b737 100644 --- a/src/content/inflection/inflection-patterns.mdx +++ b/src/content/inflection/inflection-patterns.mdx @@ -53,33 +53,7 @@ These words always end in: "غټ", )} /> -
- - -Note: In sandwiches like describing location the first inflection of *feminine nouns* in this pattern is not used. - - -For example using the word : - -{psmd([ - { - p: "زه **په کوټه کې** ناست یم", - f: "zu **pu koTá ke** naast yum", - e: "I am sitting **in the room**.", - } -])} - -In any other kind of sandwich the first inflection would be used. - -{psmd([ - { - p: "زه **کوټې ته** ځم", - f: "zu **koTé ta** dzum", - e: "I'm going to the room", - }, -])} - -
+**Note:** See exception below. ## 2. Words ending in an unstressed @@ -109,39 +83,7 @@ These words are a little irregular but you can see a common patten based around: "پښتون", )} /> -**Note**: - -
- -Note: Masculine nimate nouns in this pattern will often only use the first inflection for the plural. - - -For example, if we put a singular masculine animate word in a sandwich, most of the time people will not inflect it. - -{psmd([ - { - p: "**د پښتون** نوم څه دی؟", - f: "**du puxtoon** noom tsu dey?", - e: "What is the **Pashtun's** name", - } -])} - -But it will of course inflect for the plural. - -{psmd([ - { - p: "دلته **پښتانه** اوسېږي", - f: "dalta **puxtaanu** oseGee", - e: "**Pashtuns** live here", - }, - { - p: "دا **د پښتنو** رواج دی", - f: "daa **du puxtano** rawaaj dey", - e: "This is **the Pashtuns'** custom" - }, -])} - -
+**Note:** See exception below. ## 5. Shorter words that squish @@ -159,3 +101,112 @@ It's important to know that *not all words can be inflected*. If a word doesn't {[ { p: "خفه", f: "khufa", e: "sad", sub: "...is also sad because it can't inflect like all the other words 😢" }, ]} + +## Exceptions + +Whatever kind of word you're using, it will always inflect for the three reasons that we mentioned earlier. However, there are two big exceptions. + +### Pattern 1 words in sandwiches starting with + +When you put a pattern 1 - basic word in a the sandwich, **it will not use the first inflection**. + +For example, let's put the word inside the sandwich . It doesn't inflect! + +{psmd([ + { p: "زه **په کوټه کې** یم", f: "zu **pu koTa ke** yum", e: "I am **in the room**" }, +])} + +But if you make it plural, it *will* use the second inflection. Only the first inflection is skipped. + +{psmd([ + { p: "مونږ **په کوټو کې** یو", f: "moonG **pu koTo ke** yoo", e: "We are **in the rooms**" }, +])} + +Remember that in any other kind of sandwich, you still use the first inflection with these pattern 1 words. + +{psmd([ + { + p: "زه **کوټې ته** ځم", + f: "zu **koTé ta** dzum", + e: "I'm going to the room", + }, +])} + +Other sandwiches starting with like are a bit flexible with these pattern 1 words. Sometimes people will inflect them and sometimes they won't. + +{psmd([ + { p: "هغه **په ښځه باندې** ډوډۍ پخوي", f: "hagha **pu xudza baande** DoDuy pakhawee", e: "He gets his wife to cook the food", sub: "not inflected" }, + { p: "هغه **په ښځې باندې** ډوډۍ پخوي", f: "hagha **pu xudze baande** DoDuy pakhawee", e: "He gets his wife to cook the food", sub: "inflected" }, +])} + +### Pattern 4 masculine animate nouns + +

Pattern 4 masculine animate nouns (ie. a person or animal) in this pattern will often only use the first inflection for the plural. (In some dialects and formal written text though, they will still use the inflection for all three reasons.)

+ +#### In sandwiches + +For example, if we put the the singular word in a sandwich, *usually* people will not inflect it. + +{psmd([ + { + p: "زه **له پښتون سره** ناست یم", + f: "zu **la puxtoon sara** naast yum", + e: "I'm (m.) sitting **with the Pashtun** (m.)", + sub: "masc - not inflected", + }, + { + p: "زه **له پښتنې سره** ناسته یم", + f: "zu **la puxtane sara** naasta yum", + e: "I'm (f.) sitting **with the Pashtun** (f.)", + sub: "fem - inflected", + }, + { + p: "**د پښتون** نوم څه دی؟", + f: "**du puxtoon** (m.) noom tsu dey?", + e: "What is the **Pashtun's** (m.) name", + sub: "masc - not inflected", + }, + { + p: "زه **له پښتنو سره** ناست یم", + f: "zu **la puxtano sara** naast yum", + e: "I'm sitting **with the Pashtuns**", + }, + { + p: "**د پښتنو** نومونه څه دی؟", + f: "**du puxtano** noomoona tsu dee?", + e: "What are the **Pashtun's** names", + }, +])} + +#### As subjects of past tense transitive verbs + +{psmd([ + { + p: "**پښتون** زه ولیدم", + f: "**puxtoon** zu óoledum", + e: "The Pashtun saw me", + sub: "not inflected", + }, + { + p: "**پښتنو** زه ولیدم", + f: "**puxtano** zu óoledum", + e: "The Pashtuns saw me", + }, +])} + +#### Plural + +But these words will *always* use the first inflection for the plural. + +{psmd([ + { + p: "دلته **پښتانه** اوسېږي", + f: "dalta **puxtaanu** oseGee", + e: "**Pashtuns** live here", + }, + { + p: "دا **د پښتنو** رواج دی", + f: "daa **du puxtano** rawaaj dey", + e: "This is **the Pashtuns'** custom" + }, +])} diff --git a/src/content/phrase-structure/ap.mdx b/src/content/phrase-structure/ap.mdx index e171ee6..30fb722 100644 --- a/src/content/phrase-structure/ap.mdx +++ b/src/content/phrase-structure/ap.mdx @@ -6,6 +6,7 @@ import { defaultTextOptions as opts, InlinePs, Examples, + makeNounSelection, } from "@lingdocs/pashto-inflector"; import psmd from "../../lib/psmd"; import Link from "../../components/Link"; @@ -44,6 +45,129 @@ An adverb is a word or expression that modifies the time, manner, place, etc. of }, ]} -### Sandwich +### Sandwich 🥪 -Coming soon... \ No newline at end of file +In English we have have [prepositions](https://en.wikipedia.org/wiki/Preposition_and_postposition) like "with", "at", "towards", "under" that we put *in front* of nouns. Other langagues have [prepositions](https://en.wikipedia.org/wiki/Preposition_and_postposition) that you add to the *end* of nouns. In Pashto we have [adpostions](https://en.wikipedia.org/wiki/Preposition_and_postposition), which are little sets of words that go *in front and behind* nouns. Sometimes they only go on one side, and sometimes they surround the word on both sides. Because of this we'll call them **sandwiches**. + +These "sandwiches" are also used as an adverb to give more information for the phrase. They take an NP in the middle. For example if we want to say "in the house" we take the sandwich and put the NP inside of it. + +{[ + { + type: "AP", + block: { + type: "sandwich", + before: { p: "په", f: "pu" }, + after: { p: "کې", f: "ke" }, + e: "in", + inside: { + type: "noun", + entry: {"ts":1527812828,"i":10539,"p":"کور","f":"kor","g":"kor","e":"house, home","c":"n. m."}, + gender: "masc", + genderCanChange: false, + number: "singular", + numberCanChange: true, + adjectives: [], + possesor: undefined, + }, + }, + }, +]} + +Because the inside of a sandwich is an NP we can also spice it up by adding adjectives. + +{[ + { + type: "AP", + block: { + type: "sandwich", + before: { p: "په", f: "pu" }, + after: { p: "کې", f: "ke" }, + e: "in", + inside: { + type: "noun", + entry: {"ts":1527812828,"i":10539,"p":"کور","f":"kor","g":"kor","e":"house, home","c":"n. m."}, + gender: "masc", + genderCanChange: false, + number: "singular", + numberCanChange: true, + adjectives: [{ + type: "adjective", + entry: {"ts":1527812625,"i":9128,"p":"غټ","f":"ghuT, ghaT","g":"ghuT,ghaT","e":"big, fat","c":"adj."}, + }], + possesor: undefined, + }, + }, + }, +]} + +We can also add a possesor it hangs outside of the sandwich. All together it's still all considered one AP block though. + +{[ + { + type: "AP", + block: { + type: "sandwich", + before: { p: "په", f: "pu" }, + after: { p: "کې", f: "ke" }, + e: "in", + inside: { + type: "noun", + entry: {"ts":1527812828,"i":10539,"p":"کور","f":"kor","g":"kor","e":"house, home","c":"n. m."}, + gender: "masc", + genderCanChange: false, + number: "singular", + numberCanChange: true, + adjectives: [{ + type: "adjective", + entry: {"ts":1527812625,"i":9128,"p":"غټ","f":"ghuT, ghaT","g":"ghuT,ghaT","e":"big, fat","c":"adj."}, + }], + possesor: { + shrunken: false, + np: { + type: "noun", + entry: {"ts":1527815251,"i":7802,"p":"سړی","f":"saRéy","g":"saRey","e":"man","c":"n. m.","ec":"man","ep":"men"}, + gender: "masc", + genderCanChange: false, + number: "singular", + numberCanChange: true, + adjectives: [], + possesor: undefined, + }, + }, + }, + }, + }, +]} + +Here's another example using the sandwich : + +{[ + { + type: "AP", + block: { + type: "sandwich", + before: { p: "له", f: "la" }, + after: { p: "سره", f: "sara" }, + e: "with", + inside: { + type: "noun", + entry: {"ts":1527814159,"i":12723,"p":"ملګری","f":"malgúrey","g":"malgurey","e":"friend, companion","c":"n. m. anim. unisex"}, + gender: "masc", + genderCanChange: true, + number: "singular", + numberCanChange: true, + adjectives: [], + possesor: { + shrunken: false, + np: { + type: "pronoun", + distance: "far", + person: 0, + }, + }, + }, + }, + }, +]} + +Notice how when we put the word inside the sandwich it inflects. You always inflect the inside of the sandwich except for two exceptions. \ No newline at end of file diff --git a/src/content/phrase-structure/np.mdx b/src/content/phrase-structure/np.mdx index 6231419..4ab8c16 100644 --- a/src/content/phrase-structure/np.mdx +++ b/src/content/phrase-structure/np.mdx @@ -162,7 +162,7 @@ Now we have two words, but it's still **one NP**, one building block. We can add }, ]} -We can also add a **possesor** by adding another NP sandwiched in with a . Now we have a NP inside of an NP, but it's still all **one NP** or **one building block**. +We can also add a **possesor** by adding another NP sandwiched in with a . (Notice that the word sandwiched in there will inflect if possible.) Now we have a NP inside of an NP, but it's still all **one NP** or **one building block**. {[ { diff --git a/yarn.lock b/yarn.lock index 963c743..5c8eccf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1695,7 +1695,7 @@ rambda "^6.7.0" react-select "^5.2.2" -"@lingdocs/pashto-inflector@^2.6.4": +"@lingdocs/pashto-inflector@^2.6.5": version "2.6.5" resolved "https://npm.lingdocs.com/@lingdocs%2fpashto-inflector/-/pashto-inflector-2.6.5.tgz#9cd8efd14d48d0a9aa9ff8439b2bdc135a855f57" integrity sha512-y1prO4ASg1P2v5960twoYD2NOfN4P6vc9cM2/QqMIHQX7TkXwzFnjKKu9MD3dCOH0FPOv1V6NAEgbBMJGJa1Pw==