def auto_usecols(search, exclude, show, usecols, coref=False):
    """
    Figure out if we can speed up conll parsing based on search,
    exclude and show. the return value is passed to pandas.read_csv
    so that only relevant columns are parsed.

    If usecols isn't None, the user has specified needed cols.

    todo: coref
    """
    if usecols:
        return usecols
    from corpkit.constants import CONLL_COLUMNS
    needed = []
    for i in search.keys():
        if 'g' in i or i == 'g':
            needed.append('d')
        elif 'd' in i or i == 'd':
            needed.append('g')
        elif 'h' in i or i == 'h':
            needed.append('c')
        elif 'r' in i or i == 'r':
            needed.append('c')
        elif i == 'v':
            needed.append('f')
            needed.append('w')
            needed.append('p')
            continue
        needed.append(i)
    if isinstance(exclude, dict):
        for i in exclude.keys():
            needed.append(i)
    if isinstance(show, list):
        for i in show:
            if i.endswith('a'):
                needed.append('g')
            if i.startswith('r') or i.startswith('h'):
                needed.append('c')
            i = i.replace('a', 'f').replace('x', 'p')
            needed.append(i)
    else:
        needed.append(show)
    if coref:
        needed.append('c')
    stcols = []
    for i in needed:
        stcols.append(i[-1])
        try:
            stcols.append(i[-2])
        except:
            pass
    out = [0, 1, 2]
    for n, c in enumerate(CONLL_COLUMNS, start=1):
        if c in stcols and n not in out:
            out.append(n)
    return out
