struct TextSegment::Grapheme::Graphemes

Overview

Graphemes implements an iterator over Unicode extended grapheme clusters, specified in the Unicode Standard Annex #29. Grapheme clusters correspond to "user-perceived characters". These characters often consist of multiple code points (e.g. the "woman kissing woman" emoji consists of 8 code points: woman + ZWJ + heavy black heart (2 code points) + ZWJ + kiss mark + ZWJ + woman) and the rules described in Annex #29 must be applied to group those code points into clusters perceived by the user as one character.

Included Modules

Defined in:

grapheme/grapheme.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(str : String) #

[View source]

Instance Method Detail

def next #
Description copied from module Iterator(TextSegment::Grapheme::Cluster)

Returns the next element in this iterator, or Iterator::Stop::INSTANCE if there are no more elements.


[View source]
def reset : Nil #

Reset puts the iterator into its initial state such that the next call to #next() sets it to the first grapheme cluster again.


[View source]