fixed computing of entities when the article does not have a description
authorJean-Philippe Orsini <orsinije@fr.ibm.com>
Sun, 5 Nov 2017 21:45:45 +0000 (22:45 +0100)
committerJean-Philippe Orsini <orsinije@fr.ibm.com>
Sun, 5 Nov 2017 21:45:45 +0000 (22:45 +0100)
war/src/main/java/pnews/servlet/ArticleProvider.java

index ba96fe3..bdba835 100644 (file)
@@ -117,10 +117,11 @@ public class ArticleProvider {
                 }
                                 
                 entities = new ArrayList<>();
-                if (desc != null && lang.equals("en"))
+                if (lang.equals("en"))
                         try {
                                 NER.classify(title, entities, config);
-                                NER.classify(desc, entities, config);
+                                if (desc != null)
+                                        NER.classify(desc, entities, config);
                         } catch (ClassCastException | ClassNotFoundException | IOException e1) {
                                 LOG.log(Level.SEVERE, "Cannot classify " + feedTitle, e1);                         
                         }