W3C home > Mailing lists > Public > www-voice@w3.org > October to December 2001

Using 'Semantic Interpretation for Speech Recognition' to parse XML to the Infoset

From: Sjoerd Visscher <sjoerd@w3future.com>
Date: Sat, 24 Nov 2001 15:03:02 +0100
Message-ID: <3BFFA896.3010705@w3future.com>
To: www-voice@w3.org
Hi,

I've been reading the Semantic Interpretation for Speech Recognition 
working draft. It seems to me that it could be applied to any parsing 
job. So I've been trying to define how to parse XML to the infoset, and 
it works quite well:

$element =
  $STag {
    localName = $STag.localName,
    attributes = $STag.attributes}
  $content {children = $content.nodes}
  $ETag
  | $EmptyElemTag {
    localName = $EmptyElemTag.localName,
    attributes = $EmptyElemTag.attributes}

$STag =
  '<' $Name {localName=$Name.localName}
  {attributes = []}
  ($S $Attribute {Append(attributes, $Attribute)})<0->
  [$S] '>'

$Attribute =
  $Name {localName = $Name.localName}
  $Eq
  $AttValue {normalizedValue = $AttValue.normalizedValue}

Do you think it would be a good idea to extend the spec outside the speech
area? What would have to be added is conditions, f.e.:

$element =
  $STag {
    localName = $STag.localName,
    attributes = $STag.attributes}
  $content {children = $content.nodes}
  $ETag {$ETag.localName == localName}
|...

When any boolean expression evaluates to false, the rule would not match.

Sjoerd Visscher
w3future.com
Received on Saturday, 24 November 2001 09:02:58 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 30 October 2006 12:48:54 GMT