# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major
# 
# INPUTFUNC = input if PYTHON_VERSION == 3 else raw_input


from corpkit.constants import STRINGTYPE, PYTHON_VERSION, INPUTFUNC
    from time import localtime, strftime
    from corpkit.textprogressbar import TextProgressBar
    from corpkit.process import animator
                from zipfile import BadZipfile
    from time import localtime, strftime
    from zipfile import BadZipfile
    from subprocess import PIPE, STDOUT, Popen
    from subprocess import PIPE, STDOUT, Popen
    from corpkit.process import get_corenlp_path
    from time import localtime, strftime
    from corpkit.constants import CORENLP_URL as url
        from corpkit.constants import CORENLP_VERSION
    from corpkit.constants import CORENLP_VERSION
    from corpkit.process import saferead
    from corpkit.constants import MAX_SPEAKERNAME_SIZE
        from time import localtime, strftime
    from corpkit.corpus import Corpus
    from corpkit.constants import OPENER, PYTHON_VERSION, MAX_METADATA_FIELDS
            from corpkit.process import saferead
    from corpkit.process import saferead
    from corpkit.constants import MAX_METADATA_VALUES
    from glob import glob
    from glob import glob
    from corpkit.process import makesafe
    import os
    import shutil
    import glob
    import zipfile
        import __main__ as main
            import requests
            import traceback
    import zipfile
    import os
    import fnmatch
    import os
    import corpkit
    import subprocess
    import subprocess
    import os
    import sys
    import re
    import chardet
    import time
            import shutil
        import glob
            import importlib
    import corpkit
    import shutil
    import os
    import fnmatch
    import corpkit
    import os
    import os
    import os
    import re
    import shutil
    import os
    import re
    import os
    import re
    import os
    import re
    import os
    import os
    import shutil
                    print('%s: Speaker names found: %s ... ' % (thetime, ', '.join(sorted(set(names[:20])))))
            except:
                pass

def get_all_metadata_fields(corpus, include_speakers=False):
    """
    Get a list of metadata fields in a corpus

    This could take a while for very little infor
    """

    # allow corpus object
    if not isinstance(corpus, Corpus):
        corpus = Corpus(corpus, print_info=False)
    if not corpus.datatype == 'conll':
        return []

    path = getattr(corpus, 'path', corpus)

    fs = []
    for root, dirnames, filenames in os.walk(path):
        for filename in filenames:
            fs.append(os.path.join(root, filename))

    badfields = ['parse', 'sent_id']
    if not include_speakers:
        badfields.append('speaker')

    fields = set()
    for f in fs:

# Path: corpkit/constants.py
# STRINGTYPE = str if PYTHON_VERSION == 3 else basestring
# 
# PYTHON_VERSION = sys.version_info.major
# 
# INPUTFUNC = input if PYTHON_VERSION == 3 else raw_input


# Path: corpkit/build.py
from corpkit.constants import STRINGTYPE, PYTHON_VERSION, INPUTFUNC
    from time import localtime, strftime
    from corpkit.textprogressbar import TextProgressBar
    from corpkit.process import animator
                from zipfile import BadZipfile
    from time import localtime, strftime
    from zipfile import BadZipfile
    from subprocess import PIPE, STDOUT, Popen
    from subprocess import PIPE, STDOUT, Popen
    from corpkit.process import get_corenlp_path
    from time import localtime, strftime
    from corpkit.constants import CORENLP_URL as url
        from corpkit.constants import CORENLP_VERSION
    from corpkit.constants import CORENLP_VERSION
    from corpkit.process import saferead
    from corpkit.constants import MAX_SPEAKERNAME_SIZE
        from time import localtime, strftime
    from corpkit.corpus import Corpus
    from corpkit.constants import OPENER, PYTHON_VERSION, MAX_METADATA_FIELDS
            from corpkit.process import saferead
    from corpkit.process import saferead
    from corpkit.constants import MAX_METADATA_VALUES
    from glob import glob
    from glob import glob
    from corpkit.process import makesafe
    import os
    import shutil
    import glob
    import zipfile
        import __main__ as main
            import requests
            import traceback
    import zipfile
    import os
    import fnmatch
    import os
    import corpkit
    import subprocess
    import subprocess
    import os
    import sys
    import re
    import chardet
    import time
            import shutil
        import glob
            import importlib
    import corpkit
    import shutil
    import os
    import fnmatch
    import corpkit
    import os
    import os
    import os
    import re
    import shutil
    import os
    import re
    import os
    import re
    import os
    import re
    import os
    import os
    import shutil

                    print('%s: Speaker names found: %s ... ' % (thetime, ', '.join(sorted(set(names[:20])))))
            except:
                pass

def get_all_metadata_fields(corpus, include_speakers=False):
    """
    Get a list of metadata fields in a corpus

    This could take a while for very little infor
    """

    # allow corpus object
    if not isinstance(corpus, Corpus):
        corpus = Corpus(corpus, print_info=False)
    if not corpus.datatype == 'conll':
        return []

    path = getattr(corpus, 'path', corpus)

    fs = []
    for root, dirnames, filenames in os.walk(path):
        for filename in filenames:
            fs.append(os.path.join(root, filename))

    badfields = ['parse', 'sent_id']
    if not include_speakers:
        badfields.append('speaker')

    fields = set()
    for f in fs:

        if PYTHON_VERSION == 2: