Skip to content
Browse files

[python] Fix some details in cdec.sa tools

  • Loading branch information...
1 parent be1ab0a commit 611501431a53e507cdc15bb091d3bcc94ca7f39d @vchahun vchahun committed Aug 3, 2012
Showing with 6 additions and 6 deletions.
  1. +5 −5 python/pkg/cdec/sa/compile.py
  2. +1 −1 python/pkg/cdec/sa/extract.py
View
10 python/pkg/cdec/sa/compile.py
@@ -93,11 +93,11 @@ def main():
# Write configuration
config = cdec.configobj.ConfigObj(args.config, unrepr=True)
- config['f_sa_file'] = f_sa_bin
- config['e_file'] = e_bin
- config['a_file'] = a_bin
- config['lex_file'] = lex_bin
- config['precompute_file'] = precomp_bin
+ config['f_sa_file'] = os.path.abspath(f_sa_bin)
+ config['e_file'] = os.path.abspath(e_bin)
+ config['a_file'] = os.path.abspath(a_bin)
+ config['lex_file'] = os.path.abspath(lex_bin)
+ config['precompute_file'] = os.path.abspath(precomp_bin)
for name, value in zip(param_names, params):
config[name] = value
config.write()
View
2 python/pkg/cdec/sa/extract.py
@@ -25,7 +25,7 @@ def main():
for rule in extractor.grammar(sentence):
output.write(str(rule)+'\n')
grammar_file = os.path.abspath(grammar_file)
- print('<seg grammar="{0}">{1}</seg>'.format(grammar_file, sentence))
+ print('<seg grammar="{0}" id="{1}">{2}</seg>'.format(grammar_file, i, sentence))
if __name__ == '__main__':
main()

0 comments on commit 6115014

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