Skip to content
Snippets Groups Projects
Commit 39c51c90 authored by snigdha's avatar snigdha
Browse files

catching dep parser error

parent acad0bb6
No related branches found
No related tags found
No related merge requests found
...@@ -106,12 +106,16 @@ public class SentimentHandler { ...@@ -106,12 +106,16 @@ public class SentimentHandler {
// is this word negated // is this word negated
boolean isNeg = false; boolean isNeg = false;
if (considerNeg && (polarityBingLiu.length()!=0 || polarityMpqa.length()!=0)) { try {
if(depView==null){ if (considerNeg && (polarityBingLiu.length() != 0 || polarityMpqa.length() != 0)) {
annotator.addView(ta, ViewNames.DEPENDENCY_STANFORD); if (depView == null) {
depView = ta.getView(ViewNames.DEPENDENCY_STANFORD); annotator.addView(ta, ViewNames.DEPENDENCY_STANFORD);
depView = ta.getView(ViewNames.DEPENDENCY_STANFORD);
}
isNeg = isNegated(wordLemm, depView);
} }
isNeg = isNegated(wordLemm, depView); }catch (Exception e){
e.printStackTrace();
} }
// reverse polarity if negated // reverse polarity if negated
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment