-
Notifications
You must be signed in to change notification settings - Fork 26
SIML guidelines
Kaleith edited this page May 31, 2017
·
27 revisions
When writing SIML for our AI brain, it's a good idea to stick with some common guidelines and best practices to write clean, efficient and properly working code. Those guidelines are general tips that you should take into account when writing SIML.
If given <Pattern>
is not expected to be called by user, it should be prefixed with {Name}_
of the <Concept>
.
For example, instead of:
<Concept Name="_bob">
<Model>
<Pattern>GET_RANDOM_CAT</Pattern>
</Model>
</Concept>
You can write:
<Concept Name="_bob">
<Model>
<Pattern>_bob_GET_RANDOM_CAT</Pattern>
</Model>
</Concept>
Thanks to that we won't need to fight with potential conflicts if the same pattern is declared twice in two different files.
For example, instead of:
<Concept Name="_bob">
<Model>
<Pattern>WHO IS KALEITH</Pattern>
<Pattern>WHO IS THIELAK</Pattern>
</Model>
</Concept>
You can write:
<Concept Name="_bob">
<Model>
<Pattern>WHO IS (KALEITH|THIELAK)</Pattern>
</Model>
</Concept>
At the same time you should still stick with multiple patterns if they're entirely different or they do not differ only by a few words. This approach makes it easier for us, humans, to read the code.