i want to use heideltime tool in my java code, so i downloaded heideltime-standalone,and i imported de.unihd.dbs.heideltime.standalone.jar as well as stanford-postagger.jar.
here is the code :
String textFile ="مدى اسبوع";
HeidelTimeStandalone H = new HeidelTimeStandalone(Language.ARABIC,
DocumentType.NEWS,
OutputType.TIMEML,
"/heideltime-standalone/config.props",
POSTagger.STANFORDPOSTAGGER,true);
String result = H.process(textFile,resultFormatter );
System.out.print(result);
and here is the output:
mai 01, 2016 5:09:54 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFOS: HeidelTimeStandalone initialized with language arabic
mai 01, 2016 5:09:54 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone readConfigFile
INFOS: trying to read in file /heideltime-standalone/config.props
May 01, 2016 5:09:56 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: HeidelTime initialized
May 01, 2016 5:09:56 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone initialize
INFO: JCas factory initialized
May 01, 2016 5:09:56 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
INFO: Processing started
de.unihd.dbs.heideltime.standalone.exceptions.DocumentCreationTimeMissingException
at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.provideDocumentCreationTime(HeidelTimeStandalone.java:304)
at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:493)
at de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone.process(HeidelTimeStandalone.java:427)
at Arabic_Parser.main(Arabic_Parser.java:54)
May 01, 2016 5:09:56 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
WARNING: Processing aborted due to errors
May 01, 2016 5:09:56 PM de.unihd.dbs.heideltime.standalone.HeidelTimeStandalone process
INFO: Result formatted
<?xml version="1.0"?>
<!DOCTYPE TimeML SYSTEM "TimeML.dtd">
<TimeML>
مدى اسبوع
</TimeML>
as you can see the Processing aborted due to errors, would you please help me to fix the errors
The HeidelTime that function you're calling
says in its doc comment:
If you want to call this with NEWS then you'll have to specify a time too, as an extra parameter between the document and result formatter.