class_docstr: https://anhaidgroup.github.io/py_stringmatching/v0.3.x/Editex.html
  http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.14.3856&rep=rep1&type=pdf
  http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.18.2138&rep=rep1&type=pdf
  https://github.com/chrislit/blob/master/abydos/distance/_editex.py
  https://habr.com/ru/post/331174/ (RUS)
class_docstr_tok: ["https",":","\/\/anhaidgroup.github.io\/py_stringmatching\/v0.3.x\/Editex.html","http",":","\/\/citeseerx.ist.psu.edu\/viewdoc\/download","?","doi=10.1.1.14.3856","&","rep=rep1","&","type=pdf","http",":","\/\/citeseerx.ist.psu.edu\/viewdoc\/download","?","doi=10.1.1.18.2138","&","rep=rep1","&","type=pdf","https",":","\/\/github.com\/chrislit\/blob\/master\/abydos\/distance\/_editex.py","https",":","\/\/habr.com\/ru\/post\/331174\/","(","RUS",")"]
code: def __call__(self, s1: str, s2: str) -> float:
      result = self.quick_answer(s1, s2)
      if result is not None:
          return result
  
      # must do `upper` before getting length because some one-char lowercase glyphs
      # are represented as two chars in uppercase.
      # This might result in a distance that is greater than the maximum
      # input sequence length, though, so we save that maximum first.
      max_length = self.maximum(s1, s2)
      s1 = " " + s1.upper()
      s2 = " " + s2.upper()
      len_s1 = len(s1) - 1
      len_s2 = len(s2) - 1
      d_mat: Any
      if numpy:
          d_mat = numpy.zeros((len_s1 + 1, len_s2 + 1), dtype=int)
      else:
          d_mat = defaultdict(lambda: defaultdict(int))
  
      if not self.local:
          for i in range(1, len_s1 + 1):
              d_mat[i][0] = d_mat[i - 1][0] + self.d_cost(
                  s1[i - 1], s1[i]
              )
      for j in range(1, len_s2 + 1):
          d_mat[0][j] = d_mat[0][j - 1] + self.d_cost(s2[j - 1], s2[j])
  
      for i, (cs1_prev, cs1_curr) in enumerate(
          zip(s1, s1[1:]), start=1
      ):
          for j, (cs2_prev, cs2_curr) in enumerate(
              zip(s2, s2[1:]), start=1
          ):
              d_mat[i][j] = min(
                  d_mat[i - 1][j] + self.d_cost(cs1_prev, cs1_curr),
                  d_mat[i][j - 1] + self.d_cost(cs2_prev, cs2_curr),
                  d_mat[i - 1][j - 1] + self.r_cost(cs1_curr, cs2_curr),
              )
  
      distance = d_mat[len_s1][len_s2]
      return min(distance, max_length)
  
file_path: textdistance/textdistance/algorithms/phonetic.py
imports: from __future__ import annotations
  from collections import defaultdict
  from itertools import groupby, zip_longest
  from typing import Any, Iterator, Sequence, TypeVar
  from .base import Base, BaseSimilarity
label_desc: Use image node_id 5 for calling the Editex obj's underlying member method code with example usage: obj.__call__(s1, s2) and returns: min, result