Convert distance method to h, v, p, and s.

def convertdistmethod(method_str):
        """Convert distance method to h, v, p, and s."""
        if StringClass.string_match(method_str, 'Horizontal'):
            return 'h'
        elif StringClass.string_match(method_str, 'Vertical'):
            return 'v'
        elif StringClass.string_match(method_str, 'Pythagoras'):
            return 'p'
        elif StringClass.string_match(method_str, 'Surface'):
            return 's'
        elif method_str.lower() in ['h', 'v', 'p', 's']:
            return method_str.lower()
        else:
            return 's'