def get_min_token_filter(min_tokens):
    """
    This function returns a filter which drops any document whose total number
    of tokens is less than min_tokens.

    This filter does not alter record_dict, but instead returns either true or
    false indicating whether to document should be kept or not.

    Parameters
    ----------
    min_tokens : numeric

    Returns
    -------
    min_token_filter : function

    Note
    ----
    If the goal is to only keep documents whose final token count is greater
    than min_tokens, this filter should be used last.
    """
    def min_token_filter(record_dict):
        token_count = sum(record_dict['feature_values'].values())
        keep_doc = token_count >= min_tokens
        return keep_doc
    return min_token_filter