Redmine #1487: added error messages to assert statements
This commit is contained in:
parent
8d453eb20b
commit
2e2a523eed
|
@ -85,9 +85,9 @@ class Runner:
|
||||||
else:
|
else:
|
||||||
classla_columns = classla_line.split('\t')
|
classla_columns = classla_line.split('\t')
|
||||||
tagged_columns = tagged_line.split('\t')
|
tagged_columns = tagged_line.split('\t')
|
||||||
assert len(classla_columns) == len(tagged_columns) == 10 # conllu columns
|
assert len(classla_columns) == 10, 'Missing token in classla-generated conllu ({})'.format(len(tagged_line)
|
||||||
assert classla_columns[0] == tagged_columns[0] # match index
|
assert len(tagged_columns) == 10, 'Missing token in pre-tagged conllu ({})'.format(len(classla_line)
|
||||||
assert classla_columns[1] == tagged_columns[1] # match token
|
assert classla_columns[1] == tagged_columns[1], 'Pre-tagged token form ({}) does not match classla-generated token form ({}).'.format(classla_tokens[0], tagged_columns[0])
|
||||||
merged_columns = [classla_columns[i] if i in (3,5,9) else tagged_columns[i] for i in range(10)]
|
merged_columns = [classla_columns[i] if i in (3,5,9) else tagged_columns[i] for i in range(10)]
|
||||||
merged_line = '\t'.join(merged_columns)
|
merged_line = '\t'.join(merged_columns)
|
||||||
merged_conllu_file.write(merged_line + '\n')
|
merged_conllu_file.write(merged_line + '\n')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user