[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kinosearch-commits
Subject:    [Kinosearch-commits] r3531 - in trunk: c_src/KinoSearch/Search
From:       marvin () rectangular ! com
Date:       2008-06-24 23:56:01
Message-ID: 200806242356.m5ONu0Jx015184 () mailer ! progressive-comp ! com
[Download RAW message or body]

Author: creamyg
Date: 2008-06-24 17:09:28 -0700 (Tue, 24 Jun 2008)
New Revision: 3531

Modified:
   trunk/c_src/KinoSearch/Search/PhraseQuery.bp
   trunk/c_src/KinoSearch/Search/PhraseQuery.c
   trunk/perl/lib/KinoSearch/Search/PhraseQuery.pm
Log:
Move PhraseQuery documentation to .bp file.  Add Get_Terms accessor.


Modified: trunk/c_src/KinoSearch/Search/PhraseQuery.bp
===================================================================
--- trunk/c_src/KinoSearch/Search/PhraseQuery.bp	2008-06-23 22:58:18 UTC (rev 3530)
+++ trunk/c_src/KinoSearch/Search/PhraseQuery.bp	2008-06-25 00:09:28 UTC (rev 3531)
@@ -1,5 +1,11 @@
 parcel KinoSearch cnick Kino;
 
+/** Query matching an ordered list of Terms.  
+ *
+ * PhraseQuery is a subclass of L<KinoSearch::Search::Query> for matching
+ * against an ordered sequence of terms.  
+ */
+
 class KinoSearch::Search::PhraseQuery extends KinoSearch::Search::Query {
 
     CharBuf       *field;
@@ -11,6 +17,10 @@
     static incremented PhraseQuery*
     new_unsafe(const char *field, ...);
 
+    /**
+     * @param field The field that the phrase must occur in.
+     * @param terms The ordered array of terms that must match.
+     */
     static PhraseQuery*
     init(PhraseQuery *self, const CharBuf *field, VArray *terms);
 
@@ -19,6 +29,11 @@
     CharBuf*
     Get_Field(PhraseQuery *self);
 
+    /** Accessor for object's array of terms.
+     */
+    VArray*
+    Get_Terms(PhraseQuery *self);
+
     incremented Compiler*
     Make_Compiler(PhraseQuery *self, Searchable *searchable, float boost);
 

Modified: trunk/c_src/KinoSearch/Search/PhraseQuery.c
===================================================================
--- trunk/c_src/KinoSearch/Search/PhraseQuery.c	2008-06-23 22:58:18 UTC (rev 3530)
+++ trunk/c_src/KinoSearch/Search/PhraseQuery.c	2008-06-25 00:09:28 UTC (rev 3531)
@@ -156,6 +156,8 @@
 
 CharBuf*
 PhraseQuery_get_field(PhraseQuery *self) { return self->field; }
+VArray*
+PhraseQuery_get_terms(PhraseQuery *self) { return self->terms; }
 
 /*********************************************************************/
 

Modified: trunk/perl/lib/KinoSearch/Search/PhraseQuery.pm
===================================================================
--- trunk/perl/lib/KinoSearch/Search/PhraseQuery.pm	2008-06-23 22:58:18 UTC (rev 3530)
+++ trunk/perl/lib/KinoSearch/Search/PhraseQuery.pm	2008-06-25 00:09:28 UTC (rev 3531)
@@ -16,6 +16,8 @@
     return $either->_new(%args);
 }
 
+sub get_terms { shift->_get_terms->to_perl }
+
 package KinoSearch::Search::PhraseCompiler;
 use KinoSearch::Util::ToolSet;
 use KinoSearch::base qw( KinoSearch::Search::Compiler );
@@ -26,49 +28,31 @@
 
 __AUTO_XS__
 
+my $synopsis = <<'END_SYNOPSIS';
+    my $phrase_query = KinoSearch::Search::PhraseQuery->new( 
+        field => 'content',
+        terms => [qw( the who )],
+    );
+    my $hits = $searcher->search( query => $phrase_query );
+END_SYNOPSIS
+
 {   "KinoSearch::Search::PhraseQuery" => {
-        bind_methods      => [qw( get_field )],
+        bind_methods      => [qw( get_field _get_terms|get_terms )],
         make_constructors => ["_new"],
+        make_pod          => {
+            constructor => '',
+            synopsis => $synopsis,
+            methods => [qw( get_field get_terms )],
+        },
     },
     "KinoSearch::Search::PhraseCompiler" =>
         { make_constructors => ["do_new"], },
 }
 
-__POD__
+__COPYRIGHT__
 
-=head1 NAME
-
-KinoSearch::Search::PhraseQuery - Match ordered list of Terms.
-
-=head1 SYNOPSIS
-
-    my $phrase_query = KinoSearch::Search::PhraseQuery->new( 
-        field => 'content',
-        terms => [qw( the who )],
-    );
-    my $hits = $searcher->search( query => $phrase_query );
-
-=head1 DESCRIPTION 
-
-PhraseQuery is a subclass of L<KinoSearch::Search::Query> for matching against
-ordered collections of terms.  
-
-=head1 METHODS
-
-=head2 new
-
-    my $phrase_query = KinoSearch::Search::PhraseQuery->new(
-        field => 'content',  # required
-    );
-
-Constructor.  Takes one labeled param, the field name.
-
-=head1 COPYRIGHT
-
 Copyright 2005-2008 Marvin Humphrey
 
-=head1 LICENSE, DISCLAIMER, BUGS, etc.
+This program is free software; you can redistribute it and/or modify
+under the same terms as Perl itself.
 
-See L<KinoSearch> version 0.20.
-
-=cut


_______________________________________________
kinosearch-commits mailing list
kinosearch-commits@rectangular.com
http://www.rectangular.com/mailman/listinfo/kinosearch-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic