You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2012/02/08 16:50:13 UTC

[lucy-commits] svn commit: r1241948 - in /incubator/lucy/trunk: core/Lucy/Test/Analysis/TestPolyAnalyzer.c core/Lucy/Test/Plan/TestFullTextType.c core/Lucy/Test/TestSchema.c perl/t/binding/150-polyanalyzer.t

Author: nwellnhof
Date: Wed Feb  8 15:50:12 2012
New Revision: 1241948

URL: http://svn.apache.org/viewvc?rev=1241948&view=rev
Log:
Replace CaseFolder with Normalizer in tests

Modified:
    incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
    incubator/lucy/trunk/core/Lucy/Test/Plan/TestFullTextType.c
    incubator/lucy/trunk/core/Lucy/Test/TestSchema.c
    incubator/lucy/trunk/perl/t/binding/150-polyanalyzer.t

Modified: incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c?rev=1241948&r1=1241947&r2=1241948&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c Wed Feb  8 15:50:12 2012
@@ -21,7 +21,7 @@
 #include "Lucy/Test/TestUtils.h"
 #include "Lucy/Test/Analysis/TestPolyAnalyzer.h"
 #include "Lucy/Analysis/PolyAnalyzer.h"
-#include "Lucy/Analysis/CaseFolder.h"
+#include "Lucy/Analysis/Normalizer.h"
 #include "Lucy/Analysis/SnowballStopFilter.h"
 #include "Lucy/Analysis/SnowballStemmer.h"
 #include "Lucy/Analysis/StandardTokenizer.h"
