Skip to content

uralicNLP.string_processing

Mika Hämäläinen edited this page Jul 9, 2020 · 7 revisions

The uralicNLP.string_processing module has the following methods:

char_split

Splits words into characters better than Python's own " ".join("") method. This tries to maintain diacritics with the character they belong to instead of separating them. Take a look at the following example:

  from uralicNLP import string_processing
  s = 'h̭ɛ̮ŋkkɐᴅ'
  " ".join(s)
  >> h ̭ ɛ ̮ ŋ k k ɐ ᴅ
  string_processing.char_split(s)
  >> ['h̭', 'ɛ̮', 'ŋ', 'k', 'k', 'ɐ', 'ᴅ']

In short, it takes a string and returns a list split in characters.

Clone this wiki locally