Implementing segment-pattern-searcher