@fpw/en-wiktionary-la-modules 0.2.2 → 0.3.1
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.
- package/LICENSE +75 -75
- package/README.md +19 -15
- package/dist/LaEngine.d.ts +23 -23
- package/dist/LaEngine.js +64 -66
- package/dist/index.d.ts +12 -11
- package/dist/index.js +12 -28
- package/dist/modules/common.d.ts +67 -66
- package/dist/modules/common.js +145 -157
- package/dist/modules/conjugation/LaVerb.d.ts +118 -109
- package/dist/modules/conjugation/LaVerb.js +2861 -2295
- package/dist/modules/conjugation/VerbAffix.d.ts +18 -18
- package/dist/modules/conjugation/VerbAffix.js +19 -23
- package/dist/modules/conjugation/VerbForm.d.ts +204 -182
- package/dist/modules/conjugation/VerbForm.js +215 -199
- package/dist/modules/conjugation/VerbType.d.ts +54 -40
- package/dist/modules/conjugation/VerbType.js +66 -58
- package/dist/modules/declination/LaAdjData.d.ts +16 -16
- package/dist/modules/declination/LaAdjData.js +1474 -908
- package/dist/modules/declination/LaNominal.d.ts +136 -130
- package/dist/modules/declination/LaNominal.js +1884 -1804
- package/dist/modules/declination/LaNounData.d.ts +16 -2
- package/dist/modules/declination/LaNounData.js +935 -855
- package/dist/modules/declination/LaPersonalPronoun.d.ts +12 -12
- package/dist/modules/declination/LaPersonalPronoun.js +80 -85
- package/dist/modules/declination/NominalForm.d.ts +85 -69
- package/dist/modules/declination/NominalForm.js +101 -91
- package/dist/modules/declination/NominalType.d.ts +191 -120
- package/dist/modules/declination/NominalType.js +211 -146
- package/dist/modules/headword/HeadWord.d.ts +107 -107
- package/dist/modules/headword/HeadWord.js +28 -32
- package/dist/modules/headword/HeadwordParser.d.ts +29 -29
- package/dist/modules/headword/HeadwordParser.js +456 -452
- package/package.json +23 -15
- package/dist/LaEngine.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/modules/common.js.map +0 -1
- package/dist/modules/conjugation/LaVerb.js.map +0 -1
- package/dist/modules/conjugation/VerbAffix.js.map +0 -1
- package/dist/modules/conjugation/VerbForm.js.map +0 -1
- package/dist/modules/conjugation/VerbType.js.map +0 -1
- package/dist/modules/declination/LaAdjData.js.map +0 -1
- package/dist/modules/declination/LaNominal.js.map +0 -1
- package/dist/modules/declination/LaNounData.js.map +0 -1
- package/dist/modules/declination/LaPersonalPronoun.js.map +0 -1
- package/dist/modules/declination/NominalForm.js.map +0 -1
- package/dist/modules/declination/NominalType.js.map +0 -1
- package/dist/modules/headword/HeadWord.js.map +0 -1
- package/dist/modules/headword/HeadwordParser.js.map +0 -1
- package/src/LaEngine.ts +0 -86
- package/src/index.ts +0 -16
- package/src/modules/common.ts +0 -164
- package/src/modules/conjugation/LaVerb.ts +0 -2669
- package/src/modules/conjugation/VerbAffix.ts +0 -18
- package/src/modules/conjugation/VerbForm.ts +0 -223
- package/src/modules/conjugation/VerbType.ts +0 -55
- package/src/modules/declination/LaAdjData.ts +0 -1036
- package/src/modules/declination/LaNominal.ts +0 -2025
- package/src/modules/declination/LaNounData.ts +0 -897
- package/src/modules/declination/LaPersonalPronoun.ts +0 -92
- package/src/modules/declination/NominalForm.ts +0 -89
- package/src/modules/declination/NominalType.ts +0 -157
- package/src/modules/headword/HeadWord.ts +0 -132
- package/src/modules/headword/HeadwordParser.ts +0 -515
|
@@ -1,130 +1,136 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This is a complete re-implementation of Wiktionary's Module:la-nominal, developed by Benwing2.
|
|
3
|
-
* It was converted from Lua to TypeScript by Folke Will <folko@solhost.org>.
|
|
4
|
-
*
|
|
5
|
-
* Original source: https://en.wiktionary.org/wiki/Module:la-nominal
|
|
6
|
-
* Based on version
|
|
7
|
-
*
|
|
8
|
-
* Lua idioms, function and variable names kept as in the original in order to easily
|
|
9
|
-
* backport later changes to this implementation.
|
|
10
|
-
*
|
|
11
|
-
* For that reason, it's suggested to add a type-aware wrapper around this class and leave
|
|
12
|
-
* this code unchanged instead of improving the types and use of idioms in this class.
|
|
13
|
-
*
|
|
14
|
-
*/
|
|
15
|
-
import { ArgMap, FormMap } from "../common";
|
|
16
|
-
import { NominalForm } from "./NominalForm";
|
|
17
|
-
import { NominalType } from "./NominalType";
|
|
18
|
-
export interface DeclOptions {
|
|
19
|
-
suppressOldGenitive?: boolean;
|
|
20
|
-
suppressNonNeuterIStemAccIs?: boolean;
|
|
21
|
-
suppressRareIrregForms?: boolean;
|
|
22
|
-
useSimpleQuis?: boolean;
|
|
23
|
-
populateAllTerminations?: boolean;
|
|
24
|
-
suppressAdjPtcForms?: boolean;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
private readonly
|
|
96
|
-
private readonly
|
|
97
|
-
private readonly
|
|
98
|
-
private readonly
|
|
99
|
-
private readonly
|
|
100
|
-
private readonly
|
|
101
|
-
private
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
private
|
|
109
|
-
private
|
|
110
|
-
private
|
|
111
|
-
private
|
|
112
|
-
private
|
|
113
|
-
private
|
|
114
|
-
private
|
|
115
|
-
private
|
|
116
|
-
private
|
|
117
|
-
private
|
|
118
|
-
private
|
|
119
|
-
private
|
|
120
|
-
private
|
|
121
|
-
private
|
|
122
|
-
private
|
|
123
|
-
private
|
|
124
|
-
private
|
|
125
|
-
private
|
|
126
|
-
private
|
|
127
|
-
private
|
|
128
|
-
private
|
|
129
|
-
private
|
|
130
|
-
|
|
1
|
+
/**
|
|
2
|
+
* This is a complete re-implementation of Wiktionary's Module:la-nominal, developed by Benwing2.
|
|
3
|
+
* It was converted from Lua to TypeScript by Folke Will <folko@solhost.org>.
|
|
4
|
+
*
|
|
5
|
+
* Original source: https://en.wiktionary.org/wiki/Module:la-nominal
|
|
6
|
+
* Based on version 2026-03-03
|
|
7
|
+
*
|
|
8
|
+
* Lua idioms, function and variable names kept as in the original in order to easily
|
|
9
|
+
* backport later changes to this implementation.
|
|
10
|
+
*
|
|
11
|
+
* For that reason, it's suggested to add a type-aware wrapper around this class and leave
|
|
12
|
+
* this code unchanged instead of improving the types and use of idioms in this class.
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
import { ArgMap, FormMap } from "../common.js";
|
|
16
|
+
import { NominalForm } from "./NominalForm.js";
|
|
17
|
+
import { NominalType } from "./NominalType.js";
|
|
18
|
+
export interface DeclOptions {
|
|
19
|
+
suppressOldGenitive?: boolean;
|
|
20
|
+
suppressNonNeuterIStemAccIs?: boolean;
|
|
21
|
+
suppressRareIrregForms?: boolean;
|
|
22
|
+
useSimpleQuis?: boolean;
|
|
23
|
+
populateAllTerminations?: boolean;
|
|
24
|
+
suppressAdjPtcForms?: boolean;
|
|
25
|
+
suppress4NeutUBreves?: boolean;
|
|
26
|
+
suppressAdjCompI?: boolean;
|
|
27
|
+
suppressSufNM?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare enum Gender {
|
|
30
|
+
M = "M",
|
|
31
|
+
F = "F",
|
|
32
|
+
N = "N"
|
|
33
|
+
}
|
|
34
|
+
export declare enum NumberTantum {
|
|
35
|
+
Singular = "sg",
|
|
36
|
+
Plural = "pl",
|
|
37
|
+
Both = "both"
|
|
38
|
+
}
|
|
39
|
+
export interface DeclProp {
|
|
40
|
+
decl: string;
|
|
41
|
+
headword_decl?: string;
|
|
42
|
+
types: Set<NominalType>;
|
|
43
|
+
}
|
|
44
|
+
export interface DeclensionData {
|
|
45
|
+
templateType: "declension";
|
|
46
|
+
declensionType: "noun" | "adjective";
|
|
47
|
+
title: string;
|
|
48
|
+
num?: NumberTantum;
|
|
49
|
+
propses: DeclProp[];
|
|
50
|
+
forms: FormMap<NominalForm>;
|
|
51
|
+
categories: string[];
|
|
52
|
+
notes: Map<string, string[]>;
|
|
53
|
+
user_specified: Set<string>;
|
|
54
|
+
pos: string;
|
|
55
|
+
num_type?: string;
|
|
56
|
+
indecl: boolean;
|
|
57
|
+
overriding_lemma: string[];
|
|
58
|
+
}
|
|
59
|
+
export interface NounInflectionData extends DeclensionData {
|
|
60
|
+
declensionType: "noun";
|
|
61
|
+
gender?: Gender;
|
|
62
|
+
m?: string[];
|
|
63
|
+
f?: string[];
|
|
64
|
+
overriding_genders?: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface AdjectiveInflectionData extends DeclensionData {
|
|
67
|
+
declensionType: "adjective";
|
|
68
|
+
voc: boolean;
|
|
69
|
+
noneut: boolean;
|
|
70
|
+
nomf: boolean;
|
|
71
|
+
comp: string[];
|
|
72
|
+
sup: string[];
|
|
73
|
+
adv: string[];
|
|
74
|
+
}
|
|
75
|
+
export interface SegmentData {
|
|
76
|
+
declOpts: DeclOptions;
|
|
77
|
+
decl?: string;
|
|
78
|
+
title?: string;
|
|
79
|
+
subtitles: (string | string[])[];
|
|
80
|
+
footnote: string;
|
|
81
|
+
num?: NumberTantum;
|
|
82
|
+
loc?: boolean;
|
|
83
|
+
pos: string;
|
|
84
|
+
forms: FormMap<NominalForm>;
|
|
85
|
+
types: Set<NominalType>;
|
|
86
|
+
categories: string[];
|
|
87
|
+
notes: Map<string, string>;
|
|
88
|
+
gender?: Gender;
|
|
89
|
+
voc?: boolean;
|
|
90
|
+
noneut?: boolean;
|
|
91
|
+
nomf?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export declare class LaNominal {
|
|
94
|
+
static readonly EmptyForm = "\u2014";
|
|
95
|
+
private readonly options;
|
|
96
|
+
private readonly cases;
|
|
97
|
+
private readonly genders;
|
|
98
|
+
private readonly nums;
|
|
99
|
+
private readonly linked_prefixes;
|
|
100
|
+
private readonly potential_noun_lemma_slots;
|
|
101
|
+
private readonly potential_adj_lemma_slots;
|
|
102
|
+
private readonly irreg_noun_to_decl;
|
|
103
|
+
private readonly declension_to_english;
|
|
104
|
+
private title;
|
|
105
|
+
constructor(options?: DeclOptions);
|
|
106
|
+
do_generate_noun_forms(args: ArgMap, pos?: string, from_headword?: boolean, title?: string): NounInflectionData;
|
|
107
|
+
do_generate_adj_forms(args: ArgMap, pos?: string, from_headword?: boolean, title?: string): AdjectiveInflectionData;
|
|
108
|
+
private construct_title;
|
|
109
|
+
private process_noun_forms_and_overrides;
|
|
110
|
+
private unattested_forms;
|
|
111
|
+
private process_adj_forms_and_overrides;
|
|
112
|
+
private iter_slots;
|
|
113
|
+
private iter_adj_slots;
|
|
114
|
+
private iter_noun_slots;
|
|
115
|
+
private parse_segment_run_allowing_alternants;
|
|
116
|
+
private parse_alternant;
|
|
117
|
+
private parse_segment_run;
|
|
118
|
+
private capturing_split;
|
|
119
|
+
private parse_segment;
|
|
120
|
+
private detect_adj_type_and_subtype;
|
|
121
|
+
private get_adj_type_and_subtype_by_ending;
|
|
122
|
+
private detect_noun_subtype;
|
|
123
|
+
private static make_stem2;
|
|
124
|
+
private get_noun_subtype_by_ending;
|
|
125
|
+
private decline_segment_run;
|
|
126
|
+
private add_indefinite_article;
|
|
127
|
+
private uppercase_first_visible;
|
|
128
|
+
private lowercase_first_visible;
|
|
129
|
+
private join_sentences;
|
|
130
|
+
private set_difference;
|
|
131
|
+
private append_form;
|
|
132
|
+
private apply_ligatures;
|
|
133
|
+
private apply_sufn;
|
|
134
|
+
private propagate_number_restrictions;
|
|
135
|
+
private insert_if_not;
|
|
136
|
+
}
|