mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-05 09:12:51 -06:00
bugfix: setProbabilities should be more robust when there are missing probabilities for some functions or categories
This commit is contained in:
@@ -80,7 +80,7 @@ setProbabilities probs pgf = pgf {
|
|||||||
}}
|
}}
|
||||||
where
|
where
|
||||||
mapUnionWith f map1 map2 =
|
mapUnionWith f map1 map2 =
|
||||||
Map.mapWithKey (\k v -> f v (fromJust (Map.lookup k map2))) map1
|
Map.mapWithKey (\k v -> maybe v (f v) (Map.lookup k map2)) map1
|
||||||
|
|
||||||
-- | compute the probability of a given tree
|
-- | compute the probability of a given tree
|
||||||
probTree :: PGF -> Expr -> Double
|
probTree :: PGF -> Expr -> Double
|
||||||
|
|||||||
Reference in New Issue
Block a user