Skip to content

Apache Lucene open-source search software

LUCENE 918 and 922 docs for term vectors applied to trunk

Grant Ingersoll2bc81869dfec
diff --git a/src/java/org/apache/lucene/index/TermFreqVector.java b/src/java/org/apache/lucene/index/TermFreqVector.java
index 097709dc000..11e2d5e39b5 100644
--- a/src/java/org/apache/lucene/index/TermFreqVector.java
+++ b/src/java/org/apache/lucene/index/TermFreqVector.java
@@ -18,12 +18,14 @@ package org.apache.lucene.index;
*/
/** Provides access to stored term vector of
- * a document field.
+ * a document field. The vector consists of the name of the field, an array of the terms tha occur in the field of the
+ * {@link org.apache.lucene.document.Document} and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the
+ * frequency of getTerms()[5], assuming there are at least 5 terms in the Document.
*/
public interface TermFreqVector {
/**
- *
- * @return The field this vector is associated with.
+ * The {@link org.apache.lucene.document.Fieldable} name.
+ * @return The name of the field this vector is associated with.
*
*/
public String getField();
diff --git a/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java b/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java
index cf464534677..c86e8b3765e 100644
--- a/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java
+++ b/src/java/org/apache/lucene/index/TermVectorOffsetInfo.java
@@ -17,10 +17,18 @@ package org.apache.lucene.index;
* limitations under the License.
*/
+/**
+ * The TermVectorOffsetInfo class holds information pertaining to a Term in a {@link org.apache.lucene.index.TermPositionVector}'s
+ * offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the
+ * original content).
+ */
public class TermVectorOffsetInfo {
- public static final TermVectorOffsetInfo [] EMPTY_OFFSET_INFO = new TermVectorOffsetInfo[0];
- private int startOffset;
- private int endOffset;
+ /**
+ * Convenience declaration when creating a {@link org.apache.lucene.index.TermPositionVector} that stores only position information.
+ */
+ public static final TermVectorOffsetInfo[] EMPTY_OFFSET_INFO = new TermVectorOffsetInfo[0];
+ private int startOffset;
+ private int endOffset;
public TermVectorOffsetInfo() {
}
@@ -30,6 +38,10 @@ public class TermVectorOffsetInfo {
this.startOffset = startOffset;
}
+ /**
+ * The accessor for the ending offset for the term
+ * @return The offset
+ */
public int getEndOffset() {
return endOffset;
}
@@ -38,6 +50,11 @@ public class TermVectorOffsetInfo {
this.endOffset = endOffset;
}
+ /**
+ * The accessor for the starting offset of the term.
+ *
+ * @return The offset
+ */
public int getStartOffset() {
return startOffset;
}
@@ -46,6 +63,11 @@ public class TermVectorOffsetInfo {
this.startOffset = startOffset;
}
+ /**
+ * Two TermVectorOffsetInfos are equals if both the start and end offsets are the same
+ * @param o The comparison Object
+ * @return true if both {@link #getStartOffset()} and {@link #getEndOffset()} are the same for both objects.
+ */
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof TermVectorOffsetInfo)) return false;