Lightweight Chinese simplified and traditional Chinese conversion method based on front-end technology
By integrating lightweight Chinese simplified traditional Chinese conversion methods in web pages or applications, using front-end technology and multiple corpus, the problem of slow conversion speed and inability to support language habits in different regions in the existing technology is solved, and the efficient and low-dependence simplified traditional Chinese conversion effect is achieved.
Patent Information
- Application Number
- CN202510131011.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-05-27
AI Technical Summary
The existing Chinese simplified to traditional Chinese conversion methods rely on back-end services, resulting in slow conversion speed and dependence on specific operating environments, and cannot effectively support the differences in language habits in Hong Kong and Taiwan.
The lightweight Chinese simplified and traditional Chinese conversion method based on front-end technology is adopted. By integrating the conversion method in a web page or application, using professional field knowledge corpus, discontinued thesaurus, synonyms and simplified and traditional Chinese characters to realize the simplified and traditional Chinese conversion interface of static resources and dynamic request interfaces.
It realizes lightweight conversion that does not rely on server deployment, solves the problem of excessive consumption of high concurrent call resources on the server, supports selective translation according to specific types of resources, has low code volume, high operation efficiency and strong compatibility, and can accurately convert simplified and traditional Chinese according to language habits in different regions.
Smart Images

Figure CN120046582A_ABST
Abstract
Claims
1. A lightweight method for converting simplified and traditional Chinese based on front-end technology, characterized in that: The conversion method is integrated in a web page or application program, and the conversion of the simplified Chinese to the traditional Chinese of the static resource and the dynamic request interface is realized by calling the conversion method; The conversion method comprises: Step 1: Establish corresponding professional domain knowledge corpus according to business scenarios; Step 2: configuring a stop word library, wherein the stop word library includes low information stop words; Step 3: Configure synonym relationships between the expressions in Hong Kong and Taiwan and the expressions in Mainland China and Chinese mainland Mandarin respectively, map the expressions in Mainland China with the corresponding expressions in Hong Kong, and record them in the first synonym database contrast_hk, and map the expressions in Mainland China with the corresponding expressions in Taiwan, and record them in the second synonym database contrast_tw; Step 4: Create a simplified Chinese character table and a traditional Chinese character table; Step 5: By automatically converting the prefix of a specific uniform resource locator URL, an independent traditional Chinese website under an independent domain name different from the original domain name is realized, and the independent domain name mode is triggered by the context button of the original website. After being triggered, step 9 is performed; Step 6: Use the IP address determiner to determine whether the client's IP address is from Hong Kong, China or Taiwan, China. If so, the IP address from Hong Kong, China or Taiwan, China is automatically converted at the original site; Step 7: Perform semantic word segmentation on the original sentence T1 to obtain a non-repeated word array T2; Step 8: Perform synonym replacement processing on the non-repetitive word array T2 according to the first synonym library contrast_hk or the second synonym library contrast_tw to obtain sentence T3; Step 9: Translate the original sentence T1 or the sentence T3 into simplified Chinese to obtain the corresponding traditional Chinese sentence T4.
2. According to the lightweight Chinese simplified and traditional conversion method based on front-end technology in claim 1, it is characterized in that: The step 7 comprises: For the original sentence T1 that needs to be converted from simplified to traditional Chinese, firstly, the low-information stop words are removed according to the stop word library, and then the sentence T1 is segmented and deduplicated according to the professional domain knowledge corpus to obtain a non-repeated word array T2 after the sentence T1 is segmented.
3. The lightweight Chinese simplified and traditional conversion method based on front-end technology according to claim 2 is characterized in that: The step 8 comprises: If the client's IP address is from Hong Kong, China, the non-repeated word array T2 is matched with the first synonym library contrast_hk to obtain a synonym array C, and then the words in the original sentence T1 that hit the first synonym array C are replaced with the corresponding Hong Kong synonyms in the first synonym library contrast_hk to obtain a sentence T3. If the client's IP address is from Taiwan, the non-repeated word array T2 is matched with the second synonym library contrast_tw to obtain a synonym array C. Similarly, the words in the original sentence T1 that hit the second synonym array C are replaced with the corresponding Taiwan synonyms in the second synonym library contrast_tw to obtain sentence T3.
4. The lightweight Chinese simplified and traditional conversion method based on front-end technology according to claim 3 is characterized in that: The step 9 comprises: According to the Simplified Chinese and Traditional Chinese character comparison table, dynamically filter and configure the files of specific resources at the same time, and perform Simplified-to-Traditional Chinese translation on the sentence T3 to obtain the corresponding Traditional Chinese sentence T4.
5. The lightweight Chinese simplified and traditional conversion method based on front-end technology according to claim 1 is characterized in that: The conversion method is integrated in a web page or application program, and the Simplified-to-Traditional Chinese conversion of static resources and dynamic request interfaces is realized by calling the conversion method, including: Step A1: Add a business scenario for converting a Simplified Chinese website to a Traditional Chinese website, and the domain name of the Simplified Chinese website is the first domain name; Step A2: When requesting a Simplified Chinese website page, parse out all the Simplified Chinese characters in the page and the Simplified Chinese characters returned by the dynamic interface; Step A3: Replace the Simplified Chinese characters parsed out in Step A2 with Traditional Chinese characters through the conversion method; Step A4: Obtain the translated Traditional Chinese website, and the domain name of the Traditional Chinese website is the second domain name.
6. The lightweight Chinese simplified and traditional conversion method based on front-end technology according to claim 1 is characterized in that: The business scenarios include the securities industry and the computer software industry.
7. The lightweight Chinese simplified and traditional conversion method based on front-end technology according to claim 1 is characterized in that: The low-information stop words at least include "de" and "le".