mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
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.
This commit is contained in:
@@ -13,17 +13,17 @@ module GF.Command.Commands (
|
|||||||
import Prelude hiding (putStrLn)
|
import Prelude hiding (putStrLn)
|
||||||
|
|
||||||
import PGF
|
import PGF
|
||||||
import PGF.CId
|
|
||||||
import PGF.Linearize
|
import PGF.VisualizeTree(graphvizParseTreeOld,getDepLabels)
|
||||||
import PGF.VisualizeTree
|
import PGF.Macros(lookStartCat,functionsToCat,lookValCat,restrictPGF,hasLin)
|
||||||
import PGF.Macros
|
import PGF.Data(abstract,funs,cats,Literal(LStr),Expr(EFun,ELit)) ----
|
||||||
import PGF.Data ----
|
import PGF.Morphology(isInMorpho,morphoKnown)
|
||||||
import PGF.Morphology
|
import PGF.Printer(ppFun,ppCat)
|
||||||
import PGF.Printer
|
import PGF.Probabilistic(rankTreesByProbs,probTree,setProbabilities)
|
||||||
import PGF.Probabilistic -- (getProbsFromFile,prProbabilities,defaultProbabilities)
|
|
||||||
import PGF.Generate (generateRandomFrom) ----
|
import PGF.Generate (generateRandomFrom) ----
|
||||||
import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
|
import PGF.Tree (Tree(Fun), expr2tree, tree2expr)
|
||||||
import PGF.Optimize
|
import PGF.Optimize(optimizePGF)
|
||||||
|
|
||||||
import GF.Compile.Export
|
import GF.Compile.Export
|
||||||
import GF.Compile.ToAPI
|
import GF.Compile.ToAPI
|
||||||
import GF.Compile.ExampleBased
|
import GF.Compile.ExampleBased
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ module PGF(
|
|||||||
categories, startCat,
|
categories, startCat,
|
||||||
|
|
||||||
-- * Functions
|
-- * Functions
|
||||||
functions, functionsByCat, functionType,
|
functions, functionsByCat, functionType, missingLins,
|
||||||
|
|
||||||
-- * Expressions & Trees
|
-- * Expressions & Trees
|
||||||
-- ** Tree
|
-- ** Tree
|
||||||
@@ -132,7 +132,7 @@ module PGF(
|
|||||||
showProbabilities,
|
showProbabilities,
|
||||||
readProbabilitiesFromFile,
|
readProbabilitiesFromFile,
|
||||||
|
|
||||||
-- ** SortTop
|
-- -- ** SortTop
|
||||||
-- forExample,
|
-- forExample,
|
||||||
|
|
||||||
-- * Browsing
|
-- * Browsing
|
||||||
|
|||||||
@@ -69,12 +69,13 @@ functionsToCat pgf cat =
|
|||||||
where
|
where
|
||||||
(_,fs,_) = lookMap ([],[],0) cat $ cats $ abstract pgf
|
(_,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
|
missingLins pgf lang = [c | c <- fs, not (hasl c)] where
|
||||||
fs = Map.keys $ funs $ abstract pgf
|
fs = Map.keys $ funs $ abstract pgf
|
||||||
hasl = hasLin pgf lang
|
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
|
hasLin pgf lang f = Map.member f $ lproductions $ lookConcr pgf lang
|
||||||
|
|
||||||
restrictPGF :: (CId -> Bool) -> PGF -> PGF
|
restrictPGF :: (CId -> Bool) -> PGF -> PGF
|
||||||
|
|||||||
Reference in New Issue
Block a user