Exemplo n.º 1
0
        public override string toString()
        {
            if (this.rules.size() == 0)
            {
                return("<NULL>");
            }
            StringBuilder stringBuilder = new StringBuilder();

            for (int i = 0; i < this.rules.size(); i++)
            {
                if (i > 0)
                {
                    stringBuilder.append(' ');
                }
                JSGFRule jsgfrule = (JSGFRule)this.rules.get(i);
                if (jsgfrule is JSGFRuleAlternatives || jsgfrule is JSGFRuleSequence)
                {
                    stringBuilder.append("( ").append(jsgfrule).append(" )");
                }
                else
                {
                    stringBuilder.append(jsgfrule);
                }
            }
            return(stringBuilder.toString());
        }
        public override string toString()
        {
            if (this.rules == null || this.rules.size() == 0)
            {
                return("<VOID>");
            }
            StringBuilder stringBuilder = new StringBuilder();

            for (int i = 0; i < this.rules.size(); i++)
            {
                if (i > 0)
                {
                    stringBuilder.append(" | ");
                }
                if (this.weights != null)
                {
                    stringBuilder.append(new StringBuilder().append("/").append(this.weights.get(i)).append("/ ").toString());
                }
                JSGFRule jsgfrule = (JSGFRule)this.rules.get(i);
                if (this.rules.get(i) is JSGFRuleAlternatives)
                {
                    stringBuilder.append("( ").append(jsgfrule).append(" )");
                }
                else
                {
                    stringBuilder.append(jsgfrule);
                }
            }
            return(stringBuilder.toString());
        }
Exemplo n.º 3
0
        public virtual void append(JSGFRule rule)
        {
            if (this.rules == null)
            {
                string text = "null rule to append";

                throw new NullPointerException(text);
            }
            this.rules.add(rule);
        }
 public virtual void append(JSGFRule rule)
 {
     if (!JSGFRuleAlternatives.assertionsDisabled && rule == null)
     {
         throw new AssertionError();
     }
     this.rules.add(rule);
     if (this.weights != null)
     {
         this.weights.add(Float.valueOf(1f));
     }
 }
Exemplo n.º 5
0
 public virtual void setRule(JSGFRule rule)
 {
     this.rule = rule;
 }
Exemplo n.º 6
0
 public JSGFRuleTag(JSGFRule rule, string tag)
 {
     this.setRule(rule);
     this.setTag(tag);
 }
Exemplo n.º 7
0
 public JSGFRuleCount(JSGFRule rule, int count)
 {
     this.setRule(rule);
     this.setCount(count);
 }