private static int GetNodeIndex(IndexedWord token, int maxIndex) { if (token.CopyCount() == 0) { return(token.Index()); } else { return(token.Index() + maxIndex * token.CopyCount()); } }
private static IndexedWord GetToken(IList <IndexedWord> sortedTokens, int index, int copyCount) { int tokenLength = sortedTokens.Count; for (int i = index - 1; i < tokenLength; i++) { IndexedWord token = sortedTokens[i]; if (token.Index() == index && token.CopyCount() == copyCount) { return(token); } } return(null); }