Pop-up dictionary browser extension for language learning. Successor to Yomichan. (PERSONAL FORK)
1/*
2 * Copyright (C) 2023-2025 Yomitan Authors
3 * Copyright (C) 2020-2022 Yomichan Authors
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19import {LanguageTransformer} from '../../ext/js/language/language-transformer.js';
20import {albanianTransforms} from '../../ext/js/language/sq/albanian-transforms.js';
21import {testLanguageTransformer} from '../fixtures/language-transformer-test.js';
22
23/* eslint-disable @stylistic/no-multi-spaces */
24const tests = [
25 {
26 category: 'verbs',
27 valid: true,
28 tests: [
29 {term: 'fshij', source: 'fshin', rule: 'v', reasons: ['present indicative second-person singular']},
30 {term: 'fshij', source: 'fshin', rule: 'v', reasons: ['present indicative third-person singular']},
31 {term: 'fshij', source: 'fshijmë', rule: 'v', reasons: ['present indicative first-person plural']},
32 {term: 'fshij', source: 'fshini', rule: 'v', reasons: ['present indicative second-person plural']},
33 {term: 'fshij', source: 'fshijnë', rule: 'v', reasons: ['present indicative third-person plural']},
34 {term: 'fshij', source: 'fshija', rule: 'v', reasons: ['imperfect first-person singular indicative']},
35 {term: 'fshij', source: 'fshije', rule: 'v', reasons: ['imperfect second-person singular indicative']},
36 {term: 'fshij', source: 'fshinte', rule: 'v', reasons: ['imperfect third-person singular indicative']},
37 {term: 'fshij', source: 'fshinim', rule: 'v', reasons: ['imperfect first-person plural indicative']},
38 {term: 'fshij', source: 'fshinit', rule: 'v', reasons: ['imperfect second-person plural indicative']},
39 {term: 'fshij', source: 'fshinin', rule: 'v', reasons: ['imperfect third-person plural indicative']},
40 {term: 'fshij', source: 'fshiva', rule: 'v', reasons: ['aorist first-person singular indicative']},
41 {term: 'fshij', source: 'fshive', rule: 'v', reasons: ['aorist second-person singular indicative']},
42 {term: 'fshij', source: 'fshiu', rule: 'v', reasons: ['aorist third-person singular indicative']},
43 {term: 'fshij', source: 'fshimë', rule: 'v', reasons: ['aorist first-person plural indicative']},
44 {term: 'fshij', source: 'fshitë', rule: 'v', reasons: ['aorist second-person plural indicative']},
45 {term: 'fshij', source: 'fshinë', rule: 'v', reasons: ['aorist third-person plural indicative']},
46 {term: 'fshij', source: 'fshini', rule: 'v', reasons: ['imperative second-person plural present']},
47 {term: 'fshij', source: 'fshirë', rule: 'v', reasons: ['participle']},
48
49 {term: 'ndihmoj', source: 'ndihmojmë', rule: 'v', reasons: ['present indicative first-person plural']},
50 {term: 'ndihmoj', source: 'ndihmoni', rule: 'v', reasons: ['present indicative second-person plural']},
51 {term: 'ndihmoj', source: 'ndihmojnë', rule: 'v', reasons: ['present indicative third-person plural']},
52 {term: 'ndihmoj', source: 'ndihmoja', rule: 'v', reasons: ['imperfect first-person singular indicative']},
53 {term: 'ndihmoj', source: 'ndihmoje', rule: 'v', reasons: ['imperfect second-person singular indicative']},
54 {term: 'ndihmoj', source: 'ndihmonte', rule: 'v', reasons: ['imperfect third-person singular indicative']},
55 {term: 'ndihmoj', source: 'ndihmonim', rule: 'v', reasons: ['imperfect first-person plural indicative']},
56 {term: 'ndihmoj', source: 'ndihmonit', rule: 'v', reasons: ['imperfect second-person plural indicative']},
57 {term: 'ndihmoj', source: 'ndihmonin', rule: 'v', reasons: ['imperfect third-person plural indicative']},
58 {term: 'ndihmoj', source: 'ndihmova', rule: 'v', reasons: ['aorist first-person singular indicative']},
59 {term: 'ndihmoj', source: 'ndihmove', rule: 'v', reasons: ['aorist second-person singular indicative']},
60 {term: 'ndihmoj', source: 'ndihmoi', rule: 'v', reasons: ['aorist third-person singular indicative']},
61 {term: 'ndihmoj', source: 'ndihmuam', rule: 'v', reasons: ['aorist first-person plural indicative']},
62 {term: 'ndihmoj', source: 'ndihmuat', rule: 'v', reasons: ['aorist second-person plural indicative']},
63 {term: 'ndihmoj', source: 'ndihmuan', rule: 'v', reasons: ['aorist third-person plural indicative']},
64 {term: 'ndihmoj', source: 'ndihmoni', rule: 'v', reasons: ['imperative second-person plural present']},
65 {term: 'ndihmoj', source: 'ndihmofsha', rule: 'v', reasons: ['optative first-person singular present']},
66 {term: 'ndihmoj', source: 'ndihmofsh', rule: 'v', reasons: ['optative second-person singular present']},
67 {term: 'ndihmoj', source: 'ndihmoftë', rule: 'v', reasons: ['optative third-person singular present']},
68 {term: 'ndihmoj', source: 'ndihmofshim', rule: 'v', reasons: ['optative first-person plural present']},
69 {term: 'ndihmoj', source: 'ndihmofshi', rule: 'v', reasons: ['optative second-person plural present']},
70 {term: 'ndihmoj', source: 'ndihmofshin', rule: 'v', reasons: ['optative third-person plural present']},
71
72 {term: 'paguaj', source: 'paguajmë', rule: 'v', reasons: ['present indicative first-person plural']},
73 {term: 'paguaj', source: 'paguani', rule: 'v', reasons: ['present indicative second-person plural']},
74 {term: 'paguaj', source: 'paguajnë', rule: 'v', reasons: ['present indicative third-person plural']},
75 {term: 'paguaj', source: 'paguaja', rule: 'v', reasons: ['imperfect first-person singular indicative']},
76 {term: 'paguaj', source: 'paguaje', rule: 'v', reasons: ['imperfect second-person singular indicative']},
77 {term: 'paguaj', source: 'paguante', rule: 'v', reasons: ['imperfect third-person singular indicative']},
78 {term: 'paguaj', source: 'paguanim', rule: 'v', reasons: ['imperfect first-person plural indicative']},
79 {term: 'paguaj', source: 'paguanit', rule: 'v', reasons: ['imperfect second-person plural indicative']},
80 {term: 'paguaj', source: 'paguanin', rule: 'v', reasons: ['imperfect third-person plural indicative']},
81 {term: 'paguaj', source: 'pagova', rule: 'v', reasons: ['aorist first-person singular indicative']},
82 {term: 'paguaj', source: 'pagove', rule: 'v', reasons: ['aorist second-person singular indicative']},
83 {term: 'paguaj', source: 'pagoi', rule: 'v', reasons: ['aorist third-person singular indicative']},
84 {term: 'paguaj', source: 'paguam', rule: 'v', reasons: ['aorist first-person plural indicative']},
85 {term: 'paguaj', source: 'paguat', rule: 'v', reasons: ['aorist second-person plural indicative']},
86 {term: 'paguaj', source: 'paguan', rule: 'v', reasons: ['aorist third-person plural indicative']},
87 {term: 'paguaj', source: 'paguani', rule: 'v', reasons: ['imperative second-person plural present']},
88
89 {term: 'vendos', source: 'vendosim', rule: 'v', reasons: ['present indicative first-person plural']},
90 {term: 'vendos', source: 'vendosni', rule: 'v', reasons: ['present indicative second-person plural']},
91 {term: 'vendos', source: 'vendosin', rule: 'v', reasons: ['present indicative third-person plural']},
92 {term: 'vendos', source: 'vendosja', rule: 'v', reasons: ['imperfect first-person singular indicative']},
93 {term: 'vendos', source: 'vendosje', rule: 'v', reasons: ['imperfect second-person singular indicative']},
94 {term: 'vendos', source: 'vendoste', rule: 'v', reasons: ['imperfect third-person singular indicative']},
95 {term: 'vendos', source: 'vendosnim', rule: 'v', reasons: ['imperfect first-person plural indicative']},
96 {term: 'vendos', source: 'vendosnit', rule: 'v', reasons: ['imperfect second-person plural indicative']},
97 {term: 'vendos', source: 'vendosnin', rule: 'v', reasons: ['imperfect third-person plural indicative']},
98 {term: 'vendos', source: 'vendosa', rule: 'v', reasons: ['aorist first-person singular indicative']},
99 {term: 'vendos', source: 'vendose', rule: 'v', reasons: ['aorist second-person singular indicative']},
100 {term: 'vendos', source: 'vendosi', rule: 'v', reasons: ['aorist third-person singular indicative']},
101 {term: 'vendos', source: 'vendosëm', rule: 'v', reasons: ['aorist first-person plural indicative']},
102 {term: 'vendos', source: 'vendosët', rule: 'v', reasons: ['aorist second-person plural indicative']},
103 {term: 'vendos', source: 'vendosën', rule: 'v', reasons: ['aorist third-person plural indicative']},
104 {term: 'vendos', source: 'vendosni', rule: 'v', reasons: ['imperative second-person plural present']},
105
106 {term: 'hap', source: 'hapim', rule: 'v', reasons: ['present indicative first-person plural']},
107 {term: 'hap', source: 'hapni', rule: 'v', reasons: ['present indicative second-person plural']},
108 {term: 'hap', source: 'hapin', rule: 'v', reasons: ['present indicative third-person plural']},
109 {term: 'hap', source: 'hapja', rule: 'v', reasons: ['imperfect first-person singular indicative']},
110 {term: 'hap', source: 'hapje', rule: 'v', reasons: ['imperfect second-person singular indicative']},
111 {term: 'hap', source: 'hapte', rule: 'v', reasons: ['imperfect third-person singular indicative']},
112 {term: 'hap', source: 'hapnim', rule: 'v', reasons: ['imperfect first-person plural indicative']},
113 {term: 'hap', source: 'hapnit', rule: 'v', reasons: ['imperfect second-person plural indicative']},
114 {term: 'hap', source: 'hapnin', rule: 'v', reasons: ['imperfect third-person plural indicative']},
115 {term: 'hap', source: 'hapa', rule: 'v', reasons: ['aorist first-person singular indicative']},
116 {term: 'hap', source: 'hape', rule: 'v', reasons: ['aorist second-person singular indicative']},
117 {term: 'hap', source: 'hapi', rule: 'v', reasons: ['aorist third-person singular indicative']},
118 {term: 'hap', source: 'hapëm', rule: 'v', reasons: ['aorist first-person plural indicative']},
119 {term: 'hap', source: 'hapët', rule: 'v', reasons: ['aorist second-person plural indicative']},
120 {term: 'hap', source: 'hapën', rule: 'v', reasons: ['aorist third-person plural indicative']},
121 {term: 'hap', source: 'hapni', rule: 'v', reasons: ['imperative second-person plural present']},
122
123 {term: 'kujtohem', source: 'kujtohu', rule: 'v', reasons: ['imperative second-person singular present']},
124 {term: 'kujtohem', source: 'kujtohuni', rule: 'v', reasons: ['imperative second-person plural present']},
125
126 {term: 'kthej', source: 'kthye', rule: 'v', reasons: ['aorist third-person singular indicative']},
127 {term: 'shkëlqej', source: 'shkëlqyer', rule: 'v', reasons: ['participle']},
128 ],
129 },
130 {
131 category: 'nouns',
132 valid: true,
133 tests: [
134 {term: 'pije', source: 'pijet', rule: 'ns', reasons: ['plural']},
135
136 {term: 'gëzoj', source: 'gëzim', rule: 'v', reasons: ['nominalization']},
137 {term: 'zbuloj', source: 'zbulim', rule: 'v', reasons: ['nominalization']},
138 {term: 'përkthej', source: 'përkthim', rule: 'v', reasons: ['nominalization']},
139 {term: 'lëviz', source: 'lëvizje', rule: 'v', reasons: ['nominalization']},
140 ],
141 },
142];
143/* eslint-enable @stylistic/no-multi-spaces */
144
145const languageTransformer = new LanguageTransformer();
146languageTransformer.addDescriptor(albanianTransforms);
147testLanguageTransformer(languageTransformer, tests);