summaryrefslogtreecommitdiff
path: root/src/GF/Speech/SRG.hs
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-02-01 10:16:40 +0000
committerbringert <bringert@cs.chalmers.se>2006-02-01 10:16:40 +0000
commit36492443e970de022b7dd5ddbe463616bb6c56e4 (patch)
treed5e3f51566d139e41b57c64022bb1ed733407847 /src/GF/Speech/SRG.hs
parente59bad1f19358a11a1f1d61d00807ffcae0ab8c4 (diff)
Set xml:lang in SRGS grammars to the value of the language flag.
Diffstat (limited to 'src/GF/Speech/SRG.hs')
-rw-r--r--src/GF/Speech/SRG.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GF/Speech/SRG.hs b/src/GF/Speech/SRG.hs
index 51c01df01..8bc4f68e1 100644
--- a/src/GF/Speech/SRG.hs
+++ b/src/GF/Speech/SRG.hs
@@ -38,6 +38,8 @@ import Data.FiniteMap
data SRG = SRG { grammarName :: String -- ^ grammar name
, startCat :: String -- ^ start category name
, origStartCat :: String -- ^ original start category name
+ , grammarLanguage :: String -- ^ The language for which the grammar
+ -- is intended, e.g. en_UK
, rules :: [SRGRule]
}
deriving (Eq,Show)
@@ -64,10 +66,12 @@ makeSRG i opts probs gr
= SRG { grammarName = name,
startCat = lookupFM_ names origStart,
origStartCat = origStart,
+ grammarLanguage = l,
rules = rs }
where
name = prIdent i
origStart = getStartCat opts
+ l = fromMaybe "en_UK" (getOptVal opts speechLanguage)
gr' = removeLeftRecursion $ removeIdenticalRules $ removeEmptyCats $ cfgToCFRules gr
(cats,cfgRules) = unzip gr'
names = mkCatNames name cats