Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -96,7 +96,7 @@ def parse_google_translate_html(filepath):
|
|
| 96 |
input_text = ''
|
| 97 |
language = ''
|
| 98 |
|
| 99 |
-
translation_match = re.search(r'
|
| 100 |
date_match = re.search(r'(\d{1,2}\s+\w{3}\s+\d{4}),\s+(\d{2}:\d{2}:\d{2}\s+\w+)', text)
|
| 101 |
|
| 102 |
if translation_match and date_match:
|
|
@@ -137,7 +137,7 @@ def google_translate_to_csv(filepath):
|
|
| 137 |
|
| 138 |
try:
|
| 139 |
with open(output_file, 'w', newline='', encoding='utf-8') as csvfile:
|
| 140 |
-
fieldnames = ['Date', 'Time', 'Requested translation', '
|
| 141 |
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
|
| 142 |
|
| 143 |
writer.writeheader()
|
|
@@ -371,6 +371,7 @@ demo = gr.Interface(
|
|
| 371 |
4. **AppleHealth GPS Converter**: you can convert any .gpx file (tested only with files from AppleHealth application)
|
| 372 |
5. **WhatsApp Converter**: you can convert any WhatsApp chat exported as .txt file
|
| 373 |
6. **Google Foto Converter**: you can convert multiple JSON files, please upload a .zip file that only contains JSON files to be inserted into a CSV file
|
|
|
|
| 374 |
""",
|
| 375 |
article="""
|
| 376 |
The workshop is sponsored by the [Swiss Design Network](https://swissdesignnetwork.ch/) and the [MAKEAWARE! - Spearhead Project](https://spearhead-amr.github.io/makeaware/) and carried out at the [SUPSI FabLab](https://www.supsi.ch/fablab) in the context of the [Master of Arts in Interaction Design](https://maind.supsi.ch/master-interaction-design/en).
|
|
|
|
| 96 |
input_text = ''
|
| 97 |
language = ''
|
| 98 |
|
| 99 |
+
translation_match = re.search(r'\s+(?:<a.*?>)?"(.*?)"', str(content))
|
| 100 |
date_match = re.search(r'(\d{1,2}\s+\w{3}\s+\d{4}),\s+(\d{2}:\d{2}:\d{2}\s+\w+)', text)
|
| 101 |
|
| 102 |
if translation_match and date_match:
|
|
|
|
| 137 |
|
| 138 |
try:
|
| 139 |
with open(output_file, 'w', newline='', encoding='utf-8') as csvfile:
|
| 140 |
+
fieldnames = ['Date', 'Time', 'Requested translation', 'Language']
|
| 141 |
writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
|
| 142 |
|
| 143 |
writer.writeheader()
|
|
|
|
| 371 |
4. **AppleHealth GPS Converter**: you can convert any .gpx file (tested only with files from AppleHealth application)
|
| 372 |
5. **WhatsApp Converter**: you can convert any WhatsApp chat exported as .txt file
|
| 373 |
6. **Google Foto Converter**: you can convert multiple JSON files, please upload a .zip file that only contains JSON files to be inserted into a CSV file
|
| 374 |
+
7. **Google Translate Converter**: you can convert a single .html file from Google Takeout -> Google Translate Activity
|
| 375 |
""",
|
| 376 |
article="""
|
| 377 |
The workshop is sponsored by the [Swiss Design Network](https://swissdesignnetwork.ch/) and the [MAKEAWARE! - Spearhead Project](https://spearhead-amr.github.io/makeaware/) and carried out at the [SUPSI FabLab](https://www.supsi.ch/fablab) in the context of the [Master of Arts in Interaction Design](https://maind.supsi.ch/master-interaction-design/en).
|