docstr: refine split prediction. `string` are the first words from new page.
  delta can be used as uncertainty measure.
  returns new index and split index
docstr_tok: ["refine","split","prediction",".","`","string","`","are","the","first","words","from","new","page",".","delta","can","be","used","as","uncertainty","measure",".","returns","new","index","and","split","index"]
code: def split(
      self,
      index: int,
      string: str,
      delta: int = 5,
      reverse: bool = False,
  ) -> Tuple[int, int, float]:
      """
      refine split prediction. `string` are the first words from new page.
      delta can be used as uncertainty measure.
      returns new index and split index
      """
      if reverse:
          index = len(self.paragraphs) - 1 - index
          string = string[::-1]
          paragraphs = self.paragraphs_rev
          paragraphs_no_space = self.paragraphs_rev_no_space
      else:
          paragraphs = self.paragraphs
          paragraphs_no_space = self.paragraphs_no_space
  
      string_ = self.remove_special_chars(string)
      start_ind = max(0, index - delta)
      search_corpus = paragraphs_no_space[start_ind : index + delta + 1]
      lengths = np.asarray([0] + [len(p) for p in search_corpus])
      corp = "".join(search_corpus)
      if len(corp) == 0:
          self._split_locs.append((index, 0))
          return index, 0, 1
      ind, score = self._find_match(corp, string_)
      indices, breakpoints = get_glob_index(lengths, ind, True)
      global_ind, char_ind = int(start_ind + indices), int(
          ind - breakpoints[indices]
      )
      self._split_locs.append((global_ind, char_ind))
      if reverse:
          char_ind = len(paragraphs_no_space[global_ind]) - char_ind
          global_ind = len(paragraphs) - global_ind - 1
      add_space_ind = self.count_special_chars(
          self.paragraphs[global_ind], char_ind
      )
      return global_ind, char_ind + add_space_ind, score
  
imports: from difflib import SequenceMatcher
  from operator import itemgetter
  from typing import List, Tuple, Union
  import re
  import numpy
  from Levenshtein.StringMatcher import StringMatcher
  import Levenshtein
  from fuzzysearch import find_near_matches
label_desc: Use image node_id 5 for calling the Splitter obj's underlying member method code with example usage: obj.split(index, string, delta, reverse) and returns: global_ind,  unknown,  score, index,  int,  int