code: def augment_apos(sents):
      """
      If there are no instances of ’ in the dataset, but there are instances of ',
      we replace some fraction of ' with ’ so that the tokenizer will recognize it.
  
      # TODO: we could do it the other way around as well
      """
      has_unicode_apos = False
      has_ascii_apos = False
      for sent_idx, sent in enumerate(sents):
          if len(sent) == 0:
              raise AssertionError(
                  "Got a blank sentence in position %d!" % sent_idx
              )
          for line in sent:
              if line.startswith("# text"):
                  if line.find("'") >= 0:
                      has_ascii_apos = True
                  if line.find("’") >= 0:
                      has_unicode_apos = True
                  break
          else:
              raise ValueError(
                  "Cannot find '# text' in sentences %d.  First line: %s"
                  % (sent_idx, sent[0])
              )
  
      if has_unicode_apos or not has_ascii_apos:
          return sents
  
      new_sents = []
      for sent in sents:
          if random.random() > 0.05:
              new_sents.append(sent)
              continue
          new_sent = []
          for line in sent:
              if line.startswith("# text"):
                  new_sent.append(line.replace("'", "’"))
              elif line.startswith("#"):
                  new_sent.append(line)
              else:
                  pieces = line.split("\t")
                  pieces[1] = pieces[1].replace("'", "’")
                  new_sent.append("\t".join(pieces))
          new_sents.append(new_sent)
  
      return new_sents
  
imports: import argparse
  import glob
  import os
  import random
  import re
  import tempfile
  from collections import Counter
  from stanza.models.common.constant import treebank_to_short_name
  import stanza.utils.datasets.common
  from stanza.utils.datasets.common import read_sentences_from_conllu, write_sentences_to_conllu, INT_RE, MWT_RE, MWT_OR_COPY_RE
  import stanza.utils.datasets.tokenization.convert_ml_cochin
  import stanza.utils.datasets.tokenization.convert_my_alt
  import stanza.utils.datasets.tokenization.convert_vi_vlsp
  import stanza.utils.datasets.tokenization.convert_th_best
  import stanza.utils.datasets.tokenization.convert_th_lst20
  import stanza.utils.datasets.tokenization.convert_th_orchid
label_desc: Use image node_id 11 for calling a global function with example usage: augment_apos(sents) and returns: new_sents, sents