Boost.Locale: Boundary Analysis

| Boost.Locale

Classes | Typedefs | Enumerations | Functions | Friends
Boundary Analysis

## Classes
class | boost::locale::boundary::boundary_point< IteratorType >
| This class represents a boundary point in the text. More...
struct | boost::locale::boundary::break_info
| This structure is used for representing boundary points that follow the offset. More...
class | boost::locale::boundary::boundary_indexing< Char >
| This facet generates an index for boundary analysis of a given text. More...
class | boost::locale::boundary::segment_index< BaseIterator >
| This class holds an index of segments in the text range and allows to iterate over them. More...
class | boost::locale::boundary::boundary_point_index< BaseIterator >
| This class holds an index of boundary points and allows iterating over them. More...
class | boost::locale::boundary::segment< IteratorType >
| 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...

## Typedefs
typedef std::vector< break_info > | boost::locale::boundary::index_type
typedef BaseIterator | boost::locale::boundary::segment_index< BaseIterator >::base_iterator
| The type of the iterator used to iterate over the original text.
typedef unspecified_iterator_type | boost::locale::boundary::segment_index< BaseIterator >::iterator
typedef unspecified_iterator_type | boost::locale::boundary::segment_index< BaseIterator >::const_iterator
typedef segment< base_iterator > | boost::locale::boundary::segment_index< BaseIterator >::value_type
typedef BaseIterator | boost::locale::boundary::boundary_point_index< BaseIterator >::base_iterator
| The type of the iterator used to iterate over the original text.
typedef unspecified_iterator_type | boost::locale::boundary::boundary_point_index< BaseIterator >::iterator
typedef unspecified_iterator_type | boost::locale::boundary::boundary_point_index< BaseIterator >::const_iterator
typedef boundary_point< base_iterator > | boost::locale::boundary::boundary_point_index< BaseIterator >::value_type
typedef segment_index< std::string::const_iterator > | boost::locale::boundary::ssegment_index
| convenience typedef
typedef segment_index< std::wstring::const_iterator > | boost::locale::boundary::wssegment_index
| convenience typedef
typedef segment_index< std::u8string::const_iterator > | boost::locale::boundary::u8ssegment_index
| convenience typedef
typedef segment_index< std::u16string::const_iterator > | boost::locale::boundary::u16ssegment_index
| convenience typedef
typedef segment_index< std::u32string::const_iterator > | boost::locale::boundary::u32ssegment_index
| convenience typedef
typedef segment_index< const char * > | boost::locale::boundary::csegment_index
| convenience typedef
typedef segment_index< const wchar_t * > | boost::locale::boundary::wcsegment_index
| convenience typedef
typedef segment_index< const char16_t * > | boost::locale::boundary::u16csegment_index
| convenience typedef
typedef segment_index< const char32_t * > | boost::locale::boundary::u32csegment_index
| convenience typedef
typedef boundary_point_index< std::string::const_iterator > | boost::locale::boundary::sboundary_point_index
| convenience typedef
typedef boundary_point_index< std::wstring::const_iterator > | boost::locale::boundary::wsboundary_point_index
| convenience typedef
typedef boundary_point_index< std::u8string::const_iterator > | boost::locale::boundary::u8sboundary_point_index
| convenience typedef
typedef boundary_point_index< std::u16string::const_iterator > | boost::locale::boundary::u16sboundary_point_index
| convenience typedef
typedef boundary_point_index< std::u32string::const_iterator > | boost::locale::boundary::u32sboundary_point_index
| convenience typedef
typedef boundary_point_index< const char * > | boost::locale::boundary::cboundary_point_index
| convenience typedef
typedef boundary_point_index< const wchar_t * > | boost::locale::boundary::wcboundary_point_index
| convenience typedef
typedef boundary_point_index< const char16_t * > | boost::locale::boundary::u16cboundary_point_index
| convenience typedef
typedef boundary_point_index< const char32_t * > | boost::locale::boundary::u32cboundary_point_index
| convenience typedef
typedef segment< std::string::const_iterator > | boost::locale::boundary::ssegment
| convenience typedef
typedef segment< std::wstring::const_iterator > | boost::locale::boundary::wssegment
| convenience typedef
typedef segment< std::u8string::const_iterator > | boost::locale::boundary::u8ssegment
| convenience typedef
typedef segment< std::u16string::const_iterator > | boost::locale::boundary::u16ssegment
| convenience typedef
typedef segment< std::u32string::const_iterator > | boost::locale::boundary::u32ssegment
| convenience typedef
typedef segment< const char * > | boost::locale::boundary::csegment
| convenience typedef
typedef segment< const wchar_t * > | boost::locale::boundary::wcsegment
| convenience typedef
typedef segment< const char16_t * > | boost::locale::boundary::u16csegment
| convenience typedef
typedef segment< const char32_t * > | boost::locale::boundary::u32csegment
| convenience typedef
typedef uint32_t | boost::locale::boundary::rule_type
| Flags used with word boundary analysis – the type of the word, line or sentence boundary found. More...

