File size: 662 Bytes
8ba144e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import docx
from docx.oxml.ns import qn
from docx.shared import Pt,RGBColor
import fitz
import os
from fpdf import FPDF
import run
def text_dump_to_lines(text,topic_num,max_length):
lines = [x.strip() for x in text.split("\n") if x.strip()!='']
sentences = run.texClear(lines)
keys, output = run.textToAb(sentences,lines,int(topic_num),int(max_length))
keysText = "\n".join(keys)
outputText = "\n".join(output)
# text = "\n".join(lines)
# return text, text, dump_to_txt(lines), dump_to_docx(lines), dump_to_pdf(lines)
return keysText, outputText, dump_to_txt(output), dump_to_docx(output), dump_to_pdf(output)
|