Method and device for automatically identifying annotations in JSON codes
An automatic identification and annotation technology, applied in the computer field, can solve problems such as no quotation marks, no support for comments, no support for key names, etc., to achieve the effect of improving development efficiency and reducing communication costs
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0053] Such as figure 1 As shown, a method to automatically identify comments in JSON code, including:
[0054] Parsing the JSON code into a syntax tree, traversing the syntax tree, and identifying all field names in the JSON code and a value corresponding to each field name during the traversal process;
[0055] Match the first character that is consistent with the comment start identifier after each value, if the match is successful, match the first character that is consistent with the comment end identifier after the comment start identifier, and identify the comment start The content between the identifier and the comment end identifier is a comment of the field name of the field name corresponding to the value.
[0056] The method disclosed in the present invention involves JSON codes with annotations. Considering that code programmers are used to writing annotations at the end of the line in general, that is, behind the value, the above-mentioned disclosed annotation i...
Embodiment 2
[0093] In this embodiment, on the basis of Embodiment 1, the present invention is described and explained in detail in combination with the application of specific scenarios.
[0094] The original JSON code is:
[0095]
[0096] The above original JSON code is of object type, which means that the employee object is an array containing 3 employee records (objects). Its errors are:
[0097] 1) employees non-standard symbol package;
[0098] 2) There is no string type character in front of the firstName in the first object in the array;
[0099] 3) The symbol in front of lastName in the second object in the array is not a string type symbol;
[0100] 4) Carter in the third object in the array is followed by non-standard characters.
[0101] The content between double slashes and newlines is the comment of the nearest field name in front of it, that is, the comment start identifier is " / / ", and the comment end identifier is The type character set includes: object type sta...
PUM

Abstract
Description
Claims
Application Information

- R&D
- Intellectual Property
- Life Sciences
- Materials
- Tech Scout
- Unparalleled Data Quality
- Higher Quality Content
- 60% Fewer Hallucinations
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2025 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com