def parse_wikitext(article, keep_tables, truncate):
  """Parses the wikitext markup in an article to text."""
  article["text"] = wiki_utils.process_wikitext(
      article["text"],
      keep_tables=keep_tables,
      truncate=truncate,
  )
  if not article["text"]:
    beam.metrics.Metrics.counter(__name__, "textless_articles").inc()
    logging.debug("Textless article: %s (%i)", article["title"], article["id"])
    return
  yield article["title"], article
Parses the wikitext markup in an article to text.
language/fruit/beam_pipelines.py