From 416243a704abb30c5571ae74d0c7f448563adbd6 Mon Sep 17 00:00:00 2001 From: avine Date: Fri, 13 Sep 2013 15:55:23 -0300 Subject: [PATCH] fixed languages --- scripts/yalign-freebase | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/yalign-freebase b/scripts/yalign-freebase index c6cda225..8e55fe5f 100755 --- a/scripts/yalign-freebase +++ b/scripts/yalign-freebase @@ -65,7 +65,7 @@ def split_line(line): return code, text[text.index('"') + 1:-1].decode('string_escape') -def documents(file_a, file_b): +def documents(file_a, file_b, lang_a, lang_b): code_b = '' cnt = 0 doc_cnt = 0 @@ -85,8 +85,8 @@ def documents(file_a, file_b): if code_b == code_a and not None in (text_a, text_b): doc_cnt += 1 - A = text_to_document(text_a, "en") - B = text_to_document(text_b, "es") + A = text_to_document(text_a, lang_a) + B = text_to_document(text_b, lang_b) yield A, B if __name__ == "__main__": @@ -100,7 +100,7 @@ if __name__ == "__main__": file_a = open(args['']) file_b = open(args['']) model = YalignModel.load(model_path) - for A, B in documents(file_a, file_b): + for A, B in documents(file_a, file_b, lang_a, lang_b): pairs = model.align(A, B) if output_format == "tmx": write_tmx(stdout, pairs, lang_a, lang_b)