You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by cu...@apache.org on 2004/02/24 20:46:43 UTC
cvs commit: jakarta-lucene/src/java/org/apache/lucene/search QueryTermVector.java
cutting 2004/02/24 11:46:43
Modified: src/java/org/apache/lucene/index SegmentTermVector.java
TermFreqVector.java
src/java/org/apache/lucene/search QueryTermVector.java
Log:
Removed some dead code and redundant javadoc. Fixed a few javadoc bugs.
Revision Changes Path
1.2 +0 -49 jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermVector.java
Index: SegmentTermVector.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/SegmentTermVector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SegmentTermVector.java 20 Feb 2004 20:14:55 -0000 1.1
+++ SegmentTermVector.java 24 Feb 2004 19:46:43 -0000 1.2
@@ -35,72 +35,23 @@
return sb.toString();
}
-
- public String toString(IndexReader ir)
- throws IOException
- {
- return toString();
- /*StringBuffer sb = new StringBuffer();
- //TODO: Reimplement
-
- sb.append('{');
- sb.append(field).append(": ");
- for (int i=0; i<terms.length; i++) {
- if (i>0) sb.append(", ");
- Term t = ir.getTerm(terms[i]);
- String text = t == null ? "UNKNOWN(" + i + ")" : t.text;
- sb.append(text).append('/').append(termFreqs[i]);
- if (termProx != null) appendTermProx(sb.append('/'), termProx[i]);
- }
- sb.append('}');
- return sb.toString();*/
- }
-
-
- /** Number of terms in the term vector. If there are no terms in the
- * vector, returns 0.
- */
public int size() {
return terms == null ? 0 : terms.length;
}
- /** Array of term numbers in ascending order. If there are no terms in
- * the vector, returns null.
- */
public String [] getTerms() {
return terms;
}
- /** Array of term frequencies. Locations of the array correspond one to one
- * to the term numbers in the array obtained from <code>getTermNumbers</code>
- * method. Each location in the array contains the number of times this
- * term occurs in the document or the document field. If there are no terms in
- * the vector, returns null.
- */
public int[] getTermFrequencies() {
return termFreqs;
}
-
-
- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>
- * at which the term with the specified <code>termNumber</code> appears. If this
- * term does not appear in the array, return -1.
- */
public int indexOf(String termText) {
int res = Arrays.binarySearch(terms, termText);
return res >= 0 ? res : -1;
}
- /** Just like <code>indexOf(int)</code> but searches for a number of terms
- * at the same time. Returns an array that has the same size as the number
- * of terms searched for, each slot containing the result of searching for
- * that term number. Array of term numbers must be sorted in ascending order.
- *
- * @param termNumbers array containing term numbers to look for
- * @param start index in the array where the list of termNumbers starts
- * @param len the number of termNumbers in the list
- */
public int[] indexesOf(String [] termNumbers, int start, int len) {
// TODO: there must be a more efficient way of doing this.
// At least, we could advance the lower bound of the terms array
1.2 +5 -15 jakarta-lucene/src/java/org/apache/lucene/index/TermFreqVector.java
Index: TermFreqVector.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/index/TermFreqVector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TermFreqVector.java 20 Feb 2004 20:14:55 -0000 1.1
+++ TermFreqVector.java 24 Feb 2004 19:46:43 -0000 1.2
@@ -25,27 +25,17 @@
/** Array of term frequencies. Locations of the array correspond one to one
- * to the term numbers in the array obtained from <code>getTermNumbers</code>
+ * to the terms in the array obtained from <code>getTerms</code>
* method. Each location in the array contains the number of times this
* term occurs in the document or the document field.
*/
public int[] getTermFrequencies();
-
- /** Return a string representation of the vector.
- */
- public String toString();
-
-
- /** Return a string representation of the vector, but use the provided IndexReader
- * to obtain text for each term and include the text instead of term numbers.
- */
- public String toString(IndexReader ir) throws IOException;
-
- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>
- * at which the term with the specified <code>termNumber</code> appears. If this
- * term does not appear in the array, return -1.
+ /** Return an index in the term numbers array returned from
+ * <code>getTerms</code> at which the term with the specified
+ * <code>term</code> appears. If this term does not appear in the array,
+ * return -1.
*/
public int indexOf(String term);
1.2 +0 -40 jakarta-lucene/src/java/org/apache/lucene/search/QueryTermVector.java
Index: QueryTermVector.java
===================================================================
RCS file: /home/cvs/jakarta-lucene/src/java/org/apache/lucene/search/QueryTermVector.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- QueryTermVector.java 20 Feb 2004 20:14:55 -0000 1.1
+++ QueryTermVector.java 24 Feb 2004 19:46:43 -0000 1.2
@@ -147,63 +147,23 @@
}
- /**
- * @return The number of terms in the term vector.
- */
public int size() {
return terms.length;
}
- /** Returns an array of positions in which the term is found or null if no position information is
- * available or positions are not implemented.
- * Terms are identified by the index at which its number appears in the
- * term array obtained from <code>getTerms</code> method.
- */
- public int[] getTermPositions(int index) {
- return null;
- }
-
- /**
- * @return An Array of term texts in ascending order.
- */
public String[] getTerms() {
return terms;
}
- /** Array of term frequencies. Locations of the array correspond one to one
- * to the term numbers in the array obtained from <code>getTermNumbers</code>
- * method. Each location in the array contains the number of times this
- * term occurs in the document or the document field.
- */
public int[] getTermFrequencies() {
return termFreqs;
}
- /** Return a string representation of the vector, but use the provided IndexReader
- * to obtain text for each term and include the text instead of term numbers.
- */
- public String toString(IndexReader ir) throws IOException {
- return toString();
- }
-
- /** Return an index in the term numbers array returned from <code>getTermNumbers</code>
- * at which the term with the specified <code>termNumber</code> appears. If this
- * term does not appear in the array, return -1.
- */
public int indexOf(String term) {
int res = Arrays.binarySearch(terms, term);
return res >= 0 ? res : -1;
}
- /** Just like <code>indexOf(int)</code> but searches for a number of terms
- * at the same time. Returns an array that has the same size as the number
- * of terms searched for, each slot containing the result of searching for
- * that term number.
- *
- * @param terms array containing terms to look for
- * @param start index in the array where the list of terms starts
- * @param len the number of terms in the list
- */
public int[] indexesOf(String[] terms, int start, int len) {
int res[] = new int[len];
---------------------------------------------------------------------
To unsubscribe, e-mail: lucene-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: lucene-dev-help@jakarta.apache.org