def read_line_with_filter(
        fp,
        filter_length=None,
        preprocessing_fn=None):
    """ Reads one line from `fp`, filters by `filter_length` and
      does preprocessing if provided.

    Args:
        fp: A file identifier.
        filter_length: An integer, the maximum length of one line.
        preprocessing_fn: A callable function.

    Returns: A list.
    """
    line = fp.readline()
    if line == "":
        return ""
    tokens = line.strip()
    if preprocessing_fn:
        tokens = preprocessing_fn(tokens)
    if filter_length and len(tokens) > filter_length:
        return None
    return tokens