Document format automatic checking method
Patent Information
- Application Number
- CN202310998808.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-09
- Publication Date
- 2024-10-18
AI Technical Summary
[0003]上述专利的针对篇幅较长,内容繁多,但格式比较固定的文档解决其人工检查文档格式耗费时间长且容易出现错漏的问题,如何解决上述技术问题成了本领域技术人员的努力方向
本发明设计合理,可定义的检查清单,实现对WORD文档的文字内容和文字的字体、样式等格式信息、表格信息、图片信息、图表信息、文档的页眉、文档的页脚、文档的布局、边距等样式信息进行检查,完成相应检查判断并进行批注,以确保文件编制的正确性和规范性。
Smart Images

Figure CN118798126A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of various document checking methods, and more specifically to the technical field of automatic document format checking methods. Background Art
[0002] According to the custom checklist, the document check items are clarified to check the text content of the WORD document and the text font, style and other format information, table information, picture information, chart information, as well as the document header, footer, layout, margin and other style information of the document, complete the corresponding inspection and judgment and make annotations to ensure the correctness and standardization of the document compilation. The existing patents disclose the following technologies: The patent with the publication number CN103886098A and the patent name "A Word format extraction and reuse method" discloses the following content: A Word format extraction and reuse method, including the following steps: A. Configure the corresponding template rules for a certain type of document, including which modules the document consists of, the verifiers that each paragraph must meet, etc.; B. Use the Word to XML technology to convert the document uploaded by the user into an XML file, and extract the specific format of the document from the XML file; C. According to the configured template, the format extracted from the user document is matched and checked, and specific information is fed back for incorrect places to generate a result document. The beneficial effect of the present invention is: the Word document format checking method based on J2EE of the present invention helps users detect incorrect parts of the document format, and gives annotations to facilitate their correction, so as to reduce the consumption of manpower in format checking. The format checking method of the present invention is based on template rules. Under the architecture supported by the system, templates can be built at will, and the support for documents is very extensive.
[0003] The above patent aims to solve the problem that manual checking of document formats is time-consuming and prone to errors for documents with long length, rich content, but relatively fixed formats. How to solve the above technical problems has become the direction of efforts of technical personnel in this field. Summary of the invention
[0004] The purpose of the present invention is to solve the above technical problems and provide a method for automatically checking the document format.
[0005] In order to achieve the above-mentioned purpose, the present invention specifically adopts the following technical solutions: The present invention provides a method for automatically checking the document format, comprising the following steps: S1. Define document format check items. Document format check items are divided into fixed check items and custom check items. S2. Check the fixed check items and custom check item documents in step 1 according to the execution process, key checkpoint process methods and custom checklist processing to achieve automatic document format checking. In the custom checklist processing, users can customize the inspection format, which includes the text paragraph format, directory format, text figure title format and title format.
[0006] In one embodiment, in step S1, the fixed item check includes paragraph check, chart check, title check, directory check and reference check; Paragraph checking includes text checking, page margin checking, header checking, footer checking, punctuation checking, blank page checking, blank line checking, and paragraph duplication checking; Chart inspection includes checking the chart title, table title, and whether the table title spans across pages; Title checking includes outline level checking, numbering format checking, font size checking, paragraph checking, indentation checking, and spacing checking. The outline level checking supports from level 1 to level 5 titles; The table of contents check includes the text table of contents check, figure title table of contents check and table title table of contents check.
[0007] In one embodiment, in step S1, the custom inspection items are for some uncertain inspection locations and inspection directions, and some more flexible custom inspection rules are formulated under the existing rules. The custom inspection items include bookmark check, header and footer check, total page number check, layout feature check, content consistency check and required item check.
[0008] In one embodiment, in step S2, the document inspection execution process includes the following specific steps: 1) Use CMD to call C# through Java to use Word SDK to check the directory and chapter number. If there is any error after the check, save the error information to MySQL, and store the check log to Redis and MySQL; 2) While the word SDK is checking, Java uses Apache POI to start checking bookmarks and text. After the check is completed, if there is an error, the error information will be saved to MySQL, and the check log will be stored in Redis and MySQL; 3) After all programs have been checked, if there are any errors, first use the Word SDK to create annotations for the errors found, then use Apache POI to create annotations for the errors found, and save the annotated document to the file system; 4) When the inspection is in progress, the user interface displays the inspection details by querying redis. If the inspection log is viewed through the inspection history after the inspection is completed, the inspection details are displayed by querying mysql.
[0009] In one embodiment, in step S2, the key checkpoint process method includes a method for checking paragraph format, a method for checking figure titles, a method for checking punctuation, a method for checking references, a method for checking chapter numbering, a method for checking figure numbering, and a method for checking directory issues.
[0010] In one embodiment, the method for checking paragraph format includes the following contents: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Search for "w:r": Get the text in the paragraph, the text mark is: "w:r"; Whether to set "w:pStyle": Each paragraph of text may contain its own w:pStyle; "w:p" whether to set "w:pStyle": if w:r has no style, use the style of w:p; Get the default "w:pStyle": If w:p has no style, use the document's default style; Get the attribute w:val of w:pStyle as the style id: get the id of the style; Get the style of the corresponding id from styles: get the style from the styles.xml document according to the id in the previous step; Whether to inherit style: Determine whether the acquired style contains w:basedOn; Merge parent style: merge the font size and indentation of the parent style; Get font size, etc.: Get the merged font size and indent; Checklist: Get the font size, indentation and other information in the checklist; Determine whether the font and size are correct: Compare the obtained content and format with the check items in the checklist to determine whether the content and format are correct; The steps to check the chart title method are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find pic:pic and w:tbl: Get pictures (pic:pic) and tables (w:tbl) in XML; Get xml node: Get the node (domNode) of the previous step data in xml; Search up w:p (table) / search down w:p (picture): If it is a table, use domNode.preNode to get the previous node; if it is a picture, use domNode.nextNode to get the next node; Empty line: Determine whether the node content obtained in the previous step is empty; Whether the number of loops exceeds 5: The number of times of obtaining the previous node or the next node cannot exceed 5; Determine whether it starts with "Figure" or "Table": According to convention, figure titles start with "Figure" and table titles start with "Table"; Check as per above paragraph format: Use the Check Paragraph Format method to check paragraph format.
[0011] In one embodiment, the specific steps of the method for checking punctuation marks are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Text collection: Get the characters and punctuation marks in w:p and store them in the collection in order; Get punctuation marks: find the position of punctuation marks in the collection; In the first position of a text set: determine whether the punctuation mark is the first one in the set; Get the previous character: the character before the punctuation mark found above; Punctuation: Determine whether the previous character is a punctuation mark; Chinese and English punctuation marks do not match: if the previous character is Chinese and the punctuation mark is English, it is an error, and vice versa; Find Next Punctuation: Finds the next occurrence of a punctuation mark starting from the current one.
[0012] In one embodiment, the steps of the method for checking references are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Content = References: Determine whether the text content of w:p refers to the content of the references; Get the domNode of w:p: Get the dom node in the xml where w:p is located; Get the next domNode: get the dom node through nextNode; Whether it starts with "[n]": the node content starts with "[n]"; Is n ordered: whether n is an ordered number; Whether it is cited: Determine whether it is cited based on the reference set of the text; Get w:t: Get w:t in w:p; Whether it contains w:vertAlign: whether w:t contains the w:vertAlign tag; Whether the attribute w:val is a superscript: whether the value of the w:vertAlign tag is equal to the superscript; Whether the content is consistent with the reference: Get the w:t content to determine whether it is in the reference.
[0013] In one embodiment, the steps for checking the chapter number description are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Get font and size indentation: Get the font and size indentation and other formats by checking the paragraph format description; Is it a title: Determine whether it is a title by comparing it with the title formats of each level in the checklist; Whether "w:numId" is included: whether "w:p" contains the w:numId definition; Corresponding style contains "w:numId": Get the style of "w:p" and determine whether there is w:numId in the style; Get "w:outlineLvl": Get the level information corresponding to "w:p"; Calculate the number by level and numId: Get the level calculation method of numbering.xml by numId to calculate the sequence number of the current level, and add the number of the previous level in the collection to form the final number; Whether it starts with nm: Determine whether the "w:p" content starts with nm, that is, whether it starts with 1 or 1.1 or 1.1.1; Get number: get the number through regular expression; Total number: the number collection of two numbering methods; Order: Whether the last placeholder of the same layer number is in order and whether the previous placeholders are the same.
[0014] In one embodiment, the steps of the method for checking chart numbers are as follows: Get the figure title by checking the paragraph format method; Get the first number after the figure / table: Use the regular expression "\d[\.\d]*" to get the number.
[0015] The beneficial effects of the present invention are as follows: The present invention is reasonably designed and has a definable checklist, which can check the text content and text font, style and other format information, table information, picture information, chart information, document header, document footer, document layout, margin and other style information of the WORD document, complete corresponding inspection and judgment and make annotations to ensure the correctness and standardization of document compilation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of the process of executing the document inspection program; Figure 2 It is a flowchart of the method of checking paragraph format; Figure 3 is a flowchart of the method for checking chart titles; Figure 4 It is a flow chart of the method of checking punctuation; Figure 5 It is a flow chart of the method of checking references; Figure 6 is a flow chart of the method of checking chapter numbering; Figure 7 It is a flow chart of the method of checking chart numbering; Figure 8 It is a flow chart of the method of checking catalogue problems; Fig. 9 is a flowchart of a custom checklist. Implementation
[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0018] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. In addition, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0020] In the description of the embodiments of the present invention, it should be noted that the terms "inside", "outside", "upper", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, or are the orientations or positional relationships in which the inventive product is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. Example
[0021] This embodiment provides a method for automatically checking the format of a document, comprising the following steps: S1. Define document format check items. Document format check items are divided into fixed check items and custom check items. Fixed item checks include paragraph checks, figure checks, title checks, table of contents checks, and reference checks; Paragraph checking includes text checking, page margin checking, header checking, footer checking, punctuation checking, blank page checking, blank line checking, and paragraph duplication checking; Chart inspection includes checking the chart title, table title, and whether the table title spans across pages; Title checking includes outline level checking, numbering format checking, font size checking, paragraph checking, indentation checking, and spacing checking. The outline level checking supports from level 1 to level 5 titles; The table of contents check includes the text table of contents check, figure title table of contents check and table title table of contents check.
[0022] Customized check items are aimed at some uncertain inspection locations and directions. Some more flexible customized inspection rules are formulated under the existing rules. Customized check items include bookmark check, header and footer check, total page number check, layout feature check, content consistency check and required item check.
[0023] S2. Inspection method: document inspection execution process, key inspection point process method and custom inspection checklist. Custom checklist processing can realize automatic document format inspection. Among them, users can customize the inspection format in the custom checklist processing. The inspection format includes body paragraph format, table of contents format, body figure title format and title format.
[0024] like Figure 1As shown, in step S2, the specific steps of the document inspection execution process are as follows: 1) Use CMD to call C# through Java to use Word SDK to check the directory and chapter number. If there is any error after the check, save the error information to MySQL, and store the check log to Redis and MySQL; 2) While the word SDK is checking, Java uses Apache POI to start checking bookmarks and text. After the check is completed, if there is an error, the error information will be saved to MySQL, and the check log will be stored in Redis and MySQL; 3) After all programs have been checked, if there are any errors, first use the Word SDK to create annotations for the errors found, then use Apache POI to create annotations for the errors found, and save the annotated document to the file system; 4) When the inspection is in progress, the user interface displays the inspection details by querying redis. If the inspection log is viewed through the inspection history after the inspection is completed, the inspection details are displayed by querying mysql.
[0025] In one embodiment, in step S2, the key checkpoint process method includes a method for checking paragraph format, a method for checking figure titles, a method for checking punctuation, a method for checking references, a method for checking chapter numbering, a method for checking figure numbering, and a method for checking directory issues.
[0026] like Figure 2 As shown, the method for checking paragraph format includes the following contents: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Search for "w:r": Get the text in the paragraph, the text mark is: "w:r"; Whether to set "w:pStyle": Each paragraph of text may contain its own w:pStyle; "w:p" whether to set "w:pStyle": if w:r has no style, use the style of w:p; Get the default "w:pStyle": If w:p has no style, use the document's default style; Get the attribute w:val of w:pStyle as the style id: get the id of the style; Get the style of the corresponding id from styles: get the style from the styles.xml document according to the id in the previous step; Whether to inherit style: Determine whether the acquired style contains w:basedOn; Merge parent style: merge the font size and indentation of the parent style; Get font size, etc.: Get the merged font size and indent; Checklist: Get the font size, indentation and other information in the checklist; Determine whether the font and size are correct: Compare the obtained content and format with the check items in the checklist to determine whether the content and format are correct; like Figure 3 As shown, the steps for checking the chart title method are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find pic:pic and w:tbl: Get pictures (pic:pic) and tables (w:tbl) in XML; Get xml node: Get the node (domNode) of the previous step data in xml; Search up w:p (table) / search down w:p (picture): If it is a table, use domNode.preNode to get the previous node; if it is a picture, use domNode.nextNode to get the next node; Empty line: Determine whether the node content obtained in the previous step is empty; Whether the number of loops exceeds 5: The number of times of obtaining the previous node or the next node cannot exceed 5; Determine whether it starts with "Figure" or "Table": According to convention, figure titles start with "Figure" and table titles start with "Table"; Check according to the above paragraph format: Use Figure 2 Check paragraph formatting in this way.
[0027] like Figure 4 As shown, the specific steps of the punctuation check method are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Text collection: Get the characters and punctuation marks in w:p and store them in the collection in order; Get punctuation marks: find the position of punctuation marks in the collection; In the first position of a text set: determine whether the punctuation mark is the first one in the set; Get the previous character: the character before the punctuation mark found above; Punctuation: Determine whether the previous character is a punctuation mark; Chinese and English punctuation marks do not match: if the previous character is Chinese and the punctuation mark is English, it is an error, and vice versa; Find Next Punctuation: Finds the next occurrence of a punctuation mark starting from the current one.
[0028] like Figure 5 As shown, the steps of checking references are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Content = References: Determine whether the text content of w:p refers to the content of the references; Get the domNode of w:p: Get the dom node in the xml where w:p is located; Get the next domNode: get the dom node through nextNode; Whether it starts with "[n]": the node content starts with "[n]"; Is n ordered: whether n is an ordered number; Whether it is cited: Determine whether it is cited based on the reference set of the text; Get w:t: Get w:t in w:p; Whether it contains w:vertAlign: whether w:t contains the w:vertAlign tag; Whether the attribute w:val is a superscript: whether the value of the w:vertAlign tag is equal to the superscript; Whether the content is consistent with the reference: Get the w:t content to determine whether it is in the reference.
[0029] like Figure 6 As shown, the steps to check the chapter number description are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Get font and size indentation: Get the font and size indentation and other formats by checking the paragraph format description; Is it a title: Determine whether it is a title by comparing it with the title formats of each level in the checklist; Whether "w:numId" is included: whether "w:p" contains the w:numId definition; Corresponding style contains "w:numId": Get the style of "w:p" and determine whether there is w:numId in the style; Get "w:outlineLvl": Get the level information corresponding to "w:p"; Calculate the number by level and numId: Get the level calculation method of numbering.xml by numId to calculate the sequence number of the current level, and add the number of the previous level in the collection to form the final number; Whether it starts with nm: Determine whether the "w:p" content starts with nm, that is, whether it starts with 1 or 1.1 or 1.1.1; Get number: get the number through regular expression; Total number: the number collection of two numbering methods; Order: Whether the last placeholder of the same layer number is in order and whether the previous placeholders are the same.
[0030] like Figure 7 As shown, the steps for checking the chart numbering method are as follows: Get the figure title by checking the paragraph format method; Get the first number after the figure / table: Use the regular expression "\d[\.\d]*" to get the number.
Claims
1. A method for automatically checking document format, characterized in that: The steps include: S1. Define document format check items. Document format check items are divided into fixed check items and custom check items. S2. Check the fixed check items and custom check item documents in step 1 according to the execution process, key checkpoint process methods and custom checklist processing to achieve automatic document format checking. In the custom checklist processing, users can customize the inspection format, which includes the text paragraph format, directory format, text figure title format and title format.
2. The method for automatically checking the document format according to claim 1, characterized in that: In step S1, the fixed item check includes paragraph check, figure check, title check, directory check and reference check; Paragraph checking includes text checking, page margin checking, header checking, footer checking, punctuation checking, blank page checking, blank line checking, and paragraph duplication checking; Chart inspection includes checking the chart title, table title, and whether the table title spans across pages; Title checking includes outline level checking, numbering format checking, font size checking, paragraph checking, indentation checking, and spacing checking; outline level checking supports from level 1 to level 5 titles; The table of contents check includes the text table of contents check, figure title table of contents check and table title table of contents check.
3. A method for automatically checking document format according to claim 2, characterized in that: In step S1, the custom check items include bookmark check, header and footer check, total page number check, layout feature check, content consistency check and required item check.
4. The method for automatically checking the document format according to claim 1, characterized in that: In step S2, the specific steps of the document inspection execution process are as follows: 1) Use CMD to call C# through Java to use Word SDK to check the directory and chapter number. If there is any error after the check, save the error information to MySQL, and store the check log to Redis and MySQL; 2) While the word SDK is checking, Java uses Apache POI to start checking bookmarks and text. After the check is completed, if there is an error, the error information will be saved to MySQL, and the check log will be stored in Redis and MySQL; 3) After all programs have been checked, if there are any errors, first use the Word SDK to create annotations for the errors found, then use Apache POI to create annotations for the errors found, and save the annotated document to the file system; 4) When the inspection is in progress, the user interface displays the inspection details by querying redis. If the inspection log is viewed through the inspection history after the inspection is completed, the inspection details are displayed by querying mysql.
5. The method for automatically checking the document format according to claim 1, characterized in that: In step S2, the key checkpoint process method includes a method for checking paragraph format, a method for checking figure titles, a method for checking punctuation, a method for checking references, a method for checking chapter numbers, a method for checking figure numbers, and a method for checking directory issues.
6. A method for automatically checking document format according to claim 5, characterized in that: The method of checking paragraph format includes the following: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Search for "w:r": Get the text in the paragraph, the text mark is: "w:r"; Whether to set "w:pStyle": Each paragraph of text may contain its own w:pStyle; "w:p" whether to set "w:pStyle": if w:r has no style, use the style of w:p; Get the default "w:pStyle": If w:p has no style, the document's default style is used; Get the attribute w:val of w:pStyle as the style id: get the id of the style; Get the style of the corresponding id from styles: get the style from the styles.xml document according to the id in the previous step; Whether to inherit style: Determine whether the acquired style contains w:basedOn; Merge parent style: merge the font size and indentation of the parent style; Get font size, etc.: Get the merged font size and indent; Checklist: Get the font size, indentation and other information in the checklist; Determine whether the font and size are correct: Compare the obtained content and format with the check items in the checklist to determine whether the content and format are correct; The steps to check the chart title method are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find pic:pic and w:tbl: Get pictures (pic:pic) and tables (w:tbl) in XML; Get xml node: Get the node (domNode) of the previous step data in xml; Search up w:p (table) / search down w:p (picture): If it is a table, use domNode.preNode to get the previous node; if it is a picture, use domNode.nextNode to get the next node; Empty line: Determine whether the node content obtained in the previous step is empty; Whether the number of loops exceeds 5: The number of times of obtaining the previous node or the next node cannot exceed 5; Determine whether it starts with "Figure" or "Table": According to convention, figure titles start with "Figure" and table titles start with "Table"; Check according to the above paragraph format: Use the method in Figure 2 to check the paragraph format.
7. A method for automatically checking document format according to claim 6, characterized in that: The specific steps of the punctuation check method are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Text collection: Get the characters and punctuation marks in w:p and store them in the collection in order; Get punctuation marks: find the position of punctuation marks in the collection; In the first position of a text set: determine whether the punctuation mark is the first one in the set; Get the previous character: the character before the punctuation mark found above; Punctuation: Determine whether the previous character is a punctuation mark; Chinese and English punctuation marks do not match: if the previous character is Chinese and the punctuation mark is English, it is an error, and vice versa; Find Next Punctuation: Finds the next occurrence of a punctuation mark starting from the current one.
8. The method for automatically checking the document format according to claim 7, characterized in that: The steps to check references are as follows: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Content = References: Determine whether the text content of w:p refers to the content of the references; Get the domNode of w:p: Get the dom node in the xml where w:p is located; Get the next domNode: get the dom node through nextNode; Whether it starts with "[n]": the node content starts with "[n]"; Is n ordered: whether n is an ordered number; Whether it is cited: Determine whether it is cited based on the reference set of the text; Get w:t: Get w:t in w:p; Whether it contains w:vertAlign: whether w:t contains the w:vertAlign tag; Whether the attribute w:val is a superscript: whether the value of the w:vertAlign tag is equal to the superscript; Whether the content is consistent with the reference: Get the w:t content to determine whether it is in the reference.
9. The method for automatically checking the document format according to claim 8, characterized in that: To check the chapter number description, follow these steps: Loading XML document: Use APACHE POI to read the document's OOXML file; Find "w:p": read the paragraph in the XML document, the paragraph tag is "w:p"; Get font and size indentation: Get the font and size indentation and other formats by checking the paragraph format description; Is it a title: Determine whether it is a title by comparing it with the title formats of each level in the checklist; Whether "w:numId" is included: whether "w:p" contains the w:numId definition; Corresponding style contains "w:numId": Get the style of "w:p" and determine whether there is w:numId in the style; Get "w:outlineLvl": Get the level information corresponding to "w:p"; Calculate the number by level and numId: Get the level calculation method of numbering.xml by numId to calculate the sequence number of the current level, and add the number of the previous level in the collection to form the final number; Whether it starts with nm: Determine whether the "w:p" content starts with nm, that is, whether it starts with 1 or 1.1 or 1.1.1; Get number: get the number through regular expression; Total number: the number collection of two numbering methods; Order: Whether the last placeholder of the same layer number is in order and whether the previous placeholders are the same.
10. The method for automatically checking the document format according to claim 9, characterized in that: The steps to check the chart numbering method are as follows: Get the figure title by checking the paragraph format method; Get the first number after the figure / table: Use the regular expression "\d[\.\d]*" to get the number.
Citation Information
Cited By
Method and device for automatically correcting format of docx document and electronic equipment
CN120561089A
A method and device for automatically correcting the format of a docx document, and an electronic device
CN120561089B
Word document format checking and optimizing method
CN120893403A
