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