mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-20 18:29:33 -06:00
more probs
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
-- Stability : (stable)
|
||||
-- Portability : (portable)
|
||||
--
|
||||
-- > CVS $Date: 2005/10/30 23:44:00 $
|
||||
-- > CVS $Date: 2005/10/31 08:12:18 $
|
||||
-- > CVS $Author: aarne $
|
||||
-- > CVS $Revision: 1.47 $
|
||||
-- > CVS $Revision: 1.48 $
|
||||
--
|
||||
-- GF shell command interpreter.
|
||||
-----------------------------------------------------------------------------
|
||||
@@ -226,7 +226,7 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
|
||||
probs <- getProbsFromFile opts
|
||||
let tps = rankByScore [(t,computeProbTree probs t) | t <- ts]
|
||||
putStrLnFlush msg
|
||||
mapM_ putStrLnFlush [show p +++ prt_ t | (t,p) <- tps]
|
||||
mapM_ putStrLnFlush [show p | (t,p) <- tps]
|
||||
changeArg (const $ ATrms (map fst tps)) sa
|
||||
| otherwise -> putStrLnFlush msg >> changeArg (const $ ATrms ts) sa
|
||||
Bad msg -> changeArg (const $ AError (msg +++ "input" +++ x)) sa
|
||||
@@ -244,6 +244,14 @@ execC co@(comm, opts0) sa@(sh@(st,(h,_,_,_)),a) = checkOptions st co >> case com
|
||||
let ts = take n $ generateRandomTreesProb opts gen cgr probs cat
|
||||
returnArg (ATrms (map (term2tree gro) ts)) sa
|
||||
|
||||
CGenerateRandom | oElem showCF opts -> do
|
||||
let probs = emptyProbs ---
|
||||
let cat = firstAbsCat opts gro
|
||||
let n = optIntOrN opts flagNumber 1
|
||||
gen <- newStdGen
|
||||
let ts = take n $ generateRandomTreesProb opts gen cgr probs cat
|
||||
returnArg (ATrms (map (term2tree gro) ts)) sa
|
||||
|
||||
CGenerateRandom -> do
|
||||
let
|
||||
a' = case a of
|
||||
|
||||
Reference in New Issue
Block a user