24
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "itk.h"
|
|
19 |
|
|
20 |
#include "CLucene.h"
|
|
21 |
|
|
22 |
#include <iostream>
|
|
23 |
|
|
24 |
#include "testutils.h"
|
|
25 |
|
|
26 |
#include "evaluationtool.h"
|
|
27 |
#include "analysisunittest.h"
|
|
28 |
#include "cjkanalyzer.h"
|
|
29 |
|
|
30 |
using namespace evaluationtool;
|
|
31 |
using namespace lucene::util;
|
|
32 |
|
|
33 |
using namespace lucene::analysis;
|
|
34 |
|
|
35 |
void CjkKoreanAnalyzerTest(Itk::TestMgr* /*testMgr*/) {
|
|
36 |
cjk::CJKAnalyzer analyzer;
|
|
37 |
|
|
38 |
Corpus corpus(KOREAN_TEXTCORPUS);
|
|
39 |
|
|
40 |
for (int i = 0; i < corpus.size(); i++) {
|
|
41 |
printTokens(analyzer, corpus[i]);
|
|
42 |
}
|
|
43 |
}
|
|
44 |
|
|
45 |
Itk::TesterBase * CreateCjkAnalyzerUnitTest()
|
|
46 |
{
|
|
47 |
using namespace Itk;
|
|
48 |
SuiteTester
|
|
49 |
* testSuite =
|
|
50 |
new SuiteTester( "cjk" );
|
|
51 |
|
|
52 |
testSuite->add( "korean", CjkKoreanAnalyzerTest, "korean" );
|
|
53 |
return testSuite;
|
|
54 |
}
|