BBO Discussion Forums: XML to FD parser - BBO Discussion Forums

Jump to content

Page 1 of 1

XML to FD parser

#1 User is offline   firmit 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 263
  • Joined: 2007-January-26

Posted 2007-June-06, 06:19

I have developed a parser which reads a XML-file and parses it to FD-format.

The xml-syntax and structure I have been using, is my own creation. The motivation for this was to present my bidding structure on a website, and make it easy to export to various output - such as FD.

Ex:
<system id="2D">
	<info>
  stuff blabla
	</info>
	<sequence opps="silent" seat="1 2" description="2D opening">  <node id="2D" seat="1 2" vulnerable="0">
  	<bidtype value="5"/>
  	<alert>Multi</alert>
  	<node id="2H">
    <bidtype value="C"/>
    <description>Pass or correct</description>
    <node id="2S">
    	<bidtype value="2"/>
    	<hp from="7" to="9"/>
    	<handtype value="6!S"/>
    </node>
  	</node>
  	<node id="2S">
    <bidtype value="C"/>
    <description>Pass or correct</description>
    <node id="Pa">
    	<bidtype value="1"/>
    	<hp from="7" to="9"/>
    	<handtype value="6!S"/>
    </node>
    <node id="3H">
    	<bidtype value="2"/>
    	<hp from="7" to="9"/>
    	<handtype value="6!H"/>
    </node>

  	</node>
  </node>
	</sequence>



Running this through my parser, generates:
*00{Sense 0.2a}=NYYYYYY firmit 2D multi
502D=NNNNNNN500Multi
502DP2H=NNNNNNNC00Pass or correct
502DP2HP2S=NNNNYNN266[7-9] 
502DP2S=NNNNNNNC00Pass or correct
502DP2SP3H=NNNYNNN266[7-9] 
502DP2N=NNNNNNNDAsks for information
502DP2NP3C=NNNNNNN000Good !H suit
502DP2NP3D=NNNNNNN000Good !S suit
502DP2NP3H=NNNNNNN000Bad !H suit
502DP2NP3S=NNNNNNN000Bad !S suit
....


I don't know if anyone is interested, but I am thinking about making it available. Of course, if you are only interested in making a FD file, it's overkill. But if you'd like to present it in some other form, maybe to for printing purposes - the XML format is excellent. Not to be negative or attack your work in anyway - but inquiry2over1 system would be better presented this way rather than by using "-----" as "depth-showing"... :)

I don't know what the "big-guys" says - but if you are interested, and we maybe agree on a standard, it might be possible to make available through bridgebase.com. If people upload a XML-file (which they themself have to write), and then they get to choose to output it as FD, print, html etc... This way complete systems may be available and presented on your site. ( the FD->xml is no problem creating - it's already practically done ).

If no interest - fine. I did this on my own time because I love programming :)
"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)
0

#2 User is offline   hotShot 

  • Axxx Axx Axx Axx
  • PipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 2,976
  • Joined: 2003-August-31
  • Gender:Male

Posted 2007-June-06, 06:40

I think it's interesting! :)
0

#3 User is offline   nige1 

  • 5-level belongs to me
  • PipPipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 9,128
  • Joined: 2004-August-30
  • Gender:Male
  • Location:Glasgow Scotland
  • Interests:Poems Computers

Posted 2007-June-06, 07:21

Great idea Firmit, Clever & pretty & useful! :D B) :D B) :D B)
Quibble: I'd prefer "bid" or "call" to "id", because I'm used to the idea of "id"s being unique. :)
I wish I understood how to manipulate XML. :)
Presumably most of the tags are optional with defaults? :huh:
Please will you post the other XML thingies? :)
0

#4 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-June-06, 07:53

http://downagain.sin.khk.be/FD
0

#5 User is offline   firmit 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 263
  • Joined: 2007-January-26

Posted 2007-June-06, 07:58

downagain, on Jun 6 2007, 03:53 PM, said:


LOL!

I rest my case!
"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)
0

#6 User is offline   Dwingo 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 355
  • Joined: 2003-May-30
  • Gender:Male
  • Location:India

Posted 2007-June-06, 21:50

Looks neat. Great job. Is there a way to print the whole bidding system with one Print command, than printing each page individually?

Godwin
Bridge Players do it with Finesse
0

#7 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-June-06, 23:20

I'm still working on that.. it's a slow process ;) . For now you can:
- upload a FD file
- view files
- delete files
- download files
But most of this stuff are only available when logged in (and when your account is activated). Usually that doesn't take much time.

I'm also wondering if it would be interesting if people could edit their cards online. Any thoughts on that? Or if you have other suggestions/remarks, please let me know.
0

