tetengo 1.8.2
A multipurpose library set
|
A grapheme segment. More...
#include <grapheme_segment.hpp>
Public Types | |
enum class | break_property_type { cr , lf , control , extend , zwj , regional , prepend , spacing_mark , l , v , t , lv , lvt , other } |
A break peoperty type. More... | |
Public Member Functions | |
~grapheme_segment () | |
Destroys the grapheme segment. | |
std::vector< std::size_t > | segment_offsets (const std::vector< break_property_type > &break_properties) const |
Returns the grapheme offsets. | |
Static Public Member Functions | |
static const grapheme_segment & | instance () |
Returns the instance. | |
A grapheme segment.
|
strong |
|
static |
Returns the instance.
std::vector< std::size_t > tetengo::text::grapheme_splitting::grapheme_segment::segment_offsets | ( | const std::vector< break_property_type > & | break_properties | ) | const |
Returns the grapheme offsets.
The graphemes are split between the followings. (/: split, X:connect, X?: connect if the number of precedings is odd)
from \ to |eot|CR |LF |Con|Ext|ZWJ|Reg|Pre|SpM|L |V |T |LV |LVT|Oth| -----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ sot | / | / | / | / | / | / | / | / | / | / | / | / | / | / | / | CR | / | / | X | / | / | / | / | / | / | / | / | / | / | / | / | LF | / | / | / | / | / | / | / | / | / | / | / | / | / | / | / | Control | / | / | / | / | / | / | / | / | / | / | / | / | / | / | / | Extend | / | / | / | / | X | X | / | / | X | / | / | / | / | / | / | ZWJ | / | / | / | / | X | X | / | / | X | / | / | / | / | / | X | Regional | / | / | / | / | X | X | X?| / | X | / | / | / | / | / | / | Prepend | / | / | / | / | X | X | X | X | X | X | X | X | X | X | X | SpacingMark| / | / | / | / | X | X | / | / | X | / | / | / | / | / | / | L | / | / | / | / | X | X | / | / | X | X | X | / | X | X | / | V | / | / | / | / | X | X | / | / | X | / | X | X | / | / | / | T | / | / | / | / | X | X | / | / | X | / | / | X | / | / | / | LV | / | / | / | / | X | X | / | / | X | / | X | X | / | / | / | LVT | / | / | / | / | X | X | / | / | X | / | / | X | / | / | / | Other | / | / | / | / | X | X | / | / | X | / | / | / | / | / | / | -----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
break_properties | Break properties. |