code: def read_constituency_sentences(fin):
      """
      Reads the lines from the constituency treebank and splits into ID, text
  
      No further processing is done on the trees yet
      """
      sentences = []
      for line in fin:
          line = line.strip()
          # WTF why doesn't strip() remove this
          line = line.replace("\ufeff", "")
          if not line:
              continue
          sent_id, sent_text = line.split(maxsplit=1)
          # we have seen a couple different versions of this sentence header
          # although one file is always consistent with itself, at least
          if not sent_id.startswith(
              "#ID=sent"
          ) and not sent_id.startswith("ID#sent"):
              raise ValueError(
                  "Unexpected start of sentence: |{}|".format(sent_id)
              )
          if not sent_text:
              raise ValueError("Empty text for |{}|".format(sent_id))
          sentences.append((sent_id, sent_text))
      return sentences
  
imports: from collections import defaultdict, deque, namedtuple
  import itertools
  import os
  import re
  import sys
  from tqdm import tqdm
  from stanza.models.constituency.tree_reader import read_trees, UnclosedTreeError, ExtraCloseTreeError
  from stanza.server import tsurgeon
  from stanza.utils.conll import CoNLL
  from stanza.utils.datasets.constituency.utils import SHARDS, write_dataset
  import stanza.utils.default_paths
label_desc: Use image node_id 1 for calling a global function with example usage: read_constituency_sentences(fin) and returns: sentences