It is currently Thu May 01, 2025 3:56 pm

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next
Author Message
Offline
 Post subject: Merging sgf problem files?
Post #1 Posted: Sun Mar 30, 2014 8:37 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
I have used "cmd copy *.sgf new.prb" but the resulting file always contains multiple errors. Among the worst: color switching (confusing with directions in the text), sometimes two problems in the same board, and answers always marked wrong. Can someone please explain a "nice" way to merge hundreds of single problem sgfs into one file. It would be especially nice if the merged file allows various options, such as keeping track of right/wrong counts, randomization of problems (even more useful if it preferentially loads missed problems), rotating board orientation, and switching color (with a switch in text). Thanks in advance for any help!

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #2 Posted: Sun Mar 30, 2014 9:15 am 
Oza

Posts: 2180
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Liked others: 237
Was liked: 662
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
Years ago I wrote a routine which merged multiple sgf files into a single one. It was designed to work with a folder full of games but I guess it would work with problems. I think if would merge up to ten levels deep. I have not looked at it for 10 years. I wrote it in Excel VBA so it needs Excel to run. It could be converted to some other language if you know how. I could try to find it if you think I may help.

_________________
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).


This post by DrStraw was liked by: Aidoneus
Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #3 Posted: Sun Mar 30, 2014 12:41 pm 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
I have an older version of Excel, though I mostly use the OpenOffice suite. Assuming that I can run your program under one or the other of my programs, I would be interested in trying, and very grateful to you for your consideration whatever the result.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #4 Posted: Sun Mar 30, 2014 3:26 pm 
Oza

Posts: 2180
Location: ʍoquıɐɹ ǝɥʇ ɹǝʌo 'ǝɹǝɥʍǝɯos
Liked others: 237
Was liked: 662
Rank: AGA 5d
GD Posts: 4312
Online playing schedule: Every tenth February 29th from 20:00-20:01 (if time permits)
Send me a PM with an e-mail address and I'll mail it to you. I have to tell you though, that I have not looked at it for about 10 years (I found it and the file date was 2003) and make no claims with it. But if you can read VB you should be able to make sense of it.

_________________
Still officially AGA 5d but I play so irregularly these days that I am probably only 3d or 4d over the board (but hopefully still 5d in terms of knowledge, theory and the ability to contribute).

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #5 Posted: Sun Mar 30, 2014 4:22 pm 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
OK, I sent you a PM (I think!). Thanks.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #6 Posted: Sun Mar 30, 2014 6:55 pm 
Lives in gote
User avatar

Posts: 314
Location: Germany
Liked others: 10
Was liked: 128
Rank: KGS 4k
Quote:
and answers always marked wrong.

Quote:
It would be especially nice if the merged file allows various options, such as keeping track of right/wrong counts,

Don't get me wrong, but this sounds like you're confusing features of your specific sgf-editor (probably some sort of problem-solver thingy) with the sgf-format in general.
What sgf-editor are you using?

