IssueID #1487: added p prefix for paragraph xml ids
This commit is contained in:
parent
3761f8b253
commit
f7900c84e5
|
@ -34,7 +34,8 @@ for line in input_file:
|
||||||
(name, value) = match.groups()
|
(name, value) = match.groups()
|
||||||
if (name == 'newpar id'):
|
if (name == 'newpar id'):
|
||||||
write_paragraph(output_file, output_map)
|
write_paragraph(output_file, output_map)
|
||||||
output_map = {'paragraph': line.strip(), 'sentence':None, 'texts':[], 'tokens':[]}
|
paragraph_line = re.sub('^(# newpar id = )(\d+)$', r'\1p\2', line.strip())
|
||||||
|
output_map = {'paragraph': paragraph_line, 'sentence':None, 'texts':[], 'tokens':[]}
|
||||||
elif (name == 'sent_id'):
|
elif (name == 'sent_id'):
|
||||||
if (value.endswith('.1')):
|
if (value.endswith('.1')):
|
||||||
output_map['sentence'] = re.sub('^(# sent_id = )(\d+\.1)$', r'\1s\2', line.strip())
|
output_map['sentence'] = re.sub('^(# sent_id = )(\d+\.1)$', r'\1s\2', line.strip())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user