@@ -57,7 +57,7 @@ static void
 test_analysis(TestBatch *batch) {
     CharBuf            *EN          = (CharBuf*)ZCB_WRAP_STR("en", 2);
     CharBuf            *source_text = CB_newf("Eats, shoots and leaves.");
-    CaseFolder         *case_folder = CaseFolder_new();
+    Normalizer         *normalizer  = Normalizer_new(NULL, true, false);
     StandardTokenizer  *tokenizer   = StandardTokenizer_new();
     SnowballStopFilter *stopfilter  = SnowStop_new(EN, NULL);
     SnowballStemmer    *stemmer     = SnowStemmer_new(EN);
@@ -76,12 +76,12 @@ test_analysis(TestBatch *batch) {
 
     {
         VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(case_folder));
+        VA_Push(analyzers, INCREF(normalizer));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
         VArray       *expected     = VA_new(1);
         VA_Push(expected, (Obj*)CB_newf("eats, shoots and leaves."));
         TestUtils_test_analyzer(batch, (Analyzer*)polyanalyzer, source_text,
-                                expected, "With CaseFolder");
+                                expected, "With Normalizer");
         DECREF(expected);
         DECREF(polyanalyzer);
         DECREF(analyzers);
@@ -89,7 +89,7 @@ test_analysis(TestBatch *batch) {
 
     {
         VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(case_folder));
+        VA_Push(analyzers, INCREF(normalizer));
         VA_Push(analyzers, INCREF(tokenizer));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
         VArray       *expected     = VA_new(1);
@@ -106,7 +106,7 @@ test_analysis(TestBatch *batch) {
 
     {
         VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(case_folder));
+        VA_Push(analyzers, INCREF(normalizer));
         VA_Push(analyzers, INCREF(tokenizer));
         VA_Push(analyzers, INCREF(stopfilter));
         PolyAnalyzer *polyanalyzer = PolyAnalyzer_new(NULL, analyzers);
@@ -123,7 +123,7 @@ test_analysis(TestBatch *batch) {
 
     {
         VArray       *analyzers    = VA_new(0);
-        VA_Push(analyzers, INCREF(case_folder));
+        VA_Push(analyzers, INCREF(normalizer));
         VA_Push(analyzers, INCREF(tokenizer));
         VA_Push(analyzers, INCREF(stopfilter));
         VA_Push(analyzers, INCREF(stemmer));
@@ -142,7 +142,7 @@ test_analysis(TestBatch *batch) {
     DECREF(stemmer);
     DECREF(stopfilter);
     DECREF(tokenizer);
-    DECREF(case_folder);
+    DECREF(normalizer);
     DECREF(source_text);
 }
 

Modified: incubator/lucy/trunk/core/Lucy/Test/Plan/TestFullTextType.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Plan/TestFullTextType.c?rev=1241948&r1=1241947&r2=1241948&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Plan/TestFullTextType.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Plan/TestFullTextType.c Wed Feb  8 15:50:12 2012
@@ -21,15 +21,15 @@
 #include "Lucy/Test/Plan/TestFullTextType.h"
 #include "Lucy/Test/TestUtils.h"
 #include "Lucy/Plan/FullTextType.h"
-#include "Lucy/Analysis/CaseFolder.h"
+#include "Lucy/Analysis/Normalizer.h"
 #include "Lucy/Analysis/StandardTokenizer.h"
 
 static void
 test_Dump_Load_and_Equals(TestBatch *batch) {
     StandardTokenizer *tokenizer     = StandardTokenizer_new();
-    CaseFolder        *case_folder   = CaseFolder_new();
+    Normalizer        *normalizer    = Normalizer_new(NULL, true, false);
     FullTextType      *type          = FullTextType_new((Analyzer*)tokenizer);
-    FullTextType      *other         = FullTextType_new((Analyzer*)case_folder);
+    FullTextType      *other         = FullTextType_new((Analyzer*)normalizer);
     FullTextType      *boost_differs = FullTextType_new((Analyzer*)tokenizer);
     FullTextType      *not_indexed   = FullTextType_new((Analyzer*)tokenizer);
     FullTextType      *not_stored    = FullTextType_new((Analyzer*)tokenizer);
@@ -72,7 +72,7 @@ test_Dump_Load_and_Equals(TestBatch *bat
     DECREF(boost_differs);
     DECREF(other);
     DECREF(type);
-    DECREF(case_folder);
+    DECREF(normalizer);
     DECREF(tokenizer);
 }
 

Modified: incubator/lucy/trunk/core/Lucy/Test/TestSchema.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/TestSchema.c?rev=1241948&r1=1241947&r2=1241948&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/TestSchema.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/TestSchema.c Wed Feb  8 15:50:12 2012
@@ -20,7 +20,6 @@
 #include "Lucy/Test.h"
 #include "Lucy/Test/Plan/TestArchitecture.h"
 #include "Lucy/Test/TestSchema.h"
-#include "Lucy/Analysis/CaseFolder.h"
 #include "Lucy/Analysis/StandardTokenizer.h"
 #include "Lucy/Plan/FullTextType.h"
 #include "Lucy/Plan/Architecture.h"
@@ -60,7 +59,6 @@ test_Equals(TestBatch *batch) {
     CharBuf    *content      = (CharBuf*)ZCB_WRAP_STR("content", 7);
     FullTextType *type = (FullTextType*)TestSchema_Fetch_Type(spec_differs,
                                                               content);
-    CaseFolder *case_folder = CaseFolder_new();
 
     TEST_TRUE(batch, TestSchema_Equals(schema, (Obj*)schema), "Equals");
 
@@ -76,7 +74,6 @@ test_Equals(TestBatch *batch) {
     DECREF(schema);
     DECREF(arch_differs);
     DECREF(spec_differs);
-    DECREF(case_folder);
 }
 
 static void

Modified: incubator/lucy/trunk/perl/t/binding/150-polyanalyzer.t
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/binding/150-polyanalyzer.t?rev=1241948&r1=1241947&r2=1241948&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/binding/150-polyanalyzer.t (original)
+++ incubator/lucy/trunk/perl/t/binding/150-polyanalyzer.t Wed Feb  8 15:50:12 2012
@@ -21,9 +21,9 @@ use Test::More tests => 7;
 use Lucy::Test::TestUtils qw( test_analyzer );
 
 my $source_text = 'Eats, shoots and leaves.';
-my $case_folder = Lucy::Analysis::CaseFolder->new;
+my $normalizer  = Lucy::Analysis::Normalizer->new;
 my $polyanalyzer
-    = Lucy::Analysis::PolyAnalyzer->new( analyzers => [$case_folder], );
+    = Lucy::Analysis::PolyAnalyzer->new( analyzers => [$normalizer], );
 test_analyzer(
     $polyanalyzer, $source_text,
     ['eats, shoots and leaves.'],