class_docstr: Splits words into subwords and performs optional transformations on
  subword groups. This filter is funtionally based on yonik's
  WordDelimiterFilter in Solr, but shares no code with it.
  
  * Split on intra-word delimiters, e.g. `Wi-Fi` -> `Wi`, `Fi`.
  * When splitwords=True, split on case transitions,
    e.g. `PowerShot` -> `Power`, `Shot`.
  * When splitnums=True, split on letter-number transitions,
    e.g. `SD500` -> `SD`, `500`.
  * Leading and trailing delimiter characters are ignored.
  * Trailing possesive "'s" removed from subwords,
    e.g. `O'Neil's` -> `O`, `Neil`.
  
  The mergewords and mergenums arguments turn on merging of subwords.
  
  When the merge arguments are false, subwords are not merged.
  
  * `PowerShot` -> `0`:`Power`, `1`:`Shot` (where `0` and `1` are token
    positions).
  
  When one or both of the merge arguments are true, consecutive runs of
  alphabetic and/or numeric subwords are merged into an additional token with
  the same position as the last sub-word.
  
  * `PowerShot` -> `0`:`Power`, `1`:`Shot`, `1`:`PowerShot`
  * `A's+B's&C's` -> `0`:`A`, `1`:`B`, `2`:`C`, `2`:`ABC`
  * `Super-Duper-XL500-42-AutoCoder!` -> `0`:`Super`, `1`:`Duper`, `2`:`XL`,
    `2`:`SuperDuperXL`,
    `3`:`500`, `4`:`42`, `4`:`50042`, `5`:`Auto`, `6`:`Coder`,
    `6`:`AutoCoder`
  
  When using this filter you should use a tokenizer that only splits on
  whitespace, so the tokenizer does not remove intra-word delimiters before
  this filter can see them, and put this filter before any use of
  LowercaseFilter.
  
  >>> rt = RegexTokenizer(r"\S+")
  >>> iwf = IntraWordFilter()
  >>> lcf = LowercaseFilter()
  >>> analyzer = rt | iwf | lcf
  
  One use for this filter is to help match different written representations
  of a concept. For example, if the source text contained `wi-fi`, you
  probably want `wifi`, `WiFi`, `wi-fi`, etc. to match. One way of doing this
  is to specify mergewords=True and/or mergenums=True in the analyzer used
  for indexing, and mergewords=False / mergenums=False in the analyzer used
  for querying.
  
  >>> iwf_i = IntraWordFilter(mergewords=True, mergenums=True)
  >>> iwf_q = IntraWordFilter(mergewords=False, mergenums=False)
  >>> iwf = MultiFilter(index=iwf_i, query=iwf_q)
  >>> analyzer = RegexTokenizer(r"\S+") | iwf | LowercaseFilter()
  
  (See :class:`MultiFilter`.)
code: def _split(self, string):
      bound = self.boundary
  
      # Yields (startchar, endchar) pairs for each indexable substring in
      # the given string, e.g. "WikiWord" -> (0, 4), (4, 8)
  
      # Whether we're splitting on transitions (case changes, letter -> num,
      # num -> letter, etc.)
      splitting = self.splitting
  
      # Make a list (dispos, for "dispossessed") of (startchar, endchar)
      # pairs for runs of text between "'s"
      if "'" in string:
          # Split on possessive 's
          dispos = []
          prev = 0
          for match in self.possessive.finditer(string):
              dispos.append((prev, match.start()))
              prev = match.end()
          if prev < len(string):
              dispos.append((prev, len(string)))
      else:
          # Shortcut if there's no apostrophe in the string
          dispos = ((0, len(string)),)
  
      # For each run between 's
      for sc, ec in dispos:
          # Split on boundary characters
          for part_match in self.between.finditer(string, sc, ec):
              part_start = part_match.start()
              part_end = part_match.end()
  
              if splitting:
                  # The point to start splitting at
                  prev = part_start
                  # Find transitions (e.g. "iW" or "a0")
                  for bmatch in bound.finditer(
                      string, part_start, part_end
                  ):
                      # The point in the middle of the transition
                      pivot = bmatch.start() + 1
                      # Yield from the previous match to the transition
                      yield (prev, pivot)
                      # Make the transition the new starting point
                      prev = pivot
  
                  # If there's leftover text at the end, yield it too
                  if prev < part_end:
                      yield (prev, part_end)
              else:
                  # Not splitting on transitions, just yield the part
                  yield (part_start, part_end)
  
imports: import re
  from collections import deque
  from whoosh.compat import u, text_type
  from whoosh.compat import xrange
  from whoosh.analysis.filters import Filter
label_desc: Use image node_id 3 for calling the IntraWordFilter obj's underlying member method code with example usage: obj._split(string) without return types