summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Command/Commands.hs
diff options
context:
space:
mode:
authoraarne <aarne@chalmers.se>2010-01-28 10:06:16 +0000
committeraarne <aarne@chalmers.se>2010-01-28 10:06:16 +0000
commite056cc2bfd2e5e152edd9829b8d4d77637536a14 (patch)
treef48c6256e866402ae921d910fbfb5a7483c035cc /src/compiler/GF/Command/Commands.hs
parent750a2639b0f46153c36f6c713f522db5bb2d8587 (diff)
in example-based grammar conversion, warnings about unknown words
Diffstat (limited to 'src/compiler/GF/Command/Commands.hs')
-rw-r--r--src/compiler/GF/Command/Commands.hs14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/compiler/GF/Command/Commands.hs b/src/compiler/GF/Command/Commands.hs
index 7f8722d00..b56c19d72 100644
--- a/src/compiler/GF/Command/Commands.hs
+++ b/src/compiler/GF/Command/Commands.hs
@@ -254,7 +254,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [
exec = \opts _ -> do
let file = optFile opts
mprobs <- optProbs opts pgf
- let conf = configureExBased pgf mprobs (optLang opts)
+ let conf = configureExBased pgf (optMorpho opts) mprobs (optLang opts)
file' <- parseExamplesInGrammar conf file
return (fromString ("wrote " ++ file')),
needsTypeCheck = False
@@ -397,7 +397,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [
exec = \opts -> case opts of
_ | isOpt "missing" opts ->
return . fromString . unwords .
- morphoMissing (theMorpho opts) .
+ morphoMissing (optMorpho opts) .
concatMap words . toStrings
_ -> return . fromString . unlines .
map prMorphoAnalysis . concatMap (morphos opts) .
@@ -925,9 +925,9 @@ allCommands cod env@(pgf, mos) = Map.fromList [
[] -> ([], "no trees found")
_ -> fromExprs es
returnFromExprsPar opts ts es = return $ case es of
- [] -> ([], "no trees found; unknown words:" +++
- unwords (morphoMissing (theMorpho opts)
- (concatMap words (toStrings ts))))
+ [] -> ([], "no trees found" ++
+ missingWordMsg (optMorpho opts) (concatMap words (toStrings ts))
+ )
_ -> fromExprs es
prGrammar opts
@@ -944,7 +944,7 @@ allCommands cod env@(pgf, mos) = Map.fromList [
morpho z f la = maybe z f $ Map.lookup la mos
- theMorpho opts = morpho (error "no morpho") id (head (optLangs opts))
+ optMorpho opts = morpho (error "no morpho") id (head (optLangs opts))
-- ps -f -g s returns g (f s)
stringOps menv opts s = foldr (menvop . app) s (reverse opts) where
@@ -1016,6 +1016,4 @@ prMorphoAnalysis :: (String,[(Lemma,Analysis)]) -> String
prMorphoAnalysis (w,lps) =
unlines (w:[showCId l ++ " : " ++ p | (l,p) <- lps])
-morphoMissing :: Morpho -> [String] -> [String]
-morphoMissing mo ws = [w | w <- ws, null (lookupMorpho mo w)]