#8 User is offline   Dwingo 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 355
  • Joined: 2003-May-30
  • Gender:Male
  • Location:India

Posted 2007-June-07, 03:50

I expect editing online to be easier and convenient than doing it on FD. Hence there will be value to that proposition.

Godwin
Bridge Players do it with Finesse
0

#9 User is offline   firmit 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 263
  • Joined: 2007-January-26

Posted 2007-June-07, 06:47

OR - to support my own work - write it in XML and parse it!! :blink:

Edit;
Like I said, presentation value is maybe what I have been working with the most. I'll give you an example.
Posted Image
"Never increase, beyond what is necessary, the number of entities required to explain anything." William of Ockham (1285-1349)
0

#10 User is offline   2mouton 

  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 2007-February-26

Posted 2007-June-07, 08:09

downagain, on Jun 7 2007, 12:20 AM, said:

I'm still working on that.. it's a slow process :blink: . For now you can:
- upload a FD file
- view files
- delete files
- download files
But most of this stuff are only available when logged in (and when your account is activated). Usually that doesn't take much time.

I'm also wondering if it would be interesting if people could edit their cards online. Any thoughts on that? Or if you have other suggestions/remarks, please let me know.

I have logged in and my account has been activated (thank you downagain).

Then I have uploaded my convention card SAS 007 - version française (sorry folks, this is all in French).

Auctions without interference are correctly viewed and I must say I'm impressed. Looks like we now have a powerful tool for working on our BBO convention card (I'd love being able to edit it online).

However, as a high percentage of my CC is dedicated to auctions WITH interference (such as when LHO doubles my 1 club opening), I would have greatly enjoyed viewing these auctions, which is not presently the case (any hint on when it could be available?)

As a matter of fact, the bidedit.exe software provided by Bridge Base doesn't allow viewing auctions (where we open and opponents interfere) either. Any correlation?

Additional question: how do I manage to update the convention card that I have uploaded (and made available to all registered users). Can I delete it from the list in the main public page in order to upload a more recent version?
0

#11 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

  Posted 2007-June-07, 08:41

2mouton, on Jun 7 2007, 04:09 PM, said:

Auctions without interference are correctly viewed and I must say I'm impressed. Looks like we now have a powerful tool for working on our BBO convention card (I'd love being able to edit it online).

However, as a high percentage of my CC is dedicated to auctions WITH interference (such as when LHO doubles my 1 club opening), I would have greatly enjoyed viewing these auctions, which is not presently the case (any hint on when it could be available?)

As a matter of fact, the bidedit.exe software provided by Bridge Base doesn't allow viewing auctions (where we open and opponents interfere) either. Any correlation?

For now you can only see bids without interference.

However there is a way to get competitive bidding. Suppose you are viewing the page which contain bidding after 1-1-?. You see in the address bar "bod=1CP1DP". If you change this to "bod=1CD" you will see the continuations after 1-(dbl)-?.

This isn't an elegant solution, I know, but might do it for now. Don't have much time the next two weeks due to exams, but will post updates here on the forum.

2mouton, on Jun 7 2007, 04:09 PM, said:

Additional question: how do I manage to update the convention card that I have uploaded (and made available to all registered users). Can I delete it from the list in the main public page in order to upload a more recent version?

Indeed when you want to update your system, you can delete the old one and then upload the new one (deleting is not necessary, although then there will be 2 different versions on the site).

Glad to see people like it, and keep those suggestions coming :blink:.
0

#12 User is offline   2mouton 

  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 2007-February-26

Posted 2007-June-07, 09:14

I have tried replacing bod=1CP by bod=1C2H to see what defense I have set up against weak-2 interventions and it worked perfectly with the amazing following bug:

when responder doubles opponent's intervention, it displays 0s in the # column

New question: what if opponent opens and WE intervene? What do I have to type after bod=? I've tried bod=*1C1N to see my 1NT intervention over their 1C, but I got a blank screen
0

#13 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-June-07, 09:26

2mouton, on Jun 7 2007, 05:14 PM, said:

I have tried replacing bod=1CP by bod=1C2H to see what defense I have set up against weak-2 interventions and it worked perfectly with the amazing following bug:

when responder doubles opponent's intervention, it displays 0s in the # column

Oops :blink: .. guess it has something to do with D representing both diamonds as well as double. This will be corrected in the next update.

2mouton, on Jun 7 2007, 05:14 PM, said:

New question: what if opponent opens and WE intervene? What do I have to type after bod=? I've tried bod=*1C1N to see my 1NT intervention over their 1C, but I got a blank screen

Yep, that trick won't work there, because the defensive bidding is simply ignored when you upload a system (for now).
As you can see it's far from finished :lol:
0

#14 User is online   BillHiggin 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 499
  • Joined: 2007-February-03

Posted 2007-June-07, 10:25

An issue with FD involves sequences (often conventions) that are reused in many different auctions. Especially troublesome are maintaining such when some of the auctions require multiple bidding trees for things like opening seat, vulnerability or interference.

Perhaps one of these approaches could help to build a FD file based on macro like descriptions.

Small example (chosen because it is small):
I like 2N in many auctions beginning 1m 1M (non strong rebid by opener) to show either a weak club hand or a game forcing delayed raise of opener's minor (since I play the inverted raise denies a major)
1m (p) 1M (p)
xx (p) 2N {2Npuppet} forces 3C, either weak hand w long clubs or GF raise of m

{2Npuppet} version A
3C ; near automatic bid
... pass ; weak hand w long clubs
... 3D ; GF m raise w lower shortness
... 3H ; GF m raise w higher shortness
... 3S ; GF m raise 4M, 5m, 2-2 others, serious slam interest
... 3N ; GF m raise 4M, 5m, 2-2 others, mild slam interest
{/ 2Npuppet}

{2Npuppet} version B
3C ; near automatic bid
... pass ; weak hand w long clubs
... 3D ; GF m raise w lower shortness
... ... 3H ; opener asks
... ... ... 3S ; serious slam interest, singleton
... ... ... 3N ; mild slam interest
... ... ... 4C ; serious slam interest, void
... 3H ; GF m raise, no shortness
... ... 3S ; opener has serious slam interest
... ... 3N ; opener has little slam interest
... 3S ; GF m raise w higher singleton and serious slam interest
... 3N ; GF m raise w higher shortness and mild slam interest
... 4C ; GF m raise w higher void and serious slam interest
{/ 2Npuppet}

It would be nice to be able to switch versions without risking forgetting some branch.

no specific syntax implied - plenty of options.
You must know the rules well - so that you may break them wisely!
0

#15 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-July-18, 15:48

Site has been updated and you can try a test version out at: http://downagain.sin.khk.be/FDNEW

Changed:
- constructive option added
- change-button removed: now when you change an option, the filter and page will be reloaded
- recursive option is now also located at the top (filter bar)
- you can now use the 1st column (=bidding) to navigate back or further in the bidding, and when you hover a bid you will also see an explanation of that bid
- error that dbl shows 0s fixed

I hope that some will try it out and let me know if they encounter any problems.

If everything seems to work smoothly I will replace the actual website with this test version.

I also started with the print function. But the problem is that most browsers don't handle CSS well. Suppose you have 8 possible responses after a particular bidding. Then I think it would be better that those 8 answers are shown at 1 page.. and not split over 2 pages if they don't fit at the end of a page. That seems to work with Opera but not with IE or Firefox.

Do you think that's not really important? Or does someone maybe know an easy workaround?
0

#16 User is offline   andych 

  • PipPipPipPip
  • Group: Full Members
  • Posts: 353
  • Joined: 2003-July-24

Posted 2007-July-21, 11:44

A very nice tool. Thanks downagain. :lol: :D
0

#17 User is offline   2mouton 

  • Pip
  • Group: Members
  • Posts: 5
  • Joined: 2007-February-26

Posted 2007-July-23, 06:29

I have just browsed through the new web page where I have loaded my own system.

It works great with the following exception :
- the # column on main page (system summary) remains empty

Great thanks for the great tool!!! Now I can broadcast the link to my partners for them to have access online to all improvements I can make inside the system.
0

#18 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-July-23, 16:46

2mouton, on Jul 23 2007, 02:29 PM, said:

It works great with the following exception :
  - the # column on main page (system summary) remains empty


Thanks for reporting. I think the problem is fixed (hopefully without messing up something else).
0

#19 User is offline   uday 

  • PipPipPipPipPipPipPipPip
  • Group: Advanced Members
  • Posts: 5,808
  • Joined: 2003-January-15
  • Gender:Male
  • Location:USA

Posted 2007-September-06, 19:58

OK, I'm missing something, but how do i download a cc to my computer to use it in BBO ?


U
0

#20 User is offline   downagain 

  • PipPipPip
  • Group: Full Members
  • Posts: 58
  • Joined: 2005-April-03

Posted 2007-September-07, 00:26

Your account wasn't activated yet, it is now. When you log in again, you wil notice some changes in the interface.
Click on the FD symbol to download the corresponding system.
0

Page 1 of 1


Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users