Boost.Locale
|
a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it. More...
#include <boost/locale/boundary/segment.hpp>
Public Types | |
typedef std::iterator_traits < IteratorType >::value_type | char_type |
typedef std::basic_string < char_type > | string_type |
typedef char_type | value_type |
typedef IteratorType | iterator |
typedef IteratorType | const_iterator |
typedef std::iterator_traits < IteratorType > ::difference_type | difference_type |
Public Member Functions | |
segment () | |
segment (iterator b, iterator e, rule_type r) | |
void | begin (iterator const &v) |
void | end (iterator const &v) |
IteratorType | begin () const |
IteratorType | end () const |
template<class T , class A > | |
operator std::basic_string< char_type, T, A > () const | |
string_type | str () const |
size_t | length () const |
bool | empty () const |
rule_type | rule () const |
void | rule (rule_type r) |
bool | operator== (segment const &other) |
Compare two segments. | |
bool | operator!= (segment const &other) |
Compare two segments. | |
a segment object that represents a pair of two iterators that define the range where this segment exits and a rule that defines it.
This type of object is dereferenced by the iterators of segment_index. Using a rule() member function you can get a specific rule this segment was selected with. For example, when you use word boundary analysis, you can check if the specific word contains Kana letters by checking (rule() & word_kana)!=0 For a sentence analysis you can check if the sentence is selected because a sentence terminator is found (sentence_term) or there is a line break (sentence_sep).
This object can be automatically converted to std::basic_string with the same type of character. It is also valid range that has begin() and end() member functions returning iterators on the location of the segment.
typedef std::iterator_traits<IteratorType>::value_type boost::locale::boundary::segment< IteratorType >::char_type |
The type of the underlying character
typedef IteratorType boost::locale::boundary::segment< IteratorType >::const_iterator |
The iterator that allows to iterate the range
typedef std::iterator_traits<IteratorType>::difference_type boost::locale::boundary::segment< IteratorType >::difference_type |
The type that represent a difference between two iterators
typedef IteratorType boost::locale::boundary::segment< IteratorType >::iterator |
The iterator that allows to iterate the range
typedef std::basic_string<char_type> boost::locale::boundary::segment< IteratorType >::string_type |
The type of the string it is converted to
typedef char_type boost::locale::boundary::segment< IteratorType >::value_type |
The value that iterators return - the character itself
|
inline |
Default constructor
|
inline |
Create a segment using two iterators and a rule that represents this point
|
inline |
Set the start of the range
|
inline |
Get the start of the range
|
inline |
Check if the segment is empty
|
inline |
Set the end of the range
|
inline |
Set the end of the range
|
inline |
Get the length of the text chunk
|
inline |
Convert the range to a string automatically
|
inline |
Get the rule that is used for selection of this segment.
|
inline |
Set a rule that is used for segment selection
|
inline |
Create a string from the range explicitly