--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/searchengine/oss/loc/analysisunittest/src/prefixfilter.cpp Tue Jul 06 15:30:04 2010 +0300
@@ -0,0 +1,66 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+#include "itk.h"
+
+#include "CLucene.h"
+
+#include <iostream>
+
+#include "testutils.h"
+
+#include "evaluationtool.h"
+#include "analysisunittest.h"
+#include "prefixfilter.h"
+
+using namespace analysis;
+using namespace evaluationtool;
+using namespace lucene::util;
+
+using namespace lucene::analysis;
+
+void FrenchAnalyzerTest(Itk::TestMgr* /*testMgr*/) {
+ analysis::FrenchAnalyzer analyzer;
+
+ Corpus corpus(FRENCH_TEXTCORPUS);
+
+ for (int i = 0; i < corpus.size(); i++) {
+ printTokens(analyzer, corpus[i]);
+ }
+}
+
+void HebrewAnalyzerTest(Itk::TestMgr* /*testMgr*/) {
+ analysis::HebrewAnalyzer analyzer;
+
+ Corpus corpus(HEBREW_TEXTCORPUS);
+
+ for (int i = 0; i < corpus.size(); i++) {
+ printTokens(analyzer, corpus[i]);
+ }
+}
+
+Itk::TesterBase * CreatePrefixAnalyzerUnitTest()
+{
+ using namespace Itk;
+ SuiteTester
+ * testSuite =
+ new SuiteTester( "prefix" );
+
+ testSuite->add( "french", FrenchAnalyzerTest, "french" );
+ testSuite->add( "hebrew", HebrewAnalyzerTest, "hebrew" );
+ return testSuite;
+}