Comments (7)
Hi, I'm glad you're using it and you're happy with it!
Hmm, interesting. When I built this gem I assumed that AB/AW was to be a unique property that took a list of stones. If I'm right, then goproblems is using an invalid format by having many of these.. But that doesn't solve your problem. Thanks for bringing this to my attention. The SGF Standard is actually silent on this point.
I will ask the SGF people about whether goproblems.com is doing something correct or not (for my own edification), and then fix that problem anyway.
from sgfparser.
Yeah. Im just wondering if it has something to do with how goproblems lets you add problems (through a flash application) which might generate this strange syntax. I assume most sgf editors are designed to output correct sgf
from sgfparser.
Do all the problems on goproblems have this issue? Do you have, by chance,
an example of one that doesn't have it?
On Sat, Mar 15, 2014 at 1:57 PM, John Hager [email protected]:
Yeah. Im just wondering if it has something to do with how goproblems lets
you add problems (through a flash application) which might generate this
strange syntax. I assume most sgf editors are designed to output correct sgf—
Reply to this email directly or view it on GitHubhttps://github.com//issues/23#issuecomment-37732902
.
from sgfparser.
Yeah this is problem 1000:
GM[1]FF[4]VW[]AP[Many Faces of Go:10.0]
SZ[13]
HA[0]
ST[1]
DT[2001-08-13]
KM[0.0]
RU[GOE]
AB[lb][lc][ld][kc][jb][ka][ck][dg][ei][fb][fc][fd][ee][db][cd][ej][fk][fl][fh][eg][fg][lj][kk][jj][ij][md][lf][gm][fm][gc]
AW[ib][jc][kd][jd][le][jf][hc][fi][gb][gd][fe][ff][ia][fj][gl][gk][gh][gg][jk][kg][lh][kl][ll][ik][me][ke][hm][hl]
C[After the previous problem, Black has played at 1 rather than
protecting his corner. How can white punish him?
]
PL[W]LB[gc:A]
(;W[mb](;B[ma]
%28;W[la];B[ge];W[ma];B[mc];W[ja];B[ma];W[kb]
C[White has given up too much when black plays A
]LB[ge:A]
%29
%28;W[ja];B[kb];W[la]
C[RIGHT
]%29)
(;B[ja];W[la]))
(;W[ja];B[mb]
C[Black is unconditionally alive.
])
(;W[ge];B[ja]
C[Black has had another chance to repair his defect.
]))
from sgfparser.
I got a response from the SGF folks. I'm quoting it here.
in a correct SGF file every property appears at most once in a single node. Nowadays bad SGF files are rare (goproblems is apparently an exception). But if you want to write a resilient parser, then maybe should take duplicate properties into account. Like Postel's law: be conservative in what you do, be liberal in what you accept from others.
Reading malformed SGF files is ok, although it could get us into trouble in the long term. But the internal representation (if accessible through an API) or the output should be correct SGF. Check files with sgfc, it is my reference implementation of the SGF standard.
I've been busy as well and haven't had time to work on this, but clearly some of these goproblems are malformed. I will have to do some work to handle that, which probably means adding in some kind of notifications for the user, like an array of errors or something.
from sgfparser.
I just pushed a fix to github ( d99b575 ), it's not deployed to rubygems yet. Can you try it from here and see how it works for you?
from sgfparser.
At least this use case is handled. Closing.
from sgfparser.
Related Issues (20)
- Have properties belonging to the game accessible from tree HOT 3
- Examine naming : Tree/Game/Branch ? HOT 4
- Move depth property HOT 6
- Documentation HOT 3
- Overloaded class initialization HOT 2
- each should not stop processing if block returns nil HOT 3
- Add error when parser reaches eof and branches are still open
- Speed Increases HOT 4
- User-friendly node-level properties
- SGF::Parser - is @strict_parsing necessary? HOT 1
- A node can only have one parent, but it can be the child of many nodes
- SGF::Writer#save should output to any I/O object, not just a filename HOT 1
- SGF::Writer#parse should accept an I/O object instead, with a convenience method for a file HOT 1
- Use parser as an editor HOT 3
- Collection#gametrees returns new objects all the time HOT 1
- Add errors/warning for SGF that doesn't conform to standard
- The parser seems to not parse well HOT 1
- Update Gem Repo HOT 3
- Make properties have reasonable hash keys HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sgfparser.