Tomer Sagi
commited on
Commit
·
6cd4c25
1
Parent(s):
bbdd49e
added cantillation removal for Hebrew
Browse files- scrape_script.py +4 -1
scrape_script.py
CHANGED
@@ -60,7 +60,10 @@ def append_to_parquet(content, file_path, lang, top_level_directory, data_dir =
|
|
60 |
# Apply cleaning rules
|
61 |
content = re.sub(r'<(?:span|b|big|small|strong|br|sup[^>]*)[^>]*>|</(?:span|b|big|small|strong|sup)>', '', content) # Remove HTML tags
|
62 |
content = re.sub(r'https?://\S+', '', content) # Remove HTML links
|
63 |
-
|
|
|
|
|
|
|
64 |
|
65 |
# Remove chapter markers
|
66 |
chapter_markers = ['Chapter', 'Halakhah']
|
|
|
60 |
# Apply cleaning rules
|
61 |
content = re.sub(r'<(?:span|b|big|small|strong|br|sup[^>]*)[^>]*>|</(?:span|b|big|small|strong|sup)>', '', content) # Remove HTML tags
|
62 |
content = re.sub(r'https?://\S+', '', content) # Remove HTML links
|
63 |
+
|
64 |
+
# Remove Hebrew cantillation marks
|
65 |
+
if lang == "he":
|
66 |
+
content = re.sub(r'[\u0591-\u05AF]', '', content)
|
67 |
|
68 |
# Remove chapter markers
|
69 |
chapter_markers = ['Chapter', 'Halakhah']
|