Spelling: neighbour -> neighbor.

The old code mixed both spellings; we might as well be consistent.
This commit is contained in:
Arthur O'Dwyer
2017-04-15 22:16:31 -07:00
parent 5735888d02
commit 88ee2ddd8d
4 changed files with 11 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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: