Life In 19x19 http://www.lifein19x19.com/ |
|
Merging sgf problem files? http://www.lifein19x19.com/viewtopic.php?f=11&t=10076 |
Page 1 of 2 |
Author: | Aidoneus [ Sun Mar 30, 2014 8:37 am ] |
Post subject: | Merging sgf problem files? |
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! |
Author: | DrStraw [ Sun Mar 30, 2014 9:15 am ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | Aidoneus [ Sun Mar 30, 2014 12:41 pm ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | DrStraw [ Sun Mar 30, 2014 3:26 pm ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | Aidoneus [ Sun Mar 30, 2014 4:22 pm ] |
Post subject: | Re: Merging sgf problem files? |
OK, I sent you a PM (I think!). Thanks. |
Author: | leichtloeslich [ Sun Mar 30, 2014 6:55 pm ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | dfunkt [ Sun Mar 30, 2014 11:15 pm ] |
Post subject: | Re: Merging sgf problem files? |
try this: http://www.igoweb.org/~wms/comp/sgfMerger/ |
Author: | Aidoneus [ Mon Mar 31, 2014 6:33 am ] |
Post subject: | Re: Merging sgf problem files? |
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! |
Author: | oca [ Mon Mar 31, 2014 7:00 am ] |
Post subject: | Re: Merging sgf problem files? |
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... |
Author: | Aidoneus [ Mon Mar 31, 2014 7:42 am ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | Aidoneus [ Mon Mar 31, 2014 8:04 am ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | leichtloeslich [ Mon Mar 31, 2014 9:02 am ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Author: | oca [ Mon Mar 31, 2014 10:55 am ] |
Post subject: | Re: Merging sgf problem files? |
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". |
Author: | Aidoneus [ Mon Mar 31, 2014 12:50 pm ] |
Post subject: | Re: Merging sgf problem files? |
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! ![]() |
Author: | Aidoneus [ Mon Mar 31, 2014 1:23 pm ] |
Post subject: | Re: Merging sgf problem files? |
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... |
Author: | oca [ Tue Apr 01, 2014 3:23 am ] |
Post subject: | Re: Merging sgf problem files? |
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. 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 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] |
Author: | Aidoneus [ Tue Apr 01, 2014 6:24 am ] |
Post subject: | Re: Merging sgf problem files? |
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! ![]() 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. ![]() |
Author: | RBerenguel [ Tue Apr 01, 2014 6:46 am ] |
Post subject: | Re: Merging sgf problem files? |
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! ![]() 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. |
Author: | Bill Spight [ Tue Apr 01, 2014 9:02 am ] |
Post subject: | Re: Merging sgf problem files? |
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) ![]() |
Author: | Aidoneus [ Tue Apr 01, 2014 9:22 am ] |
Post subject: | Re: Merging sgf problem files? |
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. |
Page 1 of 2 | All times are UTC - 8 hours [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |