Tornar-se um bot de prestador de serviço com o Bot Libre Nuvem Bot Plataforma
Bugs and Features : Input word quoting versus variable and Parts of speech branching

RE: Input word quoting versus variable and Parts of speech branching

por admin postado Jan 14 2015, 19:18

I don't think I understand what you are trying to do, perhaps give a specific example.

A variable in the context of a state or case is something that can be matched to an input. The matching occurs when you do "case :aVariable ...". If the current input matches the relationships of the variable, then it is assigned to the input, and the case is evaluated, if it does not match, it is not assigned, and it goes to the next case.

A word i.e. "hello" will only match the word "hello" (well possibly synonyms too). A variable without any declaration i.e. :myvariable will match any word (or anything if processing something other than words).

When you declare a variable like,

:verb { set #instantiation to #verb; }


it will now only match against know verbs. (verbs are known because the bot will look up any new words in Wiktionary (english) and attempt to determine the type of word (and other info).

Or,
:digits { set #meaning to :number; } :number { set #instantiation to #number; }


Here :digits is a variable for a word that has a meaning that is a number (all words have meanings that represent the real object, the word is just a word, think knowledge not text).

Here #instantiation is a primitive that defines a type relationship, #number define a classification, #meaning define a "word means" relationship. There are many primitives in the system, and you can create your own, they are just a unique symbol. (#noun, #adjective, #thing, #person, #male, #female, #name, #question, #word, #sentence, #speaker, #classification, and a few more).

A variable's name is just a name there are no special variables and they do not correspond to words. (well there are a few special variables that are automatically assigned, :input, :speaker, :target, :sentence, :star, :that, :thatstar, :conversation). So you use a word "hello" when you want to match a word, and use a variable :verb when you want to match a classification of words (i.e. verbs, nouns, names, numbers, people, places, etc.).

The knowledge that variables can match can become very sophisticated, i.e. if you ask "who is Barack Obama" the WhatIs script will import the Barack Obama object from Freebase including all of its relationships and classifications (which automatically become primitives), then you could start checking for more complex data.


Id: 705996
Postado: Jan 14 2015, 19:18
Atualizado: Jan 14 2015, 19:22
Respostas: 0
Pontos de vista: 1725, hoje: 1, semana: 5, mês: 35
0 0 0.0/5