From cb8795c222ae86e4561e1009c382fe0b87e22b62 Mon Sep 17 00:00:00 2001 From: krasimir Date: Sat, 2 Oct 2010 13:03:57 +0000 Subject: refactor the API for random generation again. Now PGF contains probabilities in the abstract syntax --- src/compiler/GF/Compile/ExampleBased.hs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/compiler/GF/Compile/ExampleBased.hs') diff --git a/src/compiler/GF/Compile/ExampleBased.hs b/src/compiler/GF/Compile/ExampleBased.hs index 20fa4d62f..46fb8b5d7 100644 --- a/src/compiler/GF/Compile/ExampleBased.hs +++ b/src/compiler/GF/Compile/ExampleBased.hs @@ -59,9 +59,7 @@ convertFile conf src file = do appn t >> mapM_ (appn . (" --- " ++)) tt >> return [] appn ")" return ws - rank ts = case probs conf of - Just probs -> [showExpr [] t ++ " -- " ++ show p | (t,p) <- rankTreesByProbs probs ts] - _ -> map (showExpr []) ts + rank ts = [showExpr [] t ++ " -- " ++ show p | (t,p) <- rankTreesByProbs pgf ts] appf = appendFile file appn s = appf s >> appf "\n" appv s = appn ("--- " ++ s) >> putStrLn s @@ -69,11 +67,10 @@ convertFile conf src file = do data ExConfiguration = ExConf { resource_pgf :: PGF, resource_morpho :: Morpho, - probs :: Maybe Probabilities, verbose :: Bool, language :: Language } -configureExBased :: PGF -> Morpho -> Maybe Probabilities -> Language -> ExConfiguration -configureExBased pgf morpho mprobs lang = ExConf pgf morpho mprobs False lang +configureExBased :: PGF -> Morpho -> Language -> ExConfiguration +configureExBased pgf morpho lang = ExConf pgf morpho False lang -- cgit v1.2.3