single word recognized in complex grammar

Below is some code modified from help given to me in the recent past by Quentin. Because the words enclosed in {} are single words, I have become aware the fact that they are recognized without having the words in the[] square brackets preceding them.I was on the impression that words within a square bracket separated by vertical line indicated that that portion in the command allowed any of the variables to be recognized. Am I in error regarding this?

exported = [testing|normal|return]{phwords}+;
"""

def initialize(self):
self.load(self.gramSpec)
self.phwords = ['to','down','move', 'ears', 'nose','mouth','throat','larynx','neck']
self.setList('phwords', self.phwords)
self.activateAll()

def gotResults_ReturnNormal(self,words,fullResults):>

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Square brackets means the

Square brackets means the words inside are optional.

Normal parentheses group as well, so you should use these in your case,

please present code in a <pre> ... </pre> block in order not to miss special characters like <.

In order to get the < presented on the screen, you need to type &lt; 

Quintijn

If I want the "optional"

If I want the "optional" words to be required in the command, is there any way to have a separate "list" compared to your designation of phWords? I can conceive of including my optional words in the total list and then checking to make sure that they are present in the recognized command.

Best to you,

Allan

Hi Allan, You can put those

Hi Allan,

You can put those "optional" words as a separate list

<testrule> exported = {firstwords}{phwords}+;

and put

    self.firstwords = ['testing', 'normal', 'return']
    self.setList('firstwords', self.firstwords)
    self.phwords = ['to','down','move', 'ears', 'nose','mouth','throat','larynx','neck']
    self.setList('phwords', self.phwords)
    self.activateAll()

It will recognize things like 'testing to ears', 'return mouth' or 'normal throat neck larynx nose ears'.

But I am not sure I understand your purpose. If this does not help, please elaborate on what you want to establish,

Quintijn (

PS pronounce in English a bit like Quintain (sound of "ai" like "obtain"). "ij" is a Dutch variant of the "y" character).
But you may call me Quentin as well, as long as the discussion is about NatSpeak :=)

Quintijn wrote:

Quintijn wrote:

But you may call me Quentin as well, as long as the discussion is about NatSpeak :=)

This will even cause more confusion!

I say Quintin to get Quintijn  that's the way I trained it Smiling I suppose I should have trained it as Quinteyen Smiling
Quentin

AllanG wrote: Below is some

AllanG wrote:

Below is some code modified from help given to me in the recent past by Quentin.

I think you meant Quintijn Smiling

Quentin

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.


Syndicate content