Document processing method and apparatus, electronic device, and storage medium

By detecting and adjusting the indentation format of paragraphs at the same level in the document, the problem of inconsistent paragraph indentation was solved, improving the reading fluency and layout of the document, and increasing processing efficiency.

CN115758992BActive Publication Date: 2026-07-10GUANGZHOU KINGSOFT MOBILE TECH +3

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU KINGSOFT MOBILE TECH
Filing Date
2022-10-17
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In the process of document writing, inconsistent indentation formats of paragraphs at the same level lead to a decline in reading fluency and typesetting effect. Existing technologies are unable to quickly identify and batch adjust these issues, resulting in low processing efficiency.

Method used

By detecting the indentation of the nth level paragraphs in the current document, inconsistencies are identified, and the indentation format and spacing of the paragraphs are adjusted using the indentation uniformity control or target indentation parameters to make all paragraphs consistent.

Benefits of technology

It can quickly identify and adjust paragraph indentation, improving document layout, reducing workload, and increasing document processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115758992B_ABST
    Figure CN115758992B_ABST
Patent Text Reader

Abstract

The present disclosure provides a document processing method and device, electronic equipment and storage medium. The document processing method comprises: detecting the indentation condition of the paragraph belonging to the nth level in the current document to obtain a check result; wherein n is a positive integer less than or equal to N; N is the total level number of the current document; in the case that the check result indicates that the indentation condition of the paragraph belonging to the nth level in the current document is inconsistent, adjusting the indentation condition of at least part of the paragraph belonging to the nth level in the current document to make the indentation condition of all the paragraphs belonging to the nth level in the current document consistent. This scheme can quickly check and adjust the indentation condition of the paragraphs of each level in the document, and improve the document processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of information technology, and in particular to a document processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Currently, when users are writing documents, there may be inconsistencies in paragraph indentation at the same level within the same context. This can reduce the readability of the document content and the overall layout.

[0003] Because paragraph indentation in a document is displayed as a blank space, the indentation format cannot be shown. This can lead to different indentation formats appearing identical to the surrounding text, making it difficult to detect inconsistencies. Furthermore, when paragraphs at the same level are separated by other levels within the document, users may find it difficult to discern whether the indentation spacing and formatting of paragraphs belonging to that level are consistent.

[0004] Users need to manually check the indentation format and indentation distance one by one by dragging or clicking with the mouse. The checking process is time-consuming, laborious, and prone to omissions. Furthermore, since most paragraphs at the same level are presented in a disjointed and fragmented state in the article, after finding them, they need to compare and adjust them according to the indentation method in the previous text. Batch modification is not possible, and frequent scrolling of the article is required, resulting in low processing efficiency. Summary of the Invention

[0005] This disclosure provides a document processing method, apparatus, electronic device, and storage medium.

[0006] According to a first aspect of the present disclosure, a document processing method is provided, the method comprising:

[0007] The indentation of paragraphs belonging to the nth level in the current document is detected, and the detection result is obtained; where n is a positive integer less than or equal to N; N is the total number of levels in the current document;

[0008] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of at least some paragraphs belonging to the nth level in the current document shall be adjusted to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

[0009] In some embodiments, detecting the indentation of paragraphs belonging to the nth level in the current document and obtaining the inspection result includes:

[0010] The indentation distance and indentation format used by each paragraph belonging to the nth level in the current document are checked to obtain the check result;

[0011] Specifically, if paragraphs belonging to the nth level use different indentation distances and / or different indentation formats, the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0012] In some embodiments, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent includes:

[0013] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, an indentation uniformity control is displayed.

[0014] Upon detecting a first operation applied to the indentation unification control, the indentation of at least some paragraphs belonging to the nth level in the current document is adjusted to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

[0015] In some embodiments, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent includes:

[0016] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, a target indentation parameter for paragraphs belonging to the nth level in the current document is determined.

[0017] Based on the determined target indentation parameters, adjust the indentation of at least some paragraphs belonging to the nth level in the current document so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

[0018] In some embodiments, determining the target indentation parameter for the paragraphs belonging to the nth level in the current document when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent includes:

[0019] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents.

[0020] When the similarity exceeds the first threshold, the target indentation parameter for the paragraphs belonging to the nth level in the current document is determined based on the indentation status of the paragraphs belonging to the nth level in the historical document.

[0021] In some embodiments, determining the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents includes:

[0022] For each indentation state among all paragraphs belonging to the nth level in the current document, perform the following operations:

[0023] In the current document, among all paragraphs belonging to the nth level, determine the first frequency of occurrence corresponding to the paragraph where the indentation status is located;

[0024] In the historical document, among all paragraphs belonging to the nth level, determine the second frequency of occurrence corresponding to the paragraph where the indentation status is located;

[0025] Based on the first occurrence frequency and the second occurrence frequency, determine the similarity between the indentation status of the paragraph belonging to the nth level in the current document and the indentation status of the paragraph belonging to the nth level in the historical document.

[0026] In some embodiments, when there is a similarity greater than a first threshold, determining the target indentation parameter for the paragraphs belonging to the nth level in the current document based on the indentation status of paragraphs belonging to the nth level in the historical documents includes:

[0027] When there is a similarity greater than the first threshold, at least one candidate indentation state is determined among the indentation states of all paragraphs belonging to the nth level in the historical document, wherein the similarity corresponding to the candidate indentation state is greater than the first threshold.

[0028] When a target indentation exists among at least one of the candidate indentation states, the target indentation parameter is determined based on the indentation parameter used by the target indentation state; wherein the second occurrence frequency corresponding to the paragraph where the target indentation state is located is greater than a second threshold.

[0029] In some embodiments, the method further includes:

[0030] When there is no similarity greater than the first threshold, the target indentation parameter is determined to be one of the following parameters:

[0031] Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected.

[0032] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0033] Among the indentation parameters of paragraphs belonging to the nth level in the online document, the most frequently used indentation parameter is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document;

[0034] The indentation parameter has a preset correspondence with the nth level.

[0035] In some embodiments, determining the target indentation parameter for the paragraphs belonging to the nth level in the current document when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent includes:

[0036] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the target indentation parameter for paragraphs belonging to the nth level in the current document is determined to be one of the following parameters:

[0037] Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected.

[0038] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0039] Among the indentation parameters of paragraphs belonging to the nth level in the online document, the most frequently used indentation parameter is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document;

[0040] An indentation parameter that has a preset correspondence with the nth level.

[0041] In some embodiments, the method further includes:

[0042] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, a warning marker indicating inconsistent indentation of paragraphs belonging to the nth level in the current document will be displayed.

[0043] In some embodiments, the indicator that displays inconsistent indentation of paragraphs belonging to the nth level in the current document includes:

[0044] Display a first prompt marker; wherein, the first prompt marker is used to indicate the most frequently occurring indentation state among the indentation states of paragraphs belonging to the nth level in the current document;

[0045] And / or,

[0046] Display a second prompt marker; wherein, the second prompt marker is used to indicate the remaining indentation states of the paragraphs belonging to the nth level in the current document, excluding the most frequently occurring indentation state; the second prompt marker is different from the first prompt marker.

[0047] In some embodiments, the method further includes:

[0048] Display a hierarchy list; wherein the hierarchy list includes the hierarchy information of the nth level in the current document;

[0049] Upon detecting a second operation acting on the hierarchical information of the nth level, a toggle button is displayed; wherein the toggle button is used to switch the display of the indentation status of paragraphs belonging to the nth level in the current document when the indentation status of paragraphs belonging to the nth level in the current document is inconsistent.

[0050] According to a second aspect of the present disclosure, a document processing apparatus is provided, the apparatus comprising:

[0051] The detection module is used to detect the indentation status of paragraphs belonging to the nth level in the current document and obtain the inspection result; where n is a positive integer less than or equal to N; and N is the total number of levels in the current document;

[0052] An adjustment module is configured to adjust the indentation of at least some paragraphs belonging to the nth level in the current document, when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, so as to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

[0053] According to a third aspect of the present disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the document processing method of any one of the first aspects.

