Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #1287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion agents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"\n",
"* `is_done(self)`: Returns true if the objective of the agent and the environment has been completed\n",
"\n",
"The next two functions must be implemented by each subclasses of `Environment` for the agent to recieve percepts and execute actions \n",
"The next two functions must be implemented by each subclasses of `Environment` for the agent to receive percepts and execute actions \n",
"\n",
"* `percept(self, agent)`: Given an agent, this method returns a list of percepts that the agent sees at the current time\n",
"\n",
Expand Down
6 changes: 3 additions & 3 deletions knowledge.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,11 +325,11 @@ def gain(self, l, examples):

where:

pre_pos = number of possitive bindings of rule R (=current set of rules)
pre_pos = number of positive bindings of rule R (=current set of rules)
pre_neg = number of negative bindings of rule R
post_pos = number of possitive bindings of rule R' (= R U {l} )
post_pos = number of positive bindings of rule R' (= R U {l} )
post_neg = number of negative bindings of rule R'
T = number of possitive bindings of rule R that are still covered
T = number of positive bindings of rule R that are still covered
after adding literal l

"""
Expand Down
4 changes: 2 additions & 2 deletions logic4e.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,8 +1086,8 @@ def __eq__(self, other):
class HybridWumpusAgent(Agent):
"""An agent for the wumpus world that does logical inference. [Figure 7.20]"""

def __init__(self, dimentions):
self.dimrow = dimentions
def __init__(self, dimensions):
self.dimrow = dimensions
self.kb = WumpusKB(self.dimrow)
self.t = 0
self.plan = list()
Expand Down
4 changes: 2 additions & 2 deletions nlp.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def loadPageHTML(addressList):
for addr in addressList:
with urllib.request.urlopen(addr) as response:
raw_html = response.read().decode('utf-8')
# Strip raw html of unnessecary content. Basically everything that isn't link or text
# Strip raw html of unnecessary content. Basically everything that isn't link or text
html = stripRawHTML(raw_html)
contentDict[addr] = html
return contentDict
Expand All @@ -414,7 +414,7 @@ def initPages(addressList):

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

Expand Down
2 changes: 1 addition & 1 deletion nlp4e.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def explore(frontier):
},
lexicon={})

g = Grammar("Ali loves Bob", # A example grammer of Ali loves Bob example
g = Grammar("Ali loves Bob", # A example grammar of Ali loves Bob example
rules={
"S_loves_ali_bob": "NP_ali, VP_x_loves_x_bob", "S_loves_bob_ali": "NP_bob, VP_x_loves_x_ali",
"VP_x_loves_x_bob": "Verb_xy_loves_xy NP_bob", "VP_x_loves_x_ali": "Verb_xy_loves_xy NP_ali",
Expand Down