diff --git a/package.json b/package.json index aa73a44..41cb04f 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": "^3.2.2", + "@lingdocs/pashto-inflector": "^3.2.3", "@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/BasicBlocks.tsx b/src/components/BasicBlocks.tsx index a054aa8..1b5cab7 100644 --- a/src/components/BasicBlocks.tsx +++ b/src/components/BasicBlocks.tsx @@ -29,8 +29,8 @@ function BasicBlocks({ blocks, showKidsSection, large }: { className="d-flex flex-row justify-content-center align-items-center" style={{ border: "2px solid black", - height: large ? "2.75rem" : "2.5rem", - width: large ? "4.5rem" : "4rem", + height: large ? "3.5rem" : "2.5rem", + width: large ? "6rem" : "4rem", }} > {(typeof block === "object" && block.inside) ? block.inside : ""} diff --git a/src/components/BasicVerbShowCase.tsx b/src/components/BasicVerbShowCase.tsx index 0880d83..159891b 100644 --- a/src/components/BasicVerbShowCase.tsx +++ b/src/components/BasicVerbShowCase.tsx @@ -11,11 +11,12 @@ import { removeFVarients, isPastTense, } from "@lingdocs/pashto-inflector"; -import { isImperativeTense } from "@lingdocs/pashto-inflector/dist/lib/type-predicates"; +import { isImperativeTense, isPerfectTense } from "@lingdocs/pashto-inflector/dist/lib/type-predicates"; import { useState } from "react"; import Carousel from "./Carousel"; import { basicVerbs, intransitivePast } from "../content/verbs/basic-present-verbs"; import { getLength } from "@lingdocs/pashto-inflector/dist/lib/p-text-helpers"; +import { isThirdPerson } from "@lingdocs/pashto-inflector/dist/lib/phrase-building/vp-tools"; function BasicVerbShowCase({ opts, tense }: { opts: T.TextOptions, @@ -42,7 +43,7 @@ export default BasicVerbShowCase; function BasicVerbChart({ verb, opts, tense }: { verb: T.VerbEntry, opts: T.TextOptions, - tense: T.VerbTense | T.ImperativeTense, + tense: T.VerbTense | T.ImperativeTense | T.PerfectTense, }) { const [negative, setNegative] = useState(false); const [length, setLength] = useState<"short" | "long">("short"); @@ -60,11 +61,11 @@ function BasicVerbChart({ verb, opts, tense }: {
- {isPastTense(tense) &&
+ {isPastTense(tense) && !isPerfectTense(tense) &&
} -function makeExamplePhrases(verb: T.VerbEntry, tense: T.VerbTense | T.ImperativeTense, negative: boolean, length: "short" | "long"): { ps: T.VerbBlock | T.ImperativeBlock, e: T.EnglishBlock } { +function makeExamplePhrases(verb: T.VerbEntry, tense: T.VerbTense | T.ImperativeTense | T.PerfectTense, negative: boolean, length: "short" | "long"): { ps: T.VerbBlock | T.ImperativeBlock, e: T.EnglishBlock } { function makeSelection(person: T.Person): T.VPSelectionComplete{ return { "blocks": [ @@ -131,7 +132,7 @@ function makeExamplePhrases(verb: T.VerbEntry, tense: T.VerbTense | T.Imperative const compiled = compileVP(rendered, rendered.form); return { ps: [modifyP(getLength(compiled.ps, length)[0])], - e: compiled.e ? modifyEnglish(compiled.e.join(" • ")) : "", + e: compiled.e ? modifyEnglish(compiled.e.join(" • "), tense, isThirdPerson(person)) : "", }; } return createVerbTable(makePhrase, isImperativeTense(tense) ? "imperative" : isPastTense(tense) ? "past" : "nonImperative"); @@ -144,19 +145,22 @@ function modifyP(ps: T.PsString): T.PsString { }; } -function modifyEnglish(e: string): string { +function modifyEnglish(e: string, tense: T.VerbTense | T.ImperativeTense | T.PerfectTense, isThirdPerson: boolean): string { // "kitaab" used as a dummy object - return e - .replace(/\(a\/the\) +book/ig, "") - .replace(/he\/it/ig, "he/she/it") - .replace(/We \(m\. pl\.\)/ig, "We ") - .replace(/They \(m\. pl\.\)/ig, "They ") - .replace(/\(m\. pl\.\)/ig, "(pl.)") - .replace(/\(m\.\)/ig, ""); + const dummyObjectRemoved = + e.replace(/\(a\/the\) +book/ig, "") + return (isPerfectTense(tense) || (isPastTense(tense) && isThirdPerson)) + ? dummyObjectRemoved + : dummyObjectRemoved + .replace(/he\/it/ig, "he/she/it") + .replace(/We \(m\. pl\.\)/ig, "We ") + .replace(/They \(m\. pl\.\)/ig, "They ") + .replace(/\(m\. pl\.\)/ig, "(pl.)") + .replace(/\(m\.\)/ig, ""); } -function tenseToStem(t: T.VerbTense | T.ImperativeTense): "imperfective stem" | "perfective stem" | "imperfective root" | "perfective root" { - return t === "presentVerb" +function tenseToStem(t: T.VerbTense | T.ImperativeTense | T.PerfectTense): "imperfective stem" | "perfective stem" | "imperfective root" | "perfective root" | "past participle" { + const stem = t === "presentVerb" ? "imperfective stem" : t === "subjunctiveVerb" ? "perfective stem" @@ -174,7 +178,10 @@ function tenseToStem(t: T.VerbTense | T.ImperativeTense): "imperfective stem" | ? "perfective root" : t === "imperfectiveImperative" ? "imperfective root" + : t.endsWith("Perfect") + ? "past participle" : "perfective root"; + return stem; } function createVerbTable(f: (person: T.Person) => { ps: T.ArrayOneOrMore, e: string }, type: "imperative" | "nonImperative" | "past"): { ps: T.VerbBlock | T.ImperativeBlock, e: T.EnglishBlock } { diff --git a/src/components/terms-links.tsx b/src/components/terms-links.tsx index 860248a..7998b97 100644 --- a/src/components/terms-links.tsx +++ b/src/components/terms-links.tsx @@ -30,4 +30,20 @@ export function BlockTerm({ text }: { text: string }) { export function PerfectiveHead({ text }: { text: string }) { return { text || "perfective head"}; -} \ No newline at end of file +} + +export function Camera() { + return ; +} + +export function Video() { + return ; +} + +export function KingIcon() { + return ; +} + +export function ServantIcon() { + return ; +}; \ No newline at end of file diff --git a/src/content/index.ts b/src/content/index.ts index ea7f337..b6aaef6 100644 --- a/src/content/index.ts +++ b/src/content/index.ts @@ -63,6 +63,8 @@ import * as negativeVerbs from "!babel-loader!@lingdocs/mdx-loader!./verbs/negat import * as rootsAndStems from "!babel-loader!@lingdocs/mdx-loader!./verbs/roots-and-stems.mdx"; // @ts-ignore import * as pastVerbs from "!babel-loader!@lingdocs/mdx-loader!./verbs/past-verbs.mdx"; +// @ts-ignore +import * as perfectVerbs from "!babel-loader!@lingdocs/mdx-loader!./verbs/perfect-verbs.mdx"; // @ts-ignore import * as introToParticiples from "!babel-loader!@lingdocs/mdx-loader!./participles/intro.mdx"; @@ -223,6 +225,10 @@ const contentTree = [ import: pastVerbs, slug: "past-verbs", }, + { + import: perfectVerbs, + slug: "perfect-verbs", + }, { import: negativeVerbs, slug: "negative-verbs", diff --git a/src/content/verbs/chemistry-perfect.jpg b/src/content/verbs/chemistry-perfect.jpg new file mode 100644 index 0000000..e64b784 Binary files /dev/null and b/src/content/verbs/chemistry-perfect.jpg differ diff --git a/src/content/verbs/past-perfect.svg b/src/content/verbs/past-perfect.svg new file mode 100644 index 0000000..24046ec --- /dev/null +++ b/src/content/verbs/past-perfect.svg @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + diff --git a/src/content/verbs/past-verbs.mdx b/src/content/verbs/past-verbs.mdx index 2d08bb1..54a885d 100644 --- a/src/content/verbs/past-verbs.mdx +++ b/src/content/verbs/past-verbs.mdx @@ -7,8 +7,7 @@ import { Examples, InlinePs, } from "@lingdocs/pashto-inflector"; -import cousins from "./cousins.png"; -import { KidsSection, VP } from "../../components/terms-links"; +import { KidsSection, VP, KingIcon, ServantIcon } from "../../components/terms-links"; import psmd from "../../lib/psmd"; import Link from "../../components/Link"; import Formula from "../../components/formula/Formula"; @@ -22,15 +21,6 @@ import unoReverseMeme from "./uno-reverse-meme.jpg"; import EditableVPEx, { EditIcon } from "../../components/phrase-diagram/EditableVPEx"; import BasicVerbShowCase from "../../components/BasicVerbShowCase"; - -export function KingIcon() { - return ; -} - -export function ServantIcon() { - return ; -}; - Past tense verbs in Pashto are famous for being very difficult and confusing for the learner. Thankfully there are some very simple rules that we can learn, and with a little practice (ok, a *lot* of practice) you'll find there's nothing scary about the past tense in Pashto at all. Now that we're making past tense verbs, we will be using the **bottom half** of the roots and stems tree. diff --git a/src/content/verbs/perfect-verbs.mdx b/src/content/verbs/perfect-verbs.mdx new file mode 100644 index 0000000..aa8a284 --- /dev/null +++ b/src/content/verbs/perfect-verbs.mdx @@ -0,0 +1,105 @@ +--- +title: Perfect +--- + +import { + defaultTextOptions as opts, + Examples, + InlinePs, +} from "@lingdocs/pashto-inflector"; +import { KidsSection, VP, EP, Camera, Video, KingIcon } from "../../components/terms-links"; +import psmd from "../../lib/psmd"; +import Link from "../../components/Link"; +import Formula from "../../components/formula/Formula"; +import EditableVPEx, { EditIcon } from "../../components/phrase-diagram/EditableVPEx"; +import BasicVerbShowCase from "../../components/BasicVerbShowCase"; +import simplePast from "./simple-past-in-reality.svg"; +import presentPerfect from "./present-perfect.svg"; +import chemistryPerfect from "./chemistry-perfect.jpg"; +import BasicBlocks from "../../components/BasicBlocks"; + +## Introduction + +We use [perfect tenses](https://en.wikipedia.org/wiki/Perfect_(grammar)) when we want to **emphasize the consequences** of an event or **focus on the resulting state** after the event. + +> A perfect tense (abbreviated perf or prf) is a grammatical form used to describe a past event with present relevance, or a present state resulting from a past situation. For example, “I have put it on the table” implies both that I put the object on the table and that it is still there; “I have been to France” conveys that this is a part of my experience as of now; and “I have lost my wallet” implies that this loss is troublesome at the present moment. ([wikipedia](https://en.wikipedia.org/wiki/Perfective_aspect#Perfective_vs._perfect)) + +
+ +**Note** ⚠️: This is *not* to be confused with the perfective aspect , which is a totally different thing. + +
+ +In English we're not as strict with using the perfect tense. In fact it can sound a little formal or bookish to always say things like "I've lost my wallet" (perfect) instead of "I lost my wallet" (simple past). In Pashto however, this distinction is very normal and common, and you will see the perfect form used whenever it's important to talk about a state resulting from the action. + +With the past tense we're talking about an event happening. We're just relaying the fact that something happened, without talking about the consequences of that event. + +
+ +
+ +{[ + { + p: "ما ډوډۍ وخوړله", + f: "maa DoDúy óokhoRula", + e: "I ate food", + sub: "meaning: I chewed and swallowed the food." + } +]} + +With a perfect tense, we're talking about the **result of an event**. We're saying that something has happened, and therefore there's an affect on the situation. + +
+ +
+ +{[ + { + p: "ما ډوډۍ خوړلې ده", + f: "maa DoDúy khoRúle da", + e: "I've eaten food", + sub: "meaning: I am full now." + } +]} + +## How to make perfect tenses 🧪 + +Earlier we talked about how and are totally different in Pashto. They have different tenses, equatives don't have aspect, and they have totally different phrase structures. + +Well now we're going to do something very crazy. To make the perfect forms we are going to **combine verbs and equatives**. 👨🏻‍🔬😮 + +
+ +
+ + + Verb Past Participle +{` `} + Equative = Perfect + + +To make the perfect forms we take the past participle of the verb and **add an equative block** next to it. For example, with the verb we could have something like: + + + +Now instead of one verb block, *we have **two blocks** that have to agree with the king* of the . Let's see how this works with some intransitive verbs. + + + +That seems like a pretty intimidating chart! But it gets simpler if we remember that we are just making the two blocks (past participle and equative) agree with the king of the phrase. + +Have a look at the examples below, and notice how both the past participle and the equative blocks agree with the king of the phrase. Perfects are considered past-tense so they will follow the same VP structure as other past tense forms: + +- with **intransitive** verbs the *subject is king* +- with **transitive** verbs the *object is king* + +#### Intransitive Examples + + + +With perfect tenses, we'll use the and the tenses of equatives. + +IN PROGRESS + diff --git a/src/content/verbs/present-perfect.svg b/src/content/verbs/present-perfect.svg new file mode 100644 index 0000000..55920f4 --- /dev/null +++ b/src/content/verbs/present-perfect.svg @@ -0,0 +1,414 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + +