I would like to convert numbers from a string I receive after an OCR recognition over Japanese text.
For example, when I extract a date:
③① 年 ⑫ 月 ①③ 日
I would like to convert it to:
31 年 12 月 13 日
What would be the best way to achieve it ?
Right-click on the cell, click on Format Cell, Alignment and select Center for both Horizontal and Vertical. On the "ribbon" (toolbar), click on Insert, Shapes and select the oval. (You can drag the corners to make it a circle per se.)
When you double-click the shaded circle above, immediately following a number entry, it will enclose the number (or any character) in a circle. Also, its neighbor is the combining enclosing circle backslash.
In Word for Mac, use the Edit>Emoji & Symbols utility built into macOS. After opening it, click on the menu icon in the upper right corner to expand the dialog. Type circle into the Search field and you should see several types of circled numbers appear in the central display. Was this reply helpful?
I would use unicodedata
import unicodedata
print(unicodedata.normalize("NFKC","③① 年 ⑫ 月 ①③ 日"))
The result is this,
31 年 12 月 13 日
This also converts other variation of Japanese digits, full-width digits.
import unicodedata
print(unicodedata.normalize("NFKC","123①②③123"))
to
123123123
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With