Spaces:
Running
Running
Commit
·
a43d461
1
Parent(s):
fa3890f
fix code formatting
Browse files- curated.py +6 -11
curated.py
CHANGED
@@ -1137,17 +1137,12 @@ filtering_process = Div(
|
|
1137 |
),
|
1138 |
D_code(
|
1139 |
"""
|
1140 |
-
Raw single line in data: <P> Hi I am speaker
|
1141 |
After tag removal: P Hi I am speaker
|
1142 |
We remove everything that starts with ["P", "BRK", "CHAPTER", "/P"]
|
1143 |
and only keep tagname == SPEAKER
|
1144 |
-
because line starting with <SPEAKER> TEXT TEXT ....... has the relevant text
|
1145 |
-
|
1146 |
-
style="block",
|
1147 |
-
language="python",
|
1148 |
-
),
|
1149 |
-
D_code(
|
1150 |
-
"""
|
1151 |
def process_tag(original_tag):
|
1152 |
tag = original_tag.strip(">").strip("<")
|
1153 |
# Skip empty tags
|
@@ -1163,9 +1158,9 @@ filtering_process = Div(
|
|
1163 |
name = soup.speaker["name"]
|
1164 |
return name
|
1165 |
# Raise a error here if there is a tag we don't know
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
language="python",
|
1170 |
),
|
1171 |
table_div_up,
|
|
|
1137 |
),
|
1138 |
D_code(
|
1139 |
"""
|
1140 |
+
\"""Raw single line in data: <P> Hi I am speaker
|
1141 |
After tag removal: P Hi I am speaker
|
1142 |
We remove everything that starts with ["P", "BRK", "CHAPTER", "/P"]
|
1143 |
and only keep tagname == SPEAKER
|
1144 |
+
because line starting with <SPEAKER> TEXT TEXT ....... has the relevant text\"""
|
1145 |
+
|
|
|
|
|
|
|
|
|
|
|
1146 |
def process_tag(original_tag):
|
1147 |
tag = original_tag.strip(">").strip("<")
|
1148 |
# Skip empty tags
|
|
|
1158 |
name = soup.speaker["name"]
|
1159 |
return name
|
1160 |
# Raise a error here if there is a tag we don't know
|
1161 |
+
raise ValueError(f"Unknown tag {tag}")
|
1162 |
+
""",
|
1163 |
+
block="block",
|
1164 |
language="python",
|
1165 |
),
|
1166 |
table_div_up,
|