anchor.diff:              return Doc(self.vocab, words=words, spaces=spaces)
   
   p
  -    |  As you can see, we need a #[code vocab] instance to construct this — but
  -    |  we won't get the #[code vocab] instance until we get back the #[code nlp]
  -    |  object from #[code spacy.load()]. The simplest solution is to build the
  -    |  object in two steps:
  +    |  As you can see, we need a #[code Vocab] instance to construct this — but
  +    |  we won't have it until we get back the loaded #[code nlp] object. The
  +    |  simplest solution is to build the tokenizer in two steps. This also means
  +    |  that you can reuse the "tokenizer factory" and initialise it with
  +    |  different instances of #[code Vocab].
   
   +code.
       nlp = spacy.load('en')
  -    nlp.make_doc = WhitespaceTokenizer(nlp)
  -
  -p
  -    |  You can instead pass the class to the #[code create_make_doc] keyword,
  -    |  which is invoked as callback once the #[code nlp] object is ready:
  -
  -+code.
  -    nlp = spacy.load('en', create_make_doc=WhitespaceTokenizer)
  -
  -p
  -    |  Finally, you can of course create your own subclasses, and create a bound
  -    |  #[code make_doc] method. The disadvantage of this approach is that spaCy
  -    |  uses inheritance to give each language-specific pipeline its own class.
  -    |  If you're working with multiple languages, a naive solution will
  -    |  therefore require one custom class per language you're working with.
  -    |  This might be at least annoying. You may be able to do something more
  -    |  generic by doing some clever magic with metaclasses or mixins, if that's
  -    |  the sort of thing you're into.
  +    nlp.tokenizer = WhitespaceTokenizer(nlp.vocab)
  
positive.code: +h(2, "custom-tokenizer") Hooking an arbitrary tokenizer into the pipeline
  
  p
      |  You can pass a custom tokenizer using the #[code make_doc] keyword, when
      |  you're creating the pipeline:
  
  +code.
      nlp = spacy.load('en', make_doc=my_tokenizer)
  
  p
      |  However, this approach often leaves us with a chicken-and-egg problem.
      |  To construct the tokenizer, we usually want attributes of the #[code nlp]
      |  pipeline. Specifically, we want the tokenizer to hold a reference to the
      |  pipeline's vocabulary object. Let's say we have the following class as
      |  our tokenizer:
  
  
  +code.
      import spacy
      from spacy.tokens import Doc
  
      class WhitespaceTokenizer(object):
          def __init__(self, nlp):
              self.vocab = nlp.vocab
  
          def __call__(self, text):
              words = text.split(' ')
  
negative.code:     |  #[code spaces] booleans, which allow you to maintain alignment of the
      |  tokens into the original string.
  
  +h(2, "101") Tokenizer 101
  
  include _spacy-101/_tokenization
  
  +h(3, "101-data") Tokenizer data
  
  