Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Public Types | Public Member Functions | Friends

boost::locale::boundary::boundary_point_index< BaseIterator > Class Template Reference
[Boundary Analysis]

This class holds an index of boundary points and allows iterating over them. More...

#include <boost/locale/boundary/index.hpp>

List of all members.

Public Types

typedef BaseIterator base_iterator
typedef unspecified_iterator_type iterator
typedef unspecified_iterator_type const_iterator
typedef boundary_point
< base_iterator

Public Member Functions

 boundary_point_index ()
 boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, std::locale const &loc=std::locale())
 boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
 boundary_point_index (segment_index< base_iterator > const &other)
boundary_point_index const & operator= (segment_index< base_iterator > const &other)
void map (boundary_type type, base_iterator begin, base_iterator end, std::locale const &loc=std::locale())
iterator begin () const
iterator end () const
iterator find (base_iterator p) const
rule_type rule () const
void rule (rule_type v)


class segment_index< base_iterator >

Detailed Description

template<typename BaseIterator>
class boost::locale::boundary::boundary_point_index< BaseIterator >

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.

  • Even an empty text range [x,x) considered to have a one boundary point x.
  • a and b points of the range [a,b) are always considered boundary points regardless the rules used.
  • Changing any of the option rule() or course re-indexing the text invalidates existing iterators and they can't be used any more.
  • boundary_point_index can be created from segment_index or other boundary_point_index that was created with same boundary_type. This is very fast operation as they shared same index and it does not require its regeneration.
See also:

Member Typedef Documentation

template<typename BaseIterator >
typedef BaseIterator boost::locale::boundary::boundary_point_index< BaseIterator >::base_iterator

The type of the iterator used to iterate over the original text

The documentation for this class was generated from the following file: