You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importredefbodo_tokenizer(text):
# Regular expression to match Bodo language tokenspattern=r'(\d+\.\d+)|([\d.]+)|([\u0980-\u09FF]+)|(\S+)'# Find all matches using the regex patterntokens= [match.group(0) formatchinre.finditer(pattern, text)]
returntokens# Test the tokenizer with some examplestext1="12.6 थी22 22थी"tokens1=bodo_tokenizer(text1)
print(tokens1) # Output: ['12.6', 'थी22', '22', 'थी']text2="थी 12.6 थी 22थी"tokens2=bodo_tokenizer(text2)
print(tokens2) # Output: ['थी', '12.6', 'थी', '22', 'थी']
The text was updated successfully, but these errors were encountered: