class_docstr: 实现AC自动机的类
  
  Attributes:
      __root: Node类型，AC自动机根节点
docstr: 构建fail指针路径
docstr_tok: ["\u6784\u5efafail\u6307\u9488\u8def\u5f84"]
code: def make(self):
      """构建fail指针路径"""
  
      queue = list()
      for key in self.__root.next:
          self.__root.next[key].fail = self.__root
          queue.append(self.__root.next[key])
  
      # 广度优先算法遍历设置fail指针
      while len(queue) > 0:
          # 基于当前节点的fail指针设置其子结点的fail指针
          current = queue.pop(0)
  
          for k in current.next:
              current_fail = current.fail
  
              # 若当前节点有fail指针，尝试设置其子结点的fail指针
              while current_fail is not None:
                  if k in current_fail.next:
                      current.next[k].fail = current_fail.next[k]
                      break
                  current_fail = current_fail.fail
  
              # 若当前节点的fail指针不存在该子结点，令子结点fail指向根节点
              if current_fail is None:
                  current.next[k].fail = self.__root
  
              queue.append(current.next[k])
  
file_path: PaddleHub/modules/text/lexical_analysis/lac/ahocorasick.py
label_desc: Use image node_id 3 for calling the Ahocorasick obj's underlying member method code with example usage: obj.make() without return types