Skip to content

Commit 8c15dd1

Browse files
committed
use generic_topic_parsing() in topics parsing
1 parent d9cff35 commit 8c15dd1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fundus/publishers/us/rest_of_world.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
extract_article_body_with_selector,
1010
generic_author_parsing,
1111
generic_date_parsing,
12+
generic_topic_parsing,
1213
image_extraction,
1314
)
1415

@@ -42,8 +43,7 @@ def title(self) -> Optional[str]:
4243

4344
@attribute
4445
def topics(self) -> List[str]:
45-
keywords: List[str] = self.precomputed.ld.xpath_search("NewsArticle/keywords")
46-
return [keyword for keyword in keywords if not keyword.startswith("Subject: ")]
46+
return generic_topic_parsing(self.precomputed.ld.xpath_search("NewsArticle/keywords", scalar=True))
4747

4848
@attribute
4949
def images(self) -> List[Image]:

0 commit comments

Comments
 (0)