This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/src/data.js

65 lines
2.1 KiB
JavaScript
Raw Normal View History

import {Source, Example, NounTemplate, PronounGroup, PronounLibrary, Name, Person, NounDeclension} from './classes'
import { buildDict, buildList } from './helpers';
2020-12-04 13:09:57 -08:00
import { parsePronouns } from './buildPronoun';
import pronounsRaw from '../data/pronouns/pronouns.tsv';
export const pronouns = parsePronouns(pronounsRaw);
import examplesRaw from '../data/pronouns/examples.tsv';
export const examples = buildList(function* () {
for (let e of examplesRaw) {
yield new Example(
Example.parse(e.singular),
Example.parse(e.plural || e.singular),
e.isHonorific,
);
}
});
2020-10-12 06:49:33 -07:00
import nounTemplatesRaw from '../data/nouns/nounTemplates.tsv';
2020-09-04 08:07:32 -07:00
export const nounTemplates = buildList(function* () {
for (let t of nounTemplatesRaw) {
yield new NounTemplate(
t.masc.replace(/-/g, '').split('/'),
t.fem.replace(/-/g, '').split('/'),
t.neutr.replace(/-/g, '').split('/'),
t.mascPl.replace(/-/g, '').split('/'),
t.femPl.replace(/-/g, '').split('/'),
t.neutrPl.replace(/-/g, '').split('/'),
);
}
});
2020-08-05 11:24:05 -07:00
import pronounGroupsRaw from '../data/pronouns/pronounGroups.tsv';
export const pronounGroups = buildList(function* () {
for (let g of pronounGroupsRaw) {
yield new PronounGroup(
2020-09-08 09:10:04 -07:00
g.name,
g.pronouns ? g.pronouns.split(',') : [],
2020-09-08 09:10:04 -07:00
g.description,
2021-12-23 03:36:54 -08:00
g.key || null,
2020-09-08 09:10:04 -07:00
);
}
});
export const pronounLibrary = new PronounLibrary(pronounGroups, pronouns);
2020-09-29 08:59:23 -07:00
2020-10-12 06:49:33 -07:00
import peopleRaw from '../data/people/people.tsv';
2020-09-29 10:11:46 -07:00
export const people = buildList(function* () {
for (let p of peopleRaw) {
yield new Person(
p.name,
p.description,
p.pronouns.split(','),
p.sources ? p.sources.split(',') : [],
);
}
});
2020-10-11 05:50:33 -07:00
2020-10-12 06:49:33 -07:00
import nounDeclensionTemplatesRaw from '../data/nouns/nounDeclension.tsv';
2020-10-11 05:50:33 -07:00
export const nounDeclensionTemplates = buildList(function* () {
for (let d of nounDeclensionTemplatesRaw) {
yield new NounDeclension(d);
}
});