docstr: Construct a spaCy-based tokenizer by loading the spaCy pipeline.
          
docstr_tok: ["Construct","a","spaCy-based","tokenizer","by","loading","the","spaCy","pipeline","."]
code: def __init__(self, config):
      """Construct a spaCy-based tokenizer by loading the spaCy pipeline."""
      if config["lang"] != "en":
          raise Exception(
              "spaCy tokenizer is currently only allowed in English pipeline."
          )
  
      try:
          import spacy
          from spacy.lang.en import English
      except ImportError:
          raise ImportError(
              "spaCy 2.0+ is used but not installed on your machine. Go to https://spacy.io/usage for installation instructions."
          )
  
      # Create a Tokenizer with the default settings for English
      # including punctuation rules and exceptions
      self.nlp = English()
      # by default spacy uses dependency parser to do ssplit
      # we need to add a sentencizer for fast rule-based ssplit
      if spacy.__version__.startswith("2."):
          self.nlp.add_pipe(self.nlp.create_pipe("sentencizer"))
      else:
          self.nlp.add_pipe("sentencizer")
      self.no_ssplit = config.get("no_ssplit", False)
  
imports: from stanza.models.common import doc
  from stanza.pipeline._constants import TOKENIZE
  from stanza.pipeline.processor import ProcessorVariant, register_processor_variant
label_desc: Use image node_id 1 to create a new SpacyTokenizer object from inherited base classes: ProcessorVariant with example: obj = SpacyTokenizer(config)