From what I read about sgf, just concatenating all sgf-files into a single file should work. I tried it with about 900 problem files I have, and it worked.
However, the only sgf-editor that correctly displayed the resulting collection-sgf was jago (gopanda had a buggy output, cgoban 3 simply ignored all but the first problem and gogui informed me that it simply doesn't support multiple sgf trees).


Either way, if certain sgf-editors have problems with game collections, maybe it's not a good idea to use them in the first place.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #7 Posted: Sun Mar 30, 2014 11:15 pm 
Dies with sente

Posts: 78
Liked others: 10
Was liked: 33
Rank: 9k
Universal go server handle: dfunkt
try this: http://www.igoweb.org/~wms/comp/sgfMerger/

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #8 Posted: Mon Mar 31, 2014 6:33 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
leichtloeslich: I downloaded Jago. It would only open the first problem from my merged file. Perhaps it is because of the way that I merged it. However, Many Faces of Go v12 does open the file, though with the issues I listed in my original post. BTW, David Fotland (author of MFG) suggested the cmd string to merge the files, though he said that he hadn't tried it. How did you concatenate the various problem files?

dfunkt: I found that program before asking here. Since there is no instruction at the site for using it in Windows, and I don't know anything about Java, I have no idea how to use it.

DrStraw: Thank you for your help, but I am afraid that if I have to learn Excel VBA to reprogram a macro, I will never get it to work for me. At least not without way too much hand holding. I apologize for wasting your time.

I have to say, though, that I am surprised that I haven't found any Go database program that can do what I ask. Does anyone know of a Go program that is comparable to ChessBase? ChessBase wasn't free, and I would pay for a good Go database program. I want to spend my free time learning Go, not learning to program!

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #9 Posted: Mon Mar 31, 2014 7:00 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
Aidoneus wrote:
I have used "cmd copy *.sgf new.prb"


Did that command work better ?
Code:
cmd copy /B *.sgf new.prb


If that don't work, I may look into the file to see if I can find something that may cause the problem.
but you will then need to send me the full sgf file so that I can look inside...

_________________
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #10 Posted: Mon Mar 31, 2014 7:42 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
oca: I tried your modified cmd string. Same trouble. I purchased GoGoD and membership at GoBase.org for problems, but I have also downloaded free problems from other sites, such as http://www.u-go.net/classic/. For example, after expanding qjzm.zip from the latter site, I had several hundred sgf problem files. Running either cmd copy variant produced one file, but with reversed colors. Although your cmd string seemed to reverse colors with just every other problem.

BTW, the problems included with MFG--Graded Go Problems for Beginners v 1--are located in just one file and work perfectly.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #11 Posted: Mon Mar 31, 2014 8:04 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
oca: After looking at a few more problems in the merged file, it became clear that the file was broken--that is, I could not even input a solution or move forward through the stored solution, only step to the next problem, which again could not be solved.

Please let me know if the merged file works correctly with some other program than MFG.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #12 Posted: Mon Mar 31, 2014 9:02 am 
Lives in gote
User avatar

Posts: 314
Location: Germany
Liked others: 10
Was liked: 128
Rank: KGS 4k
Quote:
I downloaded Jago. It would only open the first problem from my merged file.

Have you tried "Next game" in the "Nodes" menu?

Quote:
How did you concatenate the various problem files?

Code:
$ cat *.sgf > collection.sgf

That's how to concatenate files under linux. Under windows you do it via the "copy" command, as others have pointed out.


Quote:
I have to say, though, that I am surprised that I haven't found any Go database program that can do what I ask. Does anyone know of a Go program that is comparable to ChessBase?

Not sure what Chessbase can do, but maybe check out Drago and GoGrinder.

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #13 Posted: Mon Mar 31, 2014 10:55 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
Aidoneus wrote:
reversed colors

This is not a bug, this is a feature ;)

Many Faces of Go treats .prb files differently than .sgf files, with .prb file, there is a "problems" menu where there is an option "Random Orientation/Color".

_________________
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #14 Posted: Mon Mar 31, 2014 12:50 pm 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
leichtloeslich: Yes, I would have tried next game except it was grayed out. And yes, I used the copy cmd to create a new prb file. I will take a look at GoGrinder, thank you.

oca: Yes, Random Orientation/Color is a nice feature in MFG, especially as it works with the included Graded Go Problems for Beginners v1. It does not work properly with any of my merged files.
First, each merged file will not open in MFG with Open/View/Edit Game or Solve Go Problems under File; they will open with Edit File of Go Problems under File. Second, for most problems the text directions (say, Black to move) and move side are reversed (White to move)--by itself a minor issue. Third, occasionally problems are run together on the board. Fourth, and this is the main issue, because the solutions are not reversed along with the colors, every problem answer will be marked wrong after the first correct move and no further moves can be made in a sequence--the full sequence will appear, however, but only by stepping through the stored solution.
If you still want to help, would you try merging the sgf files in qjzm.zip (a mere 17 kilobyte download) and see if you can get a single file that works properly--in MFG or any other program? And explain how I could replicate your result without having to learn a programming language? I can't afford to pull much more hair out! :lol:

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #15 Posted: Mon Mar 31, 2014 1:23 pm 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
leichtloeslich: GoGrinder looks like it might be the go database program I have been looking for. At least if I can figure out why it will load the default single sgf files in one folder, but not (yet!) a folder with my single sgf files. If I could get this to work, I wouldn't need to merge the sgf files. I suppose that I need to read the documentation before asking any more questions...

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #16 Posted: Tue Apr 01, 2014 3:23 am 
Lives in gote
User avatar

