-
Notifications
You must be signed in to change notification settings - Fork 4
/
souAdj.js
67 lines (59 loc) · 2.17 KB
/
souAdj.js
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
57
58
59
60
61
62
63
64
65
66
67
"use strict";
const {adjConjugate, adjDeconjugate} = require('../index');
const test = require('tape');
test('i positive', t => {
t.ok(adjConjugate('美味しい', 'StemSou', true).includes('美味しそう'))
const res = adjDeconjugate('美味しそう', '美味しい', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemSou');
t.end();
});
test('i neg', t => {
t.ok(adjConjugate('美味しい', 'StemNegativeSou', true).includes('美味しくなさそう'))
const res = adjDeconjugate('美味しくなさそう', '美味しい', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemNegativeSou');
t.end();
});
test('na positive', t => {
t.ok(adjConjugate('元気', 'StemSou', false).includes('元気そう'))
const res = adjDeconjugate('元気そう', '元気', false);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemSou');
t.end();
});
test('na neg', t => {
t.ok(adjConjugate('上手', 'StemNegativeSou', false).includes('上手じゃなさそう'))
const res = adjDeconjugate('上手じゃなさそう', '上手', false);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemNegativeSou');
t.end();
});
test('ii yoi', t => {
t.ok(adjConjugate('いい', 'StemSou', true).includes('よさそう'))
const res = adjDeconjugate('よさそう', 'いい', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemSou');
t.end();
});
test('ii yoi neg', t => {
t.ok(adjConjugate('いい', 'StemNegativeSou', true).includes('よくなさそう'))
const res = adjDeconjugate('よくなさそう', 'いい', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemNegativeSou');
t.end();
});
test('ii yoi kanji', t => {
t.ok(adjConjugate('良い', 'StemSou', true).includes('良さそう'))
const res = adjDeconjugate('良さそう', '良い', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemSou');
t.end();
});
test('nai', t=>{
t.ok(adjConjugate('美味しい', 'StemNegativeSou', true).includes('美味しくなさそう'))
const res = adjDeconjugate('美味しくなさそう', '美味しい', true);
t.ok(res.length > 0);
t.ok(res[0].conjugation === 'StemNegativeSou');
t.end();
});