struct TextSegment::Grapheme::Cluster

Overview

Unicode extended grapheme cluster. Graphemes Iterator will return an instance of this struct to return information about specific grapheme cluster.

Defined in:

grapheme/grapheme.cr

Instance Method Summary

Instance Method Detail

def bytes #

returns a byte slice which corresponds to the current grapheme cluster.


[View source]
def codepoints : Array(Int32) #

Returns codepoints which corresponds to the current grapheme cluster.


[View source]
def positions : Tuple(Int32, Int32) #

returns the interval of the current grapheme as byte positions into the original string. The first returned value "from" indexes the first byte and the second retured value "to" indexes the first byte that is not included anumore, i.e. str[from...to] is the current grapheme cluster of the original string "str".


[View source]
def str #

returns a substring of the original string which corresponds to the current grapheme cluster


[View source]