You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by jo...@apache.org on 2011/01/25 16:12:41 UTC
svn commit: r1063314 - in
/incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp:
maxent/io/RealValueFileEventStreamTest.java model/IndexHashTableTest.java
Author: joern
Date: Tue Jan 25 15:12:41 2011
New Revision: 1063314
URL: http://svn.apache.org/viewvc?rev=1063314&view=rev
Log:
OPENLP-24 Formated code to comply with conventions
Modified:
incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/io/RealValueFileEventStreamTest.java
incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/model/IndexHashTableTest.java
Modified: incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/io/RealValueFileEventStreamTest.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/io/RealValueFileEventStreamTest.java?rev=1063314&r1=1063313&r2=1063314&view=diff
==============================================================================
--- incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/io/RealValueFileEventStreamTest.java (original)
+++ incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/maxent/io/RealValueFileEventStreamTest.java Tue Jan 25 15:12:41 2011
@@ -25,13 +25,16 @@ import opennlp.model.RealValueFileEventS
public class RealValueFileEventStreamTest extends TestCase {
- public void testLastLineBug() throws IOException {
- RealValueFileEventStream rvfes = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-ok.txt");
- OnePassRealValueDataIndexer indexer = new OnePassRealValueDataIndexer(rvfes, 1);
- assertEquals(1, indexer.getOutcomeLabels().length);
-
- rvfes = new RealValueFileEventStream("src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-broken.txt");
- indexer = new OnePassRealValueDataIndexer(rvfes, 1);
- assertEquals(1, indexer.getOutcomeLabels().length);
- }
+ public void testLastLineBug() throws IOException {
+ RealValueFileEventStream rvfes = new RealValueFileEventStream(
+ "src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-ok.txt");
+ OnePassRealValueDataIndexer indexer = new OnePassRealValueDataIndexer(
+ rvfes, 1);
+ assertEquals(1, indexer.getOutcomeLabels().length);
+
+ rvfes = new RealValueFileEventStream(
+ "src/test/resources/data/opennlp/maxent/io/rvfes-bug-data-broken.txt");
+ indexer = new OnePassRealValueDataIndexer(rvfes, 1);
+ assertEquals(1, indexer.getOutcomeLabels().length);
+ }
}
\ No newline at end of file
Modified: incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/model/IndexHashTableTest.java
URL: http://svn.apache.org/viewvc/incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/model/IndexHashTableTest.java?rev=1063314&r1=1063313&r2=1063314&view=diff
==============================================================================
--- incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/model/IndexHashTableTest.java (original)
+++ incubator/opennlp/trunk/opennlp-maxent/src/test/java/opennlp/model/IndexHashTableTest.java Tue Jan 25 15:12:41 2011
@@ -21,34 +21,34 @@ import junit.framework.TestCase;
public class IndexHashTableTest extends TestCase {
- public void testWithoutCollision() {
-
- String array[] = new String[3];
-
- array[0] = "4";
- array[1] = "7";
- array[2] = "5";
-
- IndexHashTable<String> arrayIndex = new IndexHashTable<String>(array, 1d);
-
- for (int i = 0; i < array.length; i++)
- assertEquals(i, arrayIndex.get(array[i]));
- }
-
- public void testWitCollision() {
-
- String array[] = new String[3];
-
- array[0] = "7";
- array[1] = "21";
- array[2] = "0";
-
- IndexHashTable<String> arrayIndex = new IndexHashTable<String>(array, 1d);
-
- for (int i = 0; i < array.length; i++)
- assertEquals(i, arrayIndex.get(array[i]));
-
- // has the same slot as as ""
- assertEquals(-1, arrayIndex.get("4"));
- }
+ public void testWithoutCollision() {
+
+ String array[] = new String[3];
+
+ array[0] = "4";
+ array[1] = "7";
+ array[2] = "5";
+
+ IndexHashTable<String> arrayIndex = new IndexHashTable<String>(array, 1d);
+
+ for (int i = 0; i < array.length; i++)
+ assertEquals(i, arrayIndex.get(array[i]));
+ }
+
+ public void testWitCollision() {
+
+ String array[] = new String[3];
+
+ array[0] = "7";
+ array[1] = "21";
+ array[2] = "0";
+
+ IndexHashTable<String> arrayIndex = new IndexHashTable<String>(array, 1d);
+
+ for (int i = 0; i < array.length; i++)
+ assertEquals(i, arrayIndex.get(array[i]));
+
+ // has the same slot as as ""
+ assertEquals(-1, arrayIndex.get("4"));
+ }
}