Closed GoogleCodeExporter closed 9 years ago
The problem is likely this line in CleartkInternalModelFactory:
String resourceName = JarClassifierBuilder.getModelJarFile(getAnnotatorClass().getSimpleName().toLowerCase()).getPath();
It's using .getPath() and then using the result as part of a URI, but
.getPath() on Windows returns '\' characters. That code should instead do
something like:
String dirName = getAnnotatorClass().getSimpleName().toLowerCase();
File resourceFile = JarClassifierBuilder.getModelJarFile(dirName);
String resourceName = resourceFile.getPath().replaceAll("\\", "/");
(That last line is a hack, but there isn't a good way to go between a File and
the path portion of a URI.)
The problem is, I don't have a Windows machine, so I don't know how to test
this. In theory, EventAnnotatorsTest should already be failing on Windows. So
if someone can:
(1) run EventAnnotatorsTest on Windows
(2) confirm that it fails
(3) make the change suggested above
(4) confirm that EventAnnotatorsTest passes
Then I can commit the above change and everything should be fixed.
Original comment by steven.b...@gmail.com
on 2 Aug 2013 at 5:48
Thank you. I tried the suggested fix, but get a different error about the last
line:
String resourceName = resourceFile.getPath().replaceAll("\\", "/");
Exception in thread "main" java.util.regex.PatternSyntaxException: Unexpected
internal error near index 1
\
^
at java.util.regex.Pattern.error(Pattern.java:1713)
at java.util.regex.Pattern.compile(Pattern.java:1466)
at java.util.regex.Pattern.<init>(Pattern.java:1133)
at java.util.regex.Pattern.compile(Pattern.java:823)
at java.lang.String.replaceAll(String.java:2189)
at org.cleartk.timeml.util.CleartkInternalModelFactory.getClassifierJarURL(CleartkInternalModelFactory.java:66)
at org.cleartk.timeml.util.CleartkInternalModelFactory.getAnnotatorDescription(CleartkInternalModelFactory.java:113)
at org.apache.ctakes.temporal.eval.EvaluationOfClearTKEventProperties.test(EvaluationOfClearTKEventProperties.java:135)
at org.apache.ctakes.temporal.eval.EvaluationOfClearTKEventProperties.test(EvaluationOfClearTKEventProperties.java:1)
at org.cleartk.eval.Evaluation_ImplBase.trainAndTest(Evaluation_ImplBase.java:77)
at org.apache.ctakes.temporal.eval.EvaluationOfClearTKEventProperties.main(EvaluationOfClearTKEventProperties.java:92)
Original comment by chen.lin...@gmail.com
on 5 Aug 2013 at 6:26
I guess what you mean is:
String resourceName = resourceFile.getPath().replaceAll("\\\\", "/");
Original comment by chen.lin...@gmail.com
on 5 Aug 2013 at 6:54
Yeah, looks like it needs 4 backslashes. Did that work when you tried it?
Original comment by steven.b...@gmail.com
on 6 Aug 2013 at 5:14
Yes.
Original comment by chen.lin...@gmail.com
on 6 Aug 2013 at 8:13
This issue was closed by revision dc78d0f33cf1.
Original comment by steven.b...@gmail.com
on 25 Oct 2013 at 8:58
I've applied the patch as discussed. If you find that this does not resolve the
issue, please reopen the ticket.
Original comment by steven.b...@gmail.com
on 25 Oct 2013 at 8:59
Original issue reported on code.google.com by
chen.lin...@gmail.com
on 2 Aug 2013 at 5:20