From 716250bcf18ec83367c2453e319f23633f194e73 Mon Sep 17 00:00:00 2001 From: bjorn Date: Thu, 25 Sep 2008 08:44:23 +0000 Subject: [PATCH] Somewhat nicer FCFG output format. --- src/GF/Speech/PGFToCFG.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GF/Speech/PGFToCFG.hs b/src/GF/Speech/PGFToCFG.hs index b51501c18..e455f6869 100644 --- a/src/GF/Speech/PGFToCFG.hs +++ b/src/GF/Speech/PGFToCFG.hs @@ -32,7 +32,7 @@ fcfgPrinter pgf cnc = unlines (map showRule rules) rules :: [FRule] rules = Array.elems (PGF.allRules pinfo) - showRule (FRule cid ps cs fc arr) = prCId cid ++ " " ++ show ps ++ ". " ++ showCat fc ++ " ::= " ++ unwords (map showCat cs) ++ " = " ++ showLin arr + showRule (FRule cid ps cs fc arr) = prCId cid ++ " " ++ show ps ++ ". " ++ showCat fc ++ " ::= [" ++ concat (intersperse ", " (map showCat cs)) ++ "] = " ++ showLin arr where showLin arr = "[" ++ concat (intersperse ", " [ unwords (map showFSymbol (Array.elems r)) | r <- Array.elems arr]) ++ "]" showFSymbol (FSymCat i j) = showCat (cs!!j) ++ "_" ++ show j ++ "." ++ show i