class_docstr: Implementation of :class:`~deeppavlov.dataset_readers.typos_reader.TyposCustom` that works with
  English Wikipedia's list of common misspellings
class_docstr_tok: ["Implementation","of",":","class",":","`","~deeppavlov.dataset_readers.typos_reader.TyposCustom","`","that","works","with","English","Wikipedia","'s","list","of","common","misspellings"]
docstr: Download and parse common misspellings list from `Wikipedia <https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines>`_
  
  Args:
      data_path: target directory to download the data to
  
  Returns:
      path to the resulting tsv-file
docstr_tok: ["Download","and","parse","common","misspellings","list","from","`","Wikipedia","<","https",":","\/\/en.wikipedia.org\/wiki\/Wikipedia",":","Lists_of_common_misspellings\/For_machines",">","`","_","Args",":","data_path",":","target","directory","to","download","the","data","to","Returns",":","path","to","the","resulting","tsv-file"]
code: def build(data_path: str) -> Path:
      """Download and parse common misspellings list from `Wikipedia <https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines>`_
  
      Args:
          data_path: target directory to download the data to
  
      Returns:
          path to the resulting tsv-file
      """
      data_path = Path(data_path) / "typos_wiki"
  
      fname = data_path / "misspelings.tsv"
  
      if not is_done(data_path):
          url = "https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines"
  
          page = requests.get(url)
          tree = html.fromstring(page.content)
          raw = tree.xpath("//pre/text()")[0].splitlines()
          data = []
          for pair in raw:
              typo, corrects = pair.strip().split("->")
              for correct in corrects.split(","):
                  data.append([typo.strip(), correct.strip()])
  
          fname.parent.mkdir(parents=True, exist_ok=True)
          with fname.open("w", newline="", encoding="utf8") as tsvfile:
              writer = csv.writer(tsvfile, delimiter="\t")
              for line in data:
                  writer.writerow(line)
  
          mark_done(data_path)
  
          log.info("Built")
      return fname
  
imports: import csv
  from logging import getLogger
  from pathlib import Path
  from typing import Dict, List, Tuple
  import requests
  from lxml import html
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.dataset_reader import DatasetReader
  from deeppavlov.core.data.utils import is_done, download, mark_done
label_desc: Use image node_id 1 for calling the TyposWikipedia obj's underlying member method code with example usage: obj.build(data_path) and returns: fname