Class
Finder
Holds the haystack and a current search context.
Include Headers
seqan/find.h
Parameters
The haystack type. | |
The index-algorithm to search with (Optional). Default: The result of DefaultFinder Remarks: Leave empty for online pattern matching (see Pattern). |
Remarks
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
Provides approximate string matching via backtracking on a substring index. | |
Provides 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. | |
Provides 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
Type of the container given an iterator. | |
Type of an object that stores the difference between two iterators. | |
Returns the haystack type of a Finder type. | |
Type of the object a given object depends on. | |
Type of iterator objects that are used to traverse the container. | |
Type of the items in the container or behind an iterator. |
Member Functions
Constructor |
Functions
The begin of a container. | |
Begin position of object in host. | |
Resets an object. | |
The end of a container. | |
End position of object in host. | |
Search for a Pattern in a Finder object. | |
Search the begin of an approximate match. | |
Returns the haystack of a Finder object. | |
Returns the segment of the last found match in haystack. | |
The number of items/characters. | |
Position of an iterator. | |
Sets the haystack of a Finder object. | |
Sets the position of a finder. |
Examples
The following example shows how one can search online for a pattern in a haystack. Note that it is neccessary to reset the finder befor searching for another pattern.
File "finder_online.cpp"
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
21 |
Hit at position: 12
Hit at position: 22
Hit at position: 43
Hit at position: 8
Hit at position: 16
Hit at position: 17
Hit at position: 29
Hit at position: 35
Hit at position: 38
In contrast to the example above the code below shows how one can use a Finder with an index as base. Again, note that it is neccessary to reset the finder befor searching for another pattern.
File "finder_index.cpp"
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 |
Hit at position: 4
Hit at position: 22
Hit at position: 43
Hit at position: 38
Hit at position: 8
Hit at position: 35
Hit at position: 29
Hit at position: 17
Hit at position: 16
Example Programs
SeqAn - Sequence Analysis Library - www.seqan.de