lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] [27/34] git commit: refs/heads/master - Add getter for Token pos.
Date Wed, 17 Jul 2013 14:12:47 GMT
Add getter for Token pos.

Add a getter for Token's `pos` field, which only yields a valid value
after position increments have been resolved.


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

Branch: refs/heads/master
Commit: e894b7c7929216eb5ceec68510b2e5799b411f70
Parents: 0a48712
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Sun Jun 30 05:48:58 2013 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Tue Jul 16 16:08:43 2013 -0700

----------------------------------------------------------------------
 core/Lucy/Analysis/Token.c   | 5 +++++
 core/Lucy/Analysis/Token.cfh | 6 ++++++
 2 files changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/e894b7c7/core/Lucy/Analysis/Token.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Token.c b/core/Lucy/Analysis/Token.c
index f5fec54..b1b1665 100644
--- a/core/Lucy/Analysis/Token.c
+++ b/core/Lucy/Analysis/Token.c
@@ -99,6 +99,11 @@ Token_get_pos_inc(Token *self) {
     return Token_IVARS(self)->pos_inc;
 }
 
+int32_t
+Token_get_pos(Token *self) {
+    return Token_IVARS(self)->pos;
+}
+
 char*
 Token_get_text(Token *self) {
     return Token_IVARS(self)->text;

http://git-wip-us.apache.org/repos/asf/lucy/blob/e894b7c7/core/Lucy/Analysis/Token.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Analysis/Token.cfh b/core/Lucy/Analysis/Token.cfh
index cec0109..0ebfeb5 100644
--- a/core/Lucy/Analysis/Token.cfh
+++ b/core/Lucy/Analysis/Token.cfh
@@ -85,6 +85,12 @@ class Lucy::Analysis::Token inherits Clownfish::Obj {
     int32_t
     Get_Pos_Inc(Token *self);
 
+    /** Accessor for pos.  Only valid after position increments for an array
+     * of tokens have been resolved.
+     */
+    int32_t
+    Get_Pos(Token *self);
+
     char*
     Get_Text(Token *self);
 


Mime
View raw message