mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
pgf server: return 1 result for /random without limit argument.
This commit is contained in:
@@ -129,8 +129,7 @@ doRandom :: PGF -> Maybe PGF.Type -> Maybe Int -> IO JSValue
|
||||
doRandom pgf mcat mlimit =
|
||||
do trees <- random' pgf mcat
|
||||
return $ showJSON $ map toJSObject [[("tree", PGF.showTree tree)] | tree <- limit trees]
|
||||
where limit = take (fromMaybe maxLimit mlimit)
|
||||
maxLimit = 1000
|
||||
where limit = take (fromMaybe 1 mlimit)
|
||||
|
||||
doGrammar :: PGF -> Maybe (Accept Language) -> JSValue
|
||||
doGrammar pgf macc = showJSON $ toJSObject
|
||||
|
||||
Reference in New Issue
Block a user