PHP Classes

File: grammar_test3_php

Recommend this page to a friend!
  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: 18 years ago
Size: 878 bytes


Class file image Download

// 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

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