MCPcopy Index your code
hub / github.com/clips/pattern / _parse_article

Method _parse_article

pattern/web/__init__.py:1708–1719  ·  view source on GitHub ↗
(self, data, **kwargs)

Source from the content-addressed store, hash-verified

1706 return a
1707
1708 def _parse_article(self, data, **kwargs):
1709 return self.MediaWikiArticle(
1710 title = plaintext(data.get("displaytitle", data.get("title", ""))),
1711 source = data.get("text", {}).get("*", ""),
1712 disambiguation = data.get("text", {}).get("*", "").find(MEDIAWIKI_DISAMBIGUATION) >= 0,
1713 links = [x["*"] for x in data.get("links", []) if not _mediawiki_namespace.match(x["*"])],
1714 categories = [x["*"] for x in data.get("categories", [])],
1715 external = [x for x in data.get("externallinks", [])],
1716 media = [x for x in data.get("images", [])],
1717 languages = dict([(x["lang"], x["*"]) for x in data.get("langlinks", [])]),
1718 language = self.language,
1719 parser = self, **kwargs)
1720
1721 def _parse_article_sections(self, article, data):
1722 # If "References" is a section in the article,

Callers 1

searchMethod · 0.95

Calls 5

MediaWikiArticleMethod · 0.95
plaintextFunction · 0.85
getMethod · 0.45
findMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected