Merge branch 'fix-schema' into 'main'

fix: make ExampleCategory.morphemes optional

See merge request PronounsPage/PronounsPage!553
This commit is contained in:
Andrea Vos 2025-01-13 19:14:39 +00:00
commit 2ba5d4f406
2 changed files with 7 additions and 3 deletions

View File

@ -145,9 +145,10 @@ interface ExampleCategory {
*/ */
name: string; name: string;
/** /**
* which morphemes belong to this category. visible example sentences will contain at least one listed morpheme * which morphemes belong to this category. visible example sentences will contain at least one listed morpheme.
* if not present, example categories must be assigned to examples using the comma-separated "categories" column in examples.tsv
*/ */
morphemes: string[]; morphemes?: string[];
/** /**
* whether this category is only shown in comprehensive view * whether this category is only shown in comprehensive view
* @default false * @default false

View File

@ -20,7 +20,10 @@ export const examples = buildList(function* () {
Example.parse(e.null || e.singular), Example.parse(e.null || e.singular),
Example.parse(e.null_plural || e.plural || e.singular), Example.parse(e.null_plural || e.plural || e.singular),
e.isHonorific, e.isHonorific,
e.categories ? e.categories.split(',').map(c => c.trim()).filter(c => c) : [], e.categories
? e.categories.split(',').map((c) => c.trim())
.filter((c) => c)
: [],
); );
} }
}); });