I have a SGF parser in Java in my library. I haven't updated it in a
while. You can find the SGF package here:
https://tesujigoframework.dev.java.net/source/browse/
tesujigoframework/TesujiGoFramework/source/tesuji/games/sgf/
I think it's pretty efficient and easy to use. For examples look at:
https://tesujigoframework.dev.java.net/source/browse/
tesujigoframework/TesujiGoFramework/source/tesuji/games/go/test/
SGFUnitTest.java
It has examples how to parse from a string, a file or how to iterate
over a large game-collection without keeping everything in memory.
There's also stuff there to make SGF out of a tree again and more
such things.
Let me know if it's any use, so far I haven't seen much interest in
this library. It seems everybody prefers to write their own standard
stuff.
Mark
On 3-aug-08, at 21:55, Ross Werner wrote:
I'm looking for a nice Java SGF library that allows you to parse
SGF files into a simple tree, and to serialize your own tree back
to SGF. I've looked at a few of the open source Go projects
currently out there, and I've searched the computer-go archives
(and even found a post from myself a few years back on the
subject), but haven't found anything that seems very robust.
So, my question here is twofold:
1) Does anybody know of a good Java SGF parser out there?
2) What would your criteria be for a good SGF parser? (e.g. it's
more important that it's fast than memory-efficient, or vice-versa,
or have a certain API, or allow for traversing the game tree
without holding the entire file in memory, etc.)
If I can't find a good one out there, I may write one myself,
probably based on JavaCC/SableCC, which I'm somewhat familiar with.
Thanks in advance for any feedback,
~ Ross
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/
_______________________________________________
computer-go mailing list
computer-go@computer-go.org
http://www.computer-go.org/mailman/listinfo/computer-go/