Multi-Method Dispatching: A Geometric Approach With Applications to String Matching Problems