def __init__(self, n=3):
     '''initialize with the ngram arity for the model we are building
 '''
     self.n = n  #bigrams?  trigrams? other?
     self.model = ()  # a tuple to store the model
     self.k = 5
     SmoothedModel.__init__(self)
 def __init__(self, n=3):
   '''initialize with the ngram arity for the model we are building
   '''
   self.n = n  #bigrams?  trigrams? other?
   self.model = () # a tuple to store the model
   self.k = 5
   SmoothedModel.__init__(self)
Beispiel #3
0
 def __init__(self, n=2):
     """Initialize your data structures in the constructor."""
     self.kn_ngram_prob = {}
     self.discount = 0.75
     self.full_discount = 0.0
     self.continuation_prob = {}
     self.n = n  # bigrams?  trigrams? other?
     SmoothedModel.__init__(self)
Beispiel #4
0
 def __init__(self, n=2):
   """Initialize your data structures in the constructor."""
   self.kn_ngram_prob = {}
   self.discount = 0.75
   self.full_discount = 0.0
   self.continuation_prob = {}
   self.n = n  #bigrams?  trigrams? other?
   SmoothedModel.__init__(self)
Beispiel #5
0
 def __init(self, n=3):
   self.n = n
   self.model = ()
   SmoothedModel.__init__(self)