mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-12-28 14:32:38 +03:00
fix encoding issue
Error that occurred for phrase tables without phrase alignment: File "tmcombine.py", line 377, in write_phrase_table line = b"%s ||| %s ||| %s 2.718 %s||| %s ||| %s\n" %(src,target,features,origin_features,alignment,comments) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 26: ordinal not in range(128) File "tmcombine.py", line 377, in write_phrase_table
This commit is contained in:
parent
2025587439
commit
ea4d0a4785
@ -294,7 +294,7 @@ class Moses():
|
||||
sys.stderr.write('Error: unexpected phrase table format. Your current configuration requires alignment information. Make sure you trained your model with -phrase-word-alignment\n')
|
||||
exit()
|
||||
|
||||
self.phrase_pairs[src][target][1] = ['',line[3].lstrip(b'| ')]
|
||||
self.phrase_pairs[src][target][1] = [b'',line[3].lstrip(b'| ')]
|
||||
|
||||
else:
|
||||
sys.stderr.write('Error: unexpected phrase table format. Are you using a very old/new version of Moses with different formatting?\n')
|
||||
|
Loading…
Reference in New Issue
Block a user