Search code examples
pattern-matchingartificial-intelligencechatbotaiml

How to match two keywords in AIML?


The following AIML code is used for keyword detection but it can only detect one key word as it is here the FAMILY keyword How can I use such pattern for detecting two keywords in a sentence for example a sentence with FAMILY and FATHER keyword both included?

<category>
  <pattern> FAMILY </pattern>
  <template>
  Family is an important institution.
  </template>
 </category>

<category>
  <pattern> _ FAMILY </pattern>
  <template>
  <srai> FAMILY </srai>
  </template>
 </category>

 <category>
  <pattern> FAMILY * </pattern>
  <template>
  <srai> FAMILY </srai>
  </template>
 </category>

 <category>
  <pattern> _ FAMILY * </pattern>
  <template>
  <srai> FAMILY </srai>
  </template>
 </category>

Solution

  • Why not simply :

      <pattern> FAMILY * FATHER <pattern>