Snippets

Furhat Robotics Handling multiple input lists in Flow and SGRS grammar

Created by Ludvig Linse
<!-- .... -->

    <state id="Idle">
		<onentry>
            <agent:say>Say a city in Germany</agent:say>
		    <agent:listen/>
		</onentry>
		<onevent name="sense.user.speak" cond="event?:sem:list">
		    <agent:say>
		        you said
		        <repeat list="asList(event:sem:list)" handler="loop">
		            <if cond="!loop.isFirst()">
		                and
		            </if>
                    <expr>loop.getItem()</expr>
                </repeat>
            </agent:say>
		</onevent>
	</state>
<!-- .... -->

  <rule id="root" scope="public">	
        <tag>out.list = [];</tag>
        <item repeat="0-5">
            <one-of>
                <item>Berlin<tag>out.list.push("Berlin")</tag></item>
                <item>Frankfurt<tag>out.list.push("Frankfurt")</tag></item>
                <item>Stuttgart<tag>out.list.push("Stuttgart")</tag></item>
                <item>Cologne<tag>out.list.push("Cologne")</tag></item>
                <item>Hamburg<tag>out.list.push("Hamburg")</tag></item>
            </one-of>
        </item>
  </rule>

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.