import re, sys
from docx import Document
def sents(path):
    d = Document(path); t = "\n".join(p.text for p in d.paragraphs)
    for tb in d.tables:
        for r in tb.rows: t += "\n" + " ".join(c.text for c in r.cells)
    t = t.replace("–","-").replace("—","-").replace("’","'")
    return t, set(s.strip().lower() for s in re.split(r"(?<=[.!?])\s+|\n", t) if len(s.strip()) > 25)
draft_t, draft = sents(sys.argv[1]); ret_t, ret = sents(sys.argv[2])
fix = lambda s: s.replace("recieve","receive").replace("seperate","separate").replace("adress","address").replace("wich","which").replace("occassionally","occasionally").replace("untill","until").replace("definately","definitely").replace("guarentee","guarantee")
draft_fixed = set(fix(s) for s in draft)
print("-- in the return but not in the (spell-fixed) draft:")
for s in sorted(ret - draft_fixed): print("  +", s[:160])
print("-- in the draft but not in the return:")
for s in sorted(draft_fixed - ret): print("  -", s[:160])
