int mentionInSentenceIndex=-1;
int numMentionsInSentence=-1;
int prevSentenceIndex = -1;
MentionContext[] contexts = new MentionContext[mentions.length];
for (int mi=0,mn=mentions.length;mi<mn;mi++) {
Parse mentionParse = mentions[mi].getParse();
//System.err.println("AbstractLinker.constructMentionContexts: mentionParse="+mentionParse);
if (mentionParse == null) {
System.err.println("no parse for "+mentions[mi]);
}
int sentenceIndex = mentionParse.getSentenceNumber();
if (sentenceIndex != prevSentenceIndex) {
mentionInSentenceIndex=0;
prevSentenceIndex = sentenceIndex;
numMentionsInSentence = 0;
for (int msi=mi;msi<mentions.length;msi++) {