class_docstr: A ``Process`` type to capture everything, that the ``spaCy`` project can do for a given language.
  
  .. note::
      ``spacy`` has only partial functionality available for some languages.
  
  >>> from cltk.languages.example_texts import get_example_text
  >>> process_spacy = SpacyProcess(language="lat")
  >>> isinstance(process_spacy, SpacyProcess)
  True
  
  # >>> from spacy.models.common.doc import Document
  # >>> output_doc = process_spacy.run(Doc(raw=get_example_text("lat")))
  # >>> isinstance(output_doc.spacy_doc, Document)
  True
class_docstr_tok: ["A","``","Process","``","type","to","capture","everything",",","that","the","``","spaCy","``","project","can","do","for","a","given","language",".","..","note",":",":","``","spacy","``","has","only","partial","functionality","available","for","some","languages",".",">",">",">","from","cltk.languages.example_texts","import","get_example_text",">",">",">","process_spacy","=","SpacyProcess","(","language=","''","lat","''",")",">",">",">","isinstance","(","process_spacy",",","SpacyProcess",")","True","#",">",">",">","from","spacy.models.common.doc","import","Document","#",">",">",">","output_doc","=","process_spacy.run","(","Doc","(","raw=get_example_text","(","``","lat","''",")",")",")","#",">",">",">","isinstance","(","output_doc.spacy_doc",",","Document",")","True"]
docstr: Take an entire ``spacy`` document, extract
  each word, and encode it in the way expected by
  the CLTK's ``Word`` type.
  
  It works only if there is some sentence boundaries has been set by the loaded model.
  
  See note in code about starting word token index at 1
  
  >>> from cltk.dependency.processes import SpacyProcess
  >>> from cltk.languages.example_texts import get_example_text
  >>> process_spacy = SpacyProcess(language="lat")
  >>> cltk_words = process_spacy.run(Doc(raw=get_example_text("lat"))).words
  >>> isinstance(cltk_words, list)
  True
  >>> isinstance(cltk_words[0], Word)
  True
  >>> cltk_words[0]
  Word(index_char_start=0, index_char_stop=6, index_token=0, index_sentence=0, string='Gallia', pos=None, lemma='Gallia', stem=None, scansion=None, xpos='proper_noun', upos='PROPN', dependency_relation='nsubj', governor=None, features={}, category={}, stop=False, named_entity=None, syllables=None, phonetic_transcription=None, definition=None)
docstr_tok: ["Take","an","entire","``","spacy","``","document",",","extract","each","word",",","and","encode","it","in","the","way","expected","by","the","CLTK","'s","``","Word","``","type",".","It","works","only","if","there","is","some","sentence","boundaries","has","been","set","by","the","loaded","model",".","See","note","in","code","about","starting","word","token","index","at","1",">",">",">","from","cltk.dependency.processes","import","SpacyProcess",">",">",">","from","cltk.languages.example_texts","import","get_example_text",">",">",">","process_spacy","=","SpacyProcess","(","language=","''","lat","''",")",">",">",">","cltk_words","=","process_spacy.run","(","Doc","(","raw=get_example_text","(","``","lat","''",")",")",")",".words",">",">",">","isinstance","(","cltk_words",",","list",")","True",">",">",">","isinstance","(","cltk_words","[","0","]",",","Word",")","True",">",">",">","cltk_words","[","0","]","Word","(","index_char_start=0",",","index_char_stop=6",",","index_token=0",",","index_sentence=0",",","string='Gallia","'",",","pos=None",",","lemma='Gallia","'",",","stem=None",",","scansion=None",",","xpos='proper_noun","'",",","upos='PROPN","'",",","dependency_relation='nsubj","'",",","governor=None",",","features=","{","}",",","category=","{","}",",","stop=False",",","named_entity=None",",","syllables=None",",","phonetic_transcription=None",",","definition=None",")"]
code: def spacy_to_cltk_word_type(spacy_doc: spacy.tokens.doc.Doc):
      """Take an entire ``spacy`` document, extract
      each word, and encode it in the way expected by
      the CLTK's ``Word`` type.
  
      It works only if there is some sentence boundaries has been set by the loaded model.
  
      See note in code about starting word token index at 1
  
      >>> from cltk.dependency.processes import SpacyProcess
      >>> from cltk.languages.example_texts import get_example_text
      >>> process_spacy = SpacyProcess(language="lat")
      >>> cltk_words = process_spacy.run(Doc(raw=get_example_text("lat"))).words
      >>> isinstance(cltk_words, list)
      True
      >>> isinstance(cltk_words[0], Word)
      True
      >>> cltk_words[0]
      Word(index_char_start=0, index_char_stop=6, index_token=0, index_sentence=0, string='Gallia', pos=None, lemma='Gallia', stem=None, scansion=None, xpos='proper_noun', upos='PROPN', dependency_relation='nsubj', governor=None, features={}, category={}, stop=False, named_entity=None, syllables=None, phonetic_transcription=None, definition=None)
  
      """
      words_list: List[Word] = []
      for sentence_index, sentence in enumerate(spacy_doc.doc.sents):
          sent_words: Dict[int, Word] = {}
          for spacy_word in sentence:
              pos: Optional[MorphosyntacticFeature] = None
              if spacy_word.pos_:
                  pos = from_ud("POS", spacy_word.pos_)
              cltk_word = Word(
                  # Note: In order to match how Stanza orders token output
                  # (index starting at 1, not 0), we must add an extra 1 to each
                  index_token=spacy_word.i + 1,
                  index_char_start=spacy_word.idx,
                  index_char_stop=spacy_word.idx + len(spacy_word),
                  index_sentence=sentence_index,
                  string=spacy_word.text,  # same as ``token.text``
                  pos=pos,
                  xpos=spacy_word.tag_,
                  upos=spacy_word.pos_,
                  lemma=spacy_word.lemma_,
                  dependency_relation=spacy_word.dep_,  # str
                  stop=spacy_word.is_stop,
                  # Note: Must increment this, too
                  governor=spacy_word.head.i
                  + 1,  # TODO: Confirm this is the index
              )
              raw_features: list[tuple[str, str]] = (
                  [
                      (feature, value)
                      for feature, value in spacy_word.morph.to_dict().items()
                  ]
                  if spacy_word.morph
                  else []
              )
              cltk_features = [
                  from_ud(feature_name, feature_value)
                  for feature_name, feature_value in raw_features
              ]
              cltk_word.features = MorphosyntacticFeatureBundle(
                  *cltk_features
              )
              cltk_word.category = to_categorial(cltk_word.pos)
              cltk_word.spacy_features = spacy_word.morph
              sent_words[cltk_word.index_token] = cltk_word
              words_list.append(cltk_word)
      return words_list
  
imports: from copy import deepcopy
  from dataclasses import dataclass
  from typing import Any, Dict, List, Literal, Optional, Tuple
  import spacy
  import stanza
  from boltons.cacheutils import cachedproperty
  from cltk.core.data_types import Doc, MorphosyntacticFeature, Process, Word
  from cltk.dependency.spacy_wrapper import SpacyWrapper
  from cltk.dependency.stanza_wrapper import StanzaWrapper
  from cltk.dependency.tree import DependencyTree
  from cltk.morphology.morphosyntax import MorphosyntacticFeatureBundle, from_ud, to_categorial
label_desc: Use image node_id 3 for calling the SpacyProcess obj's underlying member method code with example usage: obj.spacy_to_cltk_word_type(spacy_doc) and returns: words_list