[0054] According to a fourth aspect of the present disclosure, a storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the document processing method according to any one of the first aspects.

[0055] This disclosure provides a document processing method, apparatus, electronic device, and storage medium that detects the indentation of paragraphs belonging to the nth level in the current document to obtain a check result. If the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of at least some of the paragraphs belonging to the nth level in the current document is adjusted to make the indentation of all paragraphs belonging to the nth level in the current document consistent. In this way, the indentation of paragraphs at each level in the current document can be quickly checked, and if the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of paragraphs belonging to the nth level in the current document can be quickly adjusted, thereby effectively improving the document content layout effect, reducing the document processing workload, and increasing document processing efficiency.

[0056] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0057] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0058] Figure 1 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0059] Figure 2 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0060] Figure 3 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0061] Figure 4 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0062] Figure 5 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0063] Figure 6 A flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0064] Figure 7a An example flowchart of a document processing method provided by an embodiment of this disclosure is shown.

[0065] Figure 7b A schematic diagram of an interface provided by an embodiment of this disclosure is shown.

[0066] Figure 7cA schematic diagram of an interface provided by an embodiment of this disclosure is shown.

[0067] Figure 7d An example screenshot of an embodiment of this disclosure before using uniform indentation is shown.

[0068] Figure 7e An example screenshot using uniform indentation is shown, provided by an embodiment of this disclosure.

[0069] Figure 8 A structural block diagram of a document processing apparatus provided in an embodiment of this disclosure is shown.

[0070] Figure 9 A structural block diagram of an electronic device provided in an embodiment of this disclosure is shown. Detailed Implementation

[0071] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this disclosure as detailed in the appended claims.

[0072] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. The singular forms “a,” “the,” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0073] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of embodiments of this disclosure, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0074] It is understood that the description of the various embodiments in this disclosure emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.

[0075] Figure 1A flowchart illustrating a document processing method provided in an embodiment of this disclosure is shown. Figure 1 As shown, the document processing method may include the following steps:

[0076] 101. Detect the indentation of paragraphs belonging to the nth level in the current document and obtain the detection result; where n is a positive integer less than or equal to N; N is the total number of levels in the current document;

[0077] 102. If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, adjust the indentation of at least some paragraphs belonging to the nth level in the current document so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

[0078] The document processing method provided in this disclosure can be applied to electronic devices, such as mobile phones, tablets, laptops, or document processors.

[0079] The current document can be an office document or a non-office document. For example, the current document may include, but is not limited to, at least one of the following: a thesis, technical document, official document, or contract document. This embodiment does not limit the specific content and format of the current document.

[0080] The current document can be the document currently displayed on the electronic device, the document currently being edited on the electronic device, or a document opened by a foreground application on the electronic device. Of course, the above is just an example of the current document, and the actual implementation is not limited to this example.

[0081] The current document has a hierarchical structure, and the nth level of the current document can be any one of the N levels of the current document. It is understood that the solution provided in this disclosure embodiment can be used to process each level of the current document.

[0082] The current document's hierarchical structure corresponds to different levels of headings. The headings in the current document can include level 1 headings, level 2 headings, level 3 headings, and so on. For example, Heading 1 is a level 1 heading, Heading 1.1 is a level 2 heading, and Heading 1.1.1 is a level 3 heading.

[0083] Each level of the current document consists of one or more paragraphs, and each paragraph typically has corresponding indentation parameters. These indentation parameters reflect the paragraph's indentation status. The indentation parameters can include indentation distance and indentation format.

[0084] Paragraph indentation refers to the amount of indentation of the first line of a paragraph, or the distance between the left edge of the paragraph's smallest bounding rectangle and the left edge of the page, or the distance between the right edge of the paragraph's smallest bounding rectangle and the right edge of the page. Indentation can be measured in characters, for example, an indentation of 2 characters.

[0085] Indentation formats may include first-line indentation, left indentation, right indentation, and / or hanging indentation.

[0086] In some examples, in step 101 above, the indentation status of each paragraph at the nth level can be detected, and it can be determined whether the detected indentation status of each paragraph at the nth level is consistent, thus obtaining the inspection result.

[0087] In some embodiments, in response to a format check instruction for the current document, the indentation of paragraphs belonging to the nth level in the current document can be detected, and a check result can be obtained; wherein, the format check instruction may instruct format checks to be performed on all or part of the content belonging to the current document, and the part of the level includes at least the nth level.

[0088] In some examples, a formatting check instruction for the current document is received upon detection of a formatting check operation for the current document. Here, the formatting check instruction may be generated by the user.

[0089] For example, document processing software may have a pre-set format check control, which the user can trigger to perform a format check operation on the current document. Here, the document processing software is, for example, a text editing software, typically including but not limited to WPS Office. The format check control may be, for example, a format check button or a menu item for format checking.

[0090] For example, when the current document is open in the document processing software, the user can trigger a format check operation for the current document by clicking the format check control or pressing the key corresponding to the format check control. Correspondingly, upon detecting a format check operation for the current document, the user determines to receive the format check instruction.

[0091] In some embodiments, in response to a text input or text paste operation at the nth level in the current document, the indentation of paragraphs belonging to the nth level in the current document can be detected, and the inspection result can be obtained.

[0092] When a user edits content at the same level in the current document, the user may use different input methods or copy and paste content from other documents, web pages, chat tools, emails, etc., which may result in inconsistent paragraph indentation at the same level in the context. Therefore, when receiving a text input or text paste operation for the nth level in the current document, the indentation of paragraphs belonging to the nth level in the current document can be detected.

[0093] In some embodiments, prior to the execution of step 101, the method may further include:

[0094] Determine the hierarchical structure of the current document and the paragraphs contained in each level of the hierarchical structure.

[0095] In some examples, a pre-trained recognition model can be used to identify the title of the current document and determine its hierarchical structure. One such recognition model is the Transformer-CRF model.

[0096] Once the hierarchical structure of the current document is determined, all paragraphs belonging to the same level within the current document can be identified.

[0097] For example, if Heading 1.1, Heading 1.2, and Heading 2.1 all correspond to the second level, then the paragraphs under Heading 1.1, Heading 1.2, and Heading 2.1 are all paragraphs belonging to the second level.

[0098] In some examples, in step 102 above, when adjusting the indentation of at least some paragraphs belonging to the nth level in the current document, the indentation distance of at least some paragraphs belonging to the nth level in the current document can be adjusted according to the most frequently used indentation parameter among the indentation parameters of the paragraphs belonging to the nth level in the current document, so that all paragraphs belonging to the nth level in the current document have a uniform indentation distance, and the indentation format of at least some paragraphs belonging to the nth level in the current document can be adjusted so that all paragraphs belonging to the nth level in the current document have a uniform indentation format.

[0099] It should be noted that this embodiment can, by default, directly adjust the indentation of at least some paragraphs belonging to the nth level in the current document to unify the indentation of paragraphs belonging to the nth level, if the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent. Alternatively, it can be configured to adjust the indentation of at least some paragraphs belonging to the nth level in the current document according to the trigger command received, so as to make the indentation of paragraphs belonging to the nth level in the current document consistent. For example, the trigger command can be: a command generated by triggering an operation on a preset indentation unification control, a command entered in the editing item of the menu bar, or a command entered through a preset shortcut key.

[0100] Understandably, if the indentation of paragraphs at level n in the current document is consistent, then no changes are made to the indentation of paragraphs at level n. However, if the indentation of paragraphs at level n in the current document is inconsistent, then the indentation of at least some paragraphs at level n in the current document is adjusted to make the indentation of all paragraphs at level n in the current document consistent.

[0101] In the above document processing method, the indentation of paragraphs belonging to the nth level in the current document is detected to obtain a check result. If the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of at least some paragraphs belonging to the nth level in the current document is adjusted to make the indentation of all paragraphs belonging to the nth level in the current document consistent. In this way, the indentation of paragraphs belonging to the nth level in the current document can be quickly detected, and if the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of paragraphs belonging to the nth level in the current document can be quickly adjusted, thereby effectively improving the document content layout effect, reducing the document processing workload, and improving document processing efficiency.

