+
diff --git a/src/components/blocks/Block.tsx b/src/components/blocks/Block.tsx
index 0e2c906..2d68326 100644
--- a/src/components/blocks/Block.tsx
+++ b/src/components/blocks/Block.tsx
@@ -138,7 +138,7 @@ function ModalVerbBlock({ opts, v, script }: {
>
Verb
-
Modal
+
Ability
}
diff --git a/src/lib/phrase-building/compile.ts b/src/lib/phrase-building/compile.ts
index 2550972..5327058 100644
--- a/src/lib/phrase-building/compile.ts
+++ b/src/lib/phrase-building/compile.ts
@@ -234,7 +234,11 @@ function getPsFromPiece(piece: T.Block | T.Kid, subjectPerson: T.Person): T.PsSt
}
if (piece.block.type === "modalVerbBlock") {
// getLong is just for type safety - we will have split up the length options earlier in compileVPPs
- return getLong(piece.block.ps);
+ const verbPs = getLong(piece.block.ps);
+ if (piece.block.complementWelded) {
+ return combineComplementWVerbPs(piece.block.complementWelded, verbPs);
+ }
+ return verbPs;
}
if (piece.block.type === "modalVerbKedulPart") {
// just using the short one for now - it will only be short anyways
diff --git a/src/lib/phrase-building/render-vp.ts b/src/lib/phrase-building/render-vp.ts
index cef831d..c1c1f46 100644
--- a/src/lib/phrase-building/render-vp.ts
+++ b/src/lib/phrase-building/render-vp.ts
@@ -436,7 +436,9 @@ function renderVerbSelection(vs: T.VerbSelectionComplete, person: T.Person, comp
type: "verb",
block: {
...vs,
- ps: rest,
+ ps: (!perfective && renderedComplement && vs.verb.entry.p.includes(" "))
+ ? removeComplement(rest, renderedComplement)
+ : rest,
person,
hasBa,
complementWelded: ((!perfective && renderedComplement) && (
@@ -464,13 +466,42 @@ function renderVerbSelection(vs: T.VerbSelectionComplete, person: T.Person, comp
: [],
...splitUpIfModal(vrb),
] as VerbBlocks;
- const perfectStuff = isPerfectTense(vrb.block.tense) ? getPerfectStuff(rest, vrb) : undefined;
+ const perfectStuff = isPerfectTense(vrb.block.tense) ? getPerfectStuff(vrb) : undefined;
return {
verbBlocks: perfectStuff ? perfectStuff : verbBlocks,
hasBa,
};
}
+function removeComplement(ps: T.SingleOrLengthOpts
, complement: T.Rendered): T.SingleOrLengthOpts {
+ if ("long" in ps) {
+ return {
+ long: removeComplement(ps.long, complement) as T.PsString[],
+ short: removeComplement(ps.short, complement) as T.PsString[],
+ ...ps.mini ? {
+ mini: removeComplement(ps.mini, complement) as T.PsString[],
+ } : {},
+ };
+ }
+ const c = complement.selection.type === "adjective"
+ ? complement.selection.ps
+ : complement.selection.type === "loc. adv."
+ ? complement.selection.ps
+ : complement.selection.type === "sandwich"
+ ? complement.selection.inside.selection.ps
+ : complement.selection.type === "noun"
+ ? complement.selection.ps
+ : complement.selection.ps;
+ // TODO: this is brutal
+ const removed = ps.map(p => (
+ c.reduce((acc, v) => ({
+ p: acc.p.replace(`${v.p} `, ""),
+ f: acc.f.replace(`${v.f} `, ""),
+ }), p)
+ ));
+ return removed;
+}
+
function createComplementRetroactively(complement: T.DictionaryEntry | undefined, person: T.Person | undefined): T.ComplementSelection {
// This is a bit of a hack to work with the current verb conjugation system.
if (!complement) {
@@ -534,8 +565,8 @@ function splitUpIfModal(v: T.VerbRenderedBlock): [T.VerbRenderedBlock] | [T.Moda
];
}
-function getPerfectStuff(v: T.SingleOrLengthOpts, vrb: T.VerbRenderedBlock): [T.PerfectParticipleBlock, T.PerfectEquativeBlock] {
- const [p, eq] = splitOffLeapfrogWordFull(v);
+function getPerfectStuff(vrb: T.VerbRenderedBlock): [T.PerfectParticipleBlock, T.PerfectEquativeBlock] {
+ const [p, eq] = splitOffLeapfrogWordFull(vrb.block.ps);
return [
{
type: "perfectParticipleBlock",