Comments (6)
Do you suggest that slices and enumerations be limited to the branch
on which you are, or that they include all the variations therein?
Imagine this:
0 1 2 3
2 3 4
slice = object[1..3]
Now.. Does slice mean
1 2 3
2 3
Or does it mean just
1 2 3
Or ... What does it mean?
The same question applies to enumeration. What do you suggest?
On Mon, Dec 5, 2011 at 02:43, Colin Noga
[email protected]
wrote:
The SGF format is move independent, but human logic is not. A move depth property shoudl be available for each node, specifying it’s depth from root. This is analogous to ‘move number’, as it is equivalent to the position if the node from the root (move 0).
Adding bonus properties like slices, or enumerations based on these would be delicious, delicious frosting on the cake of usability.
Reply to this email directly or view it on GitHub:
#12
from sgfparser.
Slices should act in a ruby-like way, exactly as they do with strings or arrays. In a different issue, I suggested adding a third class to game and tree called branch, for a branch within a game (which I believe is possible, no?). See Issue #11
In that case, a slice of a GameBranch should return only that branch. A slice of a GameTree or SgfTree should return all branches, it seems. Likewise, SgfTree.main[slice] would return a single branch of the main branch.
For the sake of simplicity, we could also only allow slicing for a single branch, avoiding variation trouble. But the above scenario would be superior.
Use cases:
Imagine, for example, a users wanting to comprise an compilation of opening database from the first 50 moves of pro games. He could simply go... SgfTree[0,50] to grab it for each game. Now imagine someone checking if anyone ever played the 2-6 point as an opening move on the second move. This could be done with SgfTree[2], and magically you would have every node in all those games to iterate over, to check for your 2-6. Other uses might be checking for tags, such as the old clan system on KGS used -> in order for games to qualify, you needed to add a specific tag before a specific move. Slices would facilitate this.
from sgfparser.
Okay. Here's another question.
Imagine I have a game like this:
0 1 2 3 4
1 2 3 4 5
2 3 4 5
2 3
2 3 4
Clearly, that's five branches.. Right? What would be inside those branches?
0 1 2 3 4
1 2 3 4 5
2 3 4 5
2 3
2 3 4
Or would it create this:
0 1 2 3 4
0 1 2 3 4 5
0 1 2 3 4 5
0 1 2 3
0 1 2 3 4
?
from sgfparser.
Poke @Tempus -- I think I can implement this but I would like some feedback from you on a previous comment on this issue :)
from sgfparser.
poke @Tempus so it doesn't matter that the resulting slices might be completely meaningless fragments of games, right?
from sgfparser.
Depth has been implemented.
Slicing has been at least partially implemented.
from sgfparser.
Related Issues (20)
- Have properties belonging to the game accessible from tree HOT 3
- Examine naming : Tree/Game/Branch ? HOT 4
- 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
- Parsing bad(?) sgf HOT 7
- 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.