[0102] In one embodiment, step 101 above, detecting the indentation of paragraphs belonging to the nth level in the current document and obtaining the inspection result, may include:

[0103] Check the indentation distance and indentation format used by each paragraph belonging to the nth level in the current document, and obtain the check results;

[0104] Specifically, if paragraphs belonging to the nth level use different indentation distances and / or different indentation formats, the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0105] In this embodiment, by checking the indentation distance and indentation format used by each paragraph of the nth level, it can be determined whether the indentation format used by each paragraph of the nth level is consistent, and whether the indentation distance used by each paragraph of the nth level is consistent.

[0106] It is understandable that if all paragraphs belonging to the nth level in the current document use the same indentation distance and indentation format, it can be determined that the indentation of paragraphs belonging to the nth level in the current document is consistent; if the indentation distance and / or indentation format of all paragraphs belonging to the nth level in the current document are different, it can be determined that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0107] For example, suppose the nth level includes three paragraphs. If the indentation distances used by the first, second, and third paragraphs of the nth level are 2 characters, 2 characters, and 3 characters respectively, then it can be determined that the indentation of the paragraphs belonging to the nth level is inconsistent. If the first and second paragraphs of the nth level both use first-line indentation, and the third paragraph uses left indentation, then it can be determined that the indentation of the paragraphs belonging to the nth level is inconsistent.

[0108] In one embodiment, such as Figure 2 As shown, in step 102 above, if the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent may include:

[0109] 201. If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, display the indentation uniformity control.

[0110] 202. Upon detecting a first operation applied to the indentation uniformity control, adjust the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of paragraphs belonging to the nth level in the current document consistent.

[0111] The first operation applied to the indentation uniformity control is used to trigger adjustments to the indentation of at least some paragraphs belonging to the nth level in the current document.

[0112] The first action can be a user-triggered action. For example, the first action can be a click, drag, or swipe action on the indented unified control, a click or swipe action on a specified area of ​​the indented unified control, or a press action on the button corresponding to the indented unified control.

[0113] In this embodiment, when a first operation is detected acting on the indentation uniformity control, the indentation distance and indentation format of at least some paragraphs belonging to the nth level in the current document can be adjusted to the indentation distance and indentation format of the indentation parameters most frequently used by paragraphs belonging to the nth level in the current document, so as to make the indentation status of all paragraphs belonging to the nth level in the current document consistent.

[0114] In some examples, the inspection results can be displayed in a preset display area, which can be used to indicate whether the indentation of paragraphs belonging to the nth level in the current document is consistent.

[0115] In other examples, if the check result indicates that the indentation of paragraphs belonging to level n in the current document is consistent, a prompt message can be displayed within a preset display area. This prompt message can be used to indicate that the check result for level n is passed, meaning that the indentation of paragraphs belonging to level n is correct; alternatively, the prompt message can be used to indicate the level number in the current document where the check result is passed, where the passed levels include at least level n. It is understood that each level in the current document can be used as a check item for indentation consistency checks.

[0116] In one embodiment, such as Figure 3 As shown, in step 102 above, if the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent may include:

[0117] 301. If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the target indentation parameter for paragraphs belonging to the nth level in the current document.

[0118] When implementing step 301, the indentation parameter that is used most frequently in the paragraphs of the nth level in the current document can be determined as the target indentation parameter, or the target indentation parameter can be determined based on the indentation parameters used in the paragraphs of the nth level in historical documents.

[0119] It is understood that, in addition to the above methods, the target indentation parameter can also be determined in other ways. For example, the indentation parameter corresponding to the nth level can be determined as the target indentation parameter based on the preset correspondence between the level and the indentation parameter. This disclosure does not specifically limit this.

[0120] In some examples, the indentation distance in the target indentation parameter for paragraphs belonging to level n in the current document is greater than the indentation distance in the target indentation parameter for level n-1 in the current document, but less than the indentation distance in the target indentation parameter for level n+1 in the current document.

[0121] Here, level n is lower than level n-1, and level n is higher than level n+1.

[0122] 302. Based on the determined target indentation parameters, adjust the indentation of at least some paragraphs belonging to the nth level in the current document so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

[0123] In this embodiment, the target indentation distance and target indentation format can be determined according to the target indentation parameters. The indentation distance and indentation format used by at least some paragraphs belonging to the nth level in the current document can be adjusted to the target indentation distance and target indentation format, so that the indentation status of all paragraphs belonging to the nth level in the current document is consistent.

[0124] Understandably, if the indentation of all paragraphs at level n in the current document is the same as the target indentation, then it is only necessary to adjust the indentation of at least some paragraphs at level n in the current document to match the target indentation to ensure that all paragraphs at level n in the current document use consistent indentation.

[0125] In one embodiment, such as Figure 4 As shown, in step 301 above, if the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the target indentation parameters for paragraphs belonging to the nth level in the current document are determined, including:

[0126] 401. If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents.

[0127] Historical documents can be various documents that the current user has edited in the past, such as academic papers, technical documents, official documents, or contract documents. This embodiment does not limit the specific content and format of historical documents.

[0128] In some examples, the historical document and the current document have the same document type. For example, both the current document and the historical document are contract documents. There can be one or more historical documents, which can be documents stored within a preset historical time period. For example, the preset historical time period is one month prior to the current time.

[0129] The indentation status of paragraphs at the nth level in historical documents can reflect the user's indentation behavior for paragraphs at the nth level.

[0130] In some examples, a preset similarity algorithm or a similarity recognition model trained by machine learning can be used to determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents.

[0131] 402. When there is a similarity greater than the first threshold, determine the target indentation parameter for the paragraphs belonging to the nth level in the current document based on the indentation status of the paragraphs belonging to the nth level in the historical documents.

[0132] The first threshold can be set according to actual application needs. For example, the first threshold can be set to 0.7 or 0.8 or other suitable values. Taking a first threshold of 0.8 as an example, when the similarity is 0.9, the target indentation parameter of the paragraph belonging to the nth level in the current document can be determined based on the indentation status of the paragraphs belonging to the nth level in the historical documents.

[0133] For example, the target indentation parameter can be determined based on the indentation parameters used when the similarity of paragraphs belonging to the nth level in the historical document is greater than a first threshold.

[0134] In this embodiment, the higher the similarity between the indentation of paragraphs at level n in the current document and the indentation of paragraphs at level n in historical documents, the stronger the reference value of the historical documents. When the similarity exceeds a first threshold, it indicates that the historical documents have strong reference value. Therefore, determining the target indentation parameter for paragraphs at level n in the current document based on the indentation of paragraphs at level n in historical documents can improve the accuracy of the target indentation parameter and enhance the document indentation processing effect.

[0135] In one embodiment, such as Figure 5 As shown, in step 401 above, determining the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents includes:

[0136] 501. For each indentation indentation of all paragraphs belonging to the nth level in the current document, perform the following operations:

[0137] In the current document, among all paragraphs belonging to the nth level, determine the first frequency of occurrence of the paragraph containing the indentation condition;

[0138] In the history document, among all paragraphs belonging to the nth level, determine the second frequency of occurrence of the paragraph containing the indentation condition;

[0139] Based on the first and second frequencies of occurrence, determine the similarity between the indentation of paragraphs at level n in the current document and the indentation of paragraphs at level n in historical documents.

[0140] In some examples, determining the first frequency of occurrence of the paragraph containing the indentation among all paragraphs belonging to the nth level in the current document may include:

[0141] In the current document, among all paragraphs belonging to the nth level, determine the proportion of the total number of paragraphs containing the indentation condition in the total number of paragraphs in all paragraphs, and obtain the first frequency of occurrence corresponding to the paragraph containing the indentation condition.

[0142] For example, assuming that the indentation status of paragraphs belonging to the nth level in the current document includes indentation status 1 and indentation status 2, and the total number of paragraphs at the nth level is 15, where the total number of paragraphs containing indentation status 1 is 12 and the total number of paragraphs containing indentation status 2 is 3, then the occurrence frequencies of the paragraphs containing indentation status 1 and the paragraphs containing indentation status 2 are determined to be 12 / 15 and 3 / 15, respectively.

