Beispiel #1
0
 def test_spanish(self):
     create_corpus_from_dictionary(
         os.path.join(TEST_PATH, "test_files", "dict.txt"),
         os.path.join(TEST_PATH, "temp_files", "source.txt"),
         os.path.join(TEST_PATH, "temp_files", "target.txt"))
     with open(os.path.join(TEST_PATH, "temp_files", "target.txt")) as f:
         self.assertEqual(f.read().strip(), "abril\nabril\nagosto\nagosto")
Beispiel #2
0
 def test_english(self):
     create_corpus_from_dictionary(
         os.path.join(TEST_PATH, "test_files", "dict.txt"),
         os.path.join(TEST_PATH, "temp_files", "source.txt"),
         os.path.join(TEST_PATH, "temp_files", "target.txt"))
     with open(os.path.join(TEST_PATH, "temp_files", "source.txt")) as f:
         self.assertEqual(f.read().strip(), "April\nApr\nAugust\nAug")
Beispiel #3
0
def dict_to_corpus(args):
    create_corpus_from_dictionary(args.t_input_file, args.t_source,
                                  args.t_target)
Beispiel #4
0
def dict_to_corpus(args):
    create_corpus_from_dictionary(args.t_input_file, args.t_source, args.t_target)
 def test_spanish(self):
     create_corpus_from_dictionary(os.path.join(TEST_PATH,"test_files", "dict.txt"), os.path.join(TEST_PATH, "temp_files", "source.txt"), os.path.join(TEST_PATH, "temp_files", "target.txt"))
     with open(os.path.join(TEST_PATH,"temp_files", "target.txt")) as f:
         self.assertEqual(f.read().strip(), "abril\nabril\nagosto\nagosto")
 def test_english(self):
     create_corpus_from_dictionary(os.path.join(TEST_PATH, "test_files", "dict.txt"), os.path.join(TEST_PATH, "temp_files", "source.txt"), os.path.join(TEST_PATH,"temp_files", "target.txt"))
     with open(os.path.join(TEST_PATH,"temp_files","source.txt")) as f:
         self.assertEqual(f.read().strip(), "April\nApr\nAugust\nAug")