<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fromRoman(strng):
 """convert Roman numeral to integer"""

    if not strng:
        raise TypeError('Input can not be blank')
    if not romanNumeralPattern.search(strng):
        raise ValueError('Invalid Roman numeral: %s', strng)

    result = 0
    index = 0
    for numeral, integer in romanNumeralMap:
        while strng[index:index+len(numeral)] == numeral:
            result += integer
            index += len(numeral)
    return result