class_docstr: Splits input text into N-grams instead of words.
  
  >>> ngt = NgramTokenizer(4)
  >>> [token.text for token in ngt("hi there")]
  ["hi t", "i th", " the", "ther", "here"]
  
  Note that this tokenizer does NOT use a regular expression to extract
  words, so the grams emitted by it will contain whitespace, punctuation,
  etc. You may want to massage the input or add a custom filter to this
  tokenizer's output.
  
  Alternatively, if you only want sub-word grams without whitespace, you
  could combine a RegexTokenizer with NgramFilter instead.
class_docstr_tok: ["Splits","input","text","into","N-grams","instead","of","words",".",">",">",">","ngt","=","NgramTokenizer","(","4",")",">",">",">","[","token.text","for","token","in","ngt","(","``","hi","there","''",")","]","[","``","hi","t","''",",","``","i","th","''",",","``","the","''",",","``","ther","''",",","``","here","''","]","Note","that","this","tokenizer","does","NOT","use","a","regular","expression","to","extract","words",",","so","the","grams","emitted","by","it","will","contain","whitespace",",","punctuation",",","etc",".","You","may","want","to","massage","the","input","or","add","a","custom","filter","to","this","tokenizer","'s","output",".","Alternatively",",","if","you","only","want","sub-word","grams","without","whitespace",",","you","could","combine","a","RegexTokenizer","with","NgramFilter","instead","."]
code: def __call__(
      self,
      value,
      positions=False,
      chars=False,
      keeporiginal=False,
      removestops=True,
      start_pos=0,
      start_char=0,
      mode="",
      **kwargs,
  ):
      assert isinstance(value, text_type), "%r is not unicode" % value
  
      inlen = len(value)
      t = Token(positions, chars, removestops=removestops, mode=mode)
      pos = start_pos
  
      if mode == "query":
          size = min(self.max, inlen)
          for start in xrange(0, inlen - size + 1):
              end = start + size
              if end > inlen:
                  continue
              t.text = value[start:end]
              if keeporiginal:
                  t.original = t.text
              t.stopped = False
              if positions:
                  t.pos = pos
              if chars:
                  t.startchar = start_char + start
                  t.endchar = start_char + end
              yield t
              pos += 1
      else:
          for start in xrange(0, inlen - self.min + 1):
              for size in xrange(self.min, self.max + 1):
                  end = start + size
                  if end > inlen:
                      continue
                  t.text = value[start:end]
                  if keeporiginal:
                      t.original = t.text
                  t.stopped = False
                  if positions:
                      t.pos = pos
                  if chars:
                      t.startchar = start_char + start
                      t.endchar = start_char + end
  
                  yield t
              pos += 1
  
file_path: whoosh/src/whoosh/analysis/ngrams.py
imports: from whoosh.compat import text_type
  from whoosh.compat import xrange
  from whoosh.analysis.acore import Token
  from whoosh.analysis.filters import Filter, LowercaseFilter
  from whoosh.analysis.tokenizers import Tokenizer, RegexTokenizer
label_desc: Use image node_id 3 for calling the NgramTokenizer obj's underlying member method code with example usage: obj.__call__(value, positions, chars, keeporiginal, removestops, start_pos, start_char, mode) without return types