From b114cfda7736394a5a38f2c1bf731f08f1501eca Mon Sep 17 00:00:00 2001 From: bjorn Date: Thu, 25 Sep 2008 13:41:07 +0000 Subject: Added --output-format=nolr. Minor makeRegular refactoring. --- src/GF/Speech/CFG.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/GF/Speech/CFG.hs') diff --git a/src/GF/Speech/CFG.hs b/src/GF/Speech/CFG.hs index 5b2a0f2ca..b8857a288 100644 --- a/src/GF/Speech/CFG.hs +++ b/src/GF/Speech/CFG.hs @@ -190,14 +190,13 @@ makeSimpleRegular = makeRegular . topDownFilter . bottomUpFilter . removeCycles -- Use the transformation algorithm from \"Regular Approximation of Context-free -- Grammars through Approximation\", Mohri and Nederhof, 2000 --- to create an over-generating regular frammar for a context-free +-- to create an over-generating regular grammar for a context-free -- grammar makeRegular :: CFG -> CFG makeRegular g = g { cfgRules = groupProds $ concatMap trSet (mutRecCats True g) } where trSet cs | allXLinear cs rs = rs - | otherwise = concatMap handleCat csl - where csl = Set.toList cs - rs = catSetRules g cs + | otherwise = concatMap handleCat (Set.toList cs) + where rs = catSetRules g cs handleCat c = [CFRule c' [] (mkCFTerm (c++"-empty"))] -- introduce A' -> e ++ concatMap (makeRightLinearRules c) (catRules g c) where c' = newCat c -- cgit v1.2.3