HeidelTime / heideltime

A multilingual, cross-domain temporal tagger developed at the Database Systems Research Group at Heidelberg University.
GNU General Public License v3.0
343 stars 67 forks source link

made the stand alone version nicer to use as a lib #59

Open greenwoodma opened 7 years ago

greenwoodma commented 7 years ago

Two main changes to the standalone version to make it easier to use as a lib (for example from within the GATE plugin).

  1. the code now only calls System.exit() from within the main method. In other cases where an error occurs it is logged and then a runtime exception thrown which can be handled by calling code, which includes the main method which can then call System.exit()
  2. readConfigFile() now takes a URL as an argument rather than a String which was expected to contain a file path. This is not only more robust (spaces in filenames should be less of an issue, see #58) but also means that the config.props doesn't have to be a real file but can be any URL including inside a JAR file, which is where it will be in the new version of the GATE plugin. I've kept the old methods that assumed a String but marked them as deprecated.