import re


def split_component_code(code, wordform):
    """
    Split morphological paradigm code into its components.

    Morphological paradigm codes in Reynaert's encoding scheme consist of 8
    subcomponents. These are returned as separate entries of a dictionary from
    this function.
    """
    regex = r'Z(?P<Z>\d{4})Y(?P<Y>\d{4})X(?P<X>\d{4})W(?P<W>\d{8})V(?P<V>\d{4})_(?P<wt_code>\w{3})(?P<wt_num>\d{3})?'
    match = re.search(regex, code)
    if match:
        wt_num = None
        if match.group('wt_num'):
            wt_num = int(match.group('wt_num'))
        return {'Z': int(match.group('Z')),
                'Y': int(match.group('Y')),
                'X': int(match.group('X')),
                'W': int(match.group('W')),
                'V': int(match.group('V')),
                'word_type_code': match.group('wt_code'),
                'word_type_number': wt_num,
                'wordform': wordform}
    return None