AP page
This commit is contained in:
parent
7e3d644380
commit
752adcee1f
|
@ -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",
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
}
|
||||
|
|
|
@ -65,7 +65,31 @@ function AP({ opts, children, english }: {
|
|||
</div>;
|
||||
}
|
||||
return <div>
|
||||
Will implement sandwich
|
||||
<div className="text-center">Sandwich 🥪</div>
|
||||
<div
|
||||
className={classNames("d-flex flex-row justify-content-center align-items-center")}
|
||||
style={{
|
||||
border: "2px solid black",
|
||||
padding: "0.75rem 0.5rem 0.25rem 0.5rem",
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
<div className="d-flex flex-row justify-content-between align-items-end">
|
||||
<Possesors opts={opts}>{ap.inside.type !== "pronoun" ? ap.inside.possesor : undefined}</Possesors>
|
||||
<div className="mr-2 ml-1 mb-1"><strong>{ap.before ? ap.before.f : ""}</strong></div>
|
||||
<div>
|
||||
<NP opts={opts} inside>{ap.inside}</NP>
|
||||
</div>
|
||||
<div className="ml-2 mr-1 mb-1"><strong>{ap.after ? ap.after.f : ""}</strong></div>
|
||||
</div>
|
||||
</div>
|
||||
<div>AP</div>
|
||||
{english && <div className="small text-muted text-center" style={{
|
||||
// TODO: find a better way to keep this limited to the width of the div above
|
||||
// don't let this make the div above expand
|
||||
margin: "0 auto",
|
||||
maxWidth: "300px",
|
||||
}}>{english}</div>}
|
||||
</div>;
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,3 @@ Once a word gets inflected, you can push or bend it even further a second time.
|
|||
null,
|
||||
],
|
||||
]}</Table>
|
||||
|
||||
## Exceptions
|
||||
|
||||
There are a few exceptions where words may avoid certain inflections... more will be written on that later.
|
|
@ -53,33 +53,7 @@ These words always end in:
|
|||
"غټ",
|
||||
)} />
|
||||
|
||||
<details>
|
||||
|
||||
<summary>
|
||||
<strong>Note</strong>: In sandwiches like <InlinePs opts={opts} ps={{ p: "په ... کې", f: "pu ... ke" }} /> describing <strong>location</strong> the first inflection of *feminine nouns* in this pattern is not used.
|
||||
</summary>
|
||||
|
||||
For example using the word <InlinePs opts={opts} ps={{ p: "کوټه", f: "koTá", e: "room" }} />:
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "زه **په کوټه کې** ناست یم",
|
||||
f: "zu **pu koTá ke** naast yum",
|
||||
e: "I am sitting **in the room**.",
|
||||
}
|
||||
])}</Examples>
|
||||
|
||||
In any other kind of sandwich the first inflection would be used.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "زه **کوټې ته** ځم",
|
||||
f: "zu **koTé ta** dzum",
|
||||
e: "I'm going to the room",
|
||||
},
|
||||
])}</Examples>
|
||||
|
||||
</details>
|
||||
**Note:** See <Link to="/inflection/inflection-patterns/#pattern-1-words-in-sandwiches-starting-with-inlineps-optsopts-ps-p-په-f-pu--">exception</Link> below.
|
||||
|
||||
## 2. Words ending in an unstressed <InlinePs opts={opts} ps={{ p: "ی", f: "ey" }} />
|
||||
|
||||
|
@ -109,39 +83,7 @@ These words are a little irregular but you can see a common patten based around:
|
|||
"پښتون",
|
||||
)} />
|
||||
|
||||
**Note**:
|
||||
|
||||
<details>
|
||||
<summary>
|
||||
<strong>Note</strong>: <strong>Masculine nimate nouns</strong> in this pattern will often only use the first inflection for the plural.
|
||||
</summary>
|
||||
|
||||
For example, if we put a singular masculine animate word <InlinePs opts={opts} ps={{ p: "پښټون", f: "puxtoon" }} /> in a sandwich, most of the time people will not inflect it.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "**د پښتون** نوم څه دی؟",
|
||||
f: "**du puxtoon** noom tsu dey?",
|
||||
e: "What is the **Pashtun's** name",
|
||||
}
|
||||
])}</Examples>
|
||||
|
||||
But it will of course inflect for the plural.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "دلته **پښتانه** اوسېږي",
|
||||
f: "dalta **puxtaanu** oseGee",
|
||||
e: "**Pashtuns** live here",
|
||||
},
|
||||
{
|
||||
p: "دا **د پښتنو** رواج دی",
|
||||
f: "daa **du puxtano** rawaaj dey",
|
||||
e: "This is **the Pashtuns'** custom"
|
||||
},
|
||||
])}</Examples>
|
||||
|
||||
</details>
|
||||
**Note:** See <Link to="/inflection/inflection-patterns/#pattern-4-masculine-animate-nouns">exception</Link> 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
|
|||
<Examples opts={opts}>{[
|
||||
{ p: "خفه", f: "khufa", e: "sad", sub: "...is also sad because it can't inflect like all the other words 😢" },
|
||||
]}</Examples>
|
||||
|
||||
## Exceptions
|
||||
|
||||
Whatever kind of word you're using, it will always inflect for the <Link to="/inflection/inflection-intro/">three reasons</Link> that we mentioned earlier. However, there are two big exceptions.
|
||||
|
||||
### Pattern 1 words in sandwiches starting with <InlinePs opts={opts} ps={{ p: "په", f: "pu" }} />
|
||||
|
||||
When you put a <Link to="/inflection/inflection-patterns/#1-basic">pattern 1 - basic</Link> word in a the <InlinePs opts={opts} ps={{ p: "په ... کې", f: "pu ... ke", e: "in" }} /> sandwich, **it will not use the first inflection**.
|
||||
|
||||
For example, let's put the word <InlinePs opts={opts} ps={{ p: "کوټه", f: "koTa", e: "room" }} /> inside the sandwich <InlinePs opts={opts} ps={{ p: "په ... کې", f: "pu ... ke", e: "in" }} />. It doesn't inflect!
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{ p: "زه **په کوټه کې** یم", f: "zu **pu koTa ke** yum", e: "I am **in the room**" },
|
||||
])}</Examples>
|
||||
|
||||
But if you make it plural, it *will* use the second inflection. Only the first inflection is skipped.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{ p: "مونږ **په کوټو کې** یو", f: "moonG **pu koTo ke** yoo", e: "We are **in the rooms**" },
|
||||
])}</Examples>
|
||||
|
||||
Remember that in any other kind of sandwich, you still use the first inflection with these pattern 1 words.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "زه **کوټې ته** ځم",
|
||||
f: "zu **koTé ta** dzum",
|
||||
e: "I'm going to the room",
|
||||
},
|
||||
])}</Examples>
|
||||
|
||||
Other sandwiches starting with <InlinePs opts={opts} ps={{ p: "په", f: "pu" }} /> like <InlinePs opts={opts} ps={{ p: "په ... باندې", f: "pu ... baande" }} /> are a bit flexible with these pattern 1 words. Sometimes people will inflect them and sometimes they won't.
|
||||
|
||||
<Examples opts={opts}>{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" },
|
||||
])}</Examples>
|
||||
|
||||
### Pattern 4 masculine animate nouns
|
||||
|
||||
<p><Link to="/inflection/inflection-patterns/#4-words-with-the-pashtoon-pattern">Pattern 4</Link> <strong>masculine animate nouns</strong> (ie. a person or animal) in this pattern will often <strong>only use the first inflection for the plural</strong>. (In some dialects and formal written text though, they will still use the inflection for all three reasons.)</p>
|
||||
|
||||
#### In sandwiches
|
||||
|
||||
For example, if we put the the singular word <InlinePs opts={opts} ps={{ p: "پښټون", f: "puxtoon" }} /> in a sandwich, *usually* people will not inflect it.
|
||||
|
||||
<Examples opts={opts}>{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",
|
||||
},
|
||||
])}</Examples>
|
||||
|
||||
#### As subjects of past tense transitive verbs
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "**پښتون** زه ولیدم",
|
||||
f: "**puxtoon** zu óoledum",
|
||||
e: "The Pashtun saw me",
|
||||
sub: "not inflected",
|
||||
},
|
||||
{
|
||||
p: "**پښتنو** زه ولیدم",
|
||||
f: "**puxtano** zu óoledum",
|
||||
e: "The Pashtuns saw me",
|
||||
},
|
||||
])}</Examples>
|
||||
|
||||
#### Plural
|
||||
|
||||
But these words will *always* use the first inflection for the plural.
|
||||
|
||||
<Examples opts={opts}>{psmd([
|
||||
{
|
||||
p: "دلته **پښتانه** اوسېږي",
|
||||
f: "dalta **puxtaanu** oseGee",
|
||||
e: "**Pashtuns** live here",
|
||||
},
|
||||
{
|
||||
p: "دا **د پښتنو** رواج دی",
|
||||
f: "daa **du puxtano** rawaaj dey",
|
||||
e: "This is **the Pashtuns'** custom"
|
||||
},
|
||||
])}</Examples>
|
||||
|
|
|
@ -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
|
|||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
### Sandwich
|
||||
### Sandwich 🥪
|
||||
|
||||
Coming soon...
|
||||
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 <Link to="/phrase-structure/np/">NP</Link> in the middle. For example if we want to say "in the house" we take the sandwich <InlinePs opts={opts} ps={{ p: "په ... کې", f: "pu ... ke", e: "in" }} /> and put the NP <InlinePs opts={opts} ps={{ p: "کور", f: "kor", e: "house" }} /> inside of it.
|
||||
|
||||
<EditablePhraseDiagram opts={opts}>{[
|
||||
{
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
Because the inside of a sandwich is an <Link to="/phrase-structure/np/">NP</Link> we can also spice it up by adding adjectives.
|
||||
|
||||
<EditablePhraseDiagram opts={opts}>{[
|
||||
{
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
We can also add a possesor it hangs outside of the sandwich. All together it's still all considered one AP block though.
|
||||
|
||||
<EditablePhraseDiagram opts={opts}>{[
|
||||
{
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
Here's another example using the sandwich <InlinePs opts={opts} ps={{ p: "سره", f: "sara", e: "with" }} />:
|
||||
|
||||
<EditablePhraseDiagram opts={opts}>{[
|
||||
{
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
Notice how when we put the word <InlinePs opts={opts} ps={{ p: "ملګری", f: "malgúrey", e: "friend" }} /> inside the sandwich it <Link to="/inflection/inflection-intro/">inflects</Link>. You <strong>always inflect the inside of the sandwich</strong> except for <Link to="/inflection/inflection-patterns/#exceptions">two exceptions</Link>.
|
|
@ -162,7 +162,7 @@ Now we have two words, but it's still **one NP**, one building block. We can add
|
|||
},
|
||||
]}</EditablePhraseDiagram>
|
||||
|
||||
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"}} />. 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 <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**.
|
||||
|
||||
<EditablePhraseDiagram opts={opts}>{[
|
||||
{
|
||||
|
|
|
@ -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==
|
||||
|
|
Loading…
Reference in New Issue