Ejemplo n.º 1
0
 private void traverseGDL(PrintWriter printWriter, Set set)
 {
     if (!set.contains(this))
     {
         set.add(this);
         printWriter.println(new StringBuilder().append("   node: { title: ").append(this.getGDLID(this)).append(" label: ").append(this.getGDLLabel(this)).append(" shape: ").append(this.getGDLShape(this)).append(" color: ").append(this.getGDLColor(this)).append('}').toString());
         GrammarArc[] successors = this.getSuccessors();
         GrammarArc[] array      = successors;
         int          num        = array.Length;
         for (int i = 0; i < num; i++)
         {
             GrammarArc  grammarArc  = array[i];
             GrammarNode grammarNode = grammarArc.getGrammarNode();
             float       probability = grammarArc.getProbability();
             printWriter.println(new StringBuilder().append("   edge: { source: ").append(this.getGDLID(this)).append(" target: ").append(this.getGDLID(grammarNode)).append(" label: \"").append(probability).append("\"}").toString());
             grammarNode.traverseGDL(printWriter, set);
         }
     }
 }