code: def _char_wb_ngrams(vec, text_document):
      min_n, max_n = vec.ngram_range
      ngrams = []
      for m in re.finditer(r"\S+", text_document):
          w_start, w_end = m.start(), m.end()
          w = m.group(0)
          w = " " + w + " "
          w_len = len(w)
          for n in xrange(min_n, max_n + 1):
              offset = 0
              ngrams.append(
                  (
                      [
                          (
                              w_start + offset - 1,
                              w_start + offset + n - 1,
                          )
                      ],
                      w[offset : offset + n],
                  )
              )
              while offset + n < w_len:
                  offset += 1
                  ngrams.append(
                      (
                          [
                              (
                                  w_start + offset - 1,
                                  w_start + offset + n - 1,
                              )
                          ],
                          w[offset : offset + n],
                      )
                  )
              if (
                  offset == 0
              ):  # count a short word (w_len < n) only once
                  break
      return ngrams
  
file_path: eli5/eli5/sklearn/_span_analyzers.py
imports: from __future__ import absolute_import
  import re
  from six.moves import xrange
label_desc: Use image node_id 5 for calling a global function with example usage: _char_wb_ngrams(vec, text_document) and returns: ngrams