@fpw/en-wiktionary-la-modules 0.2.2 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/LICENSE +75 -75
  2. package/README.md +19 -15
  3. package/dist/LaEngine.d.ts +23 -23
  4. package/dist/LaEngine.js +64 -66
  5. package/dist/index.d.ts +12 -11
  6. package/dist/index.js +12 -28
  7. package/dist/modules/common.d.ts +67 -66
  8. package/dist/modules/common.js +145 -157
  9. package/dist/modules/conjugation/LaVerb.d.ts +118 -109
  10. package/dist/modules/conjugation/LaVerb.js +2861 -2295
  11. package/dist/modules/conjugation/VerbAffix.d.ts +18 -18
  12. package/dist/modules/conjugation/VerbAffix.js +19 -23
  13. package/dist/modules/conjugation/VerbForm.d.ts +204 -182
  14. package/dist/modules/conjugation/VerbForm.js +215 -199
  15. package/dist/modules/conjugation/VerbType.d.ts +54 -40
  16. package/dist/modules/conjugation/VerbType.js +66 -58
  17. package/dist/modules/declination/LaAdjData.d.ts +16 -16
  18. package/dist/modules/declination/LaAdjData.js +1474 -908
  19. package/dist/modules/declination/LaNominal.d.ts +136 -130
  20. package/dist/modules/declination/LaNominal.js +1884 -1804
  21. package/dist/modules/declination/LaNounData.d.ts +16 -2
  22. package/dist/modules/declination/LaNounData.js +935 -855
  23. package/dist/modules/declination/LaPersonalPronoun.d.ts +12 -12
  24. package/dist/modules/declination/LaPersonalPronoun.js +80 -85
  25. package/dist/modules/declination/NominalForm.d.ts +85 -69
  26. package/dist/modules/declination/NominalForm.js +101 -91
  27. package/dist/modules/declination/NominalType.d.ts +191 -120
  28. package/dist/modules/declination/NominalType.js +211 -146
  29. package/dist/modules/headword/HeadWord.d.ts +107 -107
  30. package/dist/modules/headword/HeadWord.js +28 -32
  31. package/dist/modules/headword/HeadwordParser.d.ts +29 -29
  32. package/dist/modules/headword/HeadwordParser.js +456 -452
  33. package/package.json +23 -15
  34. package/dist/LaEngine.js.map +0 -1
  35. package/dist/index.js.map +0 -1
  36. package/dist/modules/common.js.map +0 -1
  37. package/dist/modules/conjugation/LaVerb.js.map +0 -1
  38. package/dist/modules/conjugation/VerbAffix.js.map +0 -1
  39. package/dist/modules/conjugation/VerbForm.js.map +0 -1
  40. package/dist/modules/conjugation/VerbType.js.map +0 -1
  41. package/dist/modules/declination/LaAdjData.js.map +0 -1
  42. package/dist/modules/declination/LaNominal.js.map +0 -1
  43. package/dist/modules/declination/LaNounData.js.map +0 -1
  44. package/dist/modules/declination/LaPersonalPronoun.js.map +0 -1
  45. package/dist/modules/declination/NominalForm.js.map +0 -1
  46. package/dist/modules/declination/NominalType.js.map +0 -1
  47. package/dist/modules/headword/HeadWord.js.map +0 -1
  48. package/dist/modules/headword/HeadwordParser.js.map +0 -1
  49. package/src/LaEngine.ts +0 -86
  50. package/src/index.ts +0 -16
  51. package/src/modules/common.ts +0 -164
  52. package/src/modules/conjugation/LaVerb.ts +0 -2669
  53. package/src/modules/conjugation/VerbAffix.ts +0 -18
  54. package/src/modules/conjugation/VerbForm.ts +0 -223
  55. package/src/modules/conjugation/VerbType.ts +0 -55
  56. package/src/modules/declination/LaAdjData.ts +0 -1036
  57. package/src/modules/declination/LaNominal.ts +0 -2025
  58. package/src/modules/declination/LaNounData.ts +0 -897
  59. package/src/modules/declination/LaPersonalPronoun.ts +0 -92
  60. package/src/modules/declination/NominalForm.ts +0 -89
  61. package/src/modules/declination/NominalType.ts +0 -157
  62. package/src/modules/headword/HeadWord.ts +0 -132
  63. package/src/modules/headword/HeadwordParser.ts +0 -515