Posts: 699
Location: Switzerland
Liked others: 485
Was liked: 166
Rank: DDK
KGS: aco
IGS: oca
OGS: oca
I did some more testing and went to some problems too.
that said, problems seems not to be related on the merging of files but more on a missing property needed by Many Faces of Go.

Here is what I did :

- dowloaded and installed "Many Faces of Go" trial version 12, later refered as "MFG" in this post
- dowloaded qjzm.zip and extracted files to a directory

from there, I just renamed one of the file from "qjzm1-1.sgf" to "qjzm1-1.prb".
I opened "qjzm1-1.prb" using the menu "File"->"Open/View/Edit Game"
then play then correct move for white and MFG told me that was the wrong move... then asked MFG to tell me what was the correct move and it showed me the same move I just played...

I then looked at another problem file that was part of MFG distribution (C:\Program Files (x86)\Many Faces of Go 12\Problems\lvl0.prb"
and that file worked fine...

so went back to the file qjzm1-1.prb and looked at its content .

The content was a valid sgf file.
(;GM[1]FF[3]SZ[19]
AW[rb][qb][pb][rc][rd]AB[ob][nc][pc][qc][qe][re]PL[W]C[White to play and live.];W[sa];B[sd];W[sc]
)


I then watched at diffrence between "lvl0.prb" and "qjzm1-1.prb" and found that there is a "TE" property in the working file. (in sgf, TE means for TEsuji move)

I then added that property to qjzm1-1.prb

(;GM[1]FF[3]SZ[19]
AW[rb][qb][pb][rc][rd]AB[ob][nc][pc][qc][qe][re]PL[W]C[White to play and live.];W[sa]TE[2];B[sd];W[sc]
)


and that change made the problem working right on MFG.

Unfortunately, that will not help you much... that just tend to indicate that MFG may rely on TE property that is not present in all files...

[edit]corrected some typo[/edit]

_________________
Converting the book Shape UP! by Charles Matthews/Seong-June Kim
to the gobook format. last updated april 2015 - Index of shapes, p.211 / 216


This post by oca was liked by: Aidoneus
Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #17 Posted: Tue Apr 01, 2014 6:24 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
oca: Thank you for looking into MFG. Without understanding sgf, which seems much more involved than pgn chess files, I couldn't tell anything by looking at the files in Notepad++. However, after looking at some single sgf files, I also noticed, like you, that some did not work right. Unfortunately, the apparent need to edit the sgf code for each problem before MFG can handle them properly seems to indicate that MFG is a poor choice (at least for me!) for problem collections.

As most problem sets seem to be split into single sgf files and GoGrinder handles single sgf files within a collection folder, I have turned my attention to trying to get GoGrinder to work right. I may have to start a new thread for GoGrinder problems, though! :cry:

If I add any second subfolder (even an empty subfolder!) under problems in GoGrinder, the program gives an error message. Then using the magnifying glass to open problem subfolders will result in an error dialog box that will not go away no matter how many times one clicks on OK--in fact, it seems the only choice is to use Task Manager to force quit GoGrinder. BTW, I have Java 7 update 51 installed and GoGrinder 1.14. Perhaps I need an older version of Java?

Is the Go community too small to support a robust software industry? Most software seems to be written by one or at most a few collaborating volunteers, often in Java, and infrequently updated. Which is quite understandable if the current audience for Go is too small to warrant full-time Go software companies. Coming from the chess world, with the proliferation of digital game collections and instructive material available for running in ChessBase or as stand-alone DVDs, I may be spoiled. This is not meant to disparage any of the work already done--other than sticking with Windows OS, I use open source programs when available. But I am willing to spend money to obtain superior products--just don't tell my wife how much I've spent on chess books, chess software, and Advanced Squad Leader modules. ;-)

Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #18 Posted: Tue Apr 01, 2014 6:46 am 
Gosei
User avatar

