def compute_changes(self, ddiff):
        for section_matcher in ddiff.section_matches.all():
            section_from = section_matcher.section_from
            section_to = section_matcher.section_to
            words_from = section_from.word_count
            words_to = section_to.word_count

            if words_from > 0:
                change_words = (float(words_to - words_from) /
                        float(words_from)) * 100.0
            else:
                change_words = words_to * 100.0

            if words_from != words_to:
                change = SectionChanger(section_from=section_from,
                        section_to=section_to,
                        words_from=words_from,
                        words_to=words_to,
                        change=change_words,
                        diff=ddiff)
                change.save()

        print('Finished computing changes')
dataset/ETHPy150Open bartdag/recodoc2/recodoc2/apps/doc/parser/doc_diff.py/DocDiffer.compute_changes/original