From 6e511e5fbddf3f388ff16c45030e2db470029758 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 12 Dec 2008 08:12:24 +0000 Subject: morphological analyser in shell state - now reasonably fast --- src/GF/Command/Interpreter.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/GF/Command/Interpreter.hs') diff --git a/src/GF/Command/Interpreter.hs b/src/GF/Command/Interpreter.hs index 82b8ae7af..7e9ebb653 100644 --- a/src/GF/Command/Interpreter.hs +++ b/src/GF/Command/Interpreter.hs @@ -13,6 +13,7 @@ import GF.Command.Parse import PGF import PGF.Data import PGF.Macros +import PGF.Morphology import GF.System.Signal import GF.Infra.UseIO @@ -22,13 +23,16 @@ import qualified Data.Map as Map data CommandEnv = CommandEnv { multigrammar :: PGF, + morphos :: Map.Map Language Morpho, commands :: Map.Map String CommandInfo, commandmacros :: Map.Map String CommandLine, expmacros :: Map.Map String Tree } mkCommandEnv :: String -> PGF -> CommandEnv -mkCommandEnv enc pgf = CommandEnv pgf (allCommands enc pgf) Map.empty Map.empty +mkCommandEnv enc pgf = + let mos = Map.fromList [(la,buildMorpho pgf la) | la <- languages pgf] in + CommandEnv pgf mos (allCommands enc (pgf, mos)) Map.empty Map.empty emptyCommandEnv :: CommandEnv emptyCommandEnv = mkCommandEnv "utf8" emptyPGF -- cgit v1.2.3