Skip to content

Commit 0a83120

Browse files
committed
feat: merge PR aimacode#1287
1 parent e1c627c commit 0a83120

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

agents.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"\n",
9797
"* `is_done(self)`: Returns true if the objective of the agent and the environment has been completed\n",
9898
"\n",
99-
"The next two functions must be implemented by each subclasses of `Environment` for the agent to recieve percepts and execute actions \n",
99+
"The next two functions must be implemented by each subclasses of `Environment` for the agent to receive percepts and execute actions \n",
100100
"\n",
101101
"* `percept(self, agent)`: Given an agent, this method returns a list of percepts that the agent sees at the current time\n",
102102
"\n",

knowledge.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -325,11 +325,11 @@ def gain(self, l, examples):
325325
326326
where:
327327
328-
pre_pos = number of possitive bindings of rule R (=current set of rules)
328+
pre_pos = number of positive bindings of rule R (=current set of rules)
329329
pre_neg = number of negative bindings of rule R
330-
post_pos = number of possitive bindings of rule R' (= R U {l} )
330+
post_pos = number of positive bindings of rule R' (= R U {l} )
331331
post_neg = number of negative bindings of rule R'
332-
T = number of possitive bindings of rule R that are still covered
332+
T = number of positive bindings of rule R that are still covered
333333
after adding literal l
334334
335335
"""

logic4e.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1086,8 +1086,8 @@ def __eq__(self, other):
10861086
class HybridWumpusAgent(Agent):
10871087
"""An agent for the wumpus world that does logical inference. [Figure 7.20]"""
10881088

1089-
def __init__(self, dimentions):
1090-
self.dimrow = dimentions
1089+
def __init__(self, dimensions):
1090+
self.dimrow = dimensions
10911091
self.kb = WumpusKB(self.dimrow)
10921092
self.t = 0
10931093
self.plan = list()

nlp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ def loadPageHTML(addressList):
398398
for addr in addressList:
399399
with urllib.request.urlopen(addr) as response:
400400
raw_html = response.read().decode('utf-8')
401-
# Strip raw html of unnessecary content. Basically everything that isn't link or text
401+
# Strip raw html of unnecessary content. Basically everything that isn't link or text
402402
html = stripRawHTML(raw_html)
403403
contentDict[addr] = html
404404
return contentDict
@@ -414,7 +414,7 @@ def initPages(addressList):
414414

415415
def stripRawHTML(raw_html):
416416
"""Remove the <head> section of the HTML which contains links to stylesheets etc.,
417-
and remove all other unnessecary HTML"""
417+
and remove all other unnecessary HTML"""
418418
# TODO: Strip more out of the raw html
419419
return re.sub("<head>.*?</head>", "", raw_html, flags=re.DOTALL) # remove <head> section
420420

nlp4e.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def explore(frontier):
512512
},
513513
lexicon={})
514514

515-
g = Grammar("Ali loves Bob", # A example grammer of Ali loves Bob example
515+
g = Grammar("Ali loves Bob", # A example grammar of Ali loves Bob example
516516
rules={
517517
"S_loves_ali_bob": "NP_ali, VP_x_loves_x_bob", "S_loves_bob_ali": "NP_bob, VP_x_loves_x_ali",
518518
"VP_x_loves_x_bob": "Verb_xy_loves_xy NP_bob", "VP_x_loves_x_ali": "Verb_xy_loves_xy NP_ali",

0 commit comments

Comments
 (0)