class_docstr: An abstract class representing a distance metric.            Every distance is normalized to be defined in [0, 1].
class_docstr_tok: ["An","abstract","class","representing","a","distance","metric",".","Every","distance","is","normalized","to","be","defined","in","[","0",",","1","]","."]
docstr: This static method allows to build a Distance object.
  
  :param distance: The distance to be returned.
  :return: A `Distance` object to evaluate the distance between two texts.
docstr_tok: ["This","static","method","allows","to","build","a","Distance","object",".",":","param","distance",":","The","distance","to","be","returned",".",":","return",":","A","`","Distance","`","object","to","evaluate","the","distance","between","two","texts","."]
code: def get_instance(distance: str) -> "Distance":
      """
      This static method allows to build a Distance object.
  
      :param distance: The distance to be returned.
      :return: A `Distance` object to evaluate the distance between two texts.
      """
      assert (
          distance in DISTANCE_OPTIONS
      ), "Allowed distances: {}".format(DISTANCE_OPTIONS)
      if distance == "word":
          return WordDistance()
      if distance == "char":
          return CharDistance()
  
file_path: espnet/egs2/uslu14/asr1/local/evaluation/metrics/distance.py
imports: from typing import List, Union
  from jiwer import wer
  from textdistance.algorithms.edit_based import levenshtein
label_desc: Use image node_id 2 for calling the Distance obj's underlying member method code with example usage: obj.get_instance(distance) and returns: WordDistance, CharDistance