class_docstr: 实现AC自动机的类
  
  Attributes:
      __root: Node类型，AC自动机根节点
docstr: 后向最大匹配.
  
  对content的文本进行多模匹配，返回后向最大匹配的结果.
  
  Args:
      content: string类型, 用于多模匹配的字符串
  
  Returns:
      list类型, 最大匹配单词列表，每个元素为匹配的模式串在句中的起止位置，比如：
      [(0, 2), [4, 7]]
docstr_tok: ["\u540e\u5411\u6700\u5927\u5339\u914d",".","\u5bf9content\u7684\u6587\u672c\u8fdb\u884c\u591a\u6a21\u5339\u914d\uff0c\u8fd4\u56de\u540e\u5411\u6700\u5927\u5339\u914d\u7684\u7ed3\u679c",".","Args",":","content",":","string\u7c7b\u578b",",","\u7528\u4e8e\u591a\u6a21\u5339\u914d\u7684\u5b57\u7b26\u4e32","Returns",":","list\u7c7b\u578b",",","\u6700\u5927\u5339\u914d\u5355\u8bcd\u5217\u8868\uff0c\u6bcf\u4e2a\u5143\u7d20\u4e3a\u5339\u914d\u7684\u6a21\u5f0f\u4e32\u5728\u53e5\u4e2d\u7684\u8d77\u6b62\u4f4d\u7f6e\uff0c\u6bd4\u5982\uff1a","[","(","0",",","2",")",",","[","4",",","7","]","]"]
code: def search(self, content):
      """后向最大匹配.
  
      对content的文本进行多模匹配，返回后向最大匹配的结果.
  
      Args:
          content: string类型, 用于多模匹配的字符串
  
      Returns:
          list类型, 最大匹配单词列表，每个元素为匹配的模式串在句中的起止位置，比如：
          [(0, 2), [4, 7]]
  
      """
      result = []
      p = self.__root
      for current_position in range(len(content)):
          word = content[current_position]
  
          #
          while word not in p.next:
              if p == self.__root:
                  break
              p = p.fail
          else:
              p = p.next[word]
              if p.length > 0:
                  result.append(
                      (
                          current_position - p.length + 1,
                          current_position,
                      )
                  )
  
      return result
  
file_path: PaddleHub/modules/text/lexical_analysis/lac/ahocorasick.py
label_desc: Use image node_id 4 for calling the Ahocorasick obj's underlying member method code with example usage: obj.search(content) and returns: result