注释处理方法、装置及设备

By matching comment separators in the code text and updating or creating new comment lines based on the number of characters, the problems of garbled characters and character obfuscation in code comment translation are solved, thus improving the reliability of the translation.

CN115659928BActive Publication Date: 2026-07-17HENAN KUNLUN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HENAN KUNLUN TECH CO LTD
Filing Date
2022-09-05
Publication Date
2026-07-17

AI Technical Summary

Technical Problem

In existing technologies, the large differences in the number of characters in code comments when translating them into different languages ​​can lead to problems such as garbled text and character confusion after translation, which reduces the reliability of code comment translation.

Method used

By matching comment separators in the code text, the system extracts and translates initial comments, updates target comments to comment lines based on character count, or creates new comment lines, thus avoiding character confusion and garbled text.

Benefits of technology

It improves the reliability of code comment translation, ensures the clarity and accuracy of the translated text, and avoids garbled text issues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115659928B_ABST
    Figure CN115659928B_ABST
Patent Text Reader

Abstract

本申请提供一种注释处理方法、装置及设备,所述方法包括获取第一文本,所述第一文本中包括代码行和所述代码行对应的注释行;根据所述第一文本中的注释符在所述第一文本中匹配所述注释行,所述注释行包括注释分隔符和初始注释;对所述初始注释进行翻译,得到所述初始注释对应的目标注释;根据所述目标注释所占的第一字符数量和可用字符数量,将所述目标注释更新至所述第一文本中的所述注释行中;所述可用字符数量为所述代码行的剩余字符数量,或者,所述可用字符数量为所述注释行的剩余字符数量。通过上述方法,可以避免翻译后第一文本出现乱码的问题,提高了代码注释的翻译可靠性。
Need to check novelty before this filing date? Find Prior Art