ctakes-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tm...@apache.org
Subject svn commit: r1727092 - /ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
Date Wed, 27 Jan 2016 15:40:53 GMT
Author: tmill
Date: Wed Jan 27 15:40:53 2016
New Revision: 1727092

URL: http://svn.apache.org/viewvc?rev=1727092&view=rev
Log:
Fixed reader to use release format of sharp knowator xml.

Modified:
    ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java

Modified: ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
URL: http://svn.apache.org/viewvc/ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java?rev=1727092&r1=1727091&r2=1727092&view=diff
==============================================================================
--- ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
(original)
+++ ctakes/trunk/ctakes-core/src/main/java/org/apache/ctakes/core/ae/SHARPKnowtatorXMLReader.java
Wed Jan 27 15:40:53 2016
@@ -177,13 +177,10 @@ public class SHARPKnowtatorXMLReader ext
    * @throws URISyntaxException 
    */
   protected URI getKnowtatorURI(JCas jCas) throws AnalysisEngineProcessException {
-    String textURI = this.getTextURI(jCas).toString();
-    String xmlURI = textURI.replaceAll("Knowtator[/\\\\]text", "Knowtator_XML") + ".knowtator.xml";
-    File fileTest = new File(URI.create(xmlURI));
-    if(!fileTest.exists()){
-      xmlURI = xmlURI.replace("_XML", " XML");
-    }
-    return UriUtils.create(xmlURI);
+    File textURI = new File(this.getTextURI(jCas));
+    String filename = textURI.getName().replace(".txt", "");
+    File xmlPath = new File(textURI.getParentFile().getParentFile().getParentFile().getParentFile().getParentFile(),
"by-document/" + filename + "/" + filename + ".umls.knowtator.xml");
+    return UriUtils.create("file:" + xmlPath.getAbsolutePath());
   }
 
   /**



Mime
View raw message