Subject: | POD patches to Document::Field from GeoffR |
Posted to mailing list. Submitting here so it is not lost.
http://www.kasei.com/pipermail/plucene/2005-May/000402.html
diff -ur Plucene-1.21.orig/lib/Plucene/Document/Field.pm Plucene-1.21/lib/Plucene/Document/Field.pm
--- Plucene-1.21.orig/lib/Plucene/Document/Field.pm 2004-02-04 11:38:19.000000000 +0000
+++ Plucene-1.21/lib/Plucene/Document/Field.pm 2005-04-26 20:15:56.000000000 +0100
@@ -14,8 +14,8 @@
=head1 DESCRIPTION
-Each Plucene::Document is made up of Plucene::Document::Fields. Each of these
-fields can be stored, indexed or tokenised.
+Each Plucene::Document is made up of Plucene::Document::Field objects.
+Each of these fields can be stored, indexed or tokenised.
=head1 METHODS
@@ -26,6 +26,31 @@
use base qw(Class::Accessor::Fast);
+=head2 name
+
+Returns the name of the field.
+
+=head2 string
+
+Returns the value of the field.
+
+=head2 is_stored
+
+Returns true if the field is or will be stored, or false if it was
+created with C<UnStored>.
+
+=head2 is_indexed
+
+Returns true if the field is or will be indexed, or false if it was
+created with C<UnIndexed>.
+
+=head2 is_tokenized
+
+Returns true if the field is or will be tokenized, or false if it was
+created with C<UnIndexed> or C<Keyword>.
+
+=cut
+
__PACKAGE__->mk_accessors(
qw(name string is_stored is_indexed is_tokenized reader));
@@ -36,7 +61,7 @@
my $field = Plucene::Document::Field->Keyword($name, $string);
This will make a new Plucene::Document::Field object that is stored
-and indexed, but not tokenised..
+and indexed, but not tokenised.
=cut
diff -ur Plucene-1.21.orig/lib/Plucene.pm Plucene-1.21/lib/Plucene.pm
--- Plucene-1.21.orig/lib/Plucene.pm 2005-01-24 10:53:32.000000000 +0000
+++ Plucene-1.21/lib/Plucene.pm 2005-04-26 15:36:07.000000000 +0100
@@ -12,8 +12,8 @@
use Plucene::Document::Field;
my $doc = Plucene::Document->new;
- $doc->add(Plucene::Document::Field->Text("content", $content);
- $doc->add(Plucene::Document::Field->Text("author", "Your Name");
+ $doc->add(Plucene::Document::Field->Text("content", $content));
+ $doc->add(Plucene::Document::Field->Text("author", "Your Name"));
...
Next, choose your analyser, and make an index writer.
@@ -48,7 +48,7 @@
my @docs;
my $hc = Plucene::Search::HitCollector->new(collect => sub {
my ($self, $doc, $score)= @_;
- push @docs, $plucy->doc($doc);
+ push @docs, $searcher->doc($doc);
});
$searcher->search_hc($query, $hc);
@@ -68,7 +68,7 @@
=head1 EXTENSIONS
-Plucene comes shipped with some default Analyzsers. However it is
+Plucene comes shipped with some default Analyzers. However it is
expected that users will want to create Analyzers to meet their own
needs. To avoid namespace corruption, anyone releasing such Analyzers
to CPAN (which is encouraged!) should place them in the namespace