public PrecedenceRelation(PrecedenceProperty p1, PrecedenceProperty p2) { this.p1 = p1; this.p2 = p2; }
public static string ConvertWords(PrecedenceProperty p, DocModelDictionary dictionary) { StringBuilder sb = new StringBuilder(); sb.Append("{"); for (int i = 0; i < p.p.Length; i++) { int wordKey = p.p[i]; sb.Append(" ["); sb.Append(dictionary.GetKey(wordKey)); sb.Append("],"); } sb.Remove(sb.Length - 1, 1); sb.Append(" }"); return sb.ToString(); }
public static string ConvertWords(PrecedenceProperty p, Dictionary<int, string[]> vocabulary) { StringBuilder sb = new StringBuilder(); sb.Append("{"); for (int i = 0; i < p.p.Length; i++) { int wordKey = p.p[i]; sb.Append(" ["); for (int j = 0; j < vocabulary[wordKey].Length; j++) { sb.Append(vocabulary[wordKey][j]); sb.Append(":"); } sb.Remove(sb.Length - 1, 1); sb.Append("],"); } sb.Remove(sb.Length - 1, 1); sb.Append(" }"); return sb.ToString(); }