File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,11 @@ class UnigramWordModel(CountingProbDist):
2121 can add, sample, or get P[word], just like with CountingProbDist. You can
2222 also generate a random text, n words long, with P.samples(n)."""
2323
24+ def __init__ (self , observations , default = 0 ):
25+ # Call CountingProbDist constructor,
26+ # passing the observations and default parameters.
27+ super (UnigramWordModel , self ).__init__ (observations , default )
28+
2429 def samples (self , n ):
2530 """Return a string of n words, random according to the model."""
2631 return ' ' .join (self .sample () for i in range (n ))
@@ -203,7 +208,7 @@ class UnixConsultant(IRSystem):
203208
204209 def __init__ (self ):
205210 IRSystem .__init__ (self , stopwords = "how do i the a of" )
206-
211+
207212 import os
208213 aima_root = os .path .dirname (__file__ )
209214 mandir = os .path .join (aima_root , 'aima-data/MAN/' )
You can’t perform that action at this time.
0 commit comments