Talk:Z26055
Adaptation of tokenisation to Chinese
@Tvpuppy I've adapted the tokenisation algorithm so that every Chinese character counts as a single token. This is done because otherwise it would be impossible for the function to separate a continuous set of characters into subparts. This means that now all the (Chinese) literals need to use BEFORE_OR_AFTER as the comparing mode; I've made it the default argument for defineLiterals and defineConstraint, so you don't have to worry about it.
A final advice: the main reason why I also created the defineLiteralFunction API is to implement a number-reading function; if I understand correctly from the testcases, this functionality could come in handy here.
If you encounter any problem, don't hesitate to ask me. Happy coding! Dv103 (talk) 20:53, 8 July 2025 (UTC)
- Thank you for the help! Previously I couldn’t figure out how to get it to work with the year number in Chinese, but I will try again now with your advice. Tvpuppy (talk) 21:38, 8 July 2025 (UTC)
- Now it should work with all the dates, so I've connected it. Please test it, and add testcases if you encounter any bug. If you need to modify the implementation, you can create another implementation where you can experiment. Dv103 (talk) 07:29, 9 July 2025 (UTC)
- By the way, I already created read Day of Roman year, Chinese (Z26076) and read year, Chinese (Z26081). Dv103 (talk) 07:58, 9 July 2025 (UTC)
- I have seen your implementation, and that’s amazing! I was trying to figure it out but couldn’t figure out how to get it to properly work, so thank you once again. Tvpuppy (talk) 11:20, 9 July 2025 (UTC)
- Now a good next step would be to localize also config of functions for date (Z20779), display Day of Roman Year (Z22941) and display Gregorian year (Z20241) (they should be way easier that this implementation). Dv103 (talk) 11:36, 9 July 2025 (UTC)
- Sure, I will try to see if I can help localizing them too. About this function, I wanted to add some alternate characters used in Chinese date, so I have created another implementation for experiment read Gregorian Date in Chinese, js, test (Z26086) and it appears it is working. So, do I just add the changes to the main implementation? Tvpuppy (talk) 15:46, 9 July 2025 (UTC)
- Basically I just added another character for zero, another word for “BC”, and less common characters for day 20 to 31. Tvpuppy (talk) 15:59, 9 July 2025 (UTC)
- I've done it (it is necessary to have Functioneer rights to edit connected functions) Dv103 (talk) 16:00, 9 July 2025 (UTC)
- Thank you! Tvpuppy (talk) 16:03, 9 July 2025 (UTC)
- Sure, I will try to see if I can help localizing them too. About this function, I wanted to add some alternate characters used in Chinese date, so I have created another implementation for experiment read Gregorian Date in Chinese, js, test (Z26086) and it appears it is working. So, do I just add the changes to the main implementation? Tvpuppy (talk) 15:46, 9 July 2025 (UTC)
- Now a good next step would be to localize also config of functions for date (Z20779), display Day of Roman Year (Z22941) and display Gregorian year (Z20241) (they should be way easier that this implementation). Dv103 (talk) 11:36, 9 July 2025 (UTC)
- Now it should work with all the dates, so I've connected it. Please test it, and add testcases if you encounter any bug. If you need to modify the implementation, you can create another implementation where you can experiment. Dv103 (talk) 07:29, 9 July 2025 (UTC)