diff --git a/locale/config.ts b/locale/config.ts index 43667e725..33f162a5d 100644 --- a/locale/config.ts +++ b/locale/config.ts @@ -145,9 +145,10 @@ interface ExampleCategory { */ 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 * @default false diff --git a/src/data.ts b/src/data.ts index 8834540c9..b7968a8aa 100644 --- a/src/data.ts +++ b/src/data.ts @@ -20,7 +20,10 @@ export const examples = buildList(function* () { Example.parse(e.null || e.singular), Example.parse(e.null_plural || e.plural || e.singular), 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) + : [], ); } });