X-Git-Url: https://git.wpitchoune.net/gitweb/?p=pnews.git;a=blobdiff_plain;f=war%2Fsrc%2Fmain%2Fjava%2Fpnews%2FOpenNLP.java;fp=war%2Fsrc%2Fmain%2Fjava%2Fpnews%2FOpenNLP.java;h=99e344df25a6fadeb3604d0386776f78f11cae5b;hp=e158a00b07d13ef27b937b1179bf3b80a02affb7;hb=8372537c3503ab0ce4681fac13ccd65023fbcd84;hpb=e28fb81c2f705d5bc47464ccbf08481a06b1035d diff --git a/war/src/main/java/pnews/OpenNLP.java b/war/src/main/java/pnews/OpenNLP.java index e158a00..99e344d 100644 --- a/war/src/main/java/pnews/OpenNLP.java +++ b/war/src/main/java/pnews/OpenNLP.java @@ -19,17 +19,13 @@ public class OpenNLP { private static TokenNameFinderModel organizationModel; private static TokenNameFinderModel personModel; private static TokenNameFinderModel locationModel; - private static TokenNameFinderModel timeModel; private static TokenizerModel tokenModel; public static List classify(String str, List entities, Config config) throws IOException { classify(str, getOrganizationModel(), entities, config); - classify(str, getPersonModel(), entities, config); classify(str, getLocationModel(), entities, config); - classify(str, getTimeModel(), entities, config); - return entities; } @@ -65,17 +61,6 @@ public class OpenNLP { return locationModel; } - - private static TokenNameFinderModel getTimeModel() throws IOException { - synchronized (OpenNLP.class) { - if (timeModel == null) { - InputStream inputStream = OpenNLP.class.getResourceAsStream("/en-ner-time.bin"); - timeModel = new TokenNameFinderModel(inputStream); - } - } - - return timeModel; - } private static List classify(String str, TokenNameFinderModel model, List entities, Config config) throws IOException { String entity;