linotp.lib.text_utils module

module contains some helper function around the text processing of unicode and utf8 strings

linotp.lib.text_utils.simple_slice(text, chunk_size)

create slices from long text

Parameters
  • text – the input text

  • chunk_size

Returns

iterator which returns a slice of chunk length

linotp.lib.text_utils.utf8_slice(text, chunk_size)

create slices utf-8 test without breaking utf-8 characters

Parameters
  • text – the input text

  • chunk_size

Returns

iterator which returns a slice which fits in utf-8 buffer of chunk len