//------------------------------------------------------------------ public int GetChainCost() { int totalCost = 0; WordTable wt = this.head; while (wt != null) { totalCost += wt.GetWordCost(); wt = wt.next; } return(totalCost); }
//------------------------------------------------------------------- private void MakeDebugInfo(StringBuilder result, WordTable wt) { string indent = " "; result.Append(indent); result.Append(" (" + wt.charCategory + ") "); result.Append(" (" + wt.posCategory + ") "); result.Append(" (" + wt.GetWordCost() + ") "); result.Append(" (" + wt.divided + ") "); if (wt.IsSentenseHead) { result.Append(" (sentense head)"); } if (wt.IsSentenseTail) { result.Append(" (sentense tail)"); } result.Append("\n"); SearchResult sResult = wt.sResult; if (sResult != null && sResult.documents != null) { foreach (DocumentData ddata in sResult.documents) { result.Append(indent); result.Append(ddata.GetData("key2")); result.Append(" " + ddata.GetData("cost2")); result.Append(" " + ddata.GetData("src")); result.Append("\n"); } } else { result.Append("\n"); } }