class_docstr: Check, install, and call TLGU.
docstr: Do conversion.
  
  :param input_path: TLG filepath to convert.
  :param output_path: filepath of new converted text.
  :param markup: Specificity of inline markup. Default None removes all numerical markup; 'full' gives most detailed, with reference numbers included before each text line.
  :param rm_newlines: No spaces; removes line ends and hyphens before an ID code; hyphens and spaces before page and column ends are retained.
  :param divide_works: Each work (book) is output as a separate file in the form output_file-xxx.txt; if an output file is not specified, this option has no effect.
  :param lat: Primarily Latin text (PHI). Some TLG texts, notably doccan1.txt and doccan2.txt are mostly roman texts lacking explicit language change codes. Setting this option will force a change to Latin text after each citation block is encountered.
  :param extra_args: Any other tlgu args to be passed, in list form and without dashes, e.g.: ['p', 'b', 'B'].
docstr_tok: ["Do","conversion",".",":","param","input_path",":","TLG","filepath","to","convert",".",":","param","output_path",":","filepath","of","new","converted","text",".",":","param","markup",":","Specificity","of","inline","markup",".","Default","None","removes","all","numerical","markup",";","'full","'","gives","most","detailed",",","with","reference","numbers","included","before","each","text","line",".",":","param","rm_newlines",":","No","spaces",";","removes","line","ends","and","hyphens","before","an","ID","code",";","hyphens","and","spaces","before","page","and","column","ends","are","retained",".",":","param","divide_works",":","Each","work","(","book",")","is","output","as","a","separate","file","in","the","form","output_file-xxx.txt",";","if","an","output","file","is","not","specified",",","this","option","has","no","effect",".",":","param","lat",":","Primarily","Latin","text","(","PHI",")",".","Some","TLG","texts",",","notably","doccan1.txt","and","doccan2.txt","are","mostly","roman","texts","lacking","explicit","language","change","codes",".","Setting","this","option","will","force","a","change","to","Latin","text","after","each","citation","block","is","encountered",".",":","param","extra_args",":","Any","other","tlgu","args","to","be","passed",",","in","list","form","and","without","dashes",",","e.g",".",":","[","'","p","'",",","'","b","'",",","'","B","'","]","."]
code: def convert(
      input_path=None,
      output_path=None,
      markup=None,
      rm_newlines=False,
      divide_works=False,
      lat=False,
      extra_args=None,
  ):
      """
      Do conversion.
  
      :param input_path: TLG filepath to convert.
      :param output_path: filepath of new converted text.
      :param markup: Specificity of inline markup. Default None removes all numerical markup; 'full' gives most detailed, with reference numbers included before each text line.
      :param rm_newlines: No spaces; removes line ends and hyphens before an ID code; hyphens and spaces before page and column ends are retained.
      :param divide_works: Each work (book) is output as a separate file in the form output_file-xxx.txt; if an output file is not specified, this option has no effect.
      :param lat: Primarily Latin text (PHI). Some TLG texts, notably doccan1.txt and doccan2.txt are mostly roman texts lacking explicit language change codes. Setting this option will force a change to Latin text after each citation block is encountered.
      :param extra_args: Any other tlgu args to be passed, in list form and without dashes, e.g.: ['p', 'b', 'B'].
  
      """
      # setup file paths
      input_path = os.path.expanduser(input_path)
      output_path = os.path.expanduser(output_path)
  
      # check input path exists
      assert os.path.isfile(
          input_path
      ), "File {0} does not exist.".format(input_path)
  
      # setup tlgu flags
      tlgu_options = []
      if markup == "full":
          full_args = ["v", "w", "x", "y", "z"]
          [
              tlgu_options.append(x) for x in full_args
          ]  # pylint: disable=W0106
      if rm_newlines:
          tlgu_options.append("N")
      if divide_works:
          tlgu_options.append("W")
      if lat:
          tlgu_options.append("r")
      # setup extra args
      if extra_args is None:
          extra_args = []
      else:
          try:
              extra_args = list(extra_args)
          except Exception as exc:
              logger.error(
                  "Argument 'extra_args' must be a list: %s.", exc
              )
              raise
      tlgu_options = tlgu_options + extra_args
      # assemble all tlgu flags
      tlgu_options = list(set(tlgu_options))
      if tlgu_options:
          tlgu_flags = "-" + " -".join(tlgu_options)
      else:
          tlgu_flags = ""
      # make tlgu call
      tlgu_call = "tlgu {0} {1} {2}".format(
          tlgu_flags, input_path, output_path
      )
      logger.info(tlgu_call)
      try:
          p_out = subprocess.call(tlgu_call, shell=True)
          if p_out == 1:
              logger.error(
                  "Failed to convert %s to %s.", input_path, output_path
              )
      except Exception as exc:
          logger.error(
              "Failed to convert %s to %s: %s",
              input_path,
              output_path,
              exc,
          )
          raise
  
file_path: cltk/src/cltk/corpora/grc/tlg/tlgu.py
imports: import os
  import subprocess
  from cltk.core.cltk_logger import logger
  from cltk.core.exceptions import CLTKException
  from cltk.data.fetch import FetchCorpus
  from cltk.utils.file_operations import make_cltk_path
  from cltk.utils.utils import query_yes_no
label_desc: Use image node_id 4 for calling the TLGU obj's underlying member method code with example usage: obj.convert(input_path, output_path, markup, rm_newlines, divide_works, lat, extra_args) without return types