|
|
|
conciliate(meaning,
partialmeaning,
subst=None,
debug=<function dbg at 0x84bb64c>)
Test whether meaning can be made comptabible with partialmeaning, by
looking for a family resemblance with partialmeanings, if found,
perform a substitution if necessary. |
source code
|
|
|
|
|
dialogue(exemplars={ } ,
constructions={ } ,
lexicon={ } ,
debug=<function dbg at 0x84bb64c>)
Co-routine for dialogue. |
source code
|
|
|
|
|
evaluate(conv,
exemplars={ } ,
n=1)
When presented with a corpus fragment, feed parent utterances to
model and generate model responses in place of child utterances. |
source code
|
|
|
express(meaning,
exemplars,
lexicon)
Express `meaning' by returning the most similar exemplar. |
source code
|
|
|
express2(meaning,
exemplars,
constructions,
lexicon,
debug=<function dbg at 0x84bb64c>)
Transform a meaning into a two word utterance using exemplars,
constructions or the lexicon. |
source code
|
|
|
expressmulti(meaning,
exemplars,
constructions,
lexicon)
Express `meaning' by returning a matching exemplar or construction |
source code
|
|
|
findmeaning(form,
exemplars,
lexicon,
debug=<function dbg at 0x84bb64c>)
Given the words in a construction, find the most common meaning
associated with it in the corpus of exemplars. |
source code
|
|
|
findtopic(discourse,
debug=<function dbg at 0x84bb64c>)
Look for a recurring element in the last two utterances, if found,
this becomes the new topic. |
source code
|
|
|
getexemplars()
Obtain corpus, either by importing from module `exemplars,' or by
falling back to a small sample corpus. |
source code
|
|
|
inferconstructions(exemplars,
lexicon,
constructions={ } ,
debug=<function dbg at 0x84bb64c>)
Build corpus of constructions from exemplars and lexicon. |
source code
|
|
|
inferlexicon(exemplars,
verbose=False,
lexicon={ } ,
debug=<function dbg at 0x84bb64c>)
Infer lexicon from corpus of exemplars. |
source code
|
|
|
interpret(utterance,
topic,
exemplars,
lexicon,
debug=<function dbg at 0x84bb64c>)
Return semantic representation for linguistic utterance. |
source code
|
|
|
interpretwith(words,
partialmeaning,
exemplars,
lexicon,
debug=<function dbg at 0x84bb64c>)
Interpretation helper function called by interpret(), work out
meaning of remaining words by stitching together the best matching
fragments. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
reinforce(meaning,
reaction,
reactionutt,
discourse,
exemplars)
Strengthen connection between last two utterances by adding a random
identifier and adding or updating the resulting exemplar. |
source code
|
|
|
response(meaning,
exemplars,
debug=<function dbg at 0x84bb64c>)
Transform a meaning into a response using adjacency pairs of speech
acts. |
source code
|
|
|
|
|
selftalk(u=25,
e={ } ,
debug=<function dbg at 0x84bb64c>)
Talk to oneself, picking a random utterance from the exemplars when
repetition is detected. |
source code
|
|
|
|
|
|
|
tokens(m)
Turn meaning into a list of operator, predicates and arguments. |
source code
|
|
|
unifies(meaning,
partialmeaning,
debug=<function dbg at 0x84bb64c>)
succeed if everything in "partialmeaning" is compatible
with "meaning", substituting along the way. |
source code
|
|
|
|
|
|