def get_input_data(): """ :return: dictionary that has the cypher text and some items calculated from it that are needed various places """ ciphered_text = read_ciphered_text() ciphered_words = [process_word(word) for word in ciphered_text.split()] input_data = {'ciphered_text': ciphered_text, 'ciphered_words': ciphered_words} return input_data
def get_input_data(): """ :return: dictionary that has the cypher text and some items calculated from it that are needed various places """ ciphered_text = read_ciphered_text() ciphered_words = [process_word(word) for word in ciphered_text.split()] input_data = { 'ciphered_text': ciphered_text, 'ciphered_words': ciphered_words } return input_data
def test_process_word_caps(self): self.assertEqual(process_word("hELLo"), "hello")
def test_process_word_other_stuff(self): for stuff in [';', '"', '.', ' ', '\xe2\x80\x94']: self.assertEqual(process_word("hel%slo" % stuff), "hello")
def test_process_word_hyphen(self): self.assertEqual(process_word("hel-lo"), "hello")
def test_process_word_simple(self): self.assertEqual(process_word("hello"), "hello")