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 2015/08/30 19:28:37 UTC

[04/19] lucy git commit: Remove Analysis POD whitelist

Remove Analysis POD whitelist

All public Analyzer methods are now documented in the Perl API:

- Transform
- TransformText
- Split
- Load
- Dump


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/ebe18215
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/ebe18215
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/ebe18215

Branch: refs/heads/master
Commit: ebe182155189ef4e7a6cbc4010d0b6c2281d9065
Parents: e4ecf75
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Thu Aug 20 20:51:14 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Sun Aug 23 15:02:02 2015 +0200

----------------------------------------------------------------------
 core/Lucy/Analysis/Analyzer.cfh              | 25 +++++++++++++++++++++++
 perl/buildlib/Lucy/Build/Binding/Analysis.pm |  8 --------
 2 files changed, 25 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/ebe18215/core/Lucy/Analysis/Analyzer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Analyzer.cfh b/core/Lucy/Analysis/Analyzer.cfh
index 1580efa..cc1363a 100644
--- a/core/Lucy/Analysis/Analyzer.cfh
+++ b/core/Lucy/Analysis/Analyzer.cfh
@@ -32,6 +32,8 @@ public abstract class Lucy::Analysis::Analyzer inherits Clownfish::Obj {
     /** Take a single [](cfish:Inversion) as input
      * and returns an Inversion, either the same one (presumably transformed
      * in some way), or a new one.
+     *
+     * @param inversion An inversion.
      */
     public abstract incremented Inversion*
     Transform(Analyzer *self, Inversion *inversion);
@@ -40,18 +42,41 @@ public abstract class Lucy::Analysis::Analyzer inherits Clownfish::Obj {
      * The default implementation simply creates an initial Inversion with a
      * single Token, then calls [](cfish:.Transform), but occasionally subclasses will
      * provide an optimized implementation which minimizes string copies.
+     *
+     * @param text A string.
      */
     public incremented Inversion*
     Transform_Text(Analyzer *self, String *text);
 
     /** Analyze text and return an array of token texts.
+     *
+     * @param text A string.
      */
     public incremented Vector*
     Split(Analyzer *self, String *text);
 
+    /** Dump the analyzer as hash.
+     *
+     * Subclasses should call [](.Dump) on the superclass. The returned
+     * object is a hash which should be populated with parameters of
+     * the analyzer.
+     *
+     * @return A hash containing a description of the analyzer.
+     */
     public incremented Obj*
     Dump(Analyzer *self);
 
+    /** Reconstruct an analyzer from a dump.
+     *
+     * Subclasses should first call [](.Load) on the superclass. The
+     * returned object is an analyzer which should be reconstructed by
+     * setting the dumped parameters from the hash contained in `dump`.
+     *
+     * Note that the invocant analyzer is unused.
+     *
+     * @param dump A hash.
+     * @return An analyzer.
+     */
     public incremented Obj*
     Load(Analyzer *self, Obj *dump);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/ebe18215/perl/buildlib/Lucy/Build/Binding/Analysis.pm
----------------------------------------------------------------------
diff --git a/perl/buildlib/Lucy/Build/Binding/Analysis.pm b/perl/buildlib/Lucy/Build/Binding/Analysis.pm
index 60a73b2..7b10636 100644
--- a/perl/buildlib/Lucy/Build/Binding/Analysis.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Analysis.pm
@@ -35,13 +35,8 @@ sub bind_all {
 }
 
 sub bind_analyzer {
-    my @exposed = qw(
-        Split
-    );
-
     my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
     $pod_spec->set_synopsis("    # Abstract base class.\n");
-    $pod_spec->add_method( method => $_, alias => lc($_) ) for @exposed;
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Lucy",
@@ -178,8 +173,6 @@ END_CONSTRUCTOR
 }
 
 sub bind_polyanalyzer {
-    my @exposed = qw( Get_Analyzers );
-
     my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
     my $synopsis = <<'END_SYNOPSIS';
     my $schema = Lucy::Plan::Schema->new;
@@ -201,7 +194,6 @@ END_SYNOPSIS
 END_CONSTRUCTOR
     $pod_spec->set_synopsis($synopsis);
     $pod_spec->add_constructor( alias => 'new', sample => $constructor );
-    $pod_spec->add_method( method => $_, alias => lc($_) ) for @exposed;
 
     my $binding = Clownfish::CFC::Binding::Perl::Class->new(
         parcel     => "Lucy",