LUCENE 918 and 922 docs for term vectors applied to trunk

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@546696 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2007-06-13 01:13:26 +00:00
parent 373af70a20
commit 2bc81869df
2 changed files with 30 additions and 6 deletions

View File

@ -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();

View File

@ -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;