Commit ยท
c2009a1
1
Parent(s): 96060c4
Update app.py
Browse files
app.py
CHANGED
|
@@ -33,24 +33,24 @@ def get_text_file(docs):
|
|
| 33 |
|
| 34 |
# .txt ํ์ผ ์ฒ๋ฆฌ ํจ์
|
| 35 |
def process_txt_file(file_content):
|
| 36 |
-
|
| 37 |
-
text_list.append(text)
|
| 38 |
|
| 39 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
| 40 |
-
for
|
| 41 |
try:
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
|
| 50 |
return text_list
|
| 51 |
|
| 52 |
|
| 53 |
|
|
|
|
| 54 |
def get_csv_file(docs):
|
| 55 |
text_list = []
|
| 56 |
for doc in docs:
|
|
|
|
| 33 |
|
| 34 |
# .txt ํ์ผ ์ฒ๋ฆฌ ํจ์
|
| 35 |
def process_txt_file(file_content):
|
| 36 |
+
text_list.append(file_content)
|
|
|
|
| 37 |
|
| 38 |
# ์ฃผ์ด์ง ํ์ผ ๋ชฉ๋ก์ ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ํ์ผ์ ์ฒ๋ฆฌ
|
| 39 |
+
for file_data in docs:
|
| 40 |
try:
|
| 41 |
+
# ํ์ผ ๋ด์ฉ์ด ํ
์คํธ์ธ ๊ฒฝ์ฐ์๋ง ํ
์คํธ๋ฅผ ์ถ๊ฐ
|
| 42 |
+
if isinstance(file_data, tuple) and len(file_data) == 2:
|
| 43 |
+
filename, file_content = file_data
|
| 44 |
+
if isinstance(file_content, str):
|
| 45 |
+
process_txt_file(file_content)
|
| 46 |
+
except IndexError:
|
| 47 |
+
pass # ํํ ํ์์ด ์๋ ๊ฒฝ์ฐ ๊ฑด๋๋๋๋ค.
|
| 48 |
|
| 49 |
return text_list
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
+
|
| 54 |
def get_csv_file(docs):
|
| 55 |
text_list = []
|
| 56 |
for doc in docs:
|