hot topics are determined according to the last 15 days articles
[pnews.git] / war / src / main / java / pnews / OpenNLP.java
index e158a00..99e344d 100644 (file)
@@ -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<String> classify(String str, List<String> 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<String> classify(String str, TokenNameFinderModel model, List<String> entities, Config config) throws IOException {
                 String entity;