You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@opennlp.apache.org by co...@apache.org on 2012/03/14 15:34:45 UTC

svn commit: r1300563 - /opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java

Author: colen
Date: Wed Mar 14 14:34:45 2012
New Revision: 1300563

URL: http://svn.apache.org/viewvc?rev=1300563&view=rev
Log:
OPENNLP-466: Loading the resource file was failing in some OS. Will create the file from a URI.

Modified:
    opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java

Modified: opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java
URL: http://svn.apache.org/viewvc/opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java?rev=1300563&r1=1300562&r2=1300563&view=diff
==============================================================================
--- opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java (original)
+++ opennlp/trunk/opennlp-tools/src/test/java/opennlp/tools/namefind/TokenNameFinderCrossValidatorTest.java Wed Mar 14 14:34:45 2012
@@ -20,6 +20,7 @@ package opennlp.tools.namefind;
 import static org.junit.Assert.*;
 
 import java.io.ByteArrayOutputStream;
+import java.io.File;
 import java.io.FileInputStream;
 import java.util.Collections;
 import java.util.Map;
@@ -35,7 +36,7 @@ import org.junit.Test;
 
 public class TokenNameFinderCrossValidatorTest {
 
-  private final String TYPE = "default";
+  private final String TYPE = null;
 
   @Test
   /**
@@ -43,9 +44,10 @@ public class TokenNameFinderCrossValidat
    */
   public void testWithNullResources() throws Exception {
 
-    FileInputStream sampleDataIn = new FileInputStream(getClass()
+    FileInputStream sampleDataIn = new FileInputStream(new File(getClass()
         .getClassLoader()
-        .getResource("opennlp/tools/namefind/AnnotatedSentences.txt").getFile());
+        .getResource("opennlp/tools/namefind/AnnotatedSentences.txt").toURI()));
+
     ObjectStream<NameSample> sampleStream = new NameSampleDataStream(
         new PlainTextByLineStream(sampleDataIn.getChannel(), "ISO-8859-1"));
 
@@ -67,9 +69,10 @@ public class TokenNameFinderCrossValidat
    */
   public void testWithNameEvaluationErrorListener() throws Exception {
 
-    FileInputStream sampleDataIn = new FileInputStream(getClass()
+    FileInputStream sampleDataIn = new FileInputStream(new File(getClass()
         .getClassLoader()
-        .getResource("opennlp/tools/namefind/AnnotatedSentences.txt").getFile());
+        .getResource("opennlp/tools/namefind/AnnotatedSentences.txt").toURI()));
+
     ObjectStream<NameSample> sampleStream = new NameSampleDataStream(
         new PlainTextByLineStream(sampleDataIn.getChannel(), "ISO-8859-1"));