code: def make_doc_from_text_chunks(
      text: str, lang: types.LangLike, chunk_size: int = 100000
  ) -> Doc:
      """
      Make a single spaCy-processed document from 1 or more chunks of ``text``.
      This is a workaround for processing very long texts, for which spaCy
      is unable to allocate enough RAM.
  
      Args:
          text: Text document to be chunked and processed by spaCy.
          lang: Language with which spaCy processes ``text``, represented as
              the full name of or path on disk to the pipeline, or
              an already instantiated pipeline instance.
          chunk_size: Number of characters comprising each text chunk
              (excluding the last chunk, which is probably smaller).
              For best performance, value should be somewhere between 1e3 and 1e7,
              depending on how much RAM you have available.
  
              .. note:: Since chunking is done by character, chunks edges' probably
                 won't respect natural language segmentation, which means that every
                 ``chunk_size`` characters, spaCy's models may make mistakes.
  
      Returns:
          A single processed document, built from concatenated text chunks.
      """
      utils.deprecated(
          "This function is deprecated, and will be removed in a future version. "
          "Instead, use the usual :func:`textacy.make_spacy_doc()` "
          "and specify a non-null `chunk_size`",
          action="once",
      )
      lang = resolve_langlike(lang)
      text_chunks = (
          text[i : i + chunk_size]
          for i in range(0, len(text), chunk_size)
      )
      docs = list(lang.pipe(text_chunks))
      return Doc.from_docs(docs)
  
imports: from __future__ import annotations
  import functools
  import itertools
  import pathlib
  from typing import Iterable, Union
  from cachetools import cached
  from cachetools.keys import hashkey
  from spacy import attrs
  from spacy.language import Language
  from spacy.morphology import Morphology
  from spacy.pipeline import Morphologizer
  from spacy.symbols import PROPN, VERB
  from spacy.tokens import Doc, Span, Token
  from ..None import cache, constants, errors, types, utils
  from .None import core
label_desc: Use image node_id 1 for calling a global function with example usage: make_doc_from_text_chunks(text, lang, chunk_size) and returns: Doc