summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhallgren <hallgren@chalmers.se>2013-04-08 15:38:11 +0000
committerhallgren <hallgren@chalmers.se>2013-04-08 15:38:11 +0000
commitb8ce5ef5b3186e437e09b8c47dbe1d1fa505ba55 (patch)
tree891f2d919a4ad473b010aed30a0f76793d6bf28b
parent35b47968d2efbb61b3faf5b31350c70cb24cb68e (diff)
PGF.hs: export function missingLins
Also in Commands.hs: be explicit about things imported from the PGF library that are not in the public API. Also a couple of haddock documentation fixes.
-rw-r--r--src/compiler/GF/Command/Commands.hs18
-rw-r--r--src/runtime/haskell/PGF.hs4
-rw-r--r--src/runtime/haskell/PGF/Macros.hs5
3 files changed, 14 insertions, 13 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 172aa9641..093fef0dc 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -13,17 +13,17 @@ module GF.Command.Commands (
import Prelude hiding (putStrLn)
import PGF
-import PGF.CId
-import PGF.Linearize
-import PGF.VisualizeTree
-import PGF.Macros
-import PGF.Data ----
-import PGF.Morphology
-import PGF.Printer
-import PGF.Probabilistic -- (getProbsFromFile,prProbabilities,defaultProbabilities)
+
+import PGF.VisualizeTree(graphvizParseTreeOld,getDepLabels)
+import PGF.Macros(lookStartCat,functionsToCat,lookValCat,restrictPGF,hasLin)
+import PGF.Data(abstract,funs,cats,Literal(LStr),Expr(EFun,ELit)) ----
+import PGF.Morphology(isInMorpho,morphoKnown)
+import PGF.Printer(ppFun,ppCat)
+import PGF.Probabilistic(rankTreesByProbs,probTree,setProbabilities)
import PGF.Generate (generateRandomFrom) ----
import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
-import PGF.Optimize
+import PGF.Optimize(optimizePGF)
+
import GF.Compile.Export
import GF.Compile.ToAPI
import GF.Compile.ExampleBased
diff --git a/src/runtime/haskell/PGF.hs b/src/runtime/haskell/PGF.hs
index b368d583d..d0eadd764 100644
--- a/src/runtime/haskell/PGF.hs
+++ b/src/runtime/haskell/PGF.hs
@@ -35,7 +35,7 @@ module PGF(
categories, startCat,
-- * Functions
- functions, functionsByCat, functionType,
+ functions, functionsByCat, functionType, missingLins,
-- * Expressions & Trees
-- ** Tree
@@ -132,7 +132,7 @@ module PGF(
showProbabilities,
readProbabilitiesFromFile,
- -- ** SortTop
+ -- -- ** SortTop
-- forExample,
-- * Browsing
diff --git a/src/runtime/haskell/PGF/Macros.hs b/src/runtime/haskell/PGF/Macros.hs
index 88057ce45..31f7655b3 100644
--- a/src/runtime/haskell/PGF/Macros.hs
+++ b/src/runtime/haskell/PGF/Macros.hs
@@ -69,12 +69,13 @@ functionsToCat pgf cat =
where
(_,fs,_) = lookMap ([],[],0) cat $ cats $ abstract pgf
-missingLins :: PGF -> CId -> [CId]
+-- | List of functions that lack linearizations in the given language.
+missingLins :: PGF -> Language -> [CId]
missingLins pgf lang = [c | c <- fs, not (hasl c)] where
fs = Map.keys $ funs $ abstract pgf
hasl = hasLin pgf lang
-hasLin :: PGF -> CId -> CId -> Bool
+hasLin :: PGF -> Language -> CId -> Bool
hasLin pgf lang f = Map.member f $ lproductions $ lookConcr pgf lang
restrictPGF :: (CId -> Bool) -> PGF -> PGF