Обновление Platinum сервис и сделать свой собственный дизайн 3D аватар
Bot Libre Dev : Knowledge

RE: Knowledge

по Paphus опубликовано Sep 6 2016, 9:40

The #word relationships are used to convert an object to text.

Bot Libre is object based, not text based, so instead of using text for data you can use objects.

For example this code,

#self.father = "Jon Smith Sr.";

This is using text as the data, it could be used in a Pattern/Template like this,

Pattern("Who is your father?")
Template("My father is {#self.father}")

so asking the bot "Who is your father?" would result in "My father is Jon Smith Sr."

But you can also instead use an object as the data.

#self.father = new Person();
#self.father.word =+ "Jon";
#self.father.word =+ "Jon Smith";
#self.father.word =+ "Jon Smith Sr.";
#self.father.child = #self;

Then the same Pattern/Template would use the #word relationship to print the Person object. You can have multiple #word relationships for an object, and the bot will pick the one that fits best with the context.

Objects can also have a #name relationship, #name will be used to print an object first, then #word if no name.

This is only relevant for Templates and Self scripts.

Идентификатор: 13938889
Опубликовано: Sep 6 2016, 9:40
Ответы: 0
Вид: 1166, сегодня: 1, неделю: 1, месяц: 2
Я уверен, что
Вывесить флаг как оскорбительное, или в нарушение правил сайта