Extended AIML

From Jason Shankel's Wiki
Jump to: navigation, search
 
Line 75: Line 75:
 
It's simple enough to avoid this and just use the multi-pattern feature when you know wildcards will match up, but it occurred to me that for readability it might be nice to name wildcards.  So I added a ':' operator thusly:
 
It's simple enough to avoid this and just use the multi-pattern feature when you know wildcards will match up, but it occurred to me that for readability it might be nice to name wildcards.  So I added a ':' operator thusly:
  
"*:visitor IS VISITING *:host" (by convention, variable names are lower case and input literals upper)
+
"*:visitor IS VISITING *:host" (by convention, variable names are lower case and input literals upper)
  
 
So now, "MARY" can be matched in "MARY IS VISITING JOHN" with both <star index="1"/> and <star name="visitor/>
 
So now, "MARY" can be matched in "MARY IS VISITING JOHN" with both <star index="1"/> and <star name="visitor/>
Line 87: Line 87:
 
I extended the AIML wildcard system to support regular expressions within a bracket operator thusly:
 
I extended the AIML wildcard system to support regular expressions within a bracket operator thusly:
  
"I LIKE *[[A-Z]+]"
+
"I LIKE *[[A-Z]+]"
  
 
In this case, the "I LIKE..." pattern is limited to matching single words containing letters but no numbers.  So "I LIKE RUNNING" would match, but not "I LIKE R2D2" or "I LIKE EATING CHICKEN."
 
In this case, the "I LIKE..." pattern is limited to matching single words containing letters but no numbers.  So "I LIKE RUNNING" would match, but not "I LIKE R2D2" or "I LIKE EATING CHICKEN."
Line 93: Line 93:
 
Regular expressions can be used in conjunction with named wildcards thusly:
 
Regular expressions can be used in conjunction with named wildcards thusly:
  
"I LIKE *[[A-Z]+]:what_i_like"
+
"I LIKE *[[A-Z]+]:what_i_like"
  
 
In this case "I LIKE CHICKEN" would have have <star name="what_i_like/> set to "CHICKEN" in the template section.
 
In this case "I LIKE CHICKEN" would have have <star name="what_i_like/> set to "CHICKEN" in the template section.
 +
 +
===Context Identification===
 +
 +
TBD
 +
 +
===Response Generation===
 +
 +
TBD

Latest revision as of 00:29, 5 April 2012

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox