mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
VoiceXML generation: the grammar file name should be based on the concrete syntax module name rather than the abstract.
This commit is contained in:
@@ -47,7 +47,8 @@ import Debug.Trace
|
|||||||
-- | the main function
|
-- | the main function
|
||||||
grammar2vxml :: Options -> StateGrammar -> String
|
grammar2vxml :: Options -> StateGrammar -> String
|
||||||
grammar2vxml opt s = showsXMLDoc (skel2vxml name language startcat gr' qs) ""
|
grammar2vxml opt s = showsXMLDoc (skel2vxml name language startcat gr' qs) ""
|
||||||
where (name, gr') = vSkeleton (stateGrammarST s)
|
where (_, gr') = vSkeleton (stateGrammarST s)
|
||||||
|
name = prIdent (cncId s)
|
||||||
qs = catQuestions s (map fst gr')
|
qs = catQuestions s (map fst gr')
|
||||||
opts = addOptions opt (stateOptions s)
|
opts = addOptions opt (stateOptions s)
|
||||||
language = fmap (replace '_' '-') $ getOptVal opts speechLanguage
|
language = fmap (replace '_' '-') $ getOptVal opts speechLanguage
|
||||||
@@ -119,11 +120,11 @@ getCatQuestion c qs =
|
|||||||
-- * Generate VoiceXML
|
-- * Generate VoiceXML
|
||||||
--
|
--
|
||||||
|
|
||||||
skel2vxml :: VIdent -> Maybe String -> VIdent -> VSkeleton -> CatQuestions -> XML
|
skel2vxml :: String -> Maybe String -> VIdent -> VSkeleton -> CatQuestions -> XML
|
||||||
skel2vxml name language start skel qs =
|
skel2vxml name language start skel qs =
|
||||||
vxml language ([startForm] ++ concatMap (uncurry (catForms gr qs)) skel)
|
vxml language ([startForm] ++ concatMap (uncurry (catForms gr qs)) skel)
|
||||||
where
|
where
|
||||||
gr = grammarURI (prid name)
|
gr = grammarURI name
|
||||||
startForm = Tag "form" [] [subdialog "sub" [("src", "#"++catFormId start)]
|
startForm = Tag "form" [] [subdialog "sub" [("src", "#"++catFormId start)]
|
||||||
[param "old" "{ name : '?' }"]]
|
[param "old" "{ name : '?' }"]]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user