Concept TextConceptConcept for a type that can be as text of an index.
Concept for a type that can be as text of an index.
Defined in | <seqan/sequence.h> |
---|---|
Signature |
concept TextConcept;
|
Detailed Description
Certain algorithms and data structures can work for both strings and string sets but need to treat these two types slightly different. Examples are index data structures and algorithms that build the indices and use the indices for lookup.
To facilitate writing of generic algorithms, the TextConcept concept gives a common interface to both for this kind of algorithms.
See Also
Interface Function Overview
-
TSeqNo getSeqNo(pos[, limits]);
Returns the sequence number of a position. -
TOffset getSeqOffset(pos[, limits]);
Returns the local sequence offset of a position. -
TPos posGlobalize(pos, limits)
Converts a local/global to a global position. -
void posLocalize(result, pos, limits)
Converts a local/global to a local position. -
void posLocalToX(dst, localPos, limits);
Converts a local to a local/global position. -
TStringSetLimits stringSetLimits(text);
Return string delimiter positions for TextConcept types.
Interface Metafunction Overview
-
SAValue<TText>::Type
The default alphabet type of a suffix array, i.e. the type to store a position of a string or string set. -
StringSetLimits<TText>::Type;
Return type of string set limits for TextConcept types.
Interface Functions Detail
TSeqNo getSeqNo(pos[, limits]);
Returns the sequence number of a position.
Parameters
pos
|
A position. Types: Pair |
---|---|
limits
|
The limits string returned by stringSetLimits. |
Returns
TSeqNo |
A single integer value that identifies the string within the stringset pos points at. If limits is omitted or Nothing getSeqNo returns 0.If pos is a local position (of class Pair) then i1 is returned.If pos is a global position (integer type and limits is a String) then pos is converted to a local position and i1 is returned. |
---|
Data Races
Thread safety unknown!
TOffset getSeqOffset(pos[, limits]);
Returns the local sequence offset of a position.
Parameters
pos
|
A position. Types: Pair |
---|---|
limits
|
The limits string returned by stringSetLimits. |
Returns
TOffset |
A single integer value that identifies the position within the string pos points at.If limits is omitted or Nothing getSeqNo returns pos. If pos is a local position (of class Pair) then i2 is returned.If pos is a global position (integer type and limits is a String) then pos is converted to a local position and i2 is returned. |
---|
Data Races
Thread safety unknown!
TPos posGlobalize(pos, limits)
Converts a local/global to a global position.
Parameters
pos
|
A local or global position (pair or integer value). Types: Pair |
---|---|
limits
|
The limits string returned by stringSetLimits. |
Returns
TPos |
The corresponding global position of pos. If pos is an integral type pos is returned. If not, limits[getSeqNo(pos, limits)] + getSeqOffset(pos, limits) is returned. |
---|
Data Races
Thread safety unknown!
void posLocalize(result, pos, limits)
Converts a local/global to a local position.
Parameters
pos
|
A local or global position (pair or integer value). |
---|---|
limits
|
The limits string returned by stringSetLimits. |
result
|
Reference to the resulting corresponding local position of pos. |
Data Races
Thread safety unknown!
void posLocalToX(dst, localPos, limits);
Converts a local to a local/global position.
Parameters
dst
|
The local or global position (pair or integer value) is written here. |
---|---|
localPos
|
The local position. |
limits
|
The string limits as returned by stringSetLimits. |
Data Races
Thread safety unknown!
TStringSetLimits stringSetLimits(text);
Return string delimiter positions for TextConcept types.
Parameters
text
|
The text to query for its string set limits. |
---|
Returns
TStringSetLimits |
The string set limits (of type StringSetLimits). |
---|
Data Races
Thread safety unknown!