[0143] In some examples, determining the second frequency of occurrence of the paragraph containing the indentation condition among all paragraphs at level n in the historical document can include:

[0144] In the historical document, among all paragraphs belonging to the nth level, determine the proportion of the total number of paragraphs containing the indentation condition in the total number of paragraphs in all paragraphs, and obtain the second frequency of occurrence corresponding to the paragraph containing the indentation condition.

[0145] For example, suppose that the indentation of paragraphs belonging to the nth level in the historical document includes indentation 1, indentation 2 and indentation 3, and the total number of paragraphs at the nth level is 89. Among them, the total number of paragraphs with indentation 1 is 77, the total number of paragraphs with indentation 2 is 8, and the total number of paragraphs with indentation 3 is 4. Then, the occurrence frequencies of the paragraphs with indentation 1, indentation 2 and indentation 3 are determined to be 77 / 89, 8 / 89 and 4 / 89, respectively.

[0146] Understandably, for the first indentation of all paragraphs belonging to the nth level in the current document, if the first frequency of occurrence of the paragraph corresponding to the first indentation in the current document is closer to the second frequency of occurrence of the paragraph corresponding to the first indentation in the historical documents, then the similarity between the first indentation of the paragraphs belonging to the nth level in the current document and the first indentation of the paragraphs belonging to the nth level in the historical documents is greater.

[0147] The first indentation can be any one of the indentation states of all paragraphs belonging to the nth level in the current document.

[0148] In some examples, determining the similarity between the indentation of paragraphs at level n in the current document and the indentation of paragraphs at level n in historical documents, based on a first frequency of occurrence and a second frequency of occurrence, may include:

[0149] For the first indentation condition, the similarity between the first indentation condition of the paragraph at level n in the current document and the first indentation condition of the paragraph at level n in the historical document can be determined based on the absolute value of the difference between the first occurrence frequency of the first indentation condition in the paragraph at level n in the current document and the second occurrence frequency of the first indentation condition in the paragraph at level n in the historical document.

[0150] In some examples, the absolute value of the difference between the first occurrence frequency of the paragraph corresponding to the first indentation state in the current document's nth level and the second occurrence frequency of the paragraph corresponding to the first indentation state in the historical document's nth level is negatively correlated with the similarity corresponding to the first indentation state; that is, the smaller the absolute value of the difference, the greater the similarity.

[0151] For example, the similarity can be equal to the difference obtained by subtracting the absolute value of the difference from 1.

[0152] For example, if in the current document, the frequency of occurrence of the paragraph with indentation 1 and the frequency of occurrence of the paragraph with indentation 2 are 12 / 15 and 3 / 15 respectively, and in the historical document, the frequency of occurrence of the paragraph with indentation 1 and the frequency of occurrence of the paragraph with indentation 2 are 77 / 89 and 8 / 89 respectively, then the similarity between indentation 1 of the paragraph at level n in the current document and indentation 1 of the paragraph at level n in the historical document is: 1 - |12 / 15 - 77 / 89|, that is, the similarity of indentation 1 is 0.93; the similarity between indentation 2 of the paragraph at level n in the current document and indentation 2 of the paragraph at level n in the historical document is: 1 - |3 / 15 - 8 / 89|, that is, the similarity of indentation 2 is 0.89.

[0153] In other examples, determining the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents, based on a first frequency of occurrence and a second frequency of occurrence, includes:

[0154] For the first indentation condition, the similarity between the first indentation condition of the paragraph corresponding to the first indentation condition and the second indentation condition of the paragraph corresponding to the first indentation condition can be determined based on the ratio between the first occurrence frequency of the paragraph corresponding to the first indentation condition and the second occurrence frequency of the paragraph corresponding to the first indentation condition.

[0155] For example, when the ratio between the first occurrence frequency of the paragraph corresponding to the first indentation state in the current document's nth level and the second occurrence frequency of the paragraph corresponding to the first indentation state in the historical document's nth level is less than or equal to 1, the ratio can be used as the similarity; when the ratio is greater than 1, the reciprocal of the ratio is used as the similarity.

[0156] It is understandable that by performing the above steps for each indentation state among all paragraphs belonging to the nth level in the current document, the similarity corresponding to each indentation state can be determined.

[0157] In one embodiment, such as Figure 6 As shown, in step 402 above, when there is a similarity greater than the first threshold, the target indentation parameters for paragraphs belonging to the nth level in the current document are determined based on the indentation status of paragraphs belonging to the nth level in historical documents. These parameters may include:

[0158] 601. When there is a similarity greater than the first threshold, determine at least one candidate indentation status among the indentation status of all paragraphs belonging to the nth level in the historical document, wherein the similarity corresponding to the candidate indentation status is greater than the first threshold.

[0159] 602. When a target indentation exists among at least one candidate indentation, the target indentation parameter is determined based on the indentation parameter used by the target indentation; wherein the second occurrence frequency of the paragraph in which the target indentation exists is greater than the second threshold.

[0160] The second threshold can be set according to the actual application needs. For example, the second threshold can be set to 0.5 or 0.6 or other suitable values.

[0161] It is understandable that the candidate indentation corresponding to a similarity greater than the first threshold may not be the most frequent occurrence in the paragraph corresponding to the nth level in the historical document.

[0162] In this embodiment, after identifying candidate indentation states, the existence of a target indentation state can be determined by comparing the second frequency of occurrence of the paragraph corresponding to the candidate indentation state within the nth level in the historical document with a second threshold. Since a higher second frequency of occurrence of a candidate indentation state corresponds to a paragraph containing that candidate indentation state, the more accurately that candidate indentation state can reflect the user's preferred indentation state as the target indentation state, by setting the second frequency of occurrence of the paragraph containing the target indentation state to be greater than the second threshold, and when the target indentation state exists among at least one candidate indentation state, the target indentation parameters can be accurately determined based on the indentation parameters used by the target indentation state.

[0163] For example, assuming the first threshold is 0.8 and the second threshold is 0.5, if the similarity between indentation status 1 of the current document and indentation status 1 of the nth level paragraph in the historical document is 0.93, and the similarity between indentation status 2 of the current document and indentation status 2 of the nth level paragraph in the historical document is 0.89, it can be determined that the similarity of indentation status 1 and indentation status 2 is greater than the first threshold. Therefore, both indentation status 1 and indentation status 2 are candidate indentation statuses. Since the occurrence frequencies of the paragraphs with indentation status 1 and indentation status 2 in the historical document are 0.87 and 0.09 respectively, indentation status 1 will be used as the target indentation status, and the target indentation parameters will be determined based on the indentation parameters used in indentation status 1.

[0164] In some examples, if there are multiple target indentation states, the frequency of occurrence of the paragraphs corresponding to the nth level in the historical document for these multiple target indentation states is sorted in descending order, and the indentation parameter used by the target indentation state belonging to the paragraph with the highest frequency of occurrence is determined as the target indentation parameter.

[0165] It is worth noting that when there is at least one candidate indentation state with a similarity greater than the first threshold among all paragraphs belonging to the nth level in the historical document, and there is no target indentation state among the at least one candidate indentation state, the method for determining the target indentation parameter can refer to the method for determining the target indentation parameter when there is no similarity greater than the first threshold.

[0166] In one embodiment, the method further includes:

[0167] When there is no similarity greater than the first threshold, the target indentation parameter is determined to be one of the following parameters:

[0168] Among the indentation parameters of paragraphs belonging to the nth level in the current document, select the indentation parameter that is used most frequently.

[0169] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0170] The most frequently used indentation parameter among the indentation parameters of paragraphs belonging to the nth level in a web document; where a web document is a document obtained from the web that meets similar conditions to the current document.

[0171] An indentation parameter that has a preset correspondence with the nth level.