Posts: 1585
Location: Barcelona, Spain (GMT+1)
Liked others: 577
Was liked: 298
Rank: KGS 5k
KGS: RBerenguel
Tygem: rberenguel
Wbaduk: JohnKeats
Kaya handle: RBerenguel
Online playing schedule: KGS on Saturday I use to be online, but I can be if needed from 20-23 GMT+1
Aidoneus wrote:
oca: Thank you for looking into MFG. Without understanding sgf, which seems much more involved than pgn chess files, I couldn't tell anything by looking at the files in Notepad++. However, after looking at some single sgf files, I also noticed, like you, that some did not work right. Unfortunately, the apparent need to edit the sgf code for each problem before MFG can handle them properly seems to indicate that MFG is a poor choice (at least for me!) for problem collections.

As most problem sets seem to be split into single sgf files and GoGrinder handles single sgf files within a collection folder, I have turned my attention to trying to get GoGrinder to work right. I may have to start a new thread for GoGrinder problems, though! :cry:

If I add any second subfolder (even an empty subfolder!) under problems in GoGrinder, the program gives an error message. Then using the magnifying glass to open problem subfolders will result in an error dialog box that will not go away no matter how many times one clicks on OK--in fact, it seems the only choice is to use Task Manager to force quit GoGrinder. BTW, I have Java 7 update 51 installed and GoGrinder 1.14. Perhaps I need an older version of Java?

Is the Go community too small to support a robust software industry? Most software seems to be written by one or at most a few collaborating volunteers, often in Java, and infrequently updated. Which is quite understandable if the current audience for Go is too small to warrant full-time Go software companies. Coming from the chess world, with the proliferation of digital game collections and instructive material available for running in ChessBase or as stand-alone DVDs, I may be spoiled. This is not meant to disparage any of the work already done--other than sticking with Windows OS, I use open source programs when available. But I am willing to spend money to obtain superior products--just don't tell my wife how much I've spent on chess books, chess software, and Advanced Squad Leader modules. ;-)


Check SmartGo. High quality (at least its iOS versions, if I had a Windows machine I'd buy it without a doubt), even if built by a very small team.

_________________
Geek of all trades, master of none: the motto for my blog mostlymaths.net


This post by RBerenguel was liked by: Aidoneus
Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #19 Posted: Tue Apr 01, 2014 9:02 am 
Honinbo

Posts: 10905
Liked others: 3651
Was liked: 3374
RBerenguel wrote:
Check SmartGo. High quality (at least its iOS versions, if I had a Windows machine I'd buy it without a doubt), even if built by a very small team.


Yes, Anders Kierulf certainly understands SGF. He invented it. (SGF = Smart Go Format) ;)

_________________
The Adkins Principle:
At some point, doesn't thinking have to go on?
— Winona Adkins

Visualize whirled peas.

Everything with love. Stay safe.


This post by Bill Spight was liked by: Aidoneus
Top
 Profile  
 
Offline
 Post subject: Re: Merging sgf problem files?
Post #20 Posted: Tue Apr 01, 2014 9:22 am 
Lives in gote

Posts: 603
Location: Indiana
Liked others: 114
Was liked: 176
Ah, I will look at SmartGo again, thank you. I discovered it a day after purchasing MFG; I would still have bought it at the time but he told me that the Windows version was not compatible with his SmartGo books, which I was very interested in purchasing. I think that my wife might notice if I pulled out an iPad, so I have been hoping that he would make the books compatible with his Windows version. Still, I think that he had a demo of the Windows version, and if it can seamlessly handle Go problem collections (SGF single files) or merged files, I will buy it.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 24 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group