I have a string which has characters from multiple languages:
'죄송합니다 how are you doing? My name is Yudhiesh and I am 아니 doing good 저기요'
I am trying to chunk this single string into a list of strings based on the number of words in the string and the result should be this if the chunk size is 7
i.e. there are at maximum 7 words in a string:
['죄송합니다 how are you doing? My name', 'is Yudhiesh and I am 아니 doing', 'good 저기요']
My current attempt which is based on how you would chunk a list which is not working:
s = '죄송합니다 how are you doing? My name is Yudhiesh and I am 아니 doing good 저기요'
>>> parts = [str(s[i:i+7]) for i in range(0, len(s), 7)]
>>> parts
['죄송합니다 h', 'ow are ', 'you doi', 'ng? My ', 'name is', ' Yudhie', 'sh and ', 'I am 아니', ' doing ', 'good 저기', '요']