Skip to content
This repository
Browse code

[python] Fix some details in cdec.sa tools

  • Loading branch information...
commit 611501431a53e507cdc15bb091d3bcc94ca7f39d 1 parent be1ab0a
Victor Chahuneau vchahun authored
10 python/pkg/cdec/sa/compile.py
@@ -93,11 +93,11 @@ def main():
93 93
94 94 # Write configuration
95 95 config = cdec.configobj.ConfigObj(args.config, unrepr=True)
96   - config['f_sa_file'] = f_sa_bin
97   - config['e_file'] = e_bin
98   - config['a_file'] = a_bin
99   - config['lex_file'] = lex_bin
100   - config['precompute_file'] = precomp_bin
  96 + config['f_sa_file'] = os.path.abspath(f_sa_bin)
  97 + config['e_file'] = os.path.abspath(e_bin)
  98 + config['a_file'] = os.path.abspath(a_bin)
  99 + config['lex_file'] = os.path.abspath(lex_bin)
  100 + config['precompute_file'] = os.path.abspath(precomp_bin)
101 101 for name, value in zip(param_names, params):
102 102 config[name] = value
103 103 config.write()
2  python/pkg/cdec/sa/extract.py
@@ -25,7 +25,7 @@ def main():
25 25 for rule in extractor.grammar(sentence):
26 26 output.write(str(rule)+'\n')
27 27 grammar_file = os.path.abspath(grammar_file)
28   - print('<seg grammar="{0}">{1}</seg>'.format(grammar_file, sentence))
  28 + print('<seg grammar="{0}" id="{1}">{2}</seg>'.format(grammar_file, i, sentence))
29 29
30 30 if __name__ == '__main__':
31 31 main()

0 comments on commit 6115014

Please sign in to comment.
Something went wrong with that request. Please try again.