[0172] In this embodiment, when there is no similarity greater than the first threshold, it indicates that the historical document is not very useful for reference. In this case, the target indentation parameter for the paragraph belonging to the nth level in the current document will not be determined based on the indentation status of the paragraph belonging to the nth level in the historical document.

[0173] In some examples, when there is no similarity greater than the first threshold, the target indentation parameter can be determined from multiple indentation parameters according to a preset determination rule. Here, the preset determination rule can be flexibly set according to the actual situation.

[0174] For example, the preset determination rule can be to determine the target indentation parameter using the default method of the document processing software. The default method of determining the target indentation parameter in the document processing software can be, for example, to determine the most frequently used indentation parameter among the indentation parameters of paragraphs belonging to the nth level in the current document as the target indentation parameter.

[0175] For example, the preset determination rule can be to determine the target indentation parameter using a user-defined method. For instance, the user-defined method for determining the target indentation parameter can be to determine the indentation parameter that has a preset correspondence with the nth level as the target indentation parameter. No specific limitations are imposed here.

[0176] In some examples, the most frequently used indentation parameter in the paragraph at level n in the current document can be determined as the target indentation parameter. If there are multiple most frequently used indentation parameters, the indentation parameter that appears earliest in the current document at level n is taken as the target indentation parameter.

[0177] Here, among the indentation parameters of paragraphs belonging to the nth level in the current document, the frequency of use of a certain indentation parameter can be: the total number of paragraphs using this indentation parameter in the current document belonging to the nth level; or it can be: the ratio between the total number of paragraphs using this indentation parameter in the current document belonging to the nth level and the total number of paragraphs belonging to the nth level in the current document.

[0178] By sorting the indentation parameters of paragraphs at level n in the current document from highest to lowest frequency, we can determine the most frequently used indentation parameter among the indentation parameters of paragraphs at level n in the current document.

[0179] Therefore, by using the most frequently used indentation parameter of the paragraph at level n in the current document as the target indentation parameter, the indentation of the paragraph at level n in the current document can be adjusted, which can reduce adjustment time and improve document processing efficiency.

[0180] In other examples, the most frequently used indentation parameter among the indentation parameters of paragraphs belonging to the nth level obtained based on user history can be determined as the target indentation parameter.

[0181] A user's historical operation record may include multiple operation records. Each operation record shall include at least the level number corresponding to the user's setting of the indentation parameter and the setting time.

[0182] User history records are used to determine at least the frequency with which a user uses different indentation parameters for paragraphs belonging to the nth level.

[0183] The frequency of use of any indentation parameter belonging to the nth level paragraph can be either the number of times the user sets that indentation parameter for the nth level paragraph within a preset historical time period, or the ratio between the number of times the user sets that indentation parameter for the nth level paragraph within a preset historical time period and the total number of times all indentation parameters set for the nth level paragraph.

[0184] In this embodiment, by determining the most frequently used indentation parameter among the indentation parameters of paragraphs belonging to the nth level obtained based on the user's historical operation records as the target indentation parameter, the determined target indentation parameter can be made to better match the user's setting habits.

[0185] In other examples, web crawlers can be used to retrieve online documents that meet similarity criteria to the current document. Here, the similarity criterion is that the similarity between the current document and the online document is greater than a preset similarity threshold.

[0186] This can be achieved by calculating semantic similarity between the current document and candidate documents on the internet to determine whether the candidate documents on the internet meet the similarity criteria with the current document. Candidate documents on the internet can be documents with similar topics to the current document.

[0187] In some examples, a pre-defined semantic similarity model can be used to obtain the semantic similarity between the current document and the online document, and the online document that meets the similarity condition can be identified from the online document.

[0188] In some examples, if there are multiple online documents that meet the same criteria as the current document, the online document with the highest semantic similarity to the current document can be selected from among the multiple online documents that meet the same criteria. The indentation parameter with the highest frequency in the paragraphs belonging to the nth level in the selected online document can then be determined as the target indentation parameter.

[0189] In some examples, the pre-defined semantic similarity models include, but are not limited to: the generalized vector space model (GVSM), the latent semantic indexing (LSI) model, and the deep structured semantic model (DSSM).

[0190] In some examples, the correspondence between different document levels and indentation parameters can be predefined, and the indentation parameter that has a predefined correspondence with the nth level can be determined as the target indentation parameter. For example, different levels may correspond to different indentation parameters.

[0191] Here, the correspondence between the hierarchy and indentation parameters in the document can be preset by the document processing software or set by the user. This embodiment does not impose any specific limitations on this.

[0192] For example, the correspondence may include: the first level corresponds to indentation parameter A, the second level corresponds to indentation parameter B, the third level corresponds to indentation parameter C, and so on.

[0193] In some examples, the mapping between different levels and indentation parameters can be set according to document type. For example, the indentation parameter corresponding to the nth level may be different in different document types.

[0194] Document types can include, but are not limited to: academic papers, technical documents, official documents, or contract documents.

[0195] It is understandable that when there is no similarity greater than the first threshold, in addition to the methods described above, other methods can be used to determine the target indentation parameters for paragraphs belonging to the nth level in the current document. This embodiment does not specifically limit this.

[0196] In one embodiment, step 301 above, when the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determining the target indentation parameter for paragraphs belonging to the nth level in the current document may include:

[0197] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine one of the following parameters as the target indentation parameter for paragraphs belonging to the nth level in the current document:

[0198] Among the indentation parameters of paragraphs belonging to the nth level in the current document, select the indentation parameter that is used most frequently.

[0199] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0200] The most frequently used indentation parameter among the indentation parameters of paragraphs belonging to the nth level in a web document; where a web document is a document obtained from the web that meets similar conditions to the current document.

[0201] Indentation parameters that have a preset correspondence with the nth level.

[0202] In this embodiment, when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the method for determining the target indentation parameter can refer to the method for determining the target indentation parameter when there is no similarity greater than the first threshold in the above embodiment, which will not be repeated here.

[0203] In one embodiment, the method may further include:

[0204] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, a warning marker will be displayed indicating that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0205] In some examples, the tooltip can be used to display inconsistent indentation of paragraphs at the nth level in the current document by setting different colors, icons, shapes, or other highlighting methods.

[0206] In this embodiment, if the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, a prompt mark can be displayed to allow the user to intuitively understand the indentation of paragraphs belonging to the nth level in the current document.

[0207] In one embodiment, a tooltip indicating inconsistent indentation of paragraphs belonging to the nth level in the current document may include:

[0208] Display a first hint marker; wherein the first hint marker is used to indicate the most frequently occurring indentation in the paragraph belonging to the nth level in the current document; and / or,

[0209] Display a second hint marker; wherein, the second hint marker is used to indicate the remaining indentation conditions in the paragraph belonging to the nth level in the current document, excluding the most frequently occurring indentation condition; the second hint marker is different from the first hint marker.

[0210] In the current document, the frequency of any indentation level can be represented by the total number of paragraphs containing that indentation level or by its frequency of occurrence. In some examples, the first and second tooltip markers are displayed in different colors; for example, the first tooltip marker may be red, green, or blue, while the second tooltip marker may be yellow or gray.

[0211] In some examples, the first and second prompts are displayed in different shapes. For example, the first prompt is a square, circle, or oval, and the second prompt is a triangle; or, for example, the first prompt is a solid circle and the second prompt is a hollow circle.

[0212] In some examples, the first cue marker may include a first numeric marker, which can be used to indicate the total number of paragraphs or the frequency of occurrence of the most frequently indented condition in the paragraphs belonging to the nth level in the current document.

[0213] For example, the first number marker is displayed as 12, indicating that the total number of paragraphs containing the most frequent indentation among the paragraphs at the nth level in the current document is 12.

[0214] In some examples, the second cue mark may include a second numeric mark that can be used to indicate the total number of indentations in the current document that are indentations of paragraphs at level n, excluding the most frequent indentation.

[0215] In one embodiment, the method may further include:

[0216] Display a list of levels; the list includes information about the nth level in the current document.

