/*!
* @concept TextConcept
*
* @headerfile <seqan/sequence.h>
*
* @brief Concept for a type that can be as text of an index.
*
* @signature concept TextConcept;
*
* 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 String
* @see StringSet
*
* @mfn TextConcept#StringSetLimits
*
* @brief Return type of string set limits for TextConcept types.
*
* @signature StringSetLimits<TText>::Type;
*
* @tparam TText The type of the text.
*
* @return Type The type of string set limits objects.
*
* @mfn TextConcept#SAValue
*
* @brief The default alphabet type of a suffix array, i.e. the type to store a
* position of a string or string set.
*
* @signature SAValue<TText>::Type
*
* @tparam TText The text type to query.
*
* @return TReturn A type to store a position in a <tt>TText</tt>. This could be
* an integer for strings or a pair of integers for string sets.
*
* @section Usage
*
* This type should be removed for functions returning positions in texts such
* as online or index-based search. Thus, always use this metafunction for
* declaring position variables.
*
* Use the functions @link TextConcept#posLocalize @endlink, @link
* TextConcept#posGlobalize @endlink, @link TextConcept#getSeqNo @endlink, and
* @link TextConcept#getSeqOffset @endlink for conversion between local and
* global positions in texts.
*
* @section Examples
*
* The following shows the original definition of the SAValue metafunction in
* SeqAn.
*
* @code{.cpp}
* template <typename TString, typename TSpec>
* struct SAValue<StringSet<TString, TSpec> >
* {
* typedef Pair<
* typename Size<StringSet<TString, TSpec> >::Type,
* typename SAValue<TString>::Type,
* Pack
* > Type;
* };
* @endcode
*
*
* @fn TextConcept#stringSetLimits
*
* @brief Return string delimiter positions for TextConcept types.
*
* @signature TStringSetLimits stringSetLimits(text);
*
* @param[in] text The text to query for its string set limits.
*
* @return TStringSetLimits The string set limits (of type @link
* TextConcept#StringSetLimits @endlink).
*
* @fn TextConcept#posLocalToX
*
* @brief Converts a local to a local/global position.
*
* @signature void posLocalToX(dst, localPos, limits);
*
* @param[in] dst The local or global position (pair or integer value) is
* written here.
* @param[in] localPos The local position.
* @param[in] limits The string limits as returned by @link
* TextConcept#stringSetLimits @endlink.
*
* @fn TextConcept#posLocalize
*
* @headerfile <seqan/sequence.h>
*
* @brief Converts a local/global to a local position.
*
* @signature void posLocalize(result, pos, limits)
*
* @param[in] pos A local or global position (pair or integer value).
* @param[in] limits The limits string returned by @link
* TextConcept#stringSetLimits @endlink.
* @param[in] result Reference to the resulting corresponding local position of
* <tt>pos</tt>.
*
* @fn TextConcept#posGlobalize
*
* @headerfile <seqan/sequence.h>
*
* @brief Converts a local/global to a global position.
*
* @signature TPos posGlobalize(pos, limits)
*
* @param[in] pos A local or global position (pair or integer value). Types:
* Pair
* @param[in] limits The limits string returned by @link
* TextConcept#stringSetLimits @endlink.
*
* @return TPos The corresponding global position of <tt>pos</tt>. If
* <tt>pos</tt> is an integral type <tt>pos</tt> is returned. If
* not, <tt>limits[getSeqNo(pos, limits)] + getSeqOffset(pos,
* limits)</tt> is returned.
*
* @fn TextConcept#getSeqNo
*
* @headerfile <seqan/sequence.h>
*
* @brief Returns the sequence number of a position.
*
* @signature TSeqNo getSeqNo(pos[, limits]);
*
* @param[in] pos A position. Types: Pair
* @param[in] limits The limits string returned by @link
* TextConcept#stringSetLimits @endlink.
*
* @return TSeqNo A single integer value that identifies the string within the
* stringset <tt>pos</tt> points at. If <tt>limits</tt> is
* omitted or @link Nothing @endlink <tt>getSeqNo</tt> returns
* 0.If <tt>pos</tt> is a local position (of class @link Pair
* @endlink) then <tt>i1</tt> is returned.If <tt>pos</tt> is a
* global position (integer type and <tt>limits</tt> is a @link
* String @endlink) then <tt>pos</tt> is converted to a local
* position and <tt>i1</tt> is returned.
*
* @fn TextConcept#getSeqOffset
*
* @headerfile <seqan/sequence.h>
*
* @brief Returns the local sequence offset of a position.
*
* @signature TOffset getSeqOffset(pos[, limits]);
*
* @param[in] pos A position. Types: Pair
* @param[in] limits The limits string returned by @link
* TextConcept#stringSetLimits @endlink.
*
* @return TOffset A single integer value that identifies the position within
* the string <tt>pos</tt> points at.If <tt>limits</tt> is
* omitted or @link Nothing @endlink <tt>getSeqNo</tt> returns
* <tt>pos</tt>. If <tt>pos</tt> is a local position (of class
* @link Pair @endlink) then <tt>i2</tt> is returned.If
* <tt>pos</tt> is a global position (integer type and
* <tt>limits</tt> is a @link String @endlink) then <tt>pos</tt>
* is converted to a local position and <tt>i2</tt> is returned.
*/