Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.

Commit

Permalink
If there is at least one NE model or a chunker, use the OpenNLP spotter:
Browse files Browse the repository at this point in the history
  • Loading branch information
jodaiber committed Apr 6, 2013
1 parent 36a6881 commit 8c26d2b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ object SpotlightModel {
new GenerativeContextSimilarity(tokenTypeStore)
))

val spotter = if(new File(modelFolder, "opennlp/pos-maxent.bin").exists()) {
//If there is at least one NE model or a chunker, use the OpenNLP spotter:
val spotter = if( new File(modelFolder, "opennlp").exists() && new File(modelFolder, "opennlp").list().exists(f => f.startsWith("ner-") || f.startsWith("chunker")) ) {
val nerModels = new File(modelFolder, "opennlp").list().filter(_.startsWith("ner-")).map { f: String =>
new TokenNameFinderModel(new FileInputStream(new File(new File(modelFolder, "opennlp"), f)))
}.toList
Expand Down

0 comments on commit 8c26d2b

Please sign in to comment.