module NLP.BinarisedCfg where data BinarisedCfgRule = BinaryRule String (String,String) | UnaryRule String String lhs :: BinarisedCfgRule -> String lhs (BinaryRule l _ ) = l lhs (UnaryRule l _) = l data BinarisedCfg = BinarisedCfg { start :: String, rules :: [BinarisedCfgRule] } toyGram :: BinarisedCfg toyGram = BinarisedCfg "S" [ BinaryRule "S" ("NP","VP") , BinaryRule "NP" ("Det","N") , BinaryRule "NP" ("NP","PP") , BinaryRule "VP" ("VP","PP") , BinaryRule "VP" ("V","NP") , BinaryRule "PP" ("P","NP") , UnaryRule "Det" "the" , UnaryRule "Det" "a" , UnaryRule "Det" "some" , UnaryRule "N" "boy" , UnaryRule "N" "code" , UnaryRule "N" "telescope" , UnaryRule "V" "hacks" , UnaryRule "P" "with" ]