[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: sgf tree structure peculiarity
Hi,
the SGF Grammar says : GameTree := "(" Sequence {GameTree} ")"
The variations are within the GameTree's, every GameTree is representing
one independent variation. So it seems that all variations are siblings,
but this is IMHO only a question of interpretation. In practice, when
encountering a "(" there should be inserted a "meta-node VARIATION" and
all the GameTrees are sub-trees of this node.
I could send you a PCCTS grammar file, but I handled the variations in
an slightly different way. Because they are always at the end of a tree
(otherwise it would not be a tree but a directed acyclic graph). I
insert them as "SUBGRAPH node's" into the sequence and count them on the
fly and currently I'm using only the first variation (which is very easy).
What compiler generator are you using, if any?
Hope, I didn't confuse you too much,
Mike
Ray Tayek wrote:
> hi, writing an sgf parser. normally i would expect that variations would
> be in a subtree (i.e the "down" link in a node). but looking at the
> simple example at http://www.red-bean.com/sgf/sgf4.html (see below) , it
> looks like they want the *first* variation to be linked on the "next"
> link. it looks like this could be accomplished by a second pass over the
> tree, by looking for nodes that have a "next" link of null and a "down"
> link non-null and swapping the two links.
>
> has anyone else ran across this? (or perhaps i am confused?)
>
> thanks
>
> (;FF[4]C[root](;C[a];C[b](;C[c])
> (;C[d];C[e]))
> (;C[f](;C[g];C[h];C[i])
> (;C[j])))
>
> ---
> ray tayek http://home.attbi.com/~rtayek/ actively seeking telecommuting
> work
> vice chair orange county java users group http://www.ocjug.org/
> mailto:chair@xxxxxxxxxxxxxxxxx
> hate spam? http://samspade.org/ssw/
>
>
>