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

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}
  | $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}
  $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
Received on Saturday, 24 November 2001 09:02:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:07:35 UTC