summaryrefslogtreecommitdiff
path: root/src/GF/Data
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-21 16:33:44 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-21 16:33:44 +0000
commit169659c096a38f8fc0cf48e3054efbdf30a96c8c (patch)
treebaf3f08f571514fe113055ce7dfd321e746b1f44 /src/GF/Data
parentb974ab06cdd64ba1db9278516fbd5803f236d5ee (diff)
Get speechLanguage flag from both command-line and grammar. Reformat it to RFC3066 format (- instead of _) and use it in SRGS, VoiceXML and JSGF.
Diffstat (limited to 'src/GF/Data')
-rw-r--r--src/GF/Data/Utilities.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GF/Data/Utilities.hs b/src/GF/Data/Utilities.hs
index e0ad08705..74d3ef81e 100644
--- a/src/GF/Data/Utilities.hs
+++ b/src/GF/Data/Utilities.hs
@@ -104,6 +104,10 @@ buildMultiMap :: Ord a => [(a,b)] -> [(a,[b])]
buildMultiMap = map (\g -> (fst (head g), map snd g) )
. sortGroupBy (compareBy fst)
+-- | Replace all occurences of an element by another element.
+replace :: Eq a => a -> a -> [a] -> [a]
+replace x y = map (\z -> if z == x then y else z)
+
-- * equality functions
-- | Use an ordering function as an equality predicate.