Login   Register  
PHP Classes
elePHPant
Icontem

File: grammar_test3_php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mark Headd  >  PHP Grammar  >  grammar_test3_php  >  Download  
File: grammar_test3_php
Role: Example script
Content type: text/plain
Description: Complex grammar example
Class: PHP Grammar
Create speech recognition grammar W3C XML files
Author: By
Last change:
Date: 2004-10-03 20:48
Size: 878 bytes
 

Contents

Class file image Download
<?php 

// Set MIME type for XML grammar fomat
header('Content-type: application/grammar+xml');

//Include sub class
require ('createGrammar.php');

// Create name arrays
$name_array1 = array("Mary""Paul""Jake""Phil""Elayne""Dorothy""Rita");
$name_array2 = array("Skip""Helen""Renee""Vito");
$name_array3 = array("Mark""Greg""Stacy""Lynn");
$name_array4 = array("Chuck""Scott""Mike");

// Combine name arrays into one multidimensioanl array
$choices = array($name_array1$name_array2$name_array3$name_array4);

// Create array for return values
$tag_array = array("HR""Sales""Marketing""Security");

// Create new grammar object
$page = new createGrammar;

// Set slot name for return value
$page->setSlot("department");

// Pass arrays to compoundGram function
$page->compoundGram($choices$tag_array);

?>