Been working on a new
GrammarVars branch - I am thinking of moving over to this way of doing things.
You can build up grammar like so:
Code: Select all
; -------- Volume Command ------------
hv.GrammarVarAddChoiceVar("percentPhrase", "Percent")
hv.GrammarVarAddString("percentPhrase", "percent")
hv.ChoiceVarAdd("fractionChoices", "quarter, half, three-quarters, full")
hv.GrammarVarAddChoiceVar("fractionPhrase", "fractionChoices")
hv.GrammarVarAddString("volumeCommand", "Volume")
hv.GrammarVarAddGrammarVars("volumeCommand", "fractionPhrase, percentPhrase")
LV_Add(, "Volume", hv.GrammarVarLoad("volumeCommand", Func("Volume")))
LV_ModifyCol(1, 80)
; -------- Call Contact Command -------------
hv.ChoiceVarAdd("females", "Anne, Mary")
hv.GrammarVarAddChoiceVar("callFemales", "females")
hv.GrammarVarAddString("callFemales", "on her")
hv.ChoiceVarAdd("males", "James, Sam")
hv.GrammarVarAddChoiceVar("callMales", "males")
hv.GrammarVarAddString("callMales", "on his")
;// Create a Choices object that contains a set of alternative phone types.
hv.ChoiceVarAdd("phoneTypes", "cell, home, work")
;// Construct the phrase.
hv.GrammarVarAddString("CallGrammar", "Call")
hv.GrammarVarAddGrammarVars("CallGrammar", "callFemales, callMales")
hv.GrammarVarAddChoiceVar("CallGrammar", "phoneTypes")
hv.GrammarVarAddString("CallGrammar", "phone")
LV_Add(, "CallContact", hv.GrammarVarLoad("CallGrammar", Func("CallContact")))
I have not made a release, but I have attached a zip that contains this new version.
Have a play and see what you think.