grapheme cluster library

MRAB python at mrabarnett.plus.com
Sat Oct 21 11:52:09 EDT 2017


On 2017-10-21 05:11, Rustom Mody wrote:
> Is there a recommended library for manipulating grapheme clusters?
> 
> In particular, in devanagari
> क् + ि = कि
> in (pseudo)unicode names
> KA-letter + I-sign = KI-composite-letter
> 
> I would like to be able to handle KI as a letter rather than two code-points.
> Can of course write an automaton to group but guessing that its already
> available some place…
> 
You can use the regex module to split a string into graphemes:

regex.findall(r'\X', string)



More information about the Python-list mailing list