aboutsummaryrefslogtreecommitdiff
path: root/test/language/latin-transforms.test.js
blob: c3c65476d1cb29bab2ed6c17ab7f5f0e9464b95e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
/*
 * Copyright (C) 2023-2024  Yomitan Authors
 * Copyright (C) 2020-2022  Yomichan Authors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */

import {latinTransforms} from '../../ext/js/language/la/latin-transforms.js';
import {LanguageTransformer} from '../../ext/js/language/language-transformer.js';
import {testLanguageTransformer} from '../fixtures/language-transformer-test.js';

/* eslint-disable @stylistic/no-multi-spaces */
const tests = [
    {
        category: 'plural',
        valid: true,
        tests: [
            {term: 'fluvius',   source: 'fluvii',    rule: 'n',   reasons: ['plural']},
            {term: 'magnus',    source: 'magni',     rule: 'adj', reasons: ['plural']},
            {term: 'insula',    source: 'insulae',   rule: 'n',   reasons: ['plural']},
        ],
    },
    {
        category: 'adjective',
        valid: true,
        tests: [
            {term: 'magnus',    source: 'magna',    rule: 'adj',  reasons: ['feminine']},
            {term: 'Graecus',   source: 'Graecum',  rule: 'adj',  reasons: ['neuter']},
            {term: 'primus',    source: 'prima',    rule: 'adj',  reasons: ['neuter', 'plural']},
        ],
    },
    {
        category: 'ablative',
        valid: true,
        tests: [
            {term: 'vocabulum', source: 'vocabulo', rule: 'n',    reasons: ['ablative']},
        ],
    },
];
/* eslint-enable @stylistic/no-multi-spaces */

const languageTransformer = new LanguageTransformer();
languageTransformer.addDescriptor(latinTransforms);

testLanguageTransformer(languageTransformer, tests);