<%

String zipCodeGrammarURL = request.getParameter("zipCodeGrammarURL");

%><grammar xml:lang="en-us" version="1.0" root="STREETINFOGRAMMAR">

<rule id="STREETINFOGRAMMAR" scope="public">
	<one-of>
		<!-- This first item is meant to capture street and high-rise address types. Examples of such addresses
			are:
			10 Maple Avenue
			123 North Main Street Apartment 5
			-->
		<item>
			<ruleref uri="http://api-internal.voxeo.net/targus_grammars/11q1/Nuance9.0/AddressGrammars/TARGUSinfoStreetNumber.gram"
				tag="streetInfoCASSformat=TARGUSStreetNumber.cassFormat; streetInfoSpoken=TARGUSStreetNumber.spoken"/>
			<ruleref uri="http://<%=zipCodeGrammarURL%>#NumberFirst"
				tag="streetInfoCASSformat=streetInfoCASSformat + ' ' + NumberFirst.cassFormat; streetInfoSpoken=streetInfoSpoken + ' ' + NumberFirst.SWI_literal; streetNameCASSformat = NumberFirst.cassFormat; streetNameSpoken = NumberFirst.SWI_literal; streetNumberCASSformat = TARGUSStreetNumber.cassFormat; streetNumberSpoken = TARGUSStreetNumber.spoken; directionChoices=NumberFirst.directionChoices"/>
			<count number="optional">
				<ruleref uri="http://api-internal.voxeo.net/targus_grammars/11q1/Nuance9.0/AddressGrammars/TARGUSinfoSecondaryNumber.gram#TARGUSSecondaryNumber_REQ_TYPE"
					tag="streetInfoCASSformat=streetInfoCASSformat + ' ' + TARGUSSecondaryNumber_REQ_TYPE.cassFormat; streetInfoSpoken=streetInfoSpoken + ' ' + TARGUSSecondaryNumber_REQ_TYPE.spoken; secondaryNumberCASSformat = TARGUSSecondaryNumber_REQ_TYPE.cassFormat; secondaryNumberSpoken=TARGUSSecondaryNumber_REQ_TYPE.spoken"/>
			</count>
		</item>
		<!-- This second item is meant to capture PO Boxes or Rural Route / Highway Contract addresses.
			Examples include:
				PO Box 123
				Rural Route 1 Box 23
				Highway Contract 4 Box 56
				-->
		<item>
			<ruleref uri="http://<%=zipCodeGrammarURL%>#NumberLast"
				tag="streetInfoCASSformat=NumberLast.cassFormat; streetInfoSpoken=NumberLast.SWI_literal"/>
			box
			<ruleref uri="http://api-internal.voxeo.net/targus_grammars/11q1/Nuance9.0/AddressGrammars/TARGUSinfoStreetNumber.gram"
				tag="streetInfoCASSformat=streetInfoCASSformat + ' BOX ' + TARGUSStreetNumber.cassFormat; streetInfoSpoken=streetInfoSpoken + ' box ' + TARGUSStreetNumber.spoken"/>
		</item>
	</one-of>
</rule>

</grammar>
