6 ms·
It works on all human languages, just inefficiently. I ran it over a sample I found on wikipedia: sample = "ฟองมันฟันหนู, ฟันหนูฟองมัน, ฝนทองฟองมัน" le
by joelburget 4y ago
It works on all human languages, just inefficiently. I ran it over a sample I found on wikipedia:
sample = "ฟองมันฟันหนู, ฟันหนูฟองมัน, ฝนทองฟองมัน"
len(sample), len(enc.encode(sample))
This returns `39, 40` so it's just encoding one character at a time. It's probably like this for almost all non-English text.
- theragra 4y agoYeah, at least it does it with Russian