@@ -1,92 +0,0 @@
1
- import { ArgMap, FormMap } from "../common";
2
- import { NumberTantum } from "./LaNominal";
3
- import { NominalForm } from "./NominalForm";
4
-
5
- export interface PersonalPronounInflectionData {
6
- templateType: "ppron";
7
- forms: FormMap<NominalForm>;
8
- pers: 1 | 2 | 3;
9
- num: NumberTantum;
10
- }
11
-
12
- export class LaPersonalPronoun {
13
- public make_data(args: ArgMap): PersonalPronounInflectionData {
14
- const lemma = args.get("1");
15
- let forms: Map<NominalForm, string[]>;
16
- let num: NumberTantum;
17
- let pers: 1 | 2 | 3;
18
-
19
- switch (lemma) {
20
- case undefined:
21
- case "":
22
- case "ego":
23
- forms = new Map<NominalForm, string[]>([
24
- [NominalForm.NomSg, ["ego"]],
25
- [NominalForm.AccSg, ["mē"]],
26
- [NominalForm.GenSg, ["meī"]],
27
- [NominalForm.DatSg, ["mihi"]],
28
- [NominalForm.AblSg, ["mē"]],
29
- ]);
30
- pers = 1;
31
- num = NumberTantum.Singular;
32
- break;
33
- case "nōs":
34
- forms = new Map<NominalForm, string[]>([
35
- [NominalForm.NomPl, ["nōs"]],
36
- [NominalForm.AccPl, ["nōs"]],
37
- [NominalForm.GenPl, ["nostrum", "nostrī"]],
38
- [NominalForm.DatPl, ["nōbīs"]],
39
- [NominalForm.AblPl, ["nōbīs"]],
40
- ]);
41
- pers = 1;
42
- num = NumberTantum.Plural;
43
- break;
44
- case "tū":
45
- forms = new Map<NominalForm, string[]>([
46
- [NominalForm.NomSg, ["tū"]],
47
- [NominalForm.AccSg, ["tē"]],
48
- [NominalForm.GenSg, ["tuī"]],
49
- [NominalForm.DatSg, ["tibi", "tibī"]],
50
- [NominalForm.AblSg, ["tē"]],
51
- ]);
52
- pers = 2;
53
- num = NumberTantum.Singular;
54
- break;
55
- case "vōs":
56
- forms = new Map<NominalForm, string[]>([
57
- [NominalForm.NomPl, ["vōs"]],
58
- [NominalForm.AccPl, ["vōs"]],
59
- [NominalForm.GenPl, ["vestrum", "vestrī"]],
60
- [NominalForm.DatPl, ["vōbīs"]],
61
- [NominalForm.AblPl, ["vōbīs"]],
62
- ]);
63
- pers = 2;
64
- num = NumberTantum.Plural;
65
- break;
66
- case "sē":
67
- forms = new Map<NominalForm, string[]>([
68
- [NominalForm.AccSg, ["sē", "sēsē"]],
69
- [NominalForm.GenSg, ["suī"]],
70
- [NominalForm.DatSg, ["sibi"]],
71
- [NominalForm.AblSg, ["sē", "sēsē"]],
72
-
73
- [NominalForm.AccPl, ["sē", "sēsē"]],
74
- [NominalForm.GenPl, ["suī"]],
75
- [NominalForm.DatPl, ["sibi"]],
76
- [NominalForm.AblPl, ["sē", "sēsē"]],
77
- ]);
78
- pers = 3;
79
- num = NumberTantum.Both;
80
- break;
81
- default:
82
- throw Error(`Unknown ppron lemma: ${lemma}`);
83
- }
84
-
85
- return {
86
- templateType: "ppron",
87
- forms: forms,
88
- pers: pers,
89
- num: num,
90
- };
91
- }
92
- }
@@ -1,89 +0,0 @@
1
- import { FormMap, is_enum_value } from "../common";
2
-
3
- export enum NominalForm {
4
- NomSg = "nom_sg",
5
- LinkedNomSg = "linked_nom_sg",
6
- NomPl = "nom_pl",
7
- LinkedNomPl = "linked_nom_pl",
8
- AccSg = "acc_sg",
9
- AccPl = "acc_pl",
10
- GenSg = "gen_sg",
11
- GenPl = "gen_pl",
12
- LocSg = "loc_sg",
13
- LocPl = "loc_pl",
14
- DatSg = "dat_sg",
15
- DatPl = "dat_pl",
16
- AblSg = "abl_sg",
17
- AblPl = "abl_pl",
18
- VocSg = "voc_sg",
19
- VocPl = "voc_pl",
20
-
21
- NomSgM = "nom_sg_m",
22
- LinkedNomSgM = "linked_nom_sg_m",
23
- NomPlM = "nom_pl_m",
24
- LinkedNomPlM = "linked_nom_pl_m",
25
- AccSgM = "acc_sg_m",
26
- AccPlM = "acc_pl_m",
27
- GenSgM = "gen_sg_m",
28
- GenPlM = "gen_pl_m",
29
- LocSgM = "loc_sg_m",
30
- LocPlM = "loc_pl_m",
31
- DatSgM = "dat_sg_m",
32
- DatPlM = "dat_pl_m",
33
- AblSgM = "abl_sg_m",
34
- AblPlM = "abl_pl_m",
35
- VocSgM = "voc_sg_m",
36
- VocPlM = "voc_pl_m",
37
-
38
- NomSgF = "nom_sg_f",
39
- LinkedNomSgF = "linked_nom_sg_f",
40
- NomPlF = "nom_pl_f",
41
- LinkedNomPlF = "linked_nom_pl_f",
42
- AccSgF = "acc_sg_f",
43
- AccPlF = "acc_pl_f",
44
- GenSgF = "gen_sg_f",
45
- GenPlF = "gen_pl_f",
46
- LocSgF = "loc_sg_f",
47
- LocPlF = "loc_pl_f",
48
- DatSgF = "dat_sg_f",
49
- DatPlF = "dat_pl_f",
50
- AblSgF = "abl_sg_f",
51
- AblPlF = "abl_pl_f",
52
- VocSgF = "voc_sg_f",
53
- VocPlF = "voc_pl_f",
54
-
55
- NomSgN = "nom_sg_n",
56
- LinkedNomSgN = "linked_nom_sg_n",
57
- NomPlN = "nom_pl_n",
58
- LinkedNomPlN = "linked_nom_pl_n",
59
- AccSgN = "acc_sg_n",
60
- AccPlN = "acc_pl_n",
61
- GenSgN = "gen_sg_n",
62
- GenPlN = "gen_pl_n",
63
- LocSgN = "loc_sg_n",
64
- LocPlN = "loc_pl_n",
65
- DatSgN = "dat_sg_n",
66
- DatPlN = "dat_pl_n",
67
- AblSgN = "abl_sg_n",
68
- AblPlN = "abl_pl_n",
69
- VocSgN = "voc_sg_n",
70
- VocPlN = "voc_pl_n",
71
- }
72
-
73
- export function setNominalForm(forms: FormMap<NominalForm>, form: string, values: string[] | undefined) {
74
- if (!is_enum_value(NominalForm, form)) {
75
- throw Error(`Invalid nominal form ${form}: ${values}`);
76
- }
77
- if (values) {
78
- forms.set(form, values);
79
- } else {
80
- forms.delete(form);
81
- }
82
- }
83
-
84
- export function getNominalForm(forms: FormMap<NominalForm>, form: string): string[] | undefined {
85
- if (!is_enum_value(NominalForm, form)) {
86
- throw Error(`Invalid nominal form ${form}`);
87
- }
88
- return forms.get(form);
89
- }
@@ -1,157 +0,0 @@
1
- import { is_enum_value } from "../common";
2
-
3
- export enum NominalType {
4
- Singular = "sg",
5
- NoSingular = "-sg",
6
- Plural = "pl",
7
- NoPlural = "-pl",
8
- Both = "both",
9
- NotBoth = "not_both",
10
-
11
- Masculine = "M",
12
- masculine = "m",
13
- Feminine = "F",
14
- feminine = "f",
15
- Neuter = "N",
16
- neuter = "n",
17
- NoMasculine = "-M",
18
- NotMasculine = "not_M",
19
- NotMe = "not_Me",
20
- NotFeminine = "not_F",
21
- NoFeminine = "-F",
22
- NoNeuter = "-N",
23
- NotNeuter = "not_N",
24
- NotNoNeuter = "not_-N",
25
-
26
- GenPluM = "genplum",
27
- NotGenPluM = "not_genplum",
28
-
29
- AccIm = "acc_im",
30
- NotAccIm = "not_acc_im",
31
- AccImEm = "acc_im_em",
32
- NotAccImEm = "not_acc_im_em",
33
- AccEmIm = "acc_em_im",
34
- NotAccEmIm = "not_acc_em_im",
35
- AccImIn = "acc_im_in",
36
- AccImInEm = "acc_im_in_em",
37
- NotAccImInEm = "not_acc_im_in_em",
38
- NotAccImIn = "not_acc_im_in",
39
- AccImOccEm = "acc_im_occ_em",
40
- NotAccImOccEm = "not_acc_im_occ_em",
41
- AblEI = "abl_e_i",
42
- NotAblEI = "not_abl_e_i",
43
- AblI = "abl_i",
44
- NotAblI = "not_abl_i",
45
- AblIE = "abl_i_e",
46
- NotAblIE = "not_abl_i_e",
47
- AblEOccI = "abl_e_occ_i",
48
- NotAblEOccI = "not_abl_e_occ_i",
49
-
50
- VocI = "voci",
51
- NoVocI = "-voci",
52
-
53
- Abus = "abus",
54
- NotAbus = "not_abus",
55
- Ubus = "ubus",
56
- NotUbus = "not_ubus",
57
-
58
- Ium = "ium",
59
- NoIum = "-ium",
60
- Ius = "ius",
61
- NoIus = "-ius",
62
- NotIus = "not_ius",
63
- Us = "us",
64
- NoUs = "-us",
65
- NotUs = "not_us",
66
- Am = "am",
67
- NoAm = "-am",
68
- NotAm = "not_am",
69
-
70
- Vos = "vos",
71
- NoVos = "-vos",
72
- Vom = "vom",
73
- NoVom = "-vom",
74
-
75
- Er = "er",
76
- NoEr = "-er",
77
- NotNoErr = "not_-er",
78
-
79
- a = "a",
80
- i = "i",
81
- I = "I",
82
- Noi = "-i",
83
- NoI = "-I",
84
- NotI = "not_I",
85
- Pure = "pure",
86
- NoPure = "-pure",
87
- NotPure = "not_pure",
88
- Par = "par",
89
- NoPar = "-par",
90
- NotPar = "not_par",
91
- Ic = "ic",
92
- NoIc = "-ic",
93
-
94
- greek = "greek",
95
- Nogreek = "-greek",
96
- Notgreek = "not_greek",
97
- Greek = "Greek",
98
- NoGreek = "-Greek",
99
- NotGreek = "not_Greek",
100
- GreekA = "greekA",
101
- NoGreekA = "-greekA",
102
- GreekE = "greekE",
103
- NoGreekE = "-greekE",
104
- Echo = "echo",
105
- argo = "argo",
106
- Callisto = "Callisto",
107
- Polis = "polis",
108
- NotPolis = "not_polis",
109
- NoPolis = "-polis",
110
- On = "on",
111
- NoOn = "-on",
112
- NotOn = "not_on",
113
- Me = "Me",
114
- NoMe = "-Me",
115
- Ma = "Ma",
116
- NoMa = "-Ma",
117
-
118
- Locative = "loc",
119
- NoLocative = "-loc",
120
- Ligature = "lig",
121
- NoCategories = "nocat",
122
-
123
- SuffixN = "sufn",
124
- NotSuffixN = "not_sufn",
125
-
126
- poetic_esi = "poetic_esi",
127
-
128
- // added by fpw to explicitly choose -e / -i in -ens adecl
129
- Participle = "ptc",
130
-
131
- // probably errors
132
- Gr = "Gr",
133
- gr = "gr",
134
- navis = "navis",
135
- Second = "2nd",
136
- }
137
-
138
- export function addNominalType(types: Set<NominalType>, nomType: string) {
139
- if (!is_enum_value(NominalType, nomType)) {
140
- throw Error(`Invalid nominal type '${nomType}'`);
141
- }
142
- types.add(nomType);
143
- }
144
-
145
- export function hasNominalType(types: Set<NominalType>, nomType: string): boolean {
146
- if (!is_enum_value(NominalType, nomType)) {
147
- throw Error(`Invalid nominal type '${nomType}'`);
148
- }
149
- return types.has(nomType);
150
- }
151
-
152
- export function delNominalType(types: Set<NominalType>, nomType: string): void {
153
- if (!is_enum_value(NominalType, nomType)) {
154
- throw Error(`Invalid nominal type '${nomType}'`);
155
- }
156
- types.delete(nomType);
157
- }
@@ -1,132 +0,0 @@
1
- import { VerbInflectionData } from "../conjugation/LaVerb";
2
- import { AdjectiveInflectionData, NounInflectionData } from "../declination/LaNominal";
3
-
4
- export type HeadwordData =
5
- NominalHead | AdjectivalHead | PrepositionHead |
6
- ComparativeHead | SuperlativeHead |
7
- VerbalHead | ParticleHead | GerundHead |
8
- AdverbHead | NumeralAdverbHead |
9
- LetterHead | InterjectionHead | PhraseHead | FormHead;
10
-
11
- export interface BaseHead {
12
- templateType: "headword";
13
- heads: string[];
14
- }
15
-
16
- export interface FormHead extends BaseHead {
17
- headType: "form";
18
- partOfSpeech: string; // as below
19
- }
20
-
21
- export enum NominalType {
22
- Noun = "nouns",
23
- Numeral = "numerals",
24
- Suffix = "suffixes",
25
- ProperNoun = "proper nouns",
26
- }
27
-
28
- export interface NominalHead extends BaseHead {
29
- headType: "nominal";
30
- partOfSpeech: NominalType;
31
- indeclinable: boolean;
32
- data: NounInflectionData;
33
- genders: string[];
34
- }
35
-
36
- export enum AdjectivalType {
37
- Adjective = "adjectives",
38
- Numeral = "numerals",
39
- Suffix = "suffixes",
40
- Pronoun = "pronouns",
41
- Determiner = "determiners",
42
- Participle = "participles",
43
- }
44
-
45
- export interface AdjectivalHead extends BaseHead {
46
- headType: "adjectival";
47
- partOfSpeech: AdjectivalType;
48
- indeclinable: boolean;
49
- data: AdjectiveInflectionData;
50
- comparatives: string[];
51
- superlatives: string[];
52
- adverbs: string[];
53
- }
54
-
55
- export enum VerbalType {
56
- Verb = "verbs",
57
- Suffix = "suffixes",
58
- }
59
-
60
- export interface VerbalHead extends BaseHead {
61
- headType: "verbal";
62
- partOfSpeech: VerbalType;
63
- data: VerbInflectionData;
64
- infinitives: string[];
65
- }
66
-
67
- export interface GerundHead extends BaseHead {
68
- headType: "gerund";
69
- gerundive?: string;
70
- }
71
-
72
- export interface ComparativeHead extends BaseHead {
73
- headType: "comparative";
74
- neuter: string[];
75
- positive: string[];
76
- isLemma: boolean;
77
- }
78
-
79
- export interface SuperlativeHead extends BaseHead {
80
- headType: "superlative";
81
- neuter: string[];
82
- feminine: string[];
83
- positive: string[];
84
- isLemma: boolean;
85
- }
86
-
87
- export enum AdverbType {
88
- Adverb = "adverbs",
89
- Suffix = "suffixes",
90
- Comparative = "comparatives",
91
- Superlative = "superlatives",
92
- }
93
-
94
- export interface AdverbHead extends BaseHead {
95
- headType: "adverb";
96
- partOfSpeech: AdverbType;
97
- comparatives: string[];
98
- superlatives: string[];
99
- }
100
-
101
- export interface NumeralAdverbHead extends BaseHead {
102
- headType: "numeral_adverb";
103
- numType: string;
104
- }
105
-
106
- export interface LetterHead extends BaseHead {
107
- headType: "letter";
108
- upper: string[];
109
- lower: string[];
110
- mixed: string[];
111
- scriptCode: string;
112
- }
113
-
114
- export interface PrepositionHead extends BaseHead {
115
- headType: "preposition";
116
- genitive: boolean;
117
- accusative: boolean;
118
- ablative: boolean;
119
- }
120
-
121
- export interface PhraseHead extends BaseHead {
122
- headType: "phrase";
123
- }
124
-
125
- export interface InterjectionHead extends BaseHead {
126
- headType: "interjection";
127
- }
128
-
129
- export interface ParticleHead extends BaseHead {
130
- headType: "particle";
131
- partOfSpeech: string; // unfortunately, this is not standardized
132
- }