diff --git a/lib/resource-1.0/Makefile b/lib/resource-1.0/Makefile index f19c428f6..ecdd4668c 100644 --- a/lib/resource-1.0/Makefile +++ b/lib/resource-1.0/Makefile @@ -1,7 +1,7 @@ all: langs test test: - echo "gr -cat=S -number=11 -cf | tb" | gf langs.gfcm + echo "gr -cat=S -number=11 -prob | tb" | gf -probs=lang.gfprob langs.gfcm langs: echo "s ;; pm | wf langs.gfcm" | gf -src */Lang??*.gf english/LangEng.gf diff --git a/lib/resource-1.0/lang.gfprob b/lib/resource-1.0/lang.gfprob new file mode 100644 index 000000000..62c68fce5 --- /dev/null +++ b/lib/resource-1.0/lang.gfprob @@ -0,0 +1,6 @@ +--# prob ConjNP 0.05 +--# prob ConjAP 0.1 +--# prob ConjAdv 0.1 +--# prob ConjS 0.1 +--# prob PredSCVP 0.05 +--# prob PredetNP 0.05 diff --git a/src/GF/Probabilistic/Probabilistic.hs b/src/GF/Probabilistic/Probabilistic.hs index 9798892e4..935175ed9 100644 --- a/src/GF/Probabilistic/Probabilistic.hs +++ b/src/GF/Probabilistic/Probabilistic.hs @@ -200,7 +200,8 @@ hitRegion d vs = case vs of checkSGrammar :: SGrammar -> Err SGrammar checkSGrammar = mapMTree chCat where chCat (c,rs) = case sum [p | ((p,f),_) <- rs] of - s | s /= 1.0 -> Bad $ "illegal probability sum " ++ show s ++ " in " ++ c + s | abs (s - 1.0) > 0.01 -> + Bad $ "illegal probability sum " ++ show s ++ " in " ++ c _ -> return (c,rs) -- for cases where explicit probability is not given (encoded as