Commit ยท
acbcadf
1
Parent(s): cc6f071
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,12 +31,15 @@ def get_pdf_text(pdf_docs):
|
|
| 31 |
def get_text_file(docs):
|
| 32 |
text_list = []
|
| 33 |
for doc in docs:
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
| 36 |
return text_list
|
| 37 |
|
| 38 |
|
| 39 |
|
|
|
|
| 40 |
def get_csv_file(docs):
|
| 41 |
text_list = []
|
| 42 |
for doc in docs:
|
|
|
|
| 31 |
def get_text_file(docs):
|
| 32 |
text_list = []
|
| 33 |
for doc in docs:
|
| 34 |
+
if doc.type == 'text/plain':
|
| 35 |
+
# ์
๋ก๋๋ .txt ํ์ผ๋ก๋ถํฐ ํ
์คํธ๋ฅผ ์ฝ์ด์ต๋๋ค
|
| 36 |
+
text = doc.getvalue().decode("utf-8") # UTF-8 ์ธ์ฝ๋ฉ์ ๊ธฐ๋ฐ์ผ๋ก ๋ฐ์ดํธ๋ฅผ ๋ฌธ์์ด๋ก ๋์ฝ๋ฉํฉ๋๋ค
|
| 37 |
+
text_list.append(text)
|
| 38 |
return text_list
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
+
|
| 43 |
def get_csv_file(docs):
|
| 44 |
text_list = []
|
| 45 |
for doc in docs:
|