lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dna...@apache.org
Subject svn commit: r219555 - /lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java
Date Mon, 18 Jul 2005 19:38:20 GMT
Author: dnaber
Date: Mon Jul 18 12:28:57 2005
New Revision: 219555

URL: http://svn.apache.org/viewcvs?rev=219555&view=rev
Log:
adding toString() implementation

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java
URL: http://svn.apache.org/viewcvs/lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java?rev=219555&r1=219554&r2=219555&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/analysis/Token.java Mon Jul 18 12:28:57 2005
@@ -109,4 +109,14 @@
   /** Returns this Token's lexical type.  Defaults to "word". */
   public final String type() { return type; }
 
+  public final String toString() {
+    StringBuffer sb = new StringBuffer();
+    sb.append("(" + termText + "," + startOffset + "," + endOffset);
+    if (!type.equals("word"))
+      sb.append(",type="+type);
+    if (positionIncrement != 1)
+      sb.append(",posIncr="+positionIncrement);
+    sb.append(")");
+    return sb.toString();
+  }
 }



Mime
View raw message