def clean_quals(vec):
    """Extracts and cleans qualifier values from the vector of arguments.
    Qualifiers are generally usage or other notes such as "archaic",
    "colloquial", "chemistry", "british", etc.  There is no standard set
    of values for them and the set probably varies from language to
    language."""
    assert isinstance(vec, (list, tuple))
    for x in vec:
        assert isinstance(x, str)
    tags = []
    for i in range(len(vec)):
        x = vec[i]
        i += 1
        if x in ('en', 'fi'):
            print('clean_quals: WARNING: {} in vec: {}'.format(x, vec))
            continue
        while i < len(vec) - 1 and vec[-1] in ('usually', 'often', 'rarely',
            'strongly', 'extremely', 'including', 'chiefly', 'sometimes',
            'mostly', 'with', 'now'):
            x += ' ' + vec[i]
            i += 1
        while i < len(vec) - 2 and vec[i] in ('_', 'and', 'or'):
            x += ' ' + vec[i + 1]
            i += 2
        tags.append(x)
    return tags