## Enumerations
enum | boost::locale::boundary::boundary_type { boost::locale::boundary::character , boost::locale::boundary::word , boost::locale::boundary::sentence , boost::locale::boundary::line }
| This type describes a possible boundary analysis alternatives. More...

## Functions
template<typename BaseIterator >
bool | boost::locale::boundary::operator== (const BaseIterator &l, const boundary_point< BaseIterator > &r)
| Check if the boundary point r points to same location as an iterator l.
template<typename BaseIterator >
bool | boost::locale::boundary::operator!= (const BaseIterator &l, const boundary_point< BaseIterator > &r)
| Check if the boundary point r points to different location from an iterator l.
| boost::locale::boundary::segment_index< BaseIterator >::segment_index ()
| boost::locale::boundary::segment_index< BaseIterator >::segment_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, const std::locale &loc=std::locale())
| boost::locale::boundary::segment_index< BaseIterator >::segment_index (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale())
| boost::locale::boundary::segment_index< BaseIterator >::segment_index (const boundary_point_index< base_iterator > &)
segment_index & | boost::locale::boundary::segment_index< BaseIterator >::operator= (const boundary_point_index< base_iterator > &)
void | boost::locale::boundary::segment_index< BaseIterator >::map (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale())
iterator | boost::locale::boundary::segment_index< BaseIterator >::begin () const
iterator | boost::locale::boundary::segment_index< BaseIterator >::end () const
iterator | boost::locale::boundary::segment_index< BaseIterator >::find (base_iterator p) const
rule_type | boost::locale::boundary::segment_index< BaseIterator >::rule () const
| Get the mask of rules that are used.
void | boost::locale::boundary::segment_index< BaseIterator >::rule (rule_type v)
| Set the mask of rules that are used.
bool | boost::locale::boundary::segment_index< BaseIterator >::full_select () const
void | boost::locale::boundary::segment_index< BaseIterator >::full_select (bool v)
| boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index ()
| boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, rule_type mask, const std::locale &loc=std::locale())
| boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale())
| boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index (const segment_index< base_iterator > &other)
boundary_point_index & | boost::locale::boundary::boundary_point_index< BaseIterator >::operator= (const segment_index< base_iterator > &other)
void | boost::locale::boundary::boundary_point_index< BaseIterator >::map (boundary_type type, base_iterator begin, base_iterator end, const std::locale &loc=std::locale())
iterator | boost::locale::boundary::boundary_point_index< BaseIterator >::begin () const
iterator | boost::locale::boundary::boundary_point_index< BaseIterator >::end () const
iterator | boost::locale::boundary::boundary_point_index< BaseIterator >::find (base_iterator p) const
rule_type | boost::locale::boundary::boundary_point_index< BaseIterator >::rule () const
| Get the mask of rules that are used.
void | boost::locale::boundary::boundary_point_index< BaseIterator >::rule (rule_type v)
| Set the mask of rules that are used.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator== (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator!= (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator< (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator<= (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator> (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename IteratorL , typename IteratorR >
bool | boost::locale::boundary::operator>= (const segment< IteratorL > &l, const segment< IteratorR > &r)
| Compare two segments.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator== (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator!= (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator< (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator<= (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator> (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename CharType , typename Traits , typename Alloc , typename IteratorR >
bool | boost::locale::boundary::operator>= (const std::basic_string< CharType, Traits, Alloc > &l, const segment< IteratorR > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator== (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator!= (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator< (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator<= (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator> (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename Iterator , typename CharType , typename Traits , typename Alloc >
bool | boost::locale::boundary::operator>= (const segment< Iterator > &l, const std::basic_string< CharType, Traits, Alloc > &r)
| Compare string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator== (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator!= (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator< (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator<= (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator> (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename CharType , typename IteratorR >
bool | boost::locale::boundary::operator>= (const CharType *l, const segment< IteratorR > &r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator== (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator!= (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator< (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator<= (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator> (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename Iterator , typename CharType >
bool | boost::locale::boundary::operator>= (const segment< Iterator > &l, const CharType *r)
| Compare C string and segment.
template<typename CharType , typename TraitsType , typename Iterator >
std::basic_ostream< CharType, TraitsType > & | boost::locale::boundary::operator<< (std::basic_ostream< CharType, TraitsType > &out, const segment< Iterator > &seg)
| Write the segment to the stream character by character.
rule_type | boost::locale::boundary::boundary_rule (boundary_type t)
| This function returns the mask that covers all variants for specific boundary type.

## Friends
class | boost::locale::boundary::segment_index< BaseIterator >::boundary_point_index< base_iterator >
class | boost::locale::boundary::boundary_point_index< BaseIterator >::segment_index< base_iterator >

## Flags that describe a type of word selected
constexpr rule_type | boost::locale::boundary::word_none = 0x0000F
| Not a word, like white space or punctuation mark.
constexpr rule_type | boost::locale::boundary::word_number = 0x000F0
| Word that appear to be a number.
constexpr rule_type | boost::locale::boundary::word_letter = 0x00F00
| Word that contains letters, excluding kana and ideographic characters.
constexpr rule_type | boost::locale::boundary::word_kana = 0x0F000
| Word that contains kana characters.
constexpr rule_type | boost::locale::boundary::word_ideo = 0xF0000
| Word that contains ideographic characters.
constexpr rule_type | boost::locale::boundary::word_any = 0xFFFF0
| Any word including numbers, 0 is special flag, equivalent to 15.
constexpr rule_type | boost::locale::boundary::word_letters = 0xFFF00
| Any word, excluding numbers but including letters, kana and ideograms.
constexpr rule_type | boost::locale::boundary::word_kana_ideo = 0xFF000
| Word that includes kana or ideographic characters.
constexpr rule_type | boost::locale::boundary::word_mask = 0xFFFFF
| Full word mask - select all possible variants.

## Flags that describe a type of line break
constexpr rule_type | boost::locale::boundary::line_soft = 0x0F
| Soft line break: optional but not required.
constexpr rule_type | boost::locale::boundary::line_hard = 0xF0
| Hard line break: like break is required (as per CR/LF)
constexpr rule_type | boost::locale::boundary::line_any = 0xFF
| Soft or Hard line break.
constexpr rule_type | boost::locale::boundary::line_mask = 0xFF
| Select all types of line breaks.

## Flags that describe a type of sentence break
constexpr rule_type | boost::locale::boundary::sentence_term = 0x0F
| The sentence was terminated with a sentence terminator like ".", "!" possible followed by hard separator like CR, LF, PS.
constexpr rule_type | boost::locale::boundary::sentence_sep
| The sentence does not contain terminator like ".", "!" but ended with hard separator like CR, LF, PS or end of input. More...
constexpr rule_type | boost::locale::boundary::sentence_any = 0xFF
| Either first or second sentence break type;.
constexpr rule_type | boost::locale::boundary::sentence_mask = 0xFF
| Select all sentence breaking points.

## Flags that describe a type of character break.
At this point break iterator does not distinguish different kinds of characters so it is used for consistency.
constexpr rule_type | boost::locale::boundary::character_any = 0xF
| Not in use, just for consistency.
constexpr rule_type | boost::locale::boundary::character_mask = 0xF
| Select all character breaking points.

## Detailed Description

This module contains all operations required for boundary analysis of text: character, word, line and sentence boundaries

This module contains all operations required for boundary analysis of text: character, word, like and sentence boundaries

## Typedef Documentation

## ◆ const_iterator [1/2]

template<typename BaseIterator >

typedef unspecified_iterator_type boost::locale::boundary::segment_index< BaseIterator >::const_iterator

The bidirectional iterator that iterates over value_type objects.

- The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) and full_select(bool).
- The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
  segment_index<some_iterator>::iterator p=index.begin();
  segment<some_iterator> &t = *p;
  ++p;
  std::cout << t.str() << std::endl;
  boost::locale::boundary::segment
  a segment object that represents a pair of two iterators that define the range where this segment exi...
  Definition: segment.hpp:90
  boost::locale::boundary::segment::str
  string_type str() const
  Create a string from the range explicitly.
  Definition: segment.hpp:127
  boost::locale::boundary::segment_index::iterator
  unspecified_iterator_type iterator
  Definition: index.hpp:493

## ◆ const_iterator [2/2]

template<typename BaseIterator >

typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index< BaseIterator >::const_iterator

The bidirectional iterator that iterates over value_type objects.

- The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) member function.
- The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
  boundary_point_index<some_iterator>::iterator p=index.begin();
  boundary_point<some_iterator> &t = *p;
  ++p;
  rule_type r = t->rule();
  boost::locale::boundary::boundary_point
  This class represents a boundary point in the text.
  Definition: boundary_point.hpp:44
  boost::locale::boundary::boundary_point::rule
  void rule(rule_type r)
  Set an new rule value r.
  Definition: boundary_point.hpp:61
  boost::locale::boundary::boundary_point_index::iterator
  unspecified_iterator_type iterator
  Definition: index.hpp:716
  boost::locale::boundary::rule_type
  uint32_t rule_type
  Flags used with word boundary analysis – the type of the word, line or sentence boundary found.
  Definition: types.hpp:40

## ◆ index_type

typedef std::vector<break_info> boost::locale::boundary::index_type

This type holds the analysis of the text - all its break points with marks

## ◆ iterator [1/2]

template<typename BaseIterator >

typedef unspecified_iterator_type boost::locale::boundary::segment_index< BaseIterator >::iterator

The bidirectional iterator that iterates over value_type objects.

- The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) and full_select(bool).
- The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
  segment_index<some_iterator>::iterator p=index.begin();
  segment<some_iterator> &t = *p;
  ++p;
  std::cout << t.str() << std::endl;

## ◆ iterator [2/2]

template<typename BaseIterator >

typedef unspecified_iterator_type boost::locale::boundary::boundary_point_index< BaseIterator >::iterator

The bidirectional iterator that iterates over value_type objects.

- The iterators may be invalidated by use of any non-const member function including but not limited to rule(rule_type) member function.
- The returned value_type object is valid as long as iterator points to it. So this following code is wrong as t used after p was updated:
  boundary_point_index<some_iterator>::iterator p=index.begin();
  boundary_point<some_iterator> &t = *p;
  ++p;
  rule_type r = t->rule();

## ◆ rule_type

typedef uint32_t boost::locale::boundary::rule_type

Flags used with word boundary analysis – the type of the word, line or sentence boundary found.

It is a bit-mask that represents various combinations of rules used to select this specific boundary.

## ◆ value_type [1/2]

template<typename BaseIterator >

typedef segment<base_iterator> boost::locale::boundary::segment_index< BaseIterator >::value_type

The type dereferenced by the iterator and const_iterator. It is an object that represents selected segment.

## ◆ value_type [2/2]

template<typename BaseIterator >

typedef boundary_point<base_iterator> boost::locale::boundary::boundary_point_index< BaseIterator >::value_type

The type dereferenced by the iterator and const_iterator. It is an object that represents the selected boundary point.

## Enumeration Type Documentation

## ◆ boundary_type

enum boost::locale::boundary::boundary_type

This type describes a possible boundary analysis alternatives.

Enumerator
character | Analyse the text for character boundaries.
word | Analyse the text for word boundaries.
sentence | Analyse the text for Find sentence boundaries.
line | Analyse the text for positions suitable for line breaks.

## Function Documentation

## ◆ begin() [1/2]

template<typename BaseIterator >

iterator boost::locale::boundary::segment_index< BaseIterator >::begin | ( |  | ) | const
| inline

Get the iterator on the beginning of the segments range.

Preconditions: the segment_index should have a mapping

Note

The returned iterator is invalidated by access to any non-const member functions of this object

Examples
  boundary.cpp, and wboundary.cpp.

## ◆ begin() [2/2]

template<typename BaseIterator >

iterator boost::locale::boundary::boundary_point_index< BaseIterator >::begin | ( |  | ) | const
| inline

Get the iterator on the beginning of the boundary points range.

Preconditions: this boundary_point_index should have a mapping

Note

The returned iterator is invalidated by access to any non-const member functions of this object

## ◆ boundary_point_index() [1/4]

template<typename BaseIterator >

boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index | ( |  | ) |
| inline

Default constructor.

Note

When this object is constructed by default it does not include a valid index, thus calling begin(), end() or find() member functions would lead to undefined behavior

## ◆ boundary_point_index() [2/4]

template<typename BaseIterator >

boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

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.

## ◆ boundary_point_index() [3/4]

template<typename BaseIterator >

boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | rule_type | mask,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

Create a segment_index for boundary analysis type of the text in range [begin,end) using a rule mask for locale loc.

## ◆ boundary_point_index() [4/4]

template<typename BaseIterator >

boost::locale::boundary::boundary_point_index< BaseIterator >::boundary_point_index | ( | const segment_index< base_iterator > & | other | ) |

Create a boundary_point_index from a segment_index. It copies all indexing information and uses the default rule (all possible boundary points)

This operation is very cheap, so if you use boundary_point_index and segment_index on the same text range it is much better to create one from another rather then indexing the same range twice.

Note
  rule() flags are not copied

## ◆ end() [1/2]

template<typename BaseIterator >

iterator boost::locale::boundary::segment_index< BaseIterator >::end | ( |  | ) | const
| inline

Get the iterator on the ending of the segments range.

Preconditions: the segment_index should have a mapping

The returned iterator is invalidated by access to any non-const member functions of this object

Examples
  boundary.cpp, and wboundary.cpp.

## ◆ end() [2/2]

template<typename BaseIterator >

iterator boost::locale::boundary::boundary_point_index< BaseIterator >::end | ( |  | ) | const
| inline

Get the iterator on the ending of the boundary points range.

Preconditions: this boundary_point_index should have a mapping

Note

The returned iterator is invalidated by access to any non-const member functions of this object

## ◆ find() [1/2]

template<typename BaseIterator >

iterator boost::locale::boundary::segment_index< BaseIterator >::find | ( | base_iterator | p | ) | const
| inline

Find a first valid segment following a position p.

If p is inside a valid segment this segment is selected:

For example: For word boundary analysis with word_any rule():

- "to| be or ", would point to "be",
- "t|o be or ", would point to "to",
- "to be or| ", would point to end.

Preconditions: the segment_index should have a mapping and p should be valid iterator to the text in the mapped range.

The returned iterator is invalidated by access to any non-const member functions of this object

## ◆ find() [2/2]

template<typename BaseIterator >

iterator boost::locale::boundary::boundary_point_index< BaseIterator >::find | ( | base_iterator | p | ) | const
| inline

Find a first valid boundary point on a position p or following it.

For example: For word boundary analysis of the text "to be or"

- "|to be", would return boundary point at "|to be",
- "t|o be", would point to "to| be"

Preconditions: the boundary_point_index should have a mapping and p should be valid iterator to the text in the mapped range.

The returned iterator is invalidated by access to any non-const member functions of this object

## ◆ full_select() [1/2]

template<typename BaseIterator >

bool boost::locale::boundary::segment_index< BaseIterator >::full_select | ( |  | ) | const
| inline

Get the full_select property value - should segment include in the range values that not belong to specific rule() or not.

The default value is false.

For example for sentence boundary with rule sentence_term the segments of text "Hello! How\nare you?" are "Hello!\", "are you?" when full_select() is false because "How
" is selected %as sentence by a rule spits the text by line feed. If full_select() is true the returned segments are "Hello! ", "How\nare you?" where "How
" is joined with the following part "are you?"

## ◆ full_select() [2/2]

template<typename BaseIterator >

void boost::locale::boundary::segment_index< BaseIterator >::full_select | ( | bool | v | ) |
| inline

Set the full_select property value - should segment include in the range values that not belong to specific rule() or not.

The default value is false.

For example for sentence boundary with rule sentence_term the segments of text "Hello! How\nare you?" are "Hello!\", "are you?" when full_select() is false because "How
" is selected %as sentence by a rule spits the text by line feed. If full_select() is true the returned segments are "Hello! ", "How\nare you?" where "How
" is joined with the following part "are you?"

## ◆ map() [1/2]

template<typename BaseIterator >

void boost::locale::boundary::segment_index< BaseIterator >::map | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

Create a new index for boundary analysis type of the text in range [begin,end) for locale loc.

Note
  rule() and full_select() remain unchanged.

Examples
  boundary.cpp, and wboundary.cpp.

## ◆ map() [2/2]

template<typename BaseIterator >

void boost::locale::boundary::boundary_point_index< BaseIterator >::map | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

Create a new index for boundary analysis type of the text in range [begin,end) for locale loc.

Note
  rule() remains unchanged.

## ◆ operator=() [1/2]

template<typename BaseIterator >

segment_index & boost::locale::boundary::segment_index< BaseIterator >::operator= | ( | const boundary_point_index< base_iterator > & |  | ) |

Copy an index from a boundary_point_index. It copies all indexing information and uses the default rule (all possible segments)

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

Note
  rule() flags are not copied

## ◆ operator=() [2/2]

template<typename BaseIterator >

boundary_point_index & boost::locale::boundary::boundary_point_index< BaseIterator >::operator= | ( | const segment_index< base_iterator > & | other | ) |

Copy a boundary_point_index from a segment_index. It copies all indexing information and keeps the current rule() unchanged

This operation is very cheap, so if you use boundary_point_index and segment_index on the same text range it is much better to create one from another rather then indexing the same range twice.

Note
  rule() flags are not copied

## ◆ segment_index() [1/4]

template<typename BaseIterator >

boost::locale::boundary::segment_index< BaseIterator >::segment_index | ( |  | ) |
| inline

Default constructor.

Note

When this object is constructed by default it does not include a valid index, thus calling begin(), end() or find() member functions would lead to undefined behavior

## ◆ segment_index() [2/4]

template<typename BaseIterator >

boost::locale::boundary::segment_index< BaseIterator >::segment_index | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

Create a segment_index for boundary analysis type of the text in range [begin,end) selecting all possible segments (full mask) for locale loc.

## ◆ segment_index() [3/4]

template<typename BaseIterator >

boost::locale::boundary::segment_index< BaseIterator >::segment_index | ( | boundary_type | type,
|  | base_iterator | begin,
|  | base_iterator | end,
|  | rule_type | mask,
|  | const std::locale & | loc = `std::locale()`
| ) |  |
| inline

Create a segment_index for boundary analysis type of the text in range [begin,end) using a rule mask for locale loc.

## ◆ segment_index() [4/4]

template<typename BaseIterator >

boost::locale::boundary::segment_index< BaseIterator >::segment_index | ( | const boundary_point_index< base_iterator > & |  | ) |

Create a segment_index from a boundary_point_index. It copies all indexing information and used default rule (all possible segments)

This operation is very cheap, so if you use boundary_point_index and segment_index on same text range it is much better to create one from another rather then indexing the same range twice.

Note
  rule() flags are not copied

## Variable Documentation

## ◆ sentence_sep

constexpr rule_type boost::locale::boundary::sentence_sep

Initial value:
=
0xF0

The sentence does not contain terminator like ".", "!" but ended with hard separator like CR, LF, PS or end of input.

- © Copyright 2009-2012 Artyom Beilis, Distributed under the Boost Software License, Version 1.0.