BuildLangModel: save lang model directly in the right directory.

This commit is contained in:
Jehan 2015-11-29 13:26:10 +01:00
parent 72fbd33dec
commit c59465adfc

View File

@ -196,7 +196,8 @@ def visit_page(title, depth, clean_text, logfd):
continue
visit_page (link, depth + 1, clean_text, logfd)
logfd = open('LangFrenchModel.log', 'w')
build_log = current_dir + '/BuildLangModelLogs/LangFrenchModel.log'
logfd = open(build_log, 'w')
logfd.write('= Logs of language model for {} ({}) =\n'.format(lang.name, lang.code))
logfd.write('\n- Generated by {}'.format(os.path.basename(__file__)))
logfd.write('\n- Started: {}'.format(str(datetime.datetime.now())))
@ -391,8 +392,13 @@ for charset in charsets:
c_code += SM_str
with open('LangFrenchModel.cpp', 'w') as cpp_fd:
lang_model_file = current_dir + '/../src/LangModels/LangFrenchModel.cpp'
with open(lang_model_file, 'w') as cpp_fd:
cpp_fd.write(c_code)
logfd.write('\n\n- Processing end: {}\n'.format(str(datetime.datetime.now())))
logfd.close()
print("The following language model file has been generated: {}"
"\nThe build log is available in: {}"
"\nTest them and commit them.".format(lang_model_file, build_log))