class_docstr: Класс, реализующий взвешенный конечный преобразователь,
  осуществляющий замены из заданного списка операций
  
  Аргументы:
  ----------
  alphabet : list
      алфавит
  
  operation_costs : dict or None(optional, default=None)
      словарь вида {(up,low) : cost}
  
  allow_spaces : bool(optional, default=False)
      разрешены ли элементы трансдукции, содержащие пробел
      (используется только если явно не заданы operation costs
      и они равны значению по умолчанию)
class_docstr_tok: ["\u041a\u043b\u0430\u0441\u0441",",","\u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439","\u0432\u0437\u0432\u0435\u0448\u0435\u043d\u043d\u044b\u0439","\u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0439","\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c",",","\u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0449\u0438\u0439","\u0437\u0430\u043c\u0435\u043d\u044b","\u0438\u0437","\u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0433\u043e","\u0441\u043f\u0438\u0441\u043a\u0430","\u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439","\u0410\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b",":","--","--","--","--","--","alphabet",":","list","\u0430\u043b\u0444\u0430\u0432\u0438\u0442","operation_costs",":","dict","or","None","(","optional",",","default=None",")","\u0441\u043b\u043e\u0432\u0430\u0440\u044c","\u0432\u0438\u0434\u0430","{","(","up",",","low",")",":","cost","}","allow_spaces",":","bool","(","optional",",","default=False",")","\u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b","\u043b\u0438","\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b","\u0442\u0440\u0430\u043d\u0441\u0434\u0443\u043a\u0446\u0438\u0438",",","\u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0435","\u043f\u0440\u043e\u0431\u0435\u043b","(","\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f","\u0442\u043e\u043b\u044c\u043a\u043e","\u0435\u0441\u043b\u0438","\u044f\u0432\u043d\u043e","\u043d\u0435","\u0437\u0430\u0434\u0430\u043d\u044b","operation","costs","\u0438","\u043e\u043d\u0438","\u0440\u0430\u0432\u043d\u044b","\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e","\u043f\u043e","\u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e",")"]
code: def lower(self, word, max_cost, return_cost=True):
      transductions = self.lower_transductions(
          word, max_cost, return_cost=True
      )
      answer = dict()
      for transduction, cost in transductions:
          low = "".join(elem[1] for elem in transductions)
          curr_cost = answer.get(low, None)
          if curr_cost is None or cost < curr_cost:
              answer[low] = cost
      answer = sorted(answer.items(), key=(lambda x: x[1]))
      if return_cost:
          return answer
      else:
          return [elem[0] for elem in answer]
  
imports: import copy
  import itertools
  import numpy
  from sortedcontainers import SortedListWithKey
  from .tabled_trie import Trie, make_trie
label_desc: Use image node_id 7 for calling the SegmentTransducer obj's underlying member method code with example usage: obj.lower(word, max_cost, return_cost) and returns: answer, unknown