[0217] Upon detecting a second operation acting on the hierarchical information of the nth level, a toggle button is displayed; wherein, the toggle button is used to switch the display of the indentation status of paragraphs belonging to the nth level in the current document when the indentation status of paragraphs belonging to the nth level in the current document is inconsistent.

[0218] Here, the hierarchical information of the nth level in the current document can include the identifier of the nth level in the current document, such as the level number of the nth level.

[0219] The second operation applied to the hierarchical information at the nth level can be a selection operation by the user on the hierarchical information at the nth level, such as a click operation or a swipe operation.

[0220] The toggle button can include the up and down arrow keys. The up and down arrow keys can be clicked by the user to toggle the indentation of paragraphs belonging to the nth level in the current document.

[0221] In this embodiment, a toggle button is displayed when a second operation is detected that acts on the level information of the nth level. In this way, when the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the user can quickly and intuitively understand the indentation of paragraphs belonging to the nth level in the current document by triggering the toggle button, thus improving the user experience.

[0222] In some embodiments, the hierarchy list further includes a target indentation parameter for paragraphs belonging to the nth level in the current document; the method may further include:

[0223] When a modification operation targeting the indentation parameter is detected, the target indentation parameter is modified;

[0224] Based on the modified target indentation parameters, adjust the indentation of at least some paragraphs belonging to the nth level in the current document so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

[0225] In this embodiment, the user can modify the target indentation parameters displayed in the hierarchy list for paragraphs belonging to the nth level in the current document according to actual needs. This allows the user to adjust the indentation parameters used by paragraphs belonging to the nth level in the current document using the modified target indentation parameters, ensuring that the indentation parameters used by paragraphs belonging to the nth level in the current document remain consistent.

[0226] Next, combined Figures 7a to 7e Further explanation of the document processing methods provided in this disclosure.

[0227] like Figure 7a As shown in the figure, this disclosure provides a document processing method, which may include the following steps:

[0228] S1: Start format check.

[0229] Formatting checks can be initiated upon receiving a formatting check instruction for the current document. This instruction can be user-triggered.

[0230] For example, such as Figure 7b As shown, the document processing software menu can have a pre-set format check control. Clicking the "Format Check" control in the menu item will start a format check for the current document.

[0231] S2: Identify the text outline of the current document.

[0232] Here, the text structure of the current document can be identified, and the content level of the current document can be distinguished, such as level 0 to 9, and the main text.

[0233] In practical applications, the text outline hierarchy recognition model can be used to determine the text structure of a document based on its content, and the document content can be classified into levels 0 to 9.

[0234] When editing documents, the indentation of the same level in the article is usually standardized to enhance the structure of the article. Therefore, after the text structure is layered by the text outline hierarchy recognition model, the content of the same level can be divided into partitions, and the paragraph indentation of the same partition can be checked to preserve the characteristics of the document's text structure.

[0235] S3: Check paragraph indentation.

[0236] Based on the partitioning results of content at the same level, the indentation of paragraphs within the same level is checked, the indentation of all paragraphs at the same level is counted, and the occurrence frequency of various indentation conditions within the same level is sorted in descending order.

[0237] The statistics on indentation can include at least the indentation distance of different paragraphs at each level. The indentation distance used by different paragraphs within each level is counted separately, and the number of paragraphs at the same level using the same indentation distance is sorted in descending order.

[0238] S4: Determine the consistency of paragraph indentation across different levels.

[0239] Whether the indentation of paragraphs at the same level is consistent can be determined by the indentation parameters used for each paragraph at the same level. These indentation parameters may include: indentation distance and indentation format.

[0240] For example, it can be determined whether all paragraphs at the same level use more than one type of indentation distance and whether the paragraphs at that level use more than one type of indentation format. If all paragraphs at that level use only one type of indentation distance and only one type of indentation format, then the indentation of the paragraphs at that level is consistent. If all paragraphs at the same level use two or more types of indentation distance and / or indentation format, then it can be determined that the indentation of the paragraphs at that level is inconsistent.

[0241] In some examples, the inspection results can be displayed in a preset display area, which can be used to indicate whether the indentation of paragraphs at the same level in the current document is consistent.

[0242] S5: Inconsistent indentation.

[0243] Within the same level, highlight the most frequent indentation patterns and the inconsistent indentation patterns (i.e., indentation patterns that do not appear most frequently) in the current document. For example, the most frequent indentation patterns are marked in green, and inconsistent indentation patterns are marked in yellow.

[0244] For example, the most frequent indentation patterns and inconsistent indentation patterns can be displayed in the current document using different color depths. For instance, the most frequent indentation patterns can be displayed using a light gray marker, while inconsistent indentation patterns can be displayed using a dark gray marker.

[0245] S6: Uniform indentation.

[0246] 1) Analyze the similarity between the indentation of paragraphs at level n in the user's historical documents and the indentation of paragraphs at level n in the current document. Based on the similarity, determine the target indentation parameter to be recommended. The target indentation parameter is used to adjust the indentation of paragraphs belonging to level n in the current document. The value of n can range from 1 to 9.

[0247] For example, the similarity is determined by a preset similarity calculation rule or a pre-trained similarity model.

[0248] For example, given 10 historical documents of a user, the frequency of indentation of paragraphs at level n in these 10 documents is as follows: Indentation 1: 77, Indentation 2: 8, Indentation 3: 4. If the frequency of indentation of paragraphs at level n in the current document is: Indentation 1: 12, Indentation 2: 1, the similarity calculation formula for Indentation 1 is: 1 - |77 / (77+8+4) - 12 / (12+1)|, and the similarity for Indentation 1 is 0.94. The similarity calculation formula for Indentation 2 is: 1 - |2 / (77+8+4) - 1 / (12+1)|, and the similarity for Indentation 2 is 0.95.

[0249] In some examples, candidate indentation states with similarity greater than a similarity threshold can be identified, and in all paragraphs at the nth level in the historical document, it can be determined whether the frequency of occurrence of the paragraph corresponding to the candidate indentation state is higher than a preset frequency threshold. When the frequency of occurrence of the paragraph corresponding to the candidate indentation state is higher than the preset frequency threshold, the candidate indentation state is determined as the target indentation state, and the indentation parameters used by the target indentation state are used as the target indentation parameters.

[0250] Continuing with the example above, assuming the similarity threshold is 0.8 and the preset frequency threshold is 0.5, since the similarity of indentation condition 1 and the similarity of indentation condition 2 are both greater than the similarity threshold, indentation condition 1 and indentation condition 2 can be used as candidate indentation conditions. Since the occurrence frequency of the paragraph corresponding to indentation condition 1 (77 / (77+8+4)) is greater than the preset frequency threshold, while the occurrence frequency of the paragraph corresponding to indentation condition 1 (2 / (77+8+4)) is less than the preset frequency threshold, the indentation parameter used in indentation condition 1 can be determined as the target indentation parameter.

[0251] In some examples, if multiple target indentation states exist, and the frequency of occurrence of each target indentation state in all paragraphs belonging to the nth level in the historical document is higher than a preset frequency threshold, then the indentation parameter used by any one of the multiple target indentation states can be determined as the target indentation parameter. If there is no similarity greater than a similarity threshold, the target indentation parameter can be determined using one of the following methods.

[0252] Method 1: Among the indentation parameters of paragraphs at level n in the current document, use the most frequent indentation parameter as the target indentation parameter. If there are multiple most frequent indentation parameters, then use the earliest indentation parameter that appears at level n in the current document as the target indentation parameter.

[0253] Method 2: Use the most frequently used indentation parameter in the nth level paragraph obtained from the user's historical operation record as the target indentation parameter.

[0254] Method 3: Perform semantic recognition on the current document, crawl similar documents in the network based on the semantic recognition results of the current document, and obtain the hierarchical structure of the similar documents and the indentation parameters used at each level; select the indentation parameter with the highest frequency of use among the indentation parameters of the paragraphs belonging to the nth level in the similar documents as the target indentation parameter.

[0255] Method 4: Use the indentation parameter that has a preset correspondence with the nth level in the current document as the target indentation parameter.

