Skip to content

Commit

Permalink
Revert "Make case insensitive (#39)"
Browse files Browse the repository at this point in the history
This reverts commit 9c8127f.
  • Loading branch information
alxwrd authored Jun 20, 2018
1 parent 9c8127f commit 270d18b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
9 changes: 3 additions & 6 deletions ety/word.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def __init__(self, word, language='eng', is_source=False):
'direct': [],
'recursive': []
}
self._id = u"{}:{}".format(
self.word.lower(), self.language.iso.lower())
self._id = u"{}:{}".format(self.word, self.language.iso)

def origins(self, recursive=False):
search = 'recursive' if recursive else 'direct'
Expand All @@ -33,10 +32,8 @@ def origins(self, recursive=False):
return o

row = list(filter(
lambda entry: (
entry['a_word'].lower() == self.word.lower()
and entry['a_lang'].lower() == self.language.iso.lower()),
etymwn_data))
lambda entry: entry['a_word'] == self.word and entry[
'a_lang'] == self.language.iso, etymwn_data))

o = [Word(item['b_word'], item['b_lang']) for item in row]

Expand Down
12 changes: 0 additions & 12 deletions tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,6 @@ def test_census_origins(self):

self.assertEqual(d.origins(recursive=True), e + f)

def test_origins_allows_any_case(self):
wonky_word_origins = ety.origins("tEsT")
lower_word_origins = ety.origins("test")

self.assertEqual(wonky_word_origins, lower_word_origins)

def test_tree_allows_any_case(self):
wonky_word_tree = [node.data for node in ety.tree("tEsT").all_nodes()]
lower_word_tree = [node.data for node in ety.tree("test").all_nodes()]

self.assertEqual(wonky_word_tree, lower_word_tree)

@stdout_capture
def test_cli_no_args(self, output):
words = ["test"]
Expand Down

0 comments on commit 270d18b

Please sign in to comment.