API docs for “lib.pyniall.pyNiall”

Class l.p.pyNiall:

Part of lib.pyniall View Source View In Hierarchy

No class docstring
Method __init__ Undocumented
Method learn Undocumented
Method reply Undocumented
Method import_brain Undocumented
Method export_brain Undocumented
Method _addRelation #adds "hello world" and "hello user" without endrelation
Method _addEndRelation
>>> n=pyNiall()
Method _rankWord rank a word by length and probability
Method _createRandomSentence Undocumented
Method _createReply Undocumented
def __init__(self): (source)
Undocumented
def _addRelation(self, word1, word2): (source)
#adds "hello world" and "hello user" without endrelation >>> n=pyNiall() >>> n._addRelation(">", "hello") >>> n._addRelation("hello", "world") >>> n._addRelation(">", "hello") >>> n._addRelation("hello", "user") >>> n.words ['>', 'hello', 'world', 'user'] >>> n.next {0: set([1]), 1: set([2, 3]), 2: set([]), 3: set([])} >>> n.prev {1: set([0]), 2: set([1]), 3: set([1]), -1: set([])} >>> n.prob {(0, 1): 2, (1, 2): 1, (1, 3): 1} >>> n.rank {1: 2, 2: 1, 3: 1}
def _addEndRelation(self, word): (source)
>>> n=pyNiall()
>>> n._addRelation(">", "hello")
>>> n._addRelation("hello", "world")
>>> n._addEndRelation("world") #"hello world"
>>> n._addRelation(">", "hello")
>>> n._addEndRelation("hello") #"hello"
>>> n.next
{0: set([1]), 1: set([2, -1]), 2: set([-1])}
>>> n.prev
{1: set([0]), 2: set([1]), -1: set([1, 2])}
>>> n.prob
{(0, 1): 2, (1, 2): 1, (2, -1): 1, (1, -1): 1}
>>> n.rank #the same as in _addRelation
{1: 2, 2: 1}
def _rankWord(self, word): (source)
rank a word by length and probability
def _createRandomSentence(self, index, sentence, forward=True): (source)
Undocumented
def _createReply(self, msg): (source)
Undocumented
def learn(self, msg): (source)
Undocumented
def reply(self, msg): (source)
Undocumented
def import_brain(self, data): (source)
Undocumented
def export_brain(self): (source)
Undocumented
API Documentation for OtfBot - the friendly Bot, generated by pydoctor at 2010-01-04 01:40:56.