[0256] In some examples, the target indentation parameter for a level with inconsistent indentation can be displayed. For instance, the target indentation for a level 2 heading is 2 characters, for a level 3 heading it is 4 characters, and for the body text it is 6 characters.

[0257] In some cases, users can modify the target indentation parameters for paragraphs belonging to a certain level in the current document as needed. The modified target indentation parameters are used to adjust the indentation parameters of paragraphs belonging to that level, so that the indentation parameters of all paragraphs belonging to that level in the current document are consistent.

[0258] 2) When a trigger operation is detected that acts on the uniform indentation control, in the same level of the current document, the indentation parameters used for indentation situations that are inconsistent with the most frequent indentation situation are adjusted to ensure that the indentation parameters of all paragraphs belonging to the same level in the current document are consistent.

[0259] For example, in the display interface, users can click the "Unified Indentation" control in the preset display area for the second-level headings, third-level headings, and body text of the current document to make the indentation parameters of paragraphs within the second-level heading level consistent, the indentation parameters of paragraphs within the third-level heading level consistent, and the indentation parameters of paragraphs within the body text level consistent.

[0260] In some examples, when a click is detected targeting a level with inconsistent indentation, a toggle button for that level can be displayed to switch the indentation of paragraphs belonging to the nth level in the current document.

[0261] For example, such as Figure 7c As shown, when a user clicks on a second-level heading within the preset display area, up and down arrow keys will appear. By clicking the up or down arrow keys, the user can trigger the current document to switch between displaying inconsistent indentation levels for the second-level headings.

[0262] For example, with Figure 7d Taking the document portion shown as an example, Figure 7d Different boxes are used to represent inconsistent indentation levels. (This is for...) Figure 7d In the document content shown, by adjusting the indentation parameters within the same level using the method provided in this embodiment, the effect of uniform indentation at the same level can be achieved. Figure 7e As shown.

[0263] The document processing method provided in this disclosure can automatically identify the indentation distance and indentation format used at each level of content in a document. By statistically analyzing the usage of indentation distance and indentation format at the same level, it highlights indentation positions at that level that use inconsistent indentation distance and indentation format, providing users with a "one-click unified indentation" solution. This allows for quick batch modification of highlighted indentations that are inconsistent with the indentation distance and indentation format at the same level, eliminating the need for manual modification of each area. This results in faster document processing efficiency and effectively avoids omissions.

[0264] Figure 8 A schematic diagram of the structure of a document processing apparatus provided in an embodiment of this disclosure is shown. Figure 8 As shown, the document processing device 100 may include:

[0265] The detection module 110 is used to detect the indentation status of paragraphs belonging to the nth level in the current document and obtain the inspection result; where n is a positive integer less than or equal to N; N is the total number of levels in the current document;

[0266] The adjustment module 120 is used to adjust the indentation of at least some paragraphs belonging to the nth level in the current document when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, so as to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

[0267] In one embodiment, the detection module 110 is used for:

[0268] The indentation distance and indentation format used by each paragraph belonging to the nth level in the current document are checked to obtain the check result;

[0269] Specifically, if paragraphs belonging to the nth level use different indentation distances and / or different indentation formats, the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0270] In one embodiment, the apparatus further includes:

[0271] The first display module is used to display an indentation unification control when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0272] The adjustment module 120 is used to adjust the indentation of at least some paragraphs belonging to the nth level in the current document when a first operation is detected acting on the indentation uniformity control, so as to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

[0273] In one embodiment, the apparatus includes:

[0274] The determination module is used to determine the target indentation parameters for paragraphs belonging to the nth level in the current document when the inspection result indicates that the indentation status of paragraphs belonging to the nth level in the current document is inconsistent.

[0275] The adjustment module 120 is used to adjust the indentation of at least some paragraphs belonging to the nth level in the current document according to the determined target indentation parameters, so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

[0276] In one embodiment, the determining module is used to:

[0277] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents.

[0278] When the similarity exceeds the first threshold, the target indentation parameter for the paragraphs belonging to the nth level in the current document is determined based on the indentation status of the paragraphs belonging to the nth level in the historical document.

[0279] In one embodiment, the determining module is used to:

[0280] For each indentation state among all paragraphs belonging to the nth level in the current document, perform the following operations:

[0281] In the current document, among all paragraphs belonging to the nth level, determine the first frequency of occurrence corresponding to the paragraph where the indentation status is located;

[0282] In the historical document, among all paragraphs belonging to the nth level, determine the second frequency of occurrence corresponding to the paragraph where the indentation status is located;

[0283] Based on the first occurrence frequency and the second occurrence frequency, determine the similarity between the indentation status of the paragraph belonging to the nth level in the current document and the indentation status of the paragraph belonging to the nth level in the historical document.

[0284] In one embodiment, the determining module is used to:

[0285] When there is a similarity greater than the first threshold, at least one candidate indentation state is determined among the indentation states of all paragraphs belonging to the nth level in the historical document, wherein the similarity corresponding to the candidate indentation state is greater than the first threshold.

[0286] When a target indentation exists among at least one of the candidate indentation states, the target indentation parameter is determined based on the indentation parameter used by the target indentation state; wherein the second occurrence frequency corresponding to the paragraph where the target indentation state is located is greater than a second threshold.

[0287] In one embodiment, the determining module is used to:

[0288] When there is no similarity greater than the first threshold, the target indentation parameter is determined to be one of the following parameters:

[0289] Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected.

[0290] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0291] Among the indentation parameters of paragraphs belonging to the nth level in the online document, the indentation parameter used most frequently is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document;

[0292] An indentation parameter that has a preset correspondence with the nth level.

[0293] In one embodiment, the determining module is used to:

[0294] If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the target indentation parameter for paragraphs belonging to the nth level in the current document is determined to be one of the following parameters:

[0295] Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected.

[0296] Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected.

[0297] Among the indentation parameters of paragraphs belonging to the nth level in the online document, the indentation parameter used most frequently is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document;

[0298] An indentation parameter that has a preset correspondence with the nth level.

[0299] In one embodiment, the apparatus further includes:

[0300] The first display module is used to display a prompt mark indicating that the indentation of paragraphs belonging to the nth level in the current document is inconsistent when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

[0301] In one embodiment, the second display module is used for:

[0302] Display a first prompt marker; wherein the first prompt marker is used to indicate the most frequently occurring indentation pattern among the indentation patterns of paragraphs belonging to the nth level in the current document; and / or,

[0303] Display a second prompt marker; wherein, the second prompt marker is used to indicate the remaining indentation states of the paragraphs belonging to the nth level in the current document, excluding the most frequently occurring indentation state; the second prompt marker is different from the first prompt marker.

[0304] In one embodiment, the device further includes a third display module; the third display module is used for:

[0305] Display a hierarchy list; wherein the hierarchy list includes the hierarchy information of the nth level in the current document;

[0306] Upon detecting a second operation acting on the hierarchical information of the nth level, a toggle button is displayed; wherein the toggle button is used to switch the display of the indentation status of paragraphs belonging to the nth level in the current document when the indentation status of paragraphs belonging to the nth level in the current document is inconsistent.

[0307] Regarding the document processing apparatus in the above embodiments, the specific manner in which each module performs its operations has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0308] In an exemplary embodiment, the detection module 110, adjustment module 120, etc., may be implemented by one or more central processing units (CPUs), graphics processing units (GPUs), baseband processors (BPs), application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers (MCUs), microprocessors, or other electronic components to perform the document processing method described above.

[0309] In one embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the document processing method described above.

[0310] Figure 9 A block diagram of an electronic device 800 provided in an embodiment of this disclosure is shown. For example, the electronic device 800 may be a mobile phone, document processor, computer, tablet device, personal digital assistant, etc.

[0311] Reference Figure 9 The electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.

[0312] Processing component 802 typically controls the overall operation of electronic device 800, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 802 may include one or more modules to facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.

[0313] Memory 804 is configured to store various types of data to support the operation of electronic device 800. Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, etc. Memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0314] Power supply component 806 provides power to various components of electronic device 800. Power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800.

