Hello to all the forum members,
This is my first question here, and I’m somewhat new to ChatScript. (which to my experience is great platform and many thanks to the author for open sourcing it)
I’ve gathered a lot of facts about specific topic and I want to be able to write big and generic pattern that will catch wide variety of input and extract information into user facts set.
Input examples:
[ol][li]computer with HD screen, speakers, mouse and keyboard [/li][li]red car with great speaker system[/li][li]big room with air conditioner and wide window[/li][/ol]
etc…
As you can tell the input consist of one subject and one or more objects as properties.
So far I have rule like this (the syntax is not exactly what I have I don’t have the code right now in front of me):
s: EXTRACT_PROPERTIES (_~subject *~1 {with} {a} {and} *~1 _~object)
^query(direct_svo _~subject has_a _~object)
If the query is not failed then I save the data in facts set specific to the user.
The goal is to catch in the first time the subject and the first property and in the second time the subject and the second property and so on…
My question is mainly about good code design:
How to use the same rule and repeat it again and again until it failed?
I can try to use ^refine \ ^reuse but before I’ll try it later today I’d love to hear from who ever had experience with this kind of patterns \ rules.
Secondly, I’d love to check out scripts similar to this to get some ideas on how to design reusable / modular / generic rules and code. so if there is something online (or in the folders of the project) please let me know.
Thanks in advance
Sam