You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/03/11 20:38:29 UTC
[lucy-commits] svn commit: r1080735 - in /incubator/lucy/trunk:
clownfish/lib/Clownfish/Binding/ core/Lucy/Analysis/
core/Lucy/Test/Analysis/ perl/lib/Lucy/ perl/lib/Lucy/Analysis/
perl/lib/Lucy/Docs/Cookbook/ perl/lib/Lucy/Docs/Tutorial/ perl/t/
perl/t/core/
Author: marvin
Date: Fri Mar 11 19:38:28 2011
New Revision: 1080735
URL: http://svn.apache.org/viewvc?rev=1080735&view=rev
Log:
LUCY-132 snowball_stemmer.patch
Rename Lucy::Analysis::Stemmer to Lucy::Analysis::SnowballStemmer.
Added:
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c
- copied, changed from r1078955, incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.c
incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.cfh
- copied, changed from r1078955, incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.cfh
incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.c
- copied, changed from r1078955, incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.c
incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh
- copied, changed from r1078955, incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.cfh
incubator/lucy/trunk/perl/lib/Lucy/Analysis/SnowballStemmer.pm
- copied, changed from r1078955, incubator/lucy/trunk/perl/lib/Lucy/Analysis/Stemmer.pm
incubator/lucy/trunk/perl/t/156-snowball_stemmer.t
- copied, changed from r1078955, incubator/lucy/trunk/perl/t/156-stemmer.t
incubator/lucy/trunk/perl/t/core/156-snowball_stemmer.t
- copied, changed from r1078955, incubator/lucy/trunk/perl/t/core/156-stemmer.t
Removed:
incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.c
incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.cfh
incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.c
incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.cfh
incubator/lucy/trunk/perl/lib/Lucy/Analysis/Stemmer.pm
incubator/lucy/trunk/perl/t/156-stemmer.t
incubator/lucy/trunk/perl/t/core/156-stemmer.t
Modified:
incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl.pm
incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.cfh
incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c
incubator/lucy/trunk/perl/lib/Lucy/Analysis/PolyAnalyzer.pm
incubator/lucy/trunk/perl/lib/Lucy/Docs/Cookbook/CustomQuery.pod
incubator/lucy/trunk/perl/lib/Lucy/Docs/Tutorial/Analysis.pod
incubator/lucy/trunk/perl/lib/Lucy/Test.pm
Modified: incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl.pm?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl.pm Fri Mar 11 19:38:28 2011
@@ -325,24 +325,26 @@ END_STUFF
}
my %ks_compat = (
- 'Lucy::Plan::Schema' => [qw( KinoSearch::Plan::Schema KinoSearch::Schema )],
+ 'Lucy::Plan::Schema' =>
+ [qw( KinoSearch::Plan::Schema KinoSearch::Schema )],
'Lucy::Plan::FieldType' =>
- [qw( KinoSearch::Plan::FieldType KinoSearch::FieldType )],
+ [qw( KinoSearch::Plan::FieldType KinoSearch::FieldType )],
'Lucy::Plan::FullTextType' => [
qw( KinoSearch::Plan::FullTextType KinoSearch::FieldType::FullTextType )
],
- 'Lucy::Plan::StringType' =>
- [ qw( KinoSearch::Plan::StringType KinoSearch::FieldType::StringType ) ],
+ 'Lucy::Plan::StringType' => [
+ qw( KinoSearch::Plan::StringType KinoSearch::FieldType::StringType )],
'Lucy::Plan::BlobType' =>
- [ qw( KinoSearch::Plan::BlobType KinoSearch::FieldType::BlobType ) ],
+ [qw( KinoSearch::Plan::BlobType KinoSearch::FieldType::BlobType )],
'Lucy::Analysis::PolyAnalyzer' =>
- [qw( KinoSearch::Analysis::PolyAnalyzer )],
+ [qw( KinoSearch::Analysis::PolyAnalyzer )],
'Lucy::Analysis::Tokenizer' => [qw( KinoSearch::Analysis::Tokenizer )],
'Lucy::Analysis::CaseFolder' => [
qw( KinoSearch::Analysis::CaseFolder KinoSearch::Analysis::LCNormalizer )
],
'Lucy::Analysis::Stopalizer' => [qw( KinoSearch::Analysis::Stopalizer )],
- 'Lucy::Analysis::Stemmer' => [qw( KinoSearch::Analysis::Stemmer )],
+ 'Lucy::Analysis::SnowballStemmer' =>
+ [qw( KinoSearch::Analysis::Stemmer )],
);
sub _write_boot_c {
Modified: incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.c Fri Mar 11 19:38:28 2011
@@ -21,7 +21,7 @@
#include "Lucy/Analysis/CaseFolder.h"
#include "Lucy/Analysis/Token.h"
#include "Lucy/Analysis/Inversion.h"
-#include "Lucy/Analysis/Stemmer.h"
+#include "Lucy/Analysis/SnowballStemmer.h"
#include "Lucy/Analysis/Tokenizer.h"
PolyAnalyzer*
@@ -46,7 +46,7 @@ PolyAnalyzer_init(PolyAnalyzer *self, co
self->analyzers = VA_new(3);
VA_Push(self->analyzers, (Obj*)CaseFolder_new());
VA_Push(self->analyzers, (Obj*)Tokenizer_new(NULL));
- VA_Push(self->analyzers, (Obj*)Stemmer_new(language));
+ VA_Push(self->analyzers, (Obj*)SnowStemmer_new(language));
}
else {
THROW(ERR, "Must specify either 'language' or 'analyzers'");
Modified: incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.cfh
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.cfh?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.cfh (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/PolyAnalyzer.cfh Fri Mar 11 19:38:28 2011
@@ -24,7 +24,7 @@ parcel Lucy;
* language, in which case a PolyAnalyzer consisting of a
* L<CaseFolder|Lucy::Analysis::CaseFolder>, a
* L<Tokenizer|Lucy::Analysis::Tokenizer>, and a
- * L<Stemmer|Lucy::Analysis::Stemmer> will be generated for you.
+ * L<SnowballStemmer|Lucy::Analysis::SnowballStemmer> will be generated for you.
*
* Supported languages:
*
@@ -55,9 +55,9 @@ class Lucy::Analysis::PolyAnalyzer
/**
* @param language An ISO code from the list of supported languages.
* @param analyzers An array of Analyzers. The order of the analyzers
- * matters. Don't put a Stemmer before a Tokenizer (can't stem whole
+ * matters. Don't put a SnowballStemmer before a Tokenizer (can't stem whole
* documents or paragraphs -- just individual words), or a Stopalizer
- * after a Stemmer (stemmed words, e.g. "themselv", will not appear in a
+ * after a SnowballStemmer (stemmed words, e.g. "themselv", will not appear in a
* stoplist). In general, the sequence should be: normalize, tokenize,
* stopalize, stem.
*/
Copied: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c (from r1078955, incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.c)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c?p2=incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c&p1=incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.c&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.c Fri Mar 11 19:38:28 2011
@@ -14,26 +14,26 @@
* limitations under the License.
*/
-#define C_LUCY_STEMMER
+#define C_LUCY_SNOWBALLSTEMMER
#define C_LUCY_TOKEN
#include <ctype.h>
#include "Lucy/Util/ToolSet.h"
-#include "Lucy/Analysis/Stemmer.h"
+#include "Lucy/Analysis/SnowballStemmer.h"
#include "Lucy/Analysis/Token.h"
#include "Lucy/Analysis/Inversion.h"
#include "libstemmer.h"
-Stemmer*
-Stemmer_new(const CharBuf *language)
+SnowballStemmer*
+SnowStemmer_new(const CharBuf *language)
{
- Stemmer *self = (Stemmer*)VTable_Make_Obj(STEMMER);
- return Stemmer_init(self, language);
+ SnowballStemmer *self = (SnowballStemmer*)VTable_Make_Obj(SNOWBALLSTEMMER);
+ return SnowStemmer_init(self, language);
}
-Stemmer*
-Stemmer_init(Stemmer *self, const CharBuf *language)
+SnowballStemmer*
+SnowStemmer_init(SnowballStemmer *self, const CharBuf *language)
{
char lang_buf[3];
Analyzer_init((Analyzer*)self);
@@ -51,17 +51,17 @@ Stemmer_init(Stemmer *self, const CharBu
}
void
-Stemmer_destroy(Stemmer *self)
+SnowStemmer_destroy(SnowballStemmer *self)
{
if (self->snowstemmer) {
sb_stemmer_delete((struct sb_stemmer*)self->snowstemmer);
}
DECREF(self->language);
- SUPER_DESTROY(self, STEMMER);
+ SUPER_DESTROY(self, SNOWBALLSTEMMER);
}
Inversion*
-Stemmer_transform(Stemmer *self, Inversion *inversion)
+SnowStemmer_transform(SnowballStemmer *self, Inversion *inversion)
{
Token *token;
struct sb_stemmer *const snowstemmer
@@ -83,33 +83,33 @@ Stemmer_transform(Stemmer *self, Inversi
}
Hash*
-Stemmer_dump(Stemmer *self)
+SnowStemmer_dump(SnowballStemmer *self)
{
- Stemmer_dump_t super_dump
- = (Stemmer_dump_t)SUPER_METHOD(STEMMER, Stemmer, Dump);
+ SnowStemmer_dump_t super_dump
+ = (SnowStemmer_dump_t)SUPER_METHOD(SNOWBALLSTEMMER, SnowStemmer, Dump);
Hash *dump = super_dump(self);
Hash_Store_Str(dump, "language", 8, (Obj*)CB_Clone(self->language));
return dump;
}
-Stemmer*
-Stemmer_load(Stemmer *self, Obj *dump)
+SnowballStemmer*
+SnowStemmer_load(SnowballStemmer *self, Obj *dump)
{
- Stemmer_load_t super_load
- = (Stemmer_load_t)SUPER_METHOD(STEMMER, Stemmer, Load);
- Stemmer *loaded = super_load(self, dump);
+ SnowStemmer_load_t super_load
+ = (SnowStemmer_load_t)SUPER_METHOD(SNOWBALLSTEMMER, SnowStemmer, Load);
+ SnowballStemmer *loaded = super_load(self, dump);
Hash *source = (Hash*)CERTIFY(dump, HASH);
CharBuf *language = (CharBuf*)CERTIFY(
Hash_Fetch_Str(source, "language", 8), CHARBUF);
- return Stemmer_init(loaded, language);
+ return SnowStemmer_init(loaded, language);
}
bool_t
-Stemmer_equals(Stemmer *self, Obj *other)
+SnowStemmer_equals(SnowballStemmer *self, Obj *other)
{
- Stemmer *const evil_twin = (Stemmer*)other;
+ SnowballStemmer *const evil_twin = (SnowballStemmer*)other;
if (evil_twin == self) return true;
- if (!Obj_Is_A(other, STEMMER)) return false;
+ if (!Obj_Is_A(other, SNOWBALLSTEMMER)) return false;
if (!CB_Equals(evil_twin->language, (Obj*)self->language)) return false;
return true;
}
Copied: incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.cfh (from r1078955, incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.cfh)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.cfh?p2=incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.cfh&p1=incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.cfh&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Analysis/Stemmer.cfh (original)
+++ incubator/lucy/trunk/core/Lucy/Analysis/SnowballStemmer.cfh Fri Mar 11 19:38:28 2011
@@ -18,43 +18,43 @@ parcel Lucy;
/** Reduce related words to a shared root.
*
- * Stemmer is an L<Analyzer|Lucy::Analysis::Analyzer> which reduces
+ * SnowballStemmer is an L<Analyzer|Lucy::Analysis::Analyzer> which reduces
* related words to a root form (using the "Snowball" stemming library). For
* instance, "horse", "horses", and "horsing" all become "hors" -- so that a
* search for 'horse' will also match documents containing 'horses' and
* 'horsing'.
*/
-class Lucy::Analysis::Stemmer inherits Lucy::Analysis::Analyzer
- : dumpable {
+class Lucy::Analysis::SnowballStemmer cnick SnowStemmer
+ inherits Lucy::Analysis::Analyzer : dumpable {
void *snowstemmer;
CharBuf *language;
- inert incremented Stemmer*
+ inert incremented SnowballStemmer*
new(const CharBuf *language);
/**
* @param language A two-letter ISO code identifying a language supported
* by Snowball.
*/
- public inert Stemmer*
- init(Stemmer *self, const CharBuf *language);
+ public inert SnowballStemmer*
+ init(SnowballStemmer *self, const CharBuf *language);
public incremented Inversion*
- Transform(Stemmer *self, Inversion *inversion);
+ Transform(SnowballStemmer *self, Inversion *inversion);
public incremented Hash*
- Dump(Stemmer *self);
+ Dump(SnowballStemmer *self);
- public incremented Stemmer*
- Load(Stemmer *self, Obj *dump);
+ public incremented SnowballStemmer*
+ Load(SnowballStemmer *self, Obj *dump);
public bool_t
- Equals(Stemmer *self, Obj *other);
+ Equals(SnowballStemmer *self, Obj *other);
public void
- Destroy(Stemmer *self);
+ Destroy(SnowballStemmer *self);
}
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=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Analysis/TestPolyAnalyzer.c Fri Mar 11 19:38:28 2011
@@ -23,7 +23,7 @@
#include "Lucy/Analysis/PolyAnalyzer.h"
#include "Lucy/Analysis/CaseFolder.h"
#include "Lucy/Analysis/Stopalizer.h"
-#include "Lucy/Analysis/Stemmer.h"
+#include "Lucy/Analysis/SnowballStemmer.h"
#include "Lucy/Analysis/Tokenizer.h"
static void
@@ -62,7 +62,7 @@ test_analysis(TestBatch *batch)
CaseFolder *case_folder = CaseFolder_new();
Tokenizer *tokenizer = Tokenizer_new(NULL);
Stopalizer *stopalizer = Stopalizer_new(EN, NULL);
- Stemmer *stemmer = Stemmer_new(EN);
+ SnowballStemmer *stemmer = SnowStemmer_new(EN);
{
VArray *analyzers = VA_new(0);
@@ -135,7 +135,7 @@ test_analysis(TestBatch *batch)
VA_Push(expected, (Obj*)CB_newf("shoot"));
VA_Push(expected, (Obj*)CB_newf("leav"));
TestUtils_test_analyzer(batch, (Analyzer*)polyanalyzer, source_text,
- expected, "With Stemmer");
+ expected, "With SnowballStemmer");
DECREF(expected);
DECREF(polyanalyzer);
DECREF(analyzers);
Copied: incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.c (from r1078955, incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.c)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.c?p2=incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.c&p1=incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.c&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.c (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.c Fri Mar 11 19:38:28 2011
@@ -14,32 +14,32 @@
* limitations under the License.
*/
-#define C_LUCY_TESTSTEMMER
+#define C_LUCY_TESTSNOWBALLSTEMMER
#include "Lucy/Util/ToolSet.h"
#include "Lucy/Test.h"
-#include "Lucy/Test/Analysis/TestStemmer.h"
-#include "Lucy/Analysis/Stemmer.h"
+#include "Lucy/Test/Analysis/TestSnowballStemmer.h"
+#include "Lucy/Analysis/SnowballStemmer.h"
#include "Lucy/Store/FSFolder.h"
#include "Lucy/Util/Json.h"
static void
test_Dump_Load_and_Equals(TestBatch *batch)
{
- CharBuf *EN = (CharBuf*)ZCB_WRAP_STR("en", 2);
- CharBuf *ES = (CharBuf*)ZCB_WRAP_STR("es", 2);
- Stemmer *stemmer = Stemmer_new(EN);
- Stemmer *other = Stemmer_new(ES);
- Obj *dump = (Obj*)Stemmer_Dump(stemmer);
- Obj *other_dump = (Obj*)Stemmer_Dump(other);
- Stemmer *clone = (Stemmer*)Stemmer_Load(other, dump);
- Stemmer *other_clone = (Stemmer*)Stemmer_Load(other, other_dump);
+ CharBuf *EN = (CharBuf*)ZCB_WRAP_STR("en", 2);
+ CharBuf *ES = (CharBuf*)ZCB_WRAP_STR("es", 2);
+ SnowballStemmer *stemmer = SnowStemmer_new(EN);
+ SnowballStemmer *other = SnowStemmer_new(ES);
+ Obj *dump = (Obj*)SnowStemmer_Dump(stemmer);
+ Obj *other_dump = (Obj*)SnowStemmer_Dump(other);
+ SnowballStemmer *clone = (SnowballStemmer*)SnowStemmer_Load(other, dump);
+ SnowballStemmer *other_clone = (SnowballStemmer*)SnowStemmer_Load(other, other_dump);
- TEST_FALSE(batch, Stemmer_Equals(stemmer,
+ TEST_FALSE(batch, SnowStemmer_Equals(stemmer,
(Obj*)other), "Equals() false with different language");
- TEST_TRUE(batch, Stemmer_Equals(stemmer,
+ TEST_TRUE(batch, SnowStemmer_Equals(stemmer,
(Obj*)clone), "Dump => Load round trip");
- TEST_TRUE(batch, Stemmer_Equals(other,
+ TEST_TRUE(batch, SnowStemmer_Equals(other,
(Obj*)other_clone), "Dump => Load round trip");
DECREF(stemmer);
@@ -73,10 +73,10 @@ test_stemming(TestBatch *batch)
while (Hash_Next(tests, (Obj**)&iso, (Obj**)&lang_data)) {
VArray *words = (VArray*)Hash_Fetch_Str(lang_data, "words", 5);
VArray *stems = (VArray*)Hash_Fetch_Str(lang_data, "stems", 5);
- Stemmer *stemmer = Stemmer_new(iso);
+ SnowballStemmer *stemmer = SnowStemmer_new(iso);
for (uint32_t i = 0, max = VA_Get_Size(words); i < max; i++) {
CharBuf *word = (CharBuf*)VA_Fetch(words, i);
- VArray *got = Stemmer_Split(stemmer, word);
+ VArray *got = SnowStemmer_Split(stemmer, word);
CharBuf *stem = (CharBuf*)VA_Fetch(got, 0);
TEST_TRUE(batch,
stem
@@ -95,7 +95,7 @@ test_stemming(TestBatch *batch)
}
void
-TestStemmer_run_tests()
+TestSnowStemmer_run_tests()
{
TestBatch *batch = TestBatch_new(153);
Copied: incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh (from r1078955, incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.cfh)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh?p2=incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh&p1=incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.cfh&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/core/Lucy/Test/Analysis/TestStemmer.cfh (original)
+++ incubator/lucy/trunk/core/Lucy/Test/Analysis/TestSnowballStemmer.cfh Fri Mar 11 19:38:28 2011
@@ -16,7 +16,7 @@
parcel Lucy;
-inert class Lucy::Test::Analysis::TestStemmer {
+inert class Lucy::Test::Analysis::TestSnowballStemmer cnick TestSnowStemmer {
inert void
run_tests();
}
Modified: incubator/lucy/trunk/perl/lib/Lucy/Analysis/PolyAnalyzer.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/Lucy/Analysis/PolyAnalyzer.pm?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/Lucy/Analysis/PolyAnalyzer.pm (original)
+++ incubator/lucy/trunk/perl/lib/Lucy/Analysis/PolyAnalyzer.pm Fri Mar 11 19:38:28 2011
@@ -43,7 +43,7 @@ my $constructor = <<'END_CONSTRUCTOR';
my $case_folder = Lucy::Analysis::CaseFolder->new;
my $tokenizer = Lucy::Analysis::Tokenizer->new;
- my $stemmer = Lucy::Analysis::Stemmer->new( language => 'en' );
+ my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $case_folder, $whitespace_tokenizer, $stemmer, ], );
END_CONSTRUCTOR
Copied: incubator/lucy/trunk/perl/lib/Lucy/Analysis/SnowballStemmer.pm (from r1078955, incubator/lucy/trunk/perl/lib/Lucy/Analysis/Stemmer.pm)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/Lucy/Analysis/SnowballStemmer.pm?p2=incubator/lucy/trunk/perl/lib/Lucy/Analysis/SnowballStemmer.pm&p1=incubator/lucy/trunk/perl/lib/Lucy/Analysis/Stemmer.pm&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/Lucy/Analysis/Stemmer.pm (original)
+++ incubator/lucy/trunk/perl/lib/Lucy/Analysis/SnowballStemmer.pm Fri Mar 11 19:38:28 2011
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-package Lucy::Analysis::Stemmer;
+package Lucy::Analysis::SnowballStemmer;
use Lucy;
1;
@@ -23,7 +23,7 @@ __END__
__BINDING__
my $synopsis = <<'END_SYNOPSIS';
- my $stemmer = Lucy::Analysis::Stemmer->new( language => 'es' );
+ my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'es' );
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $case_folder, $tokenizer, $stemmer ],
@@ -34,12 +34,12 @@ the same languages.
END_SYNOPSIS
my $constructor = <<'END_CONSTRUCTOR';
- my $stemmer = Lucy::Analysis::Stemmer->new( language => 'es' );
+ my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'es' );
END_CONSTRUCTOR
Clownfish::Binding::Perl::Class->register(
parcel => "Lucy",
- class_name => "Lucy::Analysis::Stemmer",
+ class_name => "Lucy::Analysis::SnowballStemmer",
bind_constructors => ["new"],
make_pod => {
synopsis => $synopsis,
Modified: incubator/lucy/trunk/perl/lib/Lucy/Docs/Cookbook/CustomQuery.pod
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/Lucy/Docs/Cookbook/CustomQuery.pod?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/Lucy/Docs/Cookbook/CustomQuery.pod (original)
+++ incubator/lucy/trunk/perl/lib/Lucy/Docs/Cookbook/CustomQuery.pod Fri Mar 11 19:38:28 2011
@@ -302,7 +302,7 @@ If you're planning on using PrefixQuery
change up analyzers to avoid stemming, because stemming -- another approach to
prefix conflation -- is not perfectly compatible with prefix searches.
- # Polyanalyzer with no Stemmer.
+ # Polyanalyzer with no SnowballStemmer.
my $analyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [
Lucy::Analysis::Tokenizer->new,
Modified: incubator/lucy/trunk/perl/lib/Lucy/Docs/Tutorial/Analysis.pod
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/Lucy/Docs/Tutorial/Analysis.pod?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/Lucy/Docs/Tutorial/Analysis.pod (original)
+++ incubator/lucy/trunk/perl/lib/Lucy/Docs/Tutorial/Analysis.pod Fri Mar 11 19:38:28 2011
@@ -46,7 +46,7 @@ C<< language => 'en' >> is equivalent to
my $case_folder = Lucy::Analysis::CaseFolder->new;
my $tokenizer = Lucy::Analysis::Tokenizer->new;
- my $stemmer = Lucy::Analysis::Stemmer->new( language => 'en' );
+ my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $case_folder, $tokenizer, $stemmer ],
);
@@ -62,7 +62,7 @@ and "maybe".
analyzers => [ $case_folder, $tokenizer, $stopalizer, $stemmer ],
);
-Also, try removing the Stemmer.
+Also, try removing the SnowballStemmer.
my $polyanalyzer = Lucy::Analysis::PolyAnalyzer->new(
analyzers => [ $case_folder, $tokenizer ],
Modified: incubator/lucy/trunk/perl/lib/Lucy/Test.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/lib/Lucy/Test.pm?rev=1080735&r1=1080734&r2=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/lib/Lucy/Test.pm (original)
+++ incubator/lucy/trunk/perl/lib/Lucy/Test.pm Fri Mar 11 19:38:28 2011
@@ -55,8 +55,8 @@ PPCODE:
else if (strEQ(package, "TestStopalizer")) {
lucy_TestStopalizer_run_tests();
}
- else if (strEQ(package, "TestStemmer")) {
- lucy_TestStemmer_run_tests();
+ else if (strEQ(package, "TestSnowStemmer")) {
+ lucy_TestSnowStemmer_run_tests();
}
else if (strEQ(package, "TestTokenizer")) {
lucy_TestTokenizer_run_tests();
Copied: incubator/lucy/trunk/perl/t/156-snowball_stemmer.t (from r1078955, incubator/lucy/trunk/perl/t/156-stemmer.t)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/156-snowball_stemmer.t?p2=incubator/lucy/trunk/perl/t/156-snowball_stemmer.t&p1=incubator/lucy/trunk/perl/t/156-stemmer.t&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/156-stemmer.t (original)
+++ incubator/lucy/trunk/perl/t/156-snowball_stemmer.t Fri Mar 11 19:38:28 2011
@@ -20,7 +20,7 @@ use lib 'buildlib';
use Test::More tests => 9;
use Lucy::Test::TestUtils qw( test_analyzer );
-my $stemmer = Lucy::Analysis::Stemmer->new( language => 'en' );
+my $stemmer = Lucy::Analysis::SnowballStemmer->new( language => 'en' );
test_analyzer( $stemmer, 'ponies', ['poni'], "single word stemmed" );
test_analyzer( $stemmer, 'pony', ['poni'], "stem, not just truncate" );
Copied: incubator/lucy/trunk/perl/t/core/156-snowball_stemmer.t (from r1078955, incubator/lucy/trunk/perl/t/core/156-stemmer.t)
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/t/core/156-snowball_stemmer.t?p2=incubator/lucy/trunk/perl/t/core/156-snowball_stemmer.t&p1=incubator/lucy/trunk/perl/t/core/156-stemmer.t&r1=1078955&r2=1080735&rev=1080735&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/t/core/156-stemmer.t (original)
+++ incubator/lucy/trunk/perl/t/core/156-snowball_stemmer.t Fri Mar 11 19:38:28 2011
@@ -17,5 +17,5 @@ use strict;
use warnings;
use Lucy::Test;
-Lucy::Test::run_tests("TestStemmer");
+Lucy::Test::run_tests("TestSnowStemmer");