docs: def _find_relation(self, span_doc: doc, r: List) -> Dict:
          """
          Get the relations between the each pattern in the spacy rule and the matches
          Args:
              span_doc: doc
              r: List
  
          Returns: Dict
          """
  
          rule = r[1][0]
          span_pivot = 0
          relation = {}
          for e_id, element in enumerate(rule):
              if not span_doc[span_pivot:]:
                  for extra_id, _, in enumerate(rule[e_id:]):
                      relation[e_id+extra_id] = None
                  break
              new_doc = self._tokenizer.tokenize_to_spacy_doc(span_doc[span_pivot:].text)
              if "OP" not in element:
                  relation[e_id] = (span_pivot, span_pivot+1)
                  span_pivot += 1
              else:
                  if e_id < len(rule)-1:
                      tmp_rule_1 = [rule[e_id]]
                      tmp_rule_2 = [rule[e_id+1]]
                      tmp_matcher = Matcher(self._nlp.vocab)
                      tmp_matcher.add(0, None, tmp_rule_1)
                      tmp_matcher.add(1, None, tmp_rule_2)
                      tmp_matches = sorted([x for x in tmp_matcher(new_doc) if x[1] != x[2]], key=lambda a: a[1])
  
                      if not tmp_matches:
                          relation[e_id] = None
                      else:
                          matches_1 = [x for x in tmp_matches if x[0] == 0 and x[1] == 0]
                          if not matches_1:
                              relation[e_id] = None
                          else:
                              _, s1, e1 = matches_1[0]
                              matches_2 = [x for x in tmp_matches if x[0] == 1]
                              if not matches_2:
                                  relation[e_id] = (span_pivot, span_pivot + e1)
                                  span_pivot += e1
                              else:
                                  _, s2, e2 = matches_2[0]
                                  if e1 <= s2:
                                      relation[e_id] = (span_pivot, span_pivot + e1)
                                      span_pivot += e1
                                  else:
                                      relation[e_id] = (span_pivot, span_pivot + s2)
                                      span_pivot += s2
                  else:
                      relation[e_id] = (span_pivot, len(span_doc))
  
          return relation