import io


def parse(filename):
    """Read `filename` and parse tab-separated file of word and count pairs."""
    with io.open(filename, encoding='utf-8') as reader:
        lines = (line.split('\t') for line in reader)
        return dict((word, float(number)) for word, number in lines)