This class holds an index of boundary points and allows iterating over them. More...
#include <index.hpp>
Public Types | |
typedef BaseIterator | base_iterator |
The type of the iterator used to iterate over the original text. More... | |
typedef details::boundary_point_index_iterator < base_iterator > | iterator |
typedef details::boundary_point_index_iterator < base_iterator > | const_iterator |
typedef boundary_point < base_iterator > | value_type |
The type dereferenced by the iterator and const_iterator. More... | |
Public Member Functions | |
boundary_point_index () | |
Default constructor. More... | |
boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale()) | |
Create a segment_index for boundary analysis type of the text in range [begin,end) using a rule mask for locale loc. More... | |
boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale()) | |
Create a segment_index for boundary analysis type of the text in range [begin,end) selecting all possible boundary points (full mask) for locale loc. More... | |
boundary_point_index (segment_index< base_iterator > const &other) | |
Create a boundary_point_index from a segment_index. More... | |
boundary_point_index const & | operator= (segment_index< base_iterator > const &other) |
Copy a boundary_point_index from a segment_index. More... | |
void | map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale()) |
Create a new index for boundary analysis type of the text in range [begin,end) for locale loc. More... | |
iterator | begin () const |
Get the iterator on the beginning of the boundary points range. More... | |
iterator | end () const |
Get the iterator on the ending of the boundary points range. More... | |
iterator | find (base_iterator p) const |
Find a first valid boundary point on a position p or following it. More... | |
rule_type | rule () const |
Get the mask of rules that are used. More... | |
void | rule (rule_type v) |
Set the mask of rules that are used. More... | |
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.