-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathIpaDicFeatureExtensionTest.cs
More file actions
137 lines (130 loc) · 5.06 KB
/
IpaDicFeatureExtensionTest.cs
File metadata and controls
137 lines (130 loc) · 5.06 KB
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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
using System;
using NUnit.Framework;
using MeCab.Extension.IpaDic;
using MeCab;
namespace MeCab
{
[TestFixture]
public class IpaDicFeatureExtensionTest
{
[Test]
public void TestMethod1()
{
var node = new MeCabNode()
{
Feature = "品詞,品詞細分類1,品詞細分類2,品詞細分類3,活用形,活用型,原形,読み,発音"
};
Assert.AreEqual("品詞", node.GetPartsOfSpeech());
Assert.AreEqual("品詞細分類1", node.GetPartsOfSpeechSection1());
Assert.AreEqual("品詞細分類2", node.GetPartsOfSpeechSection2());
Assert.AreEqual("品詞細分類3", node.GetPartsOfSpeechSection3());
Assert.AreEqual("活用形", node.GetConjugatedForm());
Assert.AreEqual("活用型", node.GetInflection());
Assert.AreEqual("原形", node.GetOriginalForm());
Assert.AreEqual("読み", node.GetReading());
Assert.AreEqual("発音", node.GetPronounciation());
}
[Test]
public void TestMethod2()
{
var node = new MeCabNode()
{
Feature = ",,,,,,,,"
};
Assert.AreEqual("", node.GetPartsOfSpeech());
Assert.AreEqual("", node.GetPartsOfSpeechSection1());
Assert.AreEqual("", node.GetPartsOfSpeechSection2());
Assert.AreEqual("", node.GetPartsOfSpeechSection3());
Assert.AreEqual("", node.GetConjugatedForm());
Assert.AreEqual("", node.GetInflection());
Assert.AreEqual("", node.GetOriginalForm());
Assert.AreEqual("", node.GetReading());
Assert.AreEqual("", node.GetPronounciation());
}
[Test]
public void TestMethod3()
{
var node = new MeCabNode()
{
Feature = null
};
Assert.IsNull(node.GetPartsOfSpeech());
Assert.IsNull(node.GetPartsOfSpeechSection1());
Assert.IsNull(node.GetPartsOfSpeechSection2());
Assert.IsNull(node.GetPartsOfSpeechSection3());
Assert.IsNull(node.GetConjugatedForm());
Assert.IsNull(node.GetInflection());
Assert.IsNull(node.GetOriginalForm());
Assert.IsNull(node.GetReading());
Assert.IsNull(node.GetPronounciation());
}
[Test]
public void TestMethod4()
{
var node = new MeCabNode()
{
Feature = ""
};
Assert.AreEqual("", node.GetPartsOfSpeech());
Assert.IsNull(node.GetPartsOfSpeechSection1());
Assert.IsNull(node.GetPartsOfSpeechSection2());
Assert.IsNull(node.GetPartsOfSpeechSection3());
Assert.IsNull(node.GetConjugatedForm());
Assert.IsNull(node.GetInflection());
Assert.IsNull(node.GetOriginalForm());
Assert.IsNull(node.GetReading());
Assert.IsNull(node.GetPronounciation());
}
[Test]
public void TestMethod5()
{
var node = new MeCabNode()
{
Feature = "品詞"
};
Assert.AreEqual("品詞", node.GetPartsOfSpeech());
Assert.IsNull(node.GetPartsOfSpeechSection1());
Assert.IsNull(node.GetPartsOfSpeechSection2());
Assert.IsNull(node.GetPartsOfSpeechSection3());
Assert.IsNull(node.GetConjugatedForm());
Assert.IsNull(node.GetInflection());
Assert.IsNull(node.GetOriginalForm());
Assert.IsNull(node.GetReading());
Assert.IsNull(node.GetPronounciation());
}
[Test]
public void TestMethod6()
{
var node = new MeCabNode()
{
Feature = "品詞,品詞細分類1"
};
Assert.AreEqual("品詞", node.GetPartsOfSpeech());
Assert.AreEqual("品詞細分類1", node.GetPartsOfSpeechSection1());
Assert.IsNull(node.GetPartsOfSpeechSection2());
Assert.IsNull(node.GetPartsOfSpeechSection3());
Assert.IsNull(node.GetConjugatedForm());
Assert.IsNull(node.GetInflection());
Assert.IsNull(node.GetOriginalForm());
Assert.IsNull(node.GetReading());
Assert.IsNull(node.GetPronounciation());
}
[Test]
public void TestMethod7()
{
var node = new MeCabNode()
{
Feature = "品詞,品詞細分類1,"
};
Assert.AreEqual("品詞", node.GetPartsOfSpeech());
Assert.AreEqual("品詞細分類1", node.GetPartsOfSpeechSection1());
Assert.AreEqual("", node.GetPartsOfSpeechSection2());
Assert.IsNull(node.GetPartsOfSpeechSection3());
Assert.IsNull(node.GetConjugatedForm());
Assert.IsNull(node.GetInflection());
Assert.IsNull(node.GetOriginalForm());
Assert.IsNull(node.GetReading());
Assert.IsNull(node.GetPronounciation());
}
}
}