Refactored hierarchical matcher to segment matcher.  Built in and tested generalization and added example.