diff options
| author | krasimir <krasimir@chalmers.se> | 2010-12-17 09:09:07 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2010-12-17 09:09:07 +0000 |
| commit | e4b2b8541feba5c75316034b191c3b3bcdd8b9d2 (patch) | |
| tree | fe2f174198394ab5c5625247e6f97ebff589f191 | |
| parent | 2057c9f2848b9119f1a83de02f54fec414a107c3 (diff) | |
bugfix: setProbabilities should be more robust when there are missing probabilities for some functions or categories
| -rw-r--r-- | src/runtime/haskell/PGF/Probabilistic.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/haskell/PGF/Probabilistic.hs b/src/runtime/haskell/PGF/Probabilistic.hs index 1a75b60a6..ee44e73e1 100644 --- a/src/runtime/haskell/PGF/Probabilistic.hs +++ b/src/runtime/haskell/PGF/Probabilistic.hs @@ -80,7 +80,7 @@ setProbabilities probs pgf = pgf { }} where 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 probTree :: PGF -> Expr -> Double |
