def tabular2dict(tabular, keys):
    """
    Utility function to turn tabular format CONLL data into a
    sequence of dictionaries.
    @param tabular: tabular input
    @param keys: a dictionary that maps field positions into feature names
    @rtype: C{list} of featuresets
    """
    tokendicts = []
    lines = tabular.splitlines()
    for line in lines:
        line = line.strip()
        line = line.split()
        if line:
            tokendict = {}
            for i in range(len(line)):
                key = keys[i]
                tokendict [key] = line[i]
            tokendicts.append(tokendict )
    return tokendicts