You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by ot...@apache.org on 2006/12/11 22:42:32 UTC
svn commit: r485884 -
/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java
Author: otis
Date: Mon Dec 11 13:42:32 2006
New Revision: 485884
URL: http://svn.apache.org/viewvc?view=rev&rev=485884
Log:
- Cosmetics
Modified:
lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java
Modified: lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java?view=diff&rev=485884&r1=485883&r2=485884
==============================================================================
--- lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java (original)
+++ lucene/java/trunk/contrib/miscellaneous/src/java/org/apache/lucene/misc/LengthNormModifier.java Mon Dec 11 13:42:32 2006
@@ -69,8 +69,7 @@
LengthNormModifier lnm = new LengthNormModifier(d, s);
for (int i = 2; i < args.length; i++) {
- System.out.print("Updating field: " + args[i] + " " +
- (new Date()).toString() + " ... ");
+ System.out.print("Updating field: " + args[i] + " " + (new Date()).toString() + " ... ");
lnm.reSetNorms(args[i]);
System.out.println(new Date().toString());
}
@@ -83,7 +82,7 @@
private Similarity sim;
/**
- * Constructor for code that wishes to use this class progromaticaly
+ * Constructor for code that wishes to use this class progaomatically.
*
* @param d The Directory to modify
* @param s The Similarity to use in <code>reSetNorms</code>
@@ -94,7 +93,7 @@
}
/**
- * Re-Set the norms for the specified field.
+ * Resets the norms for the specified field.
*
* <p>
* Opens a new IndexReader on the Directory given to this instance,
@@ -102,7 +101,7 @@
* and closes the IndexReader.
* </p>
*
- * @param field the field whose norms
+ * @param field the field whose norms should be reset
*/
public void reSetNorms(String field) throws IOException {
String fieldName = field.intern();
@@ -127,7 +126,6 @@
}
}
} while (termEnum.next());
-
} finally {
if (null != termDocs) termDocs.close();
}
@@ -142,12 +140,10 @@
reader = IndexReader.open(dir);
for (int d = 0; d < termCounts.length; d++) {
if (! reader.isDeleted(d)) {
- byte norm = sim.encodeNorm
- (sim.lengthNorm(fieldName, termCounts[d]));
+ byte norm = sim.encodeNorm(sim.lengthNorm(fieldName, termCounts[d]));
reader.setNorm(d, fieldName, norm);
}
}
-
} finally {
if (null != reader) reader.close();
}