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:47 UTC
[14/19] lucy git commit: Create Perl POD for Inversion
Create Perl POD for Inversion
Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/c6682c67
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/c6682c67
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/c6682c67
Branch: refs/heads/master
Commit: c6682c67a825b23f862c53880668e770bb13707c
Parents: 3e6b05e
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Sun Aug 23 15:00:03 2015 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Aug 25 12:45:53 2015 +0200
----------------------------------------------------------------------
core/Lucy/Analysis/Inversion.cfh | 11 ++++++-----
perl/buildlib/Lucy/Build/Binding/Analysis.pm | 17 +++++++++++++++++
2 files changed, 23 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy/blob/c6682c67/core/Lucy/Analysis/Inversion.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Inversion.cfh b/core/Lucy/Analysis/Inversion.cfh
index 63d84fe..750c2dd 100644
--- a/core/Lucy/Analysis/Inversion.cfh
+++ b/core/Lucy/Analysis/Inversion.cfh
@@ -33,27 +33,28 @@ public class Lucy::Analysis::Inversion inherits Clownfish::Obj {
uint32_t cluster_counts_size; /* num unique texts */
/**
- * @param seed An initial Token to start things off, which may be NULL.
+ * @param seed An initial Token to start things off, which may be
+ * [](@null).
*/
- inert incremented Inversion*
+ public inert incremented Inversion*
new(Token *seed = NULL);
/** Tack a token onto the end of the Inversion.
*
* @param token A Token.
*/
- void
+ public void
Append(Inversion *self, decremented Token *token);
/** Return the next token in the Inversion until out of tokens.
*/
- nullable Token*
+ public nullable Token*
Next(Inversion *self);
/** Reset the Inversion's iterator, so that the next call to next()
* returns the first Token in the inversion.
*/
- void
+ public void
Reset(Inversion *self);
/** Assign positions to constituent Tokens, tallying up the position
http://git-wip-us.apache.org/repos/asf/lucy/blob/c6682c67/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 7b10636..dad9b11 100644
--- a/perl/buildlib/Lucy/Build/Binding/Analysis.pm
+++ b/perl/buildlib/Lucy/Build/Binding/Analysis.pm
@@ -104,6 +104,22 @@ END_CONSTRUCTOR
}
sub bind_inversion {
+ my $pod_spec = Clownfish::CFC::Binding::Perl::Pod->new;
+ my $synopsis = <<'END_SYNOPSIS';
+ my $result = Lucy::Analysis::Inversion->new;
+
+ while (my $token = $inversion->next) {
+ $result->append($token);
+ }
+END_SYNOPSIS
+ my $constructor = <<'END_CONSTRUCTOR';
+ my $inversion = Lucy::Analysis::Inversion->new(
+ $seed, # optional
+ );
+END_CONSTRUCTOR
+ $pod_spec->set_synopsis($synopsis);
+ $pod_spec->add_constructor( alias => 'new', sample => $constructor, );
+
my $xs = <<'END_XS';
MODULE = Lucy PACKAGE = Lucy::Analysis::Inversion
@@ -139,6 +155,7 @@ END_XS
parcel => "Lucy",
class_name => "Lucy::Analysis::Inversion",
);
+ $binding->set_pod_spec($pod_spec);
$binding->append_xs($xs);
Clownfish::CFC::Binding::Perl::Class->register($binding);