diff --git a/tests/verbs.test.ts b/tests/verbs.test.ts index 8c40e10..e6a3b06 100644 --- a/tests/verbs.test.ts +++ b/tests/verbs.test.ts @@ -250,5 +250,6 @@ describe("Participle", () => { expect(find(traho)).toBe("tractus, tracta, tractum"); expect(find(fugio)).toBe("fugitus, fugita, fugitum"); expect(find(invenio)).toBe("inventus, inventa, inventum"); + expect(saevio.participle?.passive).not.toHaveProperty("perfect"); }); }); diff --git a/verbs/index.ts b/verbs/index.ts index 1060c2a..aac1b02 100644 --- a/verbs/index.ts +++ b/verbs/index.ts @@ -2,7 +2,7 @@ import deepMapValues from "just-deep-map-values"; import extend from "just-extend"; import formatStringTemplate from "string-template"; import { getConjugation, PrincipalParts, type Shape as VerbShape } from "./utils"; -import verbTemplate from "./template"; +import * as templates from "./template"; import { z } from "zod"; const Overrides: z.ZodType = z.record(z.string(), z.unknown()).default({}); @@ -30,6 +30,8 @@ export default (principalParts: z.infer, optionsInput?: V const presentStemB = conjugation >= 3 ? `${presentActiveIndicative.slice(0, -1)}u` : presentStem; const presentStemC = conjugation > 3 ? `${presentActiveIndicative.slice(0, -1)}e` : presentStem; + const verbTemplate = perfectPassiveStem ? templates.withPerfectPassiveStem : templates.withoutPerfectPassiveStem; + const verb = deepMapValues(verbTemplate, template => { return formatStringTemplate(template, { presentActiveIndicative, @@ -43,4 +45,4 @@ export default (principalParts: z.infer, optionsInput?: V }); return extend(true, verb, options.overrides) as VerbShape; -} +}; diff --git a/verbs/template.ts b/verbs/template.ts index 6648554..6b1cb87 100644 --- a/verbs/template.ts +++ b/verbs/template.ts @@ -1,6 +1,6 @@ import type { Shape as VerbShape } from "./utils"; -export default { +export const withoutPerfectPassiveStem = { indicative: { active: { present: { @@ -106,7 +106,16 @@ export default { participle: { active: { present: "{presentStemC}ns, {presentStemC}ntis" - }, + } + } +} satisfies VerbShape; + +export const withPerfectPassiveStem = { + ...withoutPerfectPassiveStem, + + participle: { + ...withoutPerfectPassiveStem.participle, + passive: { perfect: "{perfectPassiveStem}us, {perfectPassiveStem}a, {perfectPassiveStem}um" }