Esempio n. 1
0
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
Esempio n. 2
0
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
Esempio n. 3
0
 def test_process_word_caps(self):
     self.assertEqual(process_word("hELLo"), "hello")
Esempio n. 4
0
 def test_process_word_other_stuff(self):
     for stuff in [';', '"', '.', ' ', '\xe2\x80\x94']:
         self.assertEqual(process_word("hel%slo" % stuff), "hello")
Esempio n. 5
0
 def test_process_word_hyphen(self):
     self.assertEqual(process_word("hel-lo"), "hello")
Esempio n. 6
0
 def test_process_word_simple(self):
     self.assertEqual(process_word("hello"), "hello")
Esempio n. 7
0
 def test_process_word_caps(self):
     self.assertEqual(process_word("hELLo"), "hello")
Esempio n. 8
0
 def test_process_word_other_stuff(self):
     for stuff in [';', '"', '.', ' ', '\xe2\x80\x94']:
         self.assertEqual(process_word("hel%slo" % stuff), "hello")
Esempio n. 9
0
 def test_process_word_hyphen(self):
     self.assertEqual(process_word("hel-lo"), "hello")
Esempio n. 10
0
 def test_process_word_simple(self):
     self.assertEqual(process_word("hello"), "hello")