Normalize Chinese character for index, tagging, etc.
xianghong2020-07-21 05:57
Normalizing Chinese is to convert every single chinese character to simplified. Don't use it as a converting feature because it will convert the word wrongly.
For example, δΉΎι will be converted to εΉ²ι. In this case, it is ok to insert εΉ²ι into index for searching, but εΉ²ι is no longer a valid Chinese word.
administrator2020-07-21 11:40
Hey Forrest,
Thanks for your patch! I've applied it, however, the patch did not include your updated Tokenizer.php for Chinese with the normalize method. Can you uploade that separately?
Best,
Chris
xianghong2020-07-21 15:28
my2 is the combined and myseperate is just the last patch.
Best,
Forrest
administrator2020-07-21 17:44
Hey Forrest,
I modified your normalize code and have just pushed the result. I added a unit test to ZhTokenizerTest.php . I also tested if from the command line. Let me know if you spot anything.
Best,
Chris
xianghong2020-07-21 19:17
Hi Professor Pollett,
I did not test on it, but it looks good.
Best,
Forrest
administrator2022-03-27 18:54
This has been in Yioop for a while, I forgot to close the issue.
Normalizing Chinese is to convert every single chinese character to simplified. Don't use it as a converting feature because it will convert the word wrongly. For example, δΉΎι will be converted to εΉ²ι. In this case, it is ok to insert εΉ²ι into index for searching, but εΉ²ι is no longer a valid Chinese word.
Hey Forrest,
Thanks for your patch! I've applied it, however, the patch did not include your updated Tokenizer.php for Chinese with the normalize method. Can you uploade that separately?
Best,
Chris
my2 is the combined and myseperate is just the last patch.
Best, Forrest
Hey Forrest,
I modified your normalize code and have just pushed the result. I added a unit test to ZhTokenizerTest.php . I also tested if from the command line. Let me know if you spot anything.
Best, Chris
Hi Professor Pollett,
I did not test on it, but it looks good.
Best, Forrest
This has been in Yioop for a while, I forgot to close the issue.
Best, Chris
Attachments:
my.patch
my2.patch
myseperate.patch