Closed pippokill closed 4 years ago
It is necessary to encapsulate news_articles.addNewsMT
and news_articles.addNewsGM
(Main.java
) in a try/catch code block.
try { int insertedNews = news_articles.addNewsMT(conn, num_of_pages, url_news, crime_type); System.out.println(insertedNews + " news inserted related to " + crime_type + " - ModenaToday"); } catch (Exception ex) { ... }
try { int insertedNews = news_articles.addNewsGM(conn, num_of_pages, url_news, crime_type); System.out.println(insertedNews + " news inserted related to " + crime_type + " - Gazzetta di Modena"); } catch (Exception ex) { ... }
Thanks, I have modified the code adding the try/catch blocks.
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: begin 0, end -2, length 1 at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319) at java.base/java.lang.String.substring(String.java:1874) at eu.fbk.dh.tint.digimorph.annotator.GuessModel.guess(GuessModel.java:321) at eu.fbk.dh.tint.digimorph.annotator.DigiLemmaAnnotator.annotate(DigiLemmaAnnotator.java:212) at edu.stanford.nlp.pipeline.AnnotationPipeline.annotate(AnnotationPipeline.java:76) at edu.stanford.nlp.pipeline.StanfordCoreNLP.annotate(StanfordCoreNLP.java:599) at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:119) at eu.fbk.dh.tint.runner.TintPipeline.runRaw(TintPipeline.java:103) at NewsArticles.addNewsGM(NewsArticles.java:685) at Main.main(Main.java:63)