Extended AIML

From Jason Shankel's Wiki
Jump to: navigation, search
(Regular Expressions)
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.

Revision as of 20:59, 4 April 2012

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox