Templates priority

How to determine which one of the existing templates will work according to a guest's input?

To do this you need to remember the template priority.

1. “My templates” always have a higher priority than the default templates. That is why the template from the My templates section :

$ * where *

will “beat” the suggested template to the question “Where do you live?” from the topic Geography.

If you want your inf to reply correctly to the question “Where do you live?” you will need to make a template in My templates, like

$ * where * you * live *

2. The priority between two templates inside “My templates” section is determined like this:

- The template linked to an anchor is considered to be the strongest one.

For example, there are 3 templates:

$ test
# Test is working. (anchor “test”)

(anchor “test”)
$ * test 2 *
# Anchors are great.

$ * test 2 *
# Test is good.

Then, if we have the following dialogue:

Guest: test
Inf: Test is working
Guest: test 2

Then after the input “test 2” your inf will reply:

Inf: Anchors are great.

In other cases your inf will reply with “Test is good”.

- The template is considered to be stronger if it doesn’t contain ‘*’ symbols.

So, if you have the following templates:

$ and where {?/--}
# Nowhere.

and

$ * and where {?/--}
# Somewhere.

Then to the question “And where?” your inf will always reply with “Nowhere”.

- The template is considered to be stronger if it contains more words. In other words, a longer template has higher priority. The symbol ‘*’ does not count in this case.

NOTE:
• ‘!’ and ‘?’ symbols are equal to separate words.
• a double asterisk ‘**’ is equal to 0.5 word, ‘*’ symbol does not count.

For example, the length of this template:
$ my name is **
will be 3,5 words

and the length of that template:
$ my name is *
will be 3 words.

Therefore, to the guest's input “My name is Tom” your inf will reply with the longer template – 3,5 words ($ my name is **).

- If there are two similar templates, one of them will be chosen randomly.

NOTE: templates like: '''$ * where *''' and '''$ *?''' are considered to be the same to the input “where”, and have equal priority (they both have ‘*’ symbols, have the same amount of words). Every time your inf will choose one of these randomly.

Therefore, if you have templates like the following:

$ *?
and/or
$ *!

remember that these templates and templates such as:

$ * X *
$ * X *
$ X *

where X – is one word, are equal to the input like X? and/or X!

To avoid this in the templates like:

$ * X *
$ X *
$ * X

where X – is one word, you will need to add inline dictionaries like {?/!/--}. For example:

$ * X * {?/!/--}
$ X * {?/!/--}
$ * X {?/!/--}

The inf will not mistake the one word guest's inputs for templates like: $ *? or $ *! and will always choose the one that you have created for this particular word.