ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1465132 - /ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java
Date Fri, 05 Apr 2013 21:19:56 GMT
Author: tmill
Date: Fri Apr  5 21:19:55 2013
New Revision: 1465132

URL: http://svn.apache.org/r1465132
Log:
Steve Bethard's patch for reading in knowtator files from new svn repo structure.

Modified:
    ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java

Modified: ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java?rev=1465132&r1=1465131&r2=1465132&view=diff
==============================================================================
--- ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java
(original)
+++ ctakes/trunk/ctakes-temporal/src/main/java/org/apache/ctakes/temporal/ae/THYMEKnowtatorXMLReader.java
Fri Apr  5 21:19:55 2013
@@ -66,12 +66,12 @@ public class THYMEKnowtatorXMLReader ext
   protected URI getKnowtatorURI(JCas jCas) throws AnalysisEngineProcessException {
     URI uri = this.getTextURI(jCas);
     File file = new File(uri.getPath());
-    String subDir = file.getParentFile().getName();
-    Matcher matcher = Pattern.compile("^doc(\\d+)$").matcher(subDir);
+    String subDir = file.getName().substring(3, 5);
+    Matcher matcher = Pattern.compile("^\\d+$").matcher(subDir);
     if (!matcher.matches()) {
       throw new IllegalArgumentException("Unrecognized subdirectory naming: " + subDir);
     }
-    subDir = String.format("gold_revised_xml_docset%02d", Integer.parseInt(matcher.group(1)));
+    subDir = String.format("gold_revised_xml_docset%s", subDir);
     String fileName = file.getName() + ".knowtator.xml";
     return new File(new File(this.knowtatorXMLDirectory, subDir), fileName).toURI();
   }



Mime
View raw message