mirror of
https://github.com/rspeer/wordfreq.git
synced 2024-12-23 17:31:41 +00:00
removes arabic commas
This commit is contained in:
parent
6e1f7e30c6
commit
83797bd276
@ -118,6 +118,10 @@ def tokenize(text, lang):
|
||||
except NameError:
|
||||
from wordfreq.mecab import mecab_tokenize
|
||||
return mecab_tokenize(text)
|
||||
elif lang == 'ar':
|
||||
tokens = simple_tokenize(text)
|
||||
tokens = [token.replace('ـ', '') for token in tokens]
|
||||
return [token for token in tokens if token] # remove empty strings
|
||||
else:
|
||||
return simple_tokenize(text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user