def prepare_special_error_type(source, target, error_type, charset=None):
    """
    Remove all non-matching words from both the source and the target string.

    Args:
        source (str): Source string.
        target (str): Target string.
        error_type (str): One of: 'copy_chars', 'uppercase', 'digits',
            'punctuation', 'symbols'. Other strings are ignored and the
            standard word error rate will be calculated.
        charset (set): the set with all characters (or strings)
            to be considered. Defaults to None.

    Returns:
        tuple (list, list): a tuple with the source and the target strings.

    """

    if error_type == 'copy_chars':
        source = [word for word in source if
                  all(c in charset for c in word)]
        target = [word for word in target
                  if all(c in charset for c in word) and word in source]

    elif error_type == 'uppercase':
        source = [word for word in source
                  if any(c.isupper() for c in word)]
        target = [word for word in target
                  if any(c.isupper() for c in word)]

    elif error_type == 'digits':
        source = [word for word in source
                  if any(c.isdigit() for c in word)]
        target = [word for word in target
                  if any(c.isdigit() for c in word)]

    elif error_type in ('punctuation', 'symbols'):
        source = [word for word in source if word in charset]
        target = [word for word in target if word in charset]

    return source, target