[0315] Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 808 includes a front-facing camera and / or a rear-facing camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0316] Audio component 810 is configured to output and / or input audio signals. For example, audio component 810 includes a microphone (MIC) configured to receive external audio signals when electronic device 800 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 804 or transmitted via communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

[0317] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0318] Sensor assembly 814 includes one or more sensors for providing state assessments of various aspects of electronic device 800. For example, sensor assembly 814 can detect the on / off state of electronic device 800, the relative positioning of components such as the display and keypad of electronic device 800, changes in position of electronic device 800 or a component of electronic device 800, the presence or absence of user contact with electronic device 800, orientation or acceleration / deceleration of electronic device 800, and temperature changes of electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 814 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.

[0319] Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. Electronic device 800 can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G, and 5G, or combinations thereof. In one exemplary embodiment, communication component 816 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 816 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0320] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the document processing method described above.

[0321] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, which can be executed by a processor 820 of an electronic device 800 to complete the document processing method described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0322] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0323] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A document processing method, characterized in that, The method includes: The indentation of paragraphs belonging to the nth level in the current document is detected, and the detection result is obtained; where n is a positive integer less than or equal to N; N is the total number of levels in the current document; If the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, the indentation of at least some paragraphs belonging to the nth level in the current document shall be adjusted so that the indentation of all paragraphs belonging to the nth level in the current document is consistent. When the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent includes: If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents. When the similarity is greater than the first threshold, the target indentation parameter for the paragraphs belonging to the nth level in the current document is determined based on the indentation status of the paragraphs belonging to the nth level in the historical document. Based on the determined target indentation parameters, adjust the indentation of at least some paragraphs belonging to the nth level in the current document so that the indentation of all paragraphs belonging to the nth level in the current document is consistent. Determining the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents includes: For each indentation state among all paragraphs belonging to the nth level in the current document, perform the following operations: In the current document, among all paragraphs belonging to the nth level, a first frequency of occurrence corresponding to the paragraph containing the indentation is determined; wherein, the first frequency of occurrence is determined based on the proportion of the total number of paragraphs containing the indentation to the total number of paragraphs belonging to the nth level in the current document; In the historical document, among all paragraphs belonging to the nth level, a second frequency of occurrence corresponding to the paragraph containing the indentation is determined; wherein, the second frequency of occurrence is determined based on the proportion of the total number of paragraphs containing the indentation to the total number of paragraphs belonging to the nth level in the historical document. Based on the first occurrence frequency and the second occurrence frequency, determine the similarity between the indentation status of the paragraph belonging to the nth level in the current document and the indentation status of the paragraph belonging to the nth level in the historical document.

2. The method according to claim 1, characterized in that, The detection of the indentation status of paragraphs belonging to the nth level in the current document yields the following results: The indentation distance and indentation format used by each paragraph belonging to the nth level in the current document are checked to obtain the check result; Specifically, if paragraphs belonging to the nth level use different indentation distances and / or different indentation formats, the check result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent.

3. The method according to claim 1 or 2, characterized in that, When the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, adjusting the indentation of at least some paragraphs belonging to the nth level in the current document to make the indentation of all paragraphs belonging to the nth level in the current document consistent includes: If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, an indentation uniformity control is displayed. Upon detecting a first operation applied to the indentation unification control, the indentation of at least some paragraphs belonging to the nth level in the current document is adjusted so that the indentation of all paragraphs belonging to the nth level in the current document is consistent.

4. The method according to claim 1, characterized in that, When a similarity greater than a first threshold exists, the target indentation parameter for the paragraphs belonging to the nth level in the current document is determined based on the indentation status of paragraphs belonging to the nth level in the historical documents, including: When there is a similarity greater than the first threshold, at least one candidate indentation state is determined among the indentation states of all paragraphs belonging to the nth level in the historical document, wherein the similarity corresponding to the candidate indentation state is greater than the first threshold. When a target indentation exists among at least one of the candidate indentation states, the target indentation parameter is determined based on the indentation parameter used by the target indentation state; wherein the second occurrence frequency corresponding to the paragraph where the target indentation state is located is greater than a second threshold.

5. The method according to claim 1, characterized in that, The method further includes: When there is no similarity greater than the first threshold, the target indentation parameter is determined to be one of the following parameters: Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected. Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected. Among the indentation parameters of paragraphs belonging to the nth level in the online document, the most frequently used indentation parameter is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document; The indentation parameter has a preset correspondence with the nth level.

6. The method according to claim 1, characterized in that, The determination of the target indentation parameters for paragraphs belonging to the nth level in the current document includes: The target indentation parameter for the paragraph belonging to the nth level in the current document is determined to be one of the following parameters: Among the indentation parameters of paragraphs belonging to the nth level in the current document, the indentation parameter used most frequently is selected. Among the indentation parameters for paragraphs belonging to the nth level obtained based on user history operation records, the most frequently used indentation parameter is selected. Among the indentation parameters of paragraphs belonging to the nth level in the online document, the indentation parameter used most frequently is selected; wherein, the online document is: a document obtained from the network that meets similar conditions to the current document; The indentation parameter has a preset correspondence with the nth level.

7. The method according to claim 1 or 2, characterized in that, The method further includes: If the inspection results indicate that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, a prompt mark indicating that the indentation of paragraphs belonging to the nth level in the current document is inconsistent will be displayed.

8. The method according to claim 7, characterized in that, The indicator that displays inconsistent indentation of paragraphs belonging to the nth level in the current document includes: Display a first prompt marker; wherein, the first prompt marker is used to indicate the most frequently occurring indentation state among the indentation states of paragraphs belonging to the nth level in the current document; And / or, Display a second prompt marker; wherein, the second prompt marker is used to indicate the remaining indentation states of the paragraphs belonging to the nth level in the current document, excluding the most frequently occurring indentation state; the second prompt marker is different from the first prompt marker.

9. The method according to claim 1 or 2, characterized in that, The method further includes: Display a hierarchy list; wherein the hierarchy list includes the hierarchy information of the nth level in the current document; Upon detecting a second operation acting on the hierarchical information of the nth level, a toggle button is displayed; wherein the toggle button is used to switch the display of the indentation status of paragraphs belonging to the nth level in the current document when the indentation status of paragraphs belonging to the nth level in the current document is inconsistent.

10. A document processing apparatus, characterized in that, The device includes: The detection module is used to detect the indentation status of paragraphs belonging to the nth level in the current document and obtain the inspection result; where n is a positive integer less than or equal to N; and N is the total number of levels in the current document; The determining module is configured to, when the inspection result indicates that the indentation of paragraphs belonging to the nth level in the current document is inconsistent, determine the similarity between the indentation of paragraphs belonging to the nth level in the current document and the indentation of paragraphs belonging to the nth level in historical documents; when there is a similarity greater than a first threshold, determine a target indentation parameter for paragraphs belonging to the nth level in the current document based on the indentation of paragraphs belonging to the nth level in historical documents; and further configured to, for each indentation of all paragraphs belonging to the nth level in the current document, perform the following operation: determine the paragraph containing the indentation of the indentation among all paragraphs belonging to the nth level in the current document. A first occurrence frequency is determined based on the proportion of the total number of paragraphs containing the indentation in the current document to the total number of paragraphs belonging to the nth level in the current document; a second occurrence frequency is determined among all paragraphs belonging to the nth level in the historical document; the second occurrence frequency is determined based on the proportion of the total number of paragraphs containing the indentation in the historical document to the total number of paragraphs belonging to the nth level in the historical document; and the similarity between the indentation of the paragraph belonging to the nth level in the current document and the indentation of the paragraph belonging to the nth level in the historical document is determined based on the first occurrence frequency and the second occurrence frequency. An adjustment module is used to adjust the indentation of at least some paragraphs belonging to the nth level in the current document according to the determined target indentation parameters, so as to make the indentation of all paragraphs belonging to the nth level in the current document consistent.

11. An electronic device, characterized in that, The document processing method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the steps of the document processing method according to any one of claims 1 to 9.

12. A storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the steps of the document processing method according to any one of claims 1 to 9.