From c6c7557b13091116f66884c0d6105dca0fd33df3 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Mon, 24 Sep 2007 14:36:19 +0000 Subject: merge FCFGParsing with GF.Parsing.FCFG --- src/GF/Canon/GFCC/GFCCAPI.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/GF/Canon/GFCC/GFCCAPI.hs') diff --git a/src/GF/Canon/GFCC/GFCCAPI.hs b/src/GF/Canon/GFCC/GFCCAPI.hs index f04808037..0ee273f02 100644 --- a/src/GF/Canon/GFCC/GFCCAPI.hs +++ b/src/GF/Canon/GFCC/GFCCAPI.hs @@ -21,7 +21,7 @@ import GF.Canon.GFCC.AbsGFCC import GF.Canon.GFCC.ParGFCC import GF.Canon.GFCC.PrintGFCC import GF.Canon.GFCC.ErrM -import GF.Canon.GFCC.FCFGParsing +import GF.Parsing.FCFG import qualified GF.Canon.GFCC.GenGFCC as G import GF.Conversion.SimpleToFCFG (convertGrammar,FCat(..)) @@ -82,7 +82,11 @@ file2gfcc f = linearize mgr lang = GF.Canon.GFCC.DataGFCC.linearize (gfcc mgr) (CId lang) parse mgr lang cat s = - err error id $ parserLang (gfcc mgr) (CId lang) (CId cat) (words s) + case lookup lang (parsers mgr) of + Nothing -> error "no parser" + Just pinfo -> case parseFCF "bottomup" pinfo (CId cat) (words s) of + Ok x -> x + Bad s -> error s linearizeAll mgr = map snd . linearizeAllLang mgr linearizeAllLang mgr t = -- cgit v1.2.3