Dynamic Queries

2007-03-20
2013-04-22
  • Thiago Tavares
    Thiago Tavares
    2007-03-20

    Hello There!
    I would like to know how is the best solution to implement dynamic queries.
    Let me explain:

    User: Hi
    Bot: Hello There
    User: Can you show me some available pages on the internet that can explain how to use C# and SQL Server?
    Bot: Yes, you can take a look on: [here there are some results from google using web services]

    In order to make the dynamic queries, I would like to know if I can isolate the phrase "C# and SQL Server" in order to use this to make the query. Do you know what I mean? In other words I wuld like to use the phrase came from the client question.

    I don't know the best way to do it. Maybe i need to generate a new aiml with the whole possibilities.

    I have one more question about the "that.aiml". I'm a little bit confused to understand how to use the star tag and that Tag. I could use the srai tag without issues. If anyone can give me a little example to improve my knowledges, I really appreciate it.

    That's all!
    Thanks again!

    Thiago

    PS: If somebody would like to talk about the aimlbot implementation, please feel free to contact me using a msn: tvt_thiago@hotmail.com

     
    • Hi Thiago,

      Your problem is exactly the reason why I added the custom tags functionality. Download the ExampleCustomAIMLTags project in the downloads section and read the accompanying documentation (http://sourceforge.net/docman/display_doc.php?docid=37926&group_id=133783) to get familiar with the process of creating your own custom tag. The fortunecookie and news example classes are probably closest to your needs so feel free to use them as templates. As for the AIML you'd need to write, perhaps you'd create something like the following example where <google> is your custom tag:

      <category>
      <pattern>WHAT PAGES ARE THERE ABOUT * ON THE INTERNET</pattern>
      <template>Take a look at <google><star/></google></template>
      </category>

      Notice how I'm using the <star/> tag to reference the "*" wild-card match. So, for example, if I'd entered "What pages are there about C# and SQL Server on the Internet" then the contents of "*" would be "C# and SQL Server" and the <star/> tag within the <google> tag would be replaced with "C# and SQL Server" allowing the google tag class to search against "C# and SQL Server" (referenced by this.templateNode.InnerText).

      Hope this helps,

      Nicholas

       
    • Thiago Tavares
      Thiago Tavares
      2007-03-21

      Thanks Nicholas,

      I could create a custom tag based on the samples! Thanks again!

      I'm learning more and more about the aimlBot everyday.
      Now I'll study more about the aiml implementations, how to use thae available tags, see your aiml examples.....I've tried but, now I have a better idea about it!

      If you have any documentations that can helps me, please let me know!

      Thanks again

      I really appeciate it

      regards,

      Thiago