hce-node application
1.4.3
HCE Hierarchical Cluster Engine node application
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
MecabWordTypeTest.cpp
Go to the documentation of this file.
1
#include "
MecabWordTypeTest.hpp
"
2
3
4
namespace
refine_test {
5
6
void
MecabWordTypeTest::setUp
() {
10
_lcData.
_processInfo
.
_pluginType
=
HCE::component::MECAB_WTYPE
;
14
_lcData.
_mapOffsets
= {{0,3}, {4,1}, {6,6}, {16,3}, {20,3}};
15
_lcData.
_mapTokens
= {{0,
"123"
}, {4,
"?"
}, {6,
"impostors"
}, {16,
"。"
}, {20,
"~@^"
}};
16
}
17
18
void
MecabWordTypeTest::tearDown
() {
19
}
20
21
void
MecabWordTypeTest::testWordTypesCount
() {
25
_mecabPlugin.
process
(_lcData);
29
CPPUNIT_ASSERT(_lcData.
_mapWordType
.size()==5);
30
}
31
32
void
MecabWordTypeTest::testWordTypeNumber
() {
36
_mecabPlugin.
process
(_lcData);
40
CPPUNIT_ASSERT(_lcData.
_mapWordType
[0]==HCE::WORD_TYPE::NUMBER);
41
}
42
43
44
void
MecabWordTypeTest::testWordTypeDelimiter
() {
48
_mecabPlugin.
process
(_lcData);
52
CPPUNIT_ASSERT(_lcData.
_mapWordType
[16]==HCE::WORD_TYPE::DELIMITER);
53
}
54
55
56
void
MecabWordTypeTest::testWordTypePunctuation
() {
60
_mecabPlugin.
process
(_lcData);
64
CPPUNIT_ASSERT(_lcData.
_mapWordType
[4]==HCE::WORD_TYPE::PUNCTUATION);
65
}
66
67
68
void
MecabWordTypeTest::testWordTypeWord
() {
72
_mecabPlugin.
process
(_lcData);
76
CPPUNIT_ASSERT(_lcData.
_mapWordType
[6]==HCE::WORD_TYPE::WORD);
77
}
78
79
void
MecabWordTypeTest::testWordTypeUndefined
() {
83
_mecabPlugin.
process
(_lcData);
87
CPPUNIT_ASSERT(_lcData.
_mapWordType
[15]==HCE::WORD_TYPE::UNDEFINED);
88
89
}
90
91
void
MecabWordTypeTest::testTokensCount
() {
92
_lcData.
_content
=
"123one?"
;
93
_lcData.
_mapOffsets
.clear();
94
_lcData.
_mapTokens
.clear();
95
_lcData.
_processInfo
.
_pluginType
=
HCE::component::MECAB_TOKENIZE
;
99
_mecabPlugin.
process
(_lcData);
103
CPPUNIT_ASSERT(_lcData.
_mapTokens
.size()==3);
104
105
}
106
107
}
sources
utils
refine
tests
cppunit
MecabWordTypeTest.cpp
Generated on Tue Jun 30 2015 19:42:16 for hce-node application by
1.8.1.2