From 7ecf37f6eeb854b4218c75febc5adf751e3e12b0 Mon Sep 17 00:00:00 2001 From: SADIK KUZU Date: Wed, 15 Nov 2023 14:08:52 +0300 Subject: [PATCH] Fix typos --- agents.ipynb | 2 +- knowledge.py | 6 +++--- logic4e.py | 4 ++-- nlp.py | 4 ++-- nlp4e.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/agents.ipynb b/agents.ipynb index 636df75e3..e86f9f6df 100644 --- a/agents.ipynb +++ b/agents.ipynb @@ -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", diff --git a/knowledge.py b/knowledge.py index 8c27c3eb8..0cfdb4ab8 100644 --- a/knowledge.py +++ b/knowledge.py @@ -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 """ diff --git a/logic4e.py b/logic4e.py index 75608ad74..f9f97c635 100644 --- a/logic4e.py +++ b/logic4e.py @@ -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() diff --git a/nlp.py b/nlp.py index 03aabf54b..baa5120d7 100644 --- a/nlp.py +++ b/nlp.py @@ -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 @@ -414,7 +414,7 @@ def initPages(addressList): def stripRawHTML(raw_html): """Remove the 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(".*?", "", raw_html, flags=re.DOTALL) # remove section diff --git a/nlp4e.py b/nlp4e.py index 095f54357..1f3bb64ac 100644 --- a/nlp4e.py +++ b/nlp4e.py @@ -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",