From 88ee2ddd8db925fb50c41f63564c85fff6f6e42b Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sat, 15 Apr 2017 22:16:31 -0700 Subject: [PATCH] Spelling: neighbour -> neighbor. The old code mixed both spellings; we might as well be consistent. --- copycat/bond.py | 4 ++-- copycat/codeletMethods.py | 8 ++++---- copycat/slipnet.py | 8 ++++---- copycat/workspaceFormulas.py | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/copycat/bond.py b/copycat/bond.py index 8dc9a15..641f6cb 100644 --- a/copycat/bond.py +++ b/copycat/bond.py @@ -163,13 +163,13 @@ class Bond(WorkspaceStructure): except ZeroDivisionError: return 0.0 - def sameNeighbours(self, other): + def sameNeighbors(self, other): if self.leftObject == other.leftObject: return True return self.rightObject == other.rightObject def getIncompatibleBonds(self): - return [b for b in self.string.bonds if self.sameNeighbours(b)] + return [b for b in self.string.bonds if self.sameNeighbors(b)] def get_source(self): return self.source diff --git a/copycat/codeletMethods.py b/copycat/codeletMethods.py index 711f1e4..72c9b48 100644 --- a/copycat/codeletMethods.py +++ b/copycat/codeletMethods.py @@ -8,7 +8,7 @@ from slipnet import slipnet import temperature import formulas from workspaceFormulas import chooseDirectedNeighbor -from workspaceFormulas import chooseNeighbour +from workspaceFormulas import chooseNeighbor from coderack import coderack from workspaceObject import WorkspaceObject from letter import Letter @@ -202,7 +202,7 @@ def description_builder(codelet): def bottom_up_bond_scout(codelet): source = chooseUnmodifiedObject('intraStringSalience', workspace.objects) __showWhichStringObjectIsFrom(source) - destination = chooseNeighbour(source) + destination = chooseNeighbor(source) assert destination logging.info('destination: %s', destination) bondFacet = __getBondFacet(source, destination) @@ -335,7 +335,7 @@ def top_down_bond_scout__category(codelet): category = codelet.arguments[0] source = __getScoutSource(category, formulas.localBondCategoryRelevance, 'bond') - destination = chooseNeighbour(source) + destination = chooseNeighbor(source) logging.info('source: %s, destination: %s', source, destination) assert destination bondFacet = __getBondFacet(source, destination) @@ -398,7 +398,7 @@ def bond_builder(codelet): assert (bond.source in workspace.objects or bond.destination in workspace.objects) for stringBond in bond.string.bonds: - if bond.sameNeighbours(stringBond) and bond.sameCategories(stringBond): + if bond.sameNeighbors(stringBond) and bond.sameCategories(stringBond): if bond.directionCategory: bond.directionCategory.buffer = 100.0 bond.category.buffer = 100.0 diff --git a/copycat/slipnet.py b/copycat/slipnet.py index 17194f7..2f892a1 100644 --- a/copycat/slipnet.py +++ b/copycat/slipnet.py @@ -144,8 +144,8 @@ class SlipNet(object): def __addInitialLinks(self): self.sliplinks = [] - self.__link_items_to_their_neighbours(self.letters) - self.__link_items_to_their_neighbours(self.numbers) + self.__link_items_to_their_neighbors(self.letters) + self.__link_items_to_their_neighbors(self.numbers) # letter categories for letter in self.letters: self.__addInstanceLink(self.letterCategory, letter, 97.0) @@ -216,7 +216,7 @@ class SlipNet(object): # letter to group self.__addSlipLink(self.letter, self.group, length=90.0) self.__addSlipLink(self.group, self.letter, length=90.0) - # direction-position, direction-neighbour, position-neighbour + # direction-position, direction-neighbor, position-neighbor self.__addBidirectionalLink(self.left, self.leftmost, 90.0) self.__addBidirectionalLink(self.right, self.rightmost, 90.0) self.__addBidirectionalLink(self.right, self.leftmost, 100.0) @@ -272,7 +272,7 @@ class SlipNet(object): self.slipnodes += [slipnode] return slipnode - def __link_items_to_their_neighbours(self, items): + def __link_items_to_their_neighbors(self, items): previous = items[0] for item in items[1:]: self.__addNonSlipLink(previous, item, label=self.successor) diff --git a/copycat/workspaceFormulas.py b/copycat/workspaceFormulas.py index 74cd8b5..f24c504 100644 --- a/copycat/workspaceFormulas.py +++ b/copycat/workspaceFormulas.py @@ -47,7 +47,7 @@ def chooseUnmodifiedObject(attribute, inObjects): return formulas.chooseObjectFromList(objects, attribute) -def chooseNeighbour(source): +def chooseNeighbor(source): objects = [] for objekt in workspace.objects: if objekt.string != source.string: