tetengo 1.8.2
A multipurpose library set
Loading...
Searching...
No Matches
tetengo::text::grapheme_splitting::grapheme_segment Class Reference

A grapheme segment. More...

#include <grapheme_segment.hpp>

+ Inheritance diagram for tetengo::text::grapheme_splitting::grapheme_segment:
+ Collaboration diagram for tetengo::text::grapheme_splitting::grapheme_segment:

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_segmentinstance ()
 Returns the instance.
 

Detailed Description

A grapheme segment.

Member Enumeration Documentation

◆ break_property_type

A break peoperty type.

Enumerator
cr 

CR.

lf 

LF.

control 

Control.

extend 

Extend.

zwj 

ZWJ.

regional 

Regional.

prepend 

Prepend.

spacing_mark 

SpacingMark.

L.

V.

T.

lv 

LV.

lvt 

LVT.

other 

Other.

Member Function Documentation

◆ instance()

static const grapheme_segment & tetengo::text::grapheme_splitting::grapheme_segment::instance ( )
static

Returns the instance.

Returns
The instance.

◆ segment_offsets()

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 | / | / | / | / | / | / |
-----------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Parameters
break_propertiesBreak properties.
Returns
Grapheme offsets.

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