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