Boost.Locale
|
This class holds an index of boundary points and allows iterating over them. More...
#include <boost/locale/boundary/index.hpp>
Public Types | |
typedef BaseIterator | base_iterator |
The type of the iterator used to iterate over the original text. | |
typedef unspecified_iterator_type | iterator |
typedef unspecified_iterator_type | const_iterator |
typedef boundary_point< base_iterator > | value_type |
Public Member Functions | |
boundary_point_index () | |
boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, const std::locale &loc=std::locale()) | |
boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale()) | |
boundary_point_index (const segment_index< base_iterator > &other) | |
boundary_point_index & | operator= (const segment_index< base_iterator > &other) |
void | map (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale()) |
iterator | begin () const |
iterator | end () const |
iterator | find (base_iterator p) const |
rule_type | rule () const |
Get the mask of rules that are used. | |
void | rule (rule_type v) |
Set the mask of rules that are used. | |
Friends | |
class | segment_index< base_iterator > |
This class holds an index of boundary points and allows iterating over them.
This class is provides begin() and end() member functions that return bidirectional iterators to the boundary_point objects.
It provides an option that affects selecting boundary points according to different rules: using rule(rule_type mask) member function. It allows to set a mask that select only specific types of boundary points like sentence_term.
For example for a sentence boundary analysis of a text "Hello! How\nare you?" when the default rule is used the boundary points would be:
However if rule() is set to sentence_term then the selected boundary points would be:
Such that a boundary point defined by a line feed character would be ignored.
This class allows to find a boundary_point according to the given iterator in range using find() member function.