1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns=
"http://www.w3.org/1999/xhtml">
4 <meta http-equiv=
"Content-Type" content=
"text/xhtml;charset=UTF-8"/>
5 <meta http-equiv=
"X-UA-Compatible" content=
"IE=9"/>
6 <meta name=
"generator" content=
"Doxygen 1.8.6"/>
7 <title>Boost.Locale: boost::locale::boundary::segment_index
< BaseIterator
> Class Template Reference
</title>
8 <link href=
"tabs.css" rel=
"stylesheet" type=
"text/css"/>
9 <script type=
"text/javascript" src=
"jquery.js"></script>
10 <script type=
"text/javascript" src=
"dynsections.js"></script>
11 <link href=
"navtree.css" rel=
"stylesheet" type=
"text/css"/>
12 <script type=
"text/javascript" src=
"resize.js"></script>
13 <script type=
"text/javascript" src=
"navtree.js"></script>
14 <script type=
"text/javascript">
15 $(document).ready(initResizable);
16 $(window).load(resizeHeight);
18 <link href=
"doxygen.css" rel=
"stylesheet" type=
"text/css" />
21 <div id=
"top"><!-- do not remove this div, it is closed by doxygen! -->
23 <table cellspacing=
"0" cellpadding=
"0">
25 <tr style=
"height: 56px;">
26 <td id=
"projectlogo"><img alt=
"Logo" src=
"boost-small.png"/></td>
27 <td style=
"padding-left: 0.5em;">
28 <div id=
"projectname">Boost.Locale
35 <!-- end header part -->
36 <!-- Generated by Doxygen 1.8.6 -->
37 <div id=
"navrow1" class=
"tabs">
39 <li><a href=
"index.html"><span>Main
 Page
</span></a></li>
40 <li><a href=
"pages.html"><span>Related
 Pages
</span></a></li>
41 <li><a href=
"modules.html"><span>Modules
</span></a></li>
42 <li><a href=
"namespaces.html"><span>Namespaces
</span></a></li>
43 <li class=
"current"><a href=
"annotated.html"><span>Classes
</span></a></li>
44 <li><a href=
"files.html"><span>Files
</span></a></li>
45 <li><a href=
"examples.html"><span>Examples
</span></a></li>
48 <div id=
"navrow2" class=
"tabs2">
50 <li><a href=
"annotated.html"><span>Class
 List
</span></a></li>
51 <li><a href=
"hierarchy.html"><span>Class
 Hierarchy
</span></a></li>
52 <li><a href=
"functions.html"><span>Class
 Members
</span></a></li>
56 <div id=
"side-nav" class=
"ui-resizable side-nav-resizable">
58 <div id=
"nav-tree-contents">
59 <div id=
"nav-sync" class=
"sync"></div>
62 <div id=
"splitbar" style=
"-moz-user-select:none;"
63 class=
"ui-resizable-handle">
66 <script type=
"text/javascript">
67 $(document).ready(function(){initNavTree('classboost_1_1locale_1_1boundary_1_1segment__index.html','');});
69 <div id=
"doc-content">
72 <a href=
"#pub-types">Public Types
</a> |
73 <a href=
"#pub-methods">Public Member Functions
</a> |
74 <a href=
"#friends">Friends
</a> |
75 <a href=
"classboost_1_1locale_1_1boundary_1_1segment__index-members.html">List of all members
</a> </div>
76 <div class=
"headertitle">
77 <div class=
"title">boost::locale::boundary::segment_index
< BaseIterator
> Class Template Reference
<div class=
"ingroups"><a class=
"el" href=
"group__boundary.html">Boundary Analysis
</a></div></div> </div>
79 <div class=
"contents">
81 <p>This class holds an index of segments in the text range and allows to iterate over them.
82 <a href=
"classboost_1_1locale_1_1boundary_1_1segment__index.html#details">More...
</a></p>
84 <p><code>#include
<<a class=
"el" href=
"index_8hpp_source.html">boost/locale/boundary/index.hpp
</a>></code></p>
85 <table class=
"memberdecls">
86 <tr class=
"heading"><td colspan=
"2"><h2 class=
"groupheader"><a name=
"pub-types"></a>
87 Public Types
</h2></td></tr>
88 <tr class=
"memitem:ga06f2faacb9d196ebc659ad5382ea2ca5"><td class=
"memItemLeft" align=
"right" valign=
"top">typedef BaseIterator
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a></td></tr>
89 <tr class=
"separator:ga06f2faacb9d196ebc659ad5382ea2ca5"><td class=
"memSeparator" colspan=
"2"> </td></tr>
90 <tr class=
"memitem:gaf7a775e77dbbca3495e11d646df96fd2"><td class=
"memItemLeft" align=
"right" valign=
"top">typedef unspecified_iterator_type
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator
</a></td></tr>
91 <tr class=
"separator:gaf7a775e77dbbca3495e11d646df96fd2"><td class=
"memSeparator" colspan=
"2"> </td></tr>
92 <tr class=
"memitem:ga5f8e61b5babc3f0fa95f5fb8acae3724"><td class=
"memItemLeft" align=
"right" valign=
"top">typedef unspecified_iterator_type
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga5f8e61b5babc3f0fa95f5fb8acae3724">const_iterator
</a></td></tr>
93 <tr class=
"separator:ga5f8e61b5babc3f0fa95f5fb8acae3724"><td class=
"memSeparator" colspan=
"2"> </td></tr>
94 <tr class=
"memitem:ga067c663d18faee08adb3355701ae72ba"><td class=
"memItemLeft" align=
"right" valign=
"top">typedef
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment.html">segment
</a>< <a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> > </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga067c663d18faee08adb3355701ae72ba">value_type
</a></td></tr>
95 <tr class=
"separator:ga067c663d18faee08adb3355701ae72ba"><td class=
"memSeparator" colspan=
"2"> </td></tr>
96 </table><table class=
"memberdecls">
97 <tr class=
"heading"><td colspan=
"2"><h2 class=
"groupheader"><a name=
"pub-methods"></a>
98 Public Member Functions
</h2></td></tr>
99 <tr class=
"memitem:ga2c354f4cc03677b58c97038cd84dc465"><td class=
"memItemLeft" align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga2c354f4cc03677b58c97038cd84dc465">segment_index
</a> ()
</td></tr>
100 <tr class=
"separator:ga2c354f4cc03677b58c97038cd84dc465"><td class=
"memSeparator" colspan=
"2"> </td></tr>
101 <tr class=
"memitem:ga06ddc335e95479ec51e9b16d0f829bb3"><td class=
"memItemLeft" align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga06ddc335e95479ec51e9b16d0f829bb3">segment_index
</a> (
<a class=
"el" href=
"group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type
</a> type,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin
</a>,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end
</a>,
<a class=
"el" href=
"group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type
</a> mask, std::locale const
&loc=std::locale())
</td></tr>
102 <tr class=
"separator:ga06ddc335e95479ec51e9b16d0f829bb3"><td class=
"memSeparator" colspan=
"2"> </td></tr>
103 <tr class=
"memitem:ga46a5f584d5a1a43ad4bc0fff07183fcc"><td class=
"memItemLeft" align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga46a5f584d5a1a43ad4bc0fff07183fcc">segment_index
</a> (
<a class=
"el" href=
"group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type
</a> type,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin
</a>,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end
</a>, std::locale const
&loc=std::locale())
</td></tr>
104 <tr class=
"separator:ga46a5f584d5a1a43ad4bc0fff07183fcc"><td class=
"memSeparator" colspan=
"2"> </td></tr>
105 <tr class=
"memitem:ga8187f58177fc89ef2f8f818a37111363"><td class=
"memItemLeft" align=
"right" valign=
"top"> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga8187f58177fc89ef2f8f818a37111363">segment_index
</a> (
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index
</a>< <a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> > const
&)
</td></tr>
106 <tr class=
"separator:ga8187f58177fc89ef2f8f818a37111363"><td class=
"memSeparator" colspan=
"2"> </td></tr>
107 <tr class=
"memitem:gae7941dc874ca05d2ef2a03f781c5b78a"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment__index.html">segment_index
</a> const
& </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gae7941dc874ca05d2ef2a03f781c5b78a">operator=
</a> (
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index
</a>< <a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> > const
&)
</td></tr>
108 <tr class=
"separator:gae7941dc874ca05d2ef2a03f781c5b78a"><td class=
"memSeparator" colspan=
"2"> </td></tr>
109 <tr class=
"memitem:gafa2a756b10d3522743204b45b794bb3e"><td class=
"memItemLeft" align=
"right" valign=
"top">void
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gafa2a756b10d3522743204b45b794bb3e">map
</a> (
<a class=
"el" href=
"group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type
</a> type,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin
</a>,
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> <a class=
"el" href=
"group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end
</a>, std::locale const
&loc=std::locale())
</td></tr>
110 <tr class=
"separator:gafa2a756b10d3522743204b45b794bb3e"><td class=
"memSeparator" colspan=
"2"> </td></tr>
111 <tr class=
"memitem:gaf74ff9c86c177efa8f74856277d659af"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"el" href=
"group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator
</a> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin
</a> () const
</td></tr>
112 <tr class=
"separator:gaf74ff9c86c177efa8f74856277d659af"><td class=
"memSeparator" colspan=
"2"> </td></tr>
113 <tr class=
"memitem:ga8757062d2446b35675b585651c5fea9f"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"el" href=
"group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator
</a> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end
</a> () const
</td></tr>
114 <tr class=
"separator:ga8757062d2446b35675b585651c5fea9f"><td class=
"memSeparator" colspan=
"2"> </td></tr>
115 <tr class=
"memitem:ga2480236106971797460187777f2a4411"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"el" href=
"group__boundary.html#gaf7a775e77dbbca3495e11d646df96fd2">iterator
</a> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga2480236106971797460187777f2a4411">find
</a> (
<a class=
"el" href=
"group__boundary.html#ga06f2faacb9d196ebc659ad5382ea2ca5">base_iterator
</a> p) const
</td></tr>
116 <tr class=
"separator:ga2480236106971797460187777f2a4411"><td class=
"memSeparator" colspan=
"2"> </td></tr>
117 <tr class=
"memitem:ga72b4ceb5bacec0eded2601c43a4d671a"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"el" href=
"group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type
</a> </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule
</a> () const
</td></tr>
118 <tr class=
"separator:ga72b4ceb5bacec0eded2601c43a4d671a"><td class=
"memSeparator" colspan=
"2"> </td></tr>
119 <tr class=
"memitem:gad19735180401edb15acbdbbeb21e5a73"><td class=
"memItemLeft" align=
"right" valign=
"top">void
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gad19735180401edb15acbdbbeb21e5a73">rule
</a> (
<a class=
"el" href=
"group__boundary.html#ga25e193c81052ef1795f1b53b46bc2095">rule_type
</a> v)
</td></tr>
120 <tr class=
"separator:gad19735180401edb15acbdbbeb21e5a73"><td class=
"memSeparator" colspan=
"2"> </td></tr>
121 <tr class=
"memitem:gace7faa10d536c85df0f2d5cac85f2bbc"><td class=
"memItemLeft" align=
"right" valign=
"top">bool
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select
</a> () const
</td></tr>
122 <tr class=
"separator:gace7faa10d536c85df0f2d5cac85f2bbc"><td class=
"memSeparator" colspan=
"2"> </td></tr>
123 <tr class=
"memitem:ga205fd51daa439a18527675e663a0802f"><td class=
"memItemLeft" align=
"right" valign=
"top">void
 </td><td class=
"memItemRight" valign=
"bottom"><a class=
"el" href=
"group__boundary.html#ga205fd51daa439a18527675e663a0802f">full_select
</a> (bool v)
</td></tr>
124 <tr class=
"separator:ga205fd51daa439a18527675e663a0802f"><td class=
"memSeparator" colspan=
"2"> </td></tr>
125 </table><table class=
"memberdecls">
126 <tr class=
"heading"><td colspan=
"2"><h2 class=
"groupheader"><a name=
"friends"></a>
127 Friends
</h2></td></tr>
128 <tr class=
"memitem:ga960209e8a9453221641eda6bd8c4989b"><td class=
"memItemLeft" align=
"right" valign=
"top"><a class=
"anchor" id=
"ga960209e8a9453221641eda6bd8c4989b"></a>
129 class
 </td><td class=
"memItemRight" valign=
"bottom"><b>boundary_point_index
< base_iterator
></b></td></tr>
130 <tr class=
"separator:ga960209e8a9453221641eda6bd8c4989b"><td class=
"memSeparator" colspan=
"2"> </td></tr>
132 <a name=
"details" id=
"details"></a><h2 class=
"groupheader">Detailed Description
</h2>
133 <div class=
"textblock"><h3>template
<typename BaseIterator
><br/>
134 class boost::locale::boundary::segment_index
< BaseIterator
></h3>
136 <p>This class holds an index of segments in the text range and allows to iterate over them.
</p>
137 <p>This class is provides
<a class=
"el" href=
"group__boundary.html#gaf74ff9c86c177efa8f74856277d659af">begin()
</a> and
<a class=
"el" href=
"group__boundary.html#ga8757062d2446b35675b585651c5fea9f">end()
</a> member functions that return bidirectional iterators to the
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment.html">segment
</a> objects.
</p>
138 <p>It provides two options on way of selecting segments:
</p>
140 <li><a class=
"el" href=
"group__boundary.html#gad19735180401edb15acbdbbeb21e5a73">rule(rule_type mask)
</a> - a mask that allows to select only specific types of segments according to various masks as
<a class=
"el" href=
"group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any
</a>.
<br/>
141 The default is to select any types of boundaries.
<br/>
142 For example: using word boundary analysis, when the provided mask is
<a class=
"el" href=
"group__boundary.html#ga52d8c63e1f3f8c898c645352206a78ef">word_kana
</a> then the iterators would iterate only over the words containing Kana letters and
<a class=
"el" href=
"group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any
</a> would select all types of words excluding ranges that consist of white space and punctuation marks. So iterating over the text
"to be or not to be?" with
<a class=
"el" href=
"group__boundary.html#ga3ab98808dbb1cc4a346dcc2554c9d8dc">word_any
</a> rule would return segments
"to",
"be",
"or",
"not",
"to",
"be", instead of default
"to",
" ",
"be",
" ",
"or",
" ",
"not",
" ",
"to",
" ",
"be",
"?".
</li>
143 <li><a class=
"el" href=
"group__boundary.html#ga205fd51daa439a18527675e663a0802f">full_select(bool how)
</a> - a flag that defines the way a range is selected if the rule of the previous boundary point does not fit the selected rule.
<br/>
144 For example: We want to fetch all sentences from the following text:
"Hello! How\nare you?".
<br/>
145 This text contains three boundary points separating it to sentences by different rules:
<ul>
146 <li>The exclamation mark
"!" ends the sentence
"Hello!"</li>
147 <li>The line feed that splits the sentence
"How\nare you?" into two parts.
</li>
148 <li>The question mark that ends the second sentence.
<br/>
149 If you would only change the
<a class=
"el" href=
"group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule()
</a> to
<a class=
"el" href=
"group__boundary.html#ga3befefe67f79691c117bf5588741355b">sentence_term
</a> then the
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment__index.html" title=
"This class holds an index of segments in the text range and allows to iterate over them...">segment_index
</a> would provide two sentences
"Hello!" and
"are you?" as only them actually terminated with required terminator
"!" or
"?". But changing
<a class=
"el" href=
"group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select()
</a> to true, the selected segment would include all the text up to previous valid boundary point and would return two expected sentences:
"Hello!" and
"How\nare you?".
</li>
153 <p>This class allows to find a segment according to the given iterator in range using
<a class=
"el" href=
"group__boundary.html#ga2480236106971797460187777f2a4411">find()
</a> member function.
</p>
154 <dl class=
"section note"><dt>Note
</dt><dd></dd></dl>
156 <li>Changing any of the options -
<a class=
"el" href=
"group__boundary.html#ga72b4ceb5bacec0eded2601c43a4d671a">rule()
</a> or
<a class=
"el" href=
"group__boundary.html#gace7faa10d536c85df0f2d5cac85f2bbc">full_select()
</a> and of course re-indexing the text invalidates existing iterators and they can't be used any more.
</li>
157 <li><a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment__index.html" title=
"This class holds an index of segments in the text range and allows to iterate over them...">segment_index
</a> can be created from
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1boundary__point__index.html" title=
"This class holds an index of boundary points and allows iterating over them. ">boundary_point_index
</a> or other
<a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment__index.html" title=
"This class holds an index of segments in the text range and allows to iterate over them...">segment_index
</a> that was created with same
<a class=
"el" href=
"group__boundary.html#ga15de9963ce9bb6037c8525901dfbf641">boundary_type
</a>. This is very fast operation as they shared same index and it does not require its regeneration.
</li>
159 <dl class=
"section see"><dt>See Also
</dt><dd></dd></dl>
161 <li><a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1boundary__point__index.html">boundary_point_index
</a></li>
162 <li><a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1segment.html">segment
</a></li>
163 <li><a class=
"el" href=
"classboost_1_1locale_1_1boundary_1_1boundary__point.html">boundary_point
</a> </li>
165 <dl><dt><b>Examples:
</b></dt><dd><a class=
"el" href=
"boundary_8cpp-example.html#_a1">boundary.cpp
</a>, and
<a class=
"el" href=
"wboundary_8cpp-example.html#_a1">wboundary.cpp
</a>.
</dd>
166 </dl></div><hr/>The documentation for this class was generated from the following file:
<ul>
167 <li>boost/locale/boundary/
<a class=
"el" href=
"index_8hpp_source.html">index.hpp
</a></li>
169 </div><!-- contents -->
170 </div><!-- doc-content -->
173 © Copyright
2009-
2012 Artyom Beilis, Distributed under the
<a href=
"http://www.boost.org/LICENSE_1_0.txt">Boost Software License
</a>, Version
1.0.