I\'m using NLTK word_tokenizer
to split a sentence into words.
I want to tokenize this sentence:
في_بيتنا كل شي لما تحت
I always recommend using nltk.tokenize.wordpunct_tokenize
. You can try out many of the NLTK tokenizers at http://text-processing.com/demo/tokenize/ and see for yourself.
this is the output i get with my code, but i recall unicode doesn't go well in python 2 and I used 3.5
nltk.word_tokenize('في_بيتنا كل شي لما تحتاجه يضيع ...ادور على شاحن فجأة يختفي ..لدرجة اني اسوي نفسي ادور شيء ')
['في_بيتنا', 'كل', 'شي', 'لما', 'تحتاجه', 'يضيع', '...', 'ادور', 'على', 'شاحن', 'فجأة', 'يختفي', '..لدرجة', 'اني', 'اسوي', 'نفسي', 'ادور', 'شيء']