Class
Finder
Holds the haystack and a current search context.
Finder<THaystack[, TSpec]>
Include Headers
seqan/find.h
Parameters
THaystack
The haystack type.
Types: Index, String
TSpec
The index-algorithm to search with (Optional).
Default: The result of DefaultFinder
Remarks: Leave empty for online pattern matching (see Pattern).
If THaystack is an Index, then TSpec specifies the index search algorithm.
Remarks
position(finder) returns the position of the current hit in the haystack. If THaystack is a set of strings or an index of a set of strings, then position(finder) returns a Pair (hayNo, pos), in which hayNo is the haystack index and pos the local position of the hit.
To reset the finder object and use it on another text or different text position, use clear(finder) Note that clear(finder) doesn't move the text iterator. To start the search from the beginning or somewhere else in the text, use goBegin or setPosition.
Specializations
BacktrackingProvides approximate string matching via backtracking on a substring index.
PigeonholeProvides a fast filter alogrithm that uses the pigeonhole lemma, i.e. if a pattern matches with k errors in the text, every partition into k+1 parts contains one part that matches without error.
SwiftProvides a fast filter alogrithm that guarantees to find all regions overlapping with potential ε-matches. An ε-match is a matching region of minimal length and an error rate of at most ε.
Metafunctions
ContainerType of the container given an iterator.
DifferenceType of an object that stores the difference between two iterators.
HaystackReturns the haystack type of a Finder type.
HostType of the object a given object depends on.
IteratorType of iterator objects that are used to traverse the container.
ValueType of the items in the container or behind an iterator.
Member Functions
FinderConstructor
Functions
beginThe begin of a container.
beginPositionBegin position of object in host.
clearResets an object.
endThe end of a container.
endPositionEnd position of object in host.
findSearch for a Pattern in a Finder object.
findBeginSearch the begin of an approximate match.
haystackReturns the haystack of a Finder object.
infixReturns the segment of the last found match in haystack.
lengthThe number of items/characters.
positionPosition of an iterator.
setHaystackSets the haystack of a Finder object.
setPositionSets the position of a finder.
Examples
The following example shows how to restart a search from the beginning of a text.
CharString hstck = "I spy with my little eye something that is yellow";
Finder<CharString> finder(hstck);
 
Pattern<CharString, Horspool> p1("y");
findAll(finder, p1);
 
goBegin(finder);    // move Finder to the beginning of the text
clear(finder);      // reset Finder
 
Pattern<CharString, Horspool> p2("t");
findAll(finder, p2);
SeqAn - Sequence Analysis Library - www.seqan.de
 

Page built @2013/07/11 09:12:16