def generate_stanford_gazettes_file(self):
        if not self.gazette_items:
            return

        overridable_classes = ",".join(self.NATIVE_CLASSES)
        self._cache_per_kind = defaultdict(list)

        gazette_format = "{}\t{}\t{}\n"
        _, filepath = tempfile.mkstemp()
        with open(filepath, "w") as gazette_file:
            for gazette in self.gazette_items:
                kname = gazette.kind.name
                if kname in self.NATIVE_CLASSES:
                    # kind will not be escaped, but tokens will be stored on cache
                    self._cache_per_kind[kname].append(gazette.text)
                else:
                    kname = "{}{}".format(self._PREFIX, kname)
                text = self.escape_text(gazette.text)
                line = gazette_format.format(text, kname, overridable_classes)
                gazette_file.write(line)
        return filepath
Generates the gazettes file if there's any. Returns
dataset/ETHPy150Open machinalis/iepy/iepy/preprocess/stanford_preprocess.py/GazetteManager.generate_stanford_gazettes_file