From f06638cc7d90eb8298180d36e79fc292a9f898dc Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 31 Oct 2005 18:02:34 +0000 Subject: probabilities in ShellState --- src/GF/Compile/ShellState.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/GF/Compile/ShellState.hs') diff --git a/src/GF/Compile/ShellState.hs b/src/GF/Compile/ShellState.hs index e00e2e477..2d87bdf67 100644 --- a/src/GF/Compile/ShellState.hs +++ b/src/GF/Compile/ShellState.hs @@ -5,9 +5,9 @@ -- Stability : (stable) -- Portability : (portable) -- --- > CVS $Date: 2005/10/30 23:44:00 $ +-- > CVS $Date: 2005/10/31 19:02:35 $ -- > CVS $Author: aarne $ --- > CVS $Revision: 1.49 $ +-- > CVS $Revision: 1.50 $ -- -- (Description of the module) ----------------------------------------------------------------------------- @@ -462,6 +462,13 @@ abstractOfState = maybe emptyAbstractST id . maybeStateAbstract stateIsWord :: StateGrammar -> String -> Bool stateIsWord sg = isKnownWord (stateMorpho sg) +addProbs :: (Ident,Probs) -> ShellState -> Err ShellState +addProbs ip@(lang,probs) + sh@(ShSt x y cs ms ss cfs old_pis mcfgs cfgs pinfos mos pbs os rs acs s) = do + let gr = grammarOfLang sh lang + probs' <- checkGrammarProbs gr probs + let pbs' = (lang,probs') : filter ((/= lang) . fst) pbs + return (ShSt x y cs ms ss cfs old_pis mcfgs cfgs pinfos mos pbs' os rs acs s) {- -- cgit v1.2.3