public override String ToString() { if (Rules.Count == 0) { return("<NULL>"); } var sb = new StringBuilder(); for (int i = 0; i < Rules.Count; ++i) { if (i > 0) { sb.Append(' '); } JSGFRule r = Rules[i]; if ((r is JSGFRuleAlternatives) || (r is JSGFRuleSequence)) { sb.Append("( ").Append(r).Append(" )"); } else { sb.Append(r); } } return(sb.ToString()); }
public override String ToString() { if (Rules == null || Rules.Count == 0) { return("<VOID>"); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < Rules.Count; ++i) { if (i > 0) { sb.Append(" | "); } if (Weights != null) { sb.Append("/" + Weights[i] + "/ "); } JSGFRule r = Rules[i]; if (Rules[i] is JSGFRuleAlternatives) { sb.Append("( ").Append(r).Append(" )"); } else { sb.Append(r); } } return(sb.ToString()); }
public void Append(JSGFRule rule) { if (Rules == null) { throw new NullReferenceException("null rule to append"); } Rules.Add(rule); }
public void Append(JSGFRule rule) { Debug.Assert(rule != null); Rules.Add(rule); if (Weights != null) { Weights.Add(1.0f); } }
public JSGFRuleCount(JSGFRule rule, int count) { Rule = rule; Count = count; }
public JSGFRuleTag(JSGFRule rule, String tag) { Rule = rule; Tag = tag; }