Re: [computer-go] Java SGF Parser
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/
Re: [computer-go] Java SGF Parser
On Mon, Aug 4, 2008 at 12:55 PM, Ross Werner <[EMAIL PROTECTED]> 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. I have what I believe to be a fast JavaCC sgf grammar at: http://code.google.com/p/jgogears/source/browse/trunk/jgogears/jgogears/SGF/SGF.jj I am interested in developing it into a fully-functional java bean. cheers stuart ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/
Re: [computer-go] Java SGF Parser
At 05:55 PM 8/3/2008, you 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 wrote one in java a few years ago. iirc, i based it on gnugo's parser. i was trying to compile annotations from previous instances of a and sgf file to a later version, that had more moves, but was missing some of the annotations. if you have any interest, let me know and i will send you a zip. thanks --- vice-chair http://ocjug.org/ ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/