diff options
| author | krasimir <krasimir@chalmers.se> | 2010-10-02 13:03:57 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-10-02 13:03:57 +0000 |
| commit | cb8795c222ae86e4561e1009c382fe0b87e22b62 (patch) | |
| tree | eddba3e578a812347060f5f640cc49e58dc5b263 /src/compiler/GF/Compile/GrammarToPGF.hs | |
| parent | 72cc4ddb594599a5e3768a7b3921975542c3591a (diff) | |
refactor the API for random generation again. Now PGF contains probabilities in the abstract syntax
Diffstat (limited to 'src/compiler/GF/Compile/GrammarToPGF.hs')
| -rw-r--r-- | src/compiler/GF/Compile/GrammarToPGF.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/GrammarToPGF.hs b/src/compiler/GF/Compile/GrammarToPGF.hs index 9b0f9293d..05ec88e72 100644 --- a/src/compiler/GF/Compile/GrammarToPGF.hs +++ b/src/compiler/GF/Compile/GrammarToPGF.hs @@ -57,14 +57,14 @@ canon2pgf opts gr cgr@(M.MGrammar (am:cms)) = do where flags = Map.fromList [(mkCId f,C.LStr x) | (f,x) <- optionsPGF (M.flags abm)] - funs = Map.fromAscList [(i2i f, (mkType [] ty, mkArrity ma, mkDef pty)) | + funs = Map.fromAscList [(i2i f, (mkType [] ty, mkArrity ma, mkDef pty, 0)) | (f,AbsFun (Just (L _ ty)) ma pty) <- Map.toAscList (M.jments abm)] cats = Map.fromAscList [(i2i c, (snd (mkContext [] cont),catfuns c)) | (c,AbsCat (Just (L _ cont))) <- Map.toAscList (M.jments abm)] catfuns cat = - (map snd . sortBy (compare `on` fst)) + (map (\x -> (0,snd x)) . sortBy (compare `on` fst)) [(loc,i2i f) | (f,AbsFun (Just (L loc ty)) _ _) <- tree2list (M.jments abm), snd (GM.valCat ty) == cat] mkConcr am cm@(lang,mo) = do |
