Commit a1c05498 authored by rabauti's avatar rabauti
Browse files

liigitamise logi-info parendatus

parent 2c23061e
......@@ -155,9 +155,6 @@ for uid in sorted(corrections.keys()):
to_print = 0
for (i, correction) in enumerate(corrections[uid]):
correction_sets = []
......@@ -253,7 +250,7 @@ for uid in sorted(corrections.keys()):
#muudatused on seatud ainult kirjavahemärkidega
if ''.join(added_pos_uniq) in ['Z', ''] and ''.join(deleted_pos_uniq) in ['Z', '']:
flags.append('punktuatsioon')
#correction_sets.append( {'type':'punktuatsioon', 'added': ndiff_data['added'], 'deleted': ndiff_data['deleted'] })
correction_sets.append( {'type':'punktuatsioon', 'added': ndiff_data['added'], 'deleted': ndiff_data['deleted'] })
finished = 1
......@@ -262,22 +259,25 @@ for uid in sorted(corrections.keys()):
flags.append('punktuatsioon')
#teeme siin sellise sammu, kus eemaldame kõik kirjavahemärgid ja saame uuesti võrrelda
deleted_log = []
for (ind, pos) in reversed(list( enumerate(text1_postags))):
if pos == 'Z':
text1_lemmas.pop(ind)
text1_word_texts.pop(ind)
deleted_log.insert(0, text1_word_texts.pop(ind))
text1_postags.pop(ind)
text1_forms.pop(ind)
removed = []
added_log = []
for (ind, pos) in reversed(list( enumerate(text2_postags))):
if pos == 'Z':
text2_lemmas.pop(ind)
text2_word_texts.pop(ind)
added_log.insert(0, text2_word_texts.pop(ind))
text2_postags.pop(ind)
text2_forms.pop(ind)
correction_sets.append( {'type':'punktuatsioon', 'added': ndiff_data['added'], 'deleted': ndiff_data['deleted'] })
new_ndiff_result = difflib.ndiff("\n".join(text1_word_texts).splitlines(1), "\n".join(text2_word_texts).splitlines(1))
#print ("+++++++")
#print ("".join(ndiff_result_list_copy))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment