module NLP.CfgStuff where toyGram :: Cfg toyGram = Cfg "S" [ CfgRule "S" ["NP","VP"] , CfgRule "NP" ["Det","N"] , CfgRule "NP" ["Det","Adj","N"] , CfgRule "NP" ["NP","PP"] , CfgRule "VP" ["VP","PP"] , CfgRule "VP" ["V","NP"] , CfgRule "PP" ["P","NP"] , CfgRule "Det" [ "the" ] , CfgRule "Det" [ "a" ] , CfgRule "Det" [ "some" ] , CfgRule "N" [ "boy" ] , CfgRule "N" [ "code" ] , CfgRule "Adj" [ "shiny" ] , CfgRule "N" [ "machine" ] , CfgRule "V" [ "hacks" ] , CfgRule "P" [ "on" ] , CfgRule "NP" [ "somebody" ] , CfgRule "NP" [ "something" ] , CfgRule "PP" [ "somewhere" ] ] data CfgRule = CfgRule { lhs :: String , rhs :: [String] } data Cfg = Cfg { goal :: String, rules :: [CfgRule] }