def select_text(objs, lang_field, text_field):
    """Select the longest English-language text field from
    a family of PATSTAT applications. In the case where there
    are no English-language objects, the longest other text
    field is returned.

    Args:
        objs (list of dict): Group of PATSTAT objects of the same appl family.
                             Objects may be, for example, application titles
                             or application abstracts objects.
        lang_field (str): Name of the field indicating the written language
                          of each object.
        text_field (str): Name of the field indicating the text data
                          of the objects.
    Returns:
        text_data (str): The selected exemplar of text data
                         for all of these objects.
    """
    if len(objs) == 0:
        return None
    # Filter English language objects
    _objs = [t for t in objs if t[lang_field] == 'en']
    # If no English language objects, use all objects
    if len(_objs) == 0:
        _objs = objs
    # Select the object with the longest passage of text
    obj = sorted(_objs, key=lambda x: len(x[text_field]), reverse=True)[0]
    return obj[text_field]