Added --sisr option for including SISR tags in generated SRGs.

This commit is contained in:
bjorn
2008-06-16 16:12:17 +00:00
parent 395dd70f58
commit c57218d9ba
5 changed files with 29 additions and 15 deletions

View File

@@ -12,6 +12,7 @@ import Data.List
import GF.Data.Utilities
import GF.Infra.Ident
import GF.Infra.Option (SISRFormat(..))
import GF.Speech.CFG
import GF.Speech.SRG (SRGNT)
import PGF.CId
@@ -19,12 +20,6 @@ import PGF.CId
import qualified GF.JavaScript.AbsJS as JS
import qualified GF.JavaScript.PrintJS as JS
data SISRFormat =
-- SISR Working draft 1 April 2003
-- http://www.w3.org/TR/2003/WD-semantic-interpretation-20030401/
SISROld
deriving Show
type SISRTag = [JS.DeclOrExpr]
@@ -62,9 +57,9 @@ profileFinalSISR term fmt = [JS.DExpr $ fmtOut fmt `ass` f term]
f (CFVar v) = JS.EVar (var v)
f (CFMeta typ) = obj [("name",JS.EStr "?"), ("type",JS.EStr (prCId typ))]
fmtOut SISROld = JS.EVar (JS.Ident "$")
fmtOut SISR_WD20030401 = JS.EVar (JS.Ident "$")
fmtRef SISROld c = JS.EVar (JS.Ident ("$" ++ c))
fmtRef SISR_WD20030401 c = JS.EVar (JS.Ident ("$" ++ c))
args = JS.Ident "a"