idkwim / ouspg

Automatically exported from code.google.com/p/ouspg
3 stars 0 forks source link

Blab should probably use a PCFGs #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Some rules in Blab stdlib have ended up using things like A = B | (C | D) to 
control expansion probabilities, for example in cases where B is a terminal and 
C and D are not, or where C and D are more complex things which may more likely 
break some semantics or rules.

This would probably be more easily addressed by changing the grammar to a PCFG 
with initial even distribution, but allowing optionally set the weights. The 
main problem is that I haven't figured out a good syntax for it yet :)

Current plan:
 A =,2 B    <- P(B) = 1/2
   |,1 C
   |,1 D

==

 A = B,2 | C | D

Original issue reported on code.google.com by aohelin on 15 Dec 2011 at 7:03