Spaces:
Sleeping
Sleeping
anmolsahai
commited on
Commit
•
b3b8d46
1
Parent(s):
56f5cbd
app
Browse files- __pycache__/langchain_pipeline.cpython-310.pyc +0 -0
- app.py +13 -3
__pycache__/langchain_pipeline.cpython-310.pyc
CHANGED
Binary files a/__pycache__/langchain_pipeline.cpython-310.pyc and b/__pycache__/langchain_pipeline.cpython-310.pyc differ
|
|
app.py
CHANGED
@@ -33,11 +33,21 @@ def redline_changes(original_path, revised_path, output_path):
|
|
33 |
revised_text = "\n".join([para.text for para in revised_doc.paragraphs])
|
34 |
|
35 |
redline = Redlines(original_text, revised_text)
|
36 |
-
|
37 |
|
|
|
38 |
diff_doc = Document()
|
39 |
-
for line in
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
diff_doc.save(output_path)
|
43 |
|
|
|
33 |
revised_text = "\n".join([para.text for para in revised_doc.paragraphs])
|
34 |
|
35 |
redline = Redlines(original_text, revised_text)
|
36 |
+
diff_text = redline.output_markdown()
|
37 |
|
38 |
+
# Create a new document and add the redlined content as text
|
39 |
diff_doc = Document()
|
40 |
+
for line in diff_text.split("\n"):
|
41 |
+
if line.startswith('---') or line.startswith('+++') or line.startswith('@@'):
|
42 |
+
diff_doc.add_paragraph(line, style='Normal').font.color.rgb = RGBColor(255, 0, 0) # Red
|
43 |
+
elif line.startswith('-'):
|
44 |
+
p = diff_doc.add_paragraph(line, style='Normal')
|
45 |
+
p.font.color.rgb = RGBColor(255, 0, 0) # Red
|
46 |
+
elif line.startswith('+'):
|
47 |
+
p = diff_doc.add_paragraph(line, style='Normal')
|
48 |
+
p.font.color.rgb = RGBColor(0, 128, 0) # Green
|
49 |
+
else:
|
50 |
+
diff_doc.add_paragraph(line, style='Normal')
|
51 |
|
52 |
diff_doc.save(output_path)
|
53 |
|