Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
J38 authored and Stanford NLP committed Nov 10, 2016
1 parent d4b3980 commit ebcbddd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/edu/stanford/nlp/pipeline/EntityMentionsAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,9 @@ private static void addAcronyms(Annotation ann, List<CoreMap> mentions) {
// ... and actually are an acronym
if (AcronymMatcher.isAcronym(token.word(), org)) {
// ... and add them.
System.out.println("found ACRONYM ORG");
token.setNER("ORGANIZATION");
CoreMap chunk = ChunkAnnotationUtils.getAnnotatedChunk(tokens,
i, i + 1, totalTokensOffset, null, null, null);
chunk.set(CoreAnnotations.NamedEntityTagAnnotation.class,"ORGANIZATION");
mentions.add(chunk);

}
Expand Down
5 changes: 3 additions & 2 deletions src/edu/stanford/nlp/pipeline/ParserAnnotator.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ private void finishSentence(CoreMap sentence, List<Tree> trees) {
// do a pass and make sure all nodes have sentenceIndex set
SemanticGraph sg = sentence.get(SemanticGraphCoreAnnotations.CollapsedDependenciesAnnotation.class);
for (IndexedWord iw : sg.vertexSet()) {
if (iw.get(CoreAnnotations.SentenceIndexAnnotation.class) == null) {
System.out.println("found vertex with null index!");
if (iw.get(CoreAnnotations.SentenceIndexAnnotation.class) == null
&& sentence.get(CoreAnnotations.SentenceIndexAnnotation.class) != null) {
//System.out.println("found vertex with null index!");
iw.setSentIndex(sentence.get(CoreAnnotations.SentenceIndexAnnotation.class));
}
}
Expand Down

0 comments on commit ebcbddd

Please sign in to comment.