now working with giving verbs

This commit is contained in:
adueck 2023-07-23 10:17:18 +04:00
parent 5edf0d1e02
commit 021af159c5
5 changed files with 299 additions and 124 deletions

View File

@ -342,3 +342,7 @@ export function chooseLength<N>(
} }
return x; return x;
} }
export function isGivingVerb(v: T.VerbEntry): boolean {
return ["raakawul", "darkawul", "warkawul"].includes(v.entry.g);
}

View File

@ -534,6 +534,39 @@ const khufaKedul = vEntry(
c: "adj.", c: "adj.",
} }
); );
const warkawul = vEntry({
ts: 1527813914,
i: 14899,
p: "ورکول",
f: "warkawul",
g: "warkawul",
e: "to give (to him/her/it - towards third person)",
r: 4,
c: "v. trans.",
ec: "give,gives,giving,gave,given",
});
const raakawul = vEntry({
ts: 1527813914,
i: 14899,
p: "راکول",
f: "raakawul",
g: "raakawul",
e: "to give (to him/her/it - towards first person)",
r: 4,
c: "v. trans.",
ec: "give,gives,giving,gave,given",
});
const darkawul = vEntry({
ts: 1527813914,
i: 14899,
p: "درکول",
f: "darkawul",
g: "darkawul",
e: "to give (to him/her/it - towards second person)",
r: 4,
c: "v. trans.",
ec: "give,gives,giving,gave,given",
});
const ooPH: T.PH = { type: "PH", ps: { p: "و", f: "óo" } }; const ooPH: T.PH = { type: "PH", ps: { p: "و", f: "óo" } };
@ -946,6 +979,56 @@ describe("perfective stems", () => {
}, },
], ],
}, },
{
title: "special giving verbs",
tests: [
{
verb: warkawul,
result: [
[{ type: "PH", ps: { p: "ور", f: "wár" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړ", f: "kR" }],
short: [{ p: "ک", f: "k" }],
},
},
],
],
},
{
verb: darkawul,
result: [
[{ type: "PH", ps: { p: "در", f: "dár" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړ", f: "kR" }],
short: [{ p: "ک", f: "k" }],
},
},
],
],
},
{
verb: raakawul,
result: [
[{ type: "PH", ps: { p: "را", f: "ráa" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړ", f: "kR" }],
short: [{ p: "ک", f: "k" }],
},
},
],
],
},
],
},
{ {
title: "includes extra irregular short roots for kawul verbs", title: "includes extra irregular short roots for kawul verbs",
tests: [ tests: [
@ -1299,6 +1382,59 @@ describe("perfective roots", () => {
}, },
], ],
}, },
{
title: "special giving verbs",
tests: [
{
verb: warkawul,
result: [
[{ type: "PH", ps: { p: "ور", f: "wár" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړل", f: "kRul" }],
short: [{ p: "کړ", f: "kR" }],
mini: [{ p: "ک", f: "k" }],
},
},
],
],
},
{
verb: darkawul,
result: [
[{ type: "PH", ps: { p: "در", f: "dár" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړل", f: "kRul" }],
short: [{ p: "کړ", f: "kR" }],
mini: [{ p: "ک", f: "k" }],
},
},
],
],
},
{
verb: raakawul,
result: [
[{ type: "PH", ps: { p: "را", f: "ráa" } }],
[
{
type: "VB",
ps: {
long: [{ p: "کړل", f: "kRul" }],
short: [{ p: "کړ", f: "kR" }],
mini: [{ p: "ک", f: "k" }],
},
},
],
],
},
],
},
{ {
title: "is the special form with tlul", title: "is the special form with tlul",
tests: [ tests: [

View File

@ -10,6 +10,7 @@ import { concatPsString, trimOffPs } from "../p-text-helpers";
import * as T from "../../../types"; import * as T from "../../../types";
import { makePsString, removeFVarientsFromVerb } from "../accent-and-ps-utils"; import { makePsString, removeFVarientsFromVerb } from "../accent-and-ps-utils";
import { import {
accentOnFront,
accentOnNFromEnd, accentOnNFromEnd,
countSyllables, countSyllables,
removeAccents, removeAccents,
@ -32,6 +33,7 @@ import {
} from "./rs-helpers"; } from "./rs-helpers";
import { inflectPattern3 } from "./new-inflectors"; import { inflectPattern3 } from "./new-inflectors";
import { fmapSingleOrLengthOpts } from "../fp-ps"; import { fmapSingleOrLengthOpts } from "../fp-ps";
import { isGivingVerb } from "../misc-helpers";
export const statVerb = { export const statVerb = {
intransitive: vEntry({ intransitive: vEntry({
@ -250,6 +252,21 @@ function getRoot(
? [[complement], [auxStem]] ? [[complement], [auxStem]]
: [[], [weld(complement, auxStem)]]; : [[], [weld(complement, auxStem)]];
} }
if (isGivingVerb(verb) && aspect === "perfective") {
const auxStem = getRoot(
statVerb.transitive,
genderNum,
"perfective"
)[1][0] as T.VBBasic;
const ph: T.PH = {
type: "PH",
ps: accentOnFront({
p: verb.entry.p.slice(0, 2),
f: verb.entry.f.slice(0, 3),
}),
};
return [[ph], [auxStem]];
}
const base = const base =
aspect === "imperfective" aspect === "imperfective"
? accentOnNFromEnd(makePsString(verb.entry.p, verb.entry.f), 0) ? accentOnNFromEnd(makePsString(verb.entry.p, verb.entry.f), 0)
@ -320,6 +337,21 @@ function getStem(
? [[complement], [auxStem]] ? [[complement], [auxStem]]
: [[], [weld(complement, auxStem)]]; : [[], [weld(complement, auxStem)]];
} }
if (isGivingVerb(verb) && aspect === "perfective") {
const auxStem = getStem(
statVerb.transitive,
genderNum,
"perfective"
)[1][0] as T.VBBasic;
const ph: T.PH = {
type: "PH",
ps: accentOnFront({
p: verb.entry.p.slice(0, 2),
f: verb.entry.f.slice(0, 3),
}),
};
return [[ph], [auxStem]];
}
if (aspect === "perfective") { if (aspect === "perfective") {
if (verb.entry.f === "tlul") { if (verb.entry.f === "tlul") {
return tlulPerfectiveStem(genderNum); return tlulPerfectiveStem(genderNum);

View File

@ -7,6 +7,7 @@
*/ */
module.exports = [ module.exports = [
1585228579997, // ورتلل
1527815216, // راتلل - to come 1527815216, // راتلل - to come
1527813473, // الوتل - to fly 1527813473, // الوتل - to fly
1527814012, // اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon 1527814012, // اوښتل - to pass over, overturn, be flipped over, spill over, shift, change, diverge, pass, cross, abandon

View File

@ -7,6 +7,8 @@
*/ */
module.exports = [ module.exports = [
1527819279, // راکول
1527813914, // ورکول
1527814617, // نیول - to take 1527814617, // نیول - to take
1527811872, // اچول - to put, pour, drop, throw, put on 1527811872, // اچول - to put, pour, drop, throw, put on
1527817298, // اخیستل - to take, buy, purchase, receive; to shave, cut with scissors 1527817298, // اخیستل - to take, buy, purchase, receive; to shave, cut with scissors