Commit 78259c13 authored by Duc Cao's avatar Duc Cao

Fix NullPointerException in AProcess.bestAnnotation method

parent ba197d21
...@@ -1196,18 +1196,9 @@ public abstract class AProcess extends AProcessSupport { ...@@ -1196,18 +1196,9 @@ public abstract class AProcess extends AProcessSupport {
} else { } else {
// we are looking for anonymous sources and they start with a non // we are looking for anonymous sources and they start with a non
// determinate article ("des","une","un") // determinate article ("des","une","un")
String firstWord; String firstWord = null;
try { if (wordsAndPosByOffset != null && wordsAndPosByOffset.containsKey(sourceLeftOffset)) {
firstWord = wordsAndPosByOffset.get(sourceLeftOffset).getFirst(); firstWord = wordsAndPosByOffset.get(sourceLeftOffset).getFirst();
} catch (NullPointerException e) {
TreeMap<Integer, Pair<String, String>> ordered = new TreeMap<>();
ordered.putAll(wordsAndPosByOffset);
System.out.println(ordered);
System.out.println(sourceLeftOffset);
System.out.println(wordsAndPosByOffset.get(sourceLeftOffset));
System.out.println(sourceWords);
System.out.println(sourcePOSs);
throw e;
} }
// if not anonymous // if not anonymous
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment