forked from GitHub/gf-core
remove the dependency to GF.Data.Operations from GF Embed API
This commit is contained in:
@@ -2,7 +2,7 @@ module GF.Canon.GFCC.GenGFCC where
|
||||
|
||||
import GF.Canon.GFCC.DataGFCC
|
||||
import GF.Canon.GFCC.AbsGFCC
|
||||
import GF.Data.Operations
|
||||
|
||||
import qualified Data.Map as M
|
||||
import System.Random
|
||||
|
||||
@@ -26,6 +26,11 @@ generate gfcc cat = concatMap (\i -> gener i cat) [0..]
|
||||
Tr _ [] -> 1
|
||||
Tr _ ts -> maximum (map depth ts) + 1
|
||||
|
||||
combinations :: [[a]] -> [[a]]
|
||||
combinations t = case t of
|
||||
[] -> [[]]
|
||||
aa:uu -> [a:u | a <- aa, u <- combinations uu]
|
||||
|
||||
-- generate an infinite list of trees randomly
|
||||
generateRandom :: StdGen -> GFCC -> CId -> [Exp]
|
||||
generateRandom gen gfcc cat = genTrees (randomRs (0.0, 1.0) gen) cat where
|
||||
|
||||
Reference in New Issue
Block a user