Beispiel #1
0
 def __init__(self, n, observation_sequence=[]):
     ## In addition to the dictionary of n-tuples, cond_prob is a
     ## mapping from (w1, ..., wn-1) to P(wn | w1, ... wn-1)
     CountingProbDist.__init__(self)
     self.n = n
     self.cond_prob = defaultdict(CountingProbDist())
     self.add_sequence(observation_sequence)
Beispiel #2
0
 def __init__(self, n, observation_sequence=[], default=0):
     # In addition to the dictionary of n-tuples, cond_prob is a
     # mapping from (w1, ..., wn-1) to P(wn | w1, ... wn-1)
     CountingProbDist.__init__(self, default=default)
     self.n = n
     self.cond_prob = defaultdict()
     self.add_sequence(observation_sequence)
Beispiel #3
0
 def __init__(self, observation_sequence=[], default=0):
     CountingProbDist.__init__(self, default=default)
     self.n = 1
     self.cond_prob = defaultdict()
     self.add_sequence(observation_sequence)
Beispiel #4
0
 def __init__(self, observation_sequence=[], default=0):
     CountingProbDist.__init__(self, default=default)
     self.n = 1
     self.cond_prob = defaultdict()
     self.add_sequence(observation_sequence)