class_docstr: Spacy doesn't assume that text is tokenised. Sometimes this
  is annoying, like when you have gold data which is pre-tokenised,
  but Spacy's tokenisation doesn't match the gold. This can be used
  as follows:
  nlp = spacy.load("en_core_web_md")
  # hack to replace tokenizer with a whitespace tokenizer
  nlp.tokenizer = _WhitespaceSpacyTokenizer(nlp.vocab)
  ... use nlp("here is some text") as normal.
class_docstr_tok: ["Spacy","does","n't","assume","that","text","is","tokenised",".","Sometimes","this","is","annoying",",","like","when","you","have","gold","data","which","is","pre-tokenised",",","but","Spacy","'s","tokenisation","does","n't","match","the","gold",".","This","can","be","used","as","follows",":","nlp","=","spacy.load","(","``","en_core_web_md","''",")","#","hack","to","replace","tokenizer","with","a","whitespace","tokenizer","nlp.tokenizer","=","_WhitespaceSpacyTokenizer","(","nlp.vocab",")","...","use","nlp","(","``","here","is","some","text","''",")","as","normal","."]
code: def __call__(self, text):
      words = text.split(" ")
      spaces = [True] * len(words)
      return Doc(self.vocab, words=words, spaces=spaces)
  
file_path: allennlp/allennlp/data/tokenizers/spacy_tokenizer.py
imports: from typing import List, Optional
  import spacy
  from spacy.tokens import Doc
  from allennlp.common.util import get_spacy_model
  from allennlp.data.tokenizers.token_class import Token
  from allennlp.data.tokenizers.tokenizer import Tokenizer
label_desc: Use image node_id 2 for calling the _WhitespaceSpacyTokenizer obj's underlying member method code with example usage: obj.__call__(text) and returns: Doc