A method to modify document error content with one click based on icontent architecture

By introducing JavaScript scripts and related libraries into the iContent architecture, the one-click modification function of document error content is realized, which solves the problem of manual correction in the existing technology, improves correction efficiency and reduces costs.

CN119005137BActive Publication Date: 2025-04-04ANRUI DIGITAL INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410860092.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-04-04
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

In the prior art, when reviewing word documents, the iContent architecture needs to manually spell the wrong content one by one, which takes a lot of time and lacks the function of one-click modification.

Method used

By introducing JavaScript scripts into the iContent architecture, importing regular expression libraries, text processing libraries and DOM operations libraries, using the functions of these libraries to automatically locate, identify and replace error content in documents, and implementing one-click modification function.

Benefits of technology

It greatly reduces the time for modifying the wrong content, reduces labor costs, and improves the efficiency of document correction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119005137B_ABST
    Figure CN119005137B_ABST
Patent Text Reader

Abstract

The invention discloses a method for modifying document error content with one key based on icontent architecture, comprising: importing a language code library for modifying errors with one key; monitoring whether a document to be loaded has been loaded, and obtaining text content of the document to be loaded when the document to be loaded has been loaded; locating a DOM element containing the text content from the text content; obtaining a text data set of all DOM elements using a method or attribute provided by a DOM library; traversing the text data set using a regular expression library to obtain error content and modification suggestions of the document to be loaded; replacing the error content with modification content data of the modification suggestion using a string method or a regular expression replacement method in the regular expression library to generate a modified document of the document to be loaded; and verifying the accuracy of the modified document, and outputting the modified document of the document to be loaded when the modified document has no error content.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text correction, and more specifically, to a method for modifying erroneous content of a document with one click based on an icontent architecture. Background Art

[0002] With the increasing demand for error checking in word documents, how to quickly check and correct document errors has become a technical problem that people want to solve. Currently, iContent can review word documents, display problematic content, and give modification suggestions, but these contents need to be manually spelled and modified one by one, which is very time-consuming. How to achieve one-click modification of documents in the iContent architecture has become a technical problem that needs to be solved urgently. Summary of the invention

[0003] In view of the deficiencies of the prior art, the present invention provides a method for modifying erroneous content of a document with one click based on the icontent architecture.

[0004] According to one aspect of the present invention, a method for modifying document error content with one click based on the icontent architecture is provided, comprising:

[0005] Use JavaScript scripts to import the icontent architecture to modify the wrong language code library with one click, where the language code library includes regular expression library, text processing library, and DOM operation library;

[0006] Monitor whether the document to be loaded has been loaded through the DOMContentLoaded event, and obtain the text content of the document to be loaded if the document to be loaded has been loaded;

[0007] Use the selectors provided by the DOM operation library to locate the DOM element containing the text content from the text content, where the selectors include element selectors, class selectors, and ID selectors;

[0008] Use the methods or attributes provided by the DOM library to obtain the text data set of all DOM elements;

[0009] Use the regular expression library to traverse the text data set to obtain the error content and modification suggestions of the document to be loaded;

[0010] Using a string method or a regular expression replacement method in a regular expression library to replace the erroneous content with the modification content data of the modification suggestion, a correction document of the document to be loaded is generated;

[0011] Verify the accuracy of the revised document, and if there is no error in the revised document, output the revised document of the document to be loaded.

[0012] Optionally, a string method or a regular expression replacement method in a regular expression library is used to replace the erroneous content with the modification content data of the modification suggestion, and a correction document of the document to be loaded is generated, including:

[0013] Define error patterns using string methods or regular expression replacement methods in the regular expression library;

[0014] Use the compilation function provided by the regular expression library to compile the error pattern into an error pattern object;

[0015] The error pattern object is used to call the replacement function provided by the regular expression library to replace the error content with the correction content, thereby generating a correction document for the document to be loaded.

[0016] Optionally, the error pattern object is used to call a replacement function provided by the regular expression library to replace the error content with the correction content, and a correction document of the document to be loaded is generated, including:

[0017] Use the regular expression library to convert the modified content and the error content into the modified string and the error string respectively;

[0018] The replacement function is called using the error mode object, and the error content is replaced with the correction content according to the modification string and the error string, so as to generate the correction document of the document to be loaded.

[0019] Optionally, the replace function includes a target string, a replacement string, and other replacement options.

[0020] According to another aspect of the present invention, a device for modifying document error content with one click based on the icontent architecture is provided, comprising:

[0021] Import module, used to import icontent architecture using JavaScript scripts to modify the language code library with one click, where the language code library includes regular expression library, text processing library, and DOM operation library;

[0022] The first acquisition module is used to monitor whether the document to be loaded is loaded through the DOMContentLoaded event, and obtain the text content of the document to be loaded if the document to be loaded is loaded;

[0023] A positioning module, used to locate the DOM element containing the text content from the text content by using the selector provided by the DOM operation library, wherein the selector includes an element selector, a class selector, and an ID selector;

[0024] The second acquisition module is used to acquire the text data set of all DOM elements by using the method or attribute provided by the DOM library;

[0025] The third acquisition module is used to traverse the text data set using the regular expression library to obtain the error content and modification suggestions of the document to be loaded;

[0026] A generation module, used to replace the erroneous content with the modification content data of the modification suggestion by using a string method or a regular expression replacement method in a regular expression library, so as to generate a correction document of the document to be loaded;

[0027] The output module is used to verify the accuracy of the revised document and output the revised document of the document to be loaded if there is no error in the revised document.

[0028] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method described in any one of the above aspects of the present invention.

[0029] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of the above aspects of the present invention.

[0030] Therefore, the present invention achieves the problem of one-key modification of errors by adding a one-key modification function in the icontent architecture, greatly reducing the time for modifying erroneous content and also reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:

[0032] Figure 1 It is a flowchart of a method for modifying document error content with one click based on the icontent architecture provided by an exemplary embodiment of the present invention;

[0033] Figure 2 It is a structural diagram of a device for modifying document error content with one click based on the icontent architecture provided by an exemplary embodiment of the present invention;

[0034] Figure 3 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0035] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.

[0036] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.

[0037] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0038] It should also be understood that, in the embodiments of the present invention, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0039] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0040] In addition, the term "and / or" in the present invention is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.

[0041] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0042] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.

[0044] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0045] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0046] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0047] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0048] Exemplary Methods

[0049] Figure 1 FIG. 1 is a flowchart of a method for modifying document error content with one key based on the icontent architecture provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the method 100 for modifying document error content with one click based on the icontent architecture includes the following steps:

[0050] Step 101, using a JavaScript script to import an icontent framework to modify an erroneous language code library with one click, wherein the language code library includes a regular expression library, a text processing library, and a DOM operation library;

[0051] Step 102, monitoring whether the document to be loaded has been loaded through the DOMContentLoaded event, and obtaining the text content of the document to be loaded if the document to be loaded has been loaded;

[0052] Step 103, using the selector provided by the DOM operation library to locate the DOM element containing the text content from the text content, wherein the selector includes an element selector, a class selector, and an ID selector;

[0053] Step 104, using the method or attribute provided by the DOM library to obtain the text data set of all DOM elements;

[0054] Step 105, using a regular expression library to traverse the text data set to obtain error content and modification suggestions of the document to be loaded;

[0055] Step 106, using a string method or a regular expression replacement method in a regular expression library to replace the erroneous content with the modification content data of the modification suggestion, and generating a correction document of the document to be loaded;

[0056] Step 107 , verifying the accuracy of the revised document, and outputting the revised document of the document to be loaded if the revised document has no erroneous content.

[0057] Specifically, this application uses scripting language to add a one-click error correction function to iContent review.

[0058] The specific implementation steps are as follows:

[0059] 1. Choose the appropriate scripting language:

[0060] In view of the functional content of iContent, the present invention selects JavaScript for writing. This script has good compatibility with iContent and contains the code library required for this function.

[0061] 2. Import the required libraries and modules:

[0062] After selecting the required scripting language, import the required language code library, such as: regular expression library (used to match and locate error content), text processing library (used to match and replace error content), DOM operation library (used to obtain text content), etc.

[0063] 3. Get the document content:

[0064] 1) Wait for the document to load: Before getting the text content, make sure that the DOM structure of the document has been loaded. This step is judged by the DOMContentLoaded event to ensure that the code does not encounter the problem of not finding the DOM element when getting the text content.

[0065] 2) Select the text element: Next, use the selector method provided by the DOM manipulation library to locate the DOM element containing the text content. You can use element selectors, class selectors, ID selectors, etc. to select the target element.

[0066] 3) Get text content: After locating the element content, use the methods or attributes provided by the DOM operation library to get the text data of the target element. You can use methods such as `.text()`, `.html()`, and `.val()` to get the text content of a DOM element.

[0067] 4. Obtain the error content and modification suggestions of the review document:

[0068] Through the above operations, the desired text content is obtained. At this time, string-related methods (such as includes, indexOf) or regular expressions can be used to traverse the target DOM element set to determine whether the text content of the element contains errors or keywords.

[0069] 5. Modify the error content:

[0070] In the above operation, the error content to be modified is known. At this time, you can use string methods (such as `replace`) or regular expression replacement methods to replace the error content with the correct content.

[0071] Regular expression replacement, use the following scheme:

[0072] 1) Define an error pattern: First, you need to define an error pattern, which describes the rules for replacing the error content. Regular expression syntax provides many special characters and operators that can help create flexible patterns. For example, you can use the metacharacter `_x005f` to match word boundaries, use the character set `[...]` to match a group of characters, and so on.

[0073] 2) Compile error patterns: Use the compilation function provided by the regular expression library (such as Python's re module) to compile the defined pattern into a reusable object. Compiling patterns can improve the efficiency of replacement and is more convenient when the same pattern is used multiple times.

[0074] 3) Matching and replacement: Use the compiled pattern object to call the replacement function or method provided by the regular expression library to replace the incorrect content with the correct content. The replacement function usually needs to pass three parameters: the target string, the replacement string, and other replacement options. For example, in Python's re module, you can use the `re.sub()` function to perform a replacement operation.

[0075] 6. Testing and verification:

[0076] After correcting the error, verify the modified document to ensure that the error content has been corrected.

[0077] Therefore, the present invention achieves the problem of one-key modification of errors by adding a one-key modification function in the icontent architecture, greatly reducing the time for modifying erroneous content and also reducing labor costs.

[0078] Exemplary Devices

[0079] Figure 2 FIG. 1 is a schematic diagram of a structure of a device for modifying document error content with one click based on the icontent architecture provided by an exemplary embodiment of the present invention. Figure 2 As shown, the device 200 includes:

[0080] Import module, used to import icontent architecture using JavaScript scripts to modify the language code library with one click, where the language code library includes regular expression library, text processing library, and DOM operation library;

[0081] The first acquisition module is used to monitor whether the document to be loaded is loaded through the DOMContentLoaded event, and obtain the text content of the document to be loaded if the document to be loaded is loaded;

[0082] A positioning module, used to locate the DOM element containing the text content from the text content by using the selector provided by the DOM operation library, wherein the selector includes an element selector, a class selector, and an ID selector;

[0083] The second acquisition module is used to acquire the text data set of all DOM elements by using the method or attribute provided by the DOM library;

[0084] The third acquisition module is used to traverse the text data set using the regular expression library to obtain the error content and modification suggestions of the document to be loaded;

[0085] A generation module, used to replace the erroneous content with the modification content data of the modification suggestion by using a string method or a regular expression replacement method in a regular expression library, so as to generate a correction document of the document to be loaded;

[0086] The output module is used to verify the accuracy of the revised document and output the revised document of the document to be loaded if there is no error in the revised document.

[0087] Optionally, generate a module including:

[0088] Define submodules for defining error patterns using string methods or regular expression replacement methods in the regular expression library;

[0089] A compiling submodule, used to compile the error pattern into an error pattern object using a compiling function provided by the regular expression library;

[0090] The replacement submodule is used to use the error pattern object to call the replacement function provided by the regular expression library to replace the error content with the corrected content, and generate a corrected document for the document to be loaded.

[0091] Optionally, replace submodules, including:

[0092] A conversion unit, used to convert the modified content and the error content into a modified string and an error string respectively by using a regular expression library;

[0093] The generating unit is used to call the replacement function by using the error mode object, replace the error content with the correction content according to the modification string and the error string, and generate the correction document of the document to be loaded.

[0094] Optionally, the replace function includes a target string, a replacement string, and other replacement options.

[0095] Exemplary Electronic Devices

[0096] Figure 3 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. Figure 3 As shown, the electronic device 30 includes one or more processors 31 and a memory 32 .

[0097] The processor 31 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0098] The memory 32 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may run the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above and / or other desired functions. In one example, the electronic device may also include: an input device 33 and an output device 34, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0099] In addition, the input device 33 may also include, for example, a keyboard, a mouse, and the like.

[0100] The output device 34 can output various information to the outside. The output device 34 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto.

[0101] Of course, to simplify, Figure 3 Only some of the components related to the present invention in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application conditions, the electronic device may also include any other appropriate components.

[0102] Exemplary computer program products and computer-readable storage media

[0103] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above-mentioned "Exemplary Method" section of this specification.

[0104] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0105] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the method for information mining of historical change records according to various embodiments of the present invention described in the above “Exemplary Method” section of this specification.

[0106] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, system or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0107] The basic principle of the present invention is described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, strengths, effects, etc. mentioned in the present invention are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present invention. In addition, the specific details disclosed above are only for the purpose of illustration and facilitation of understanding, rather than limitation, and the above details do not limit the present invention to being implemented by adopting the above specific details.

[0108] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0109] The block diagrams of the devices, systems, equipment, and systems involved in the present invention are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, systems, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.

[0110] The method and system of the present invention may be implemented in many ways. For example, the method and system of the present invention may be implemented by software, hardware, firmware or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present invention are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present invention may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.

[0111] It should also be noted that in the system, device and method of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. The above description of the disclosed aspects is provided to enable any technician in the field to make or use the present invention. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined here can be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown here, but in accordance with the widest range consistent with the principles and novel features disclosed here.

[0112] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present invention to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A method for modifying document error content with one click based on icontent architecture, characterized in that: include: A JavaScript script is used to import the icontent framework to modify the erroneous language code library with one click, wherein the language code library includes a regular expression library and a DOM operation library; Monitor whether the document to be loaded is loaded through the DOMContentLoaded event, and obtain the text content of the document to be loaded if the document to be loaded is loaded; Locate a DOM element containing text content from the text content using a selector provided by the DOM operation library, wherein the selector includes an element selector, a class selector, and an ID selector; Obtaining a text data set of all the DOM elements using methods or attributes provided by the DOM operation library; Using the regular expression library to traverse the text data set, obtaining error content and modification suggestions of the document to be loaded; Using a string method or a regular expression replacement method in a regular expression library to replace the erroneous content with the modification content data of the modification suggestion, to generate a correction document of the document to be loaded; The correction document is verified for accuracy, and if the correction document contains no erroneous content, the correction document of the document to be loaded is output.

2. The method according to claim 1, characterized in that The erroneous content is replaced with the modification content data of the modification suggestion by using a string method or a regular expression replacement method in a regular expression library to generate a correction document of the document to be loaded, including: Adopting the string method or the regular expression replacement method in the regular expression library to define an error pattern; Compiling the error pattern into an error pattern object using a compile function provided by the regular expression library; The error pattern object is used to call a replacement function provided by the regular expression library to replace the error content with the modified content data, thereby generating the corrected document of the document to be loaded.

3. The method according to claim 2, characterized in that Using the error pattern object to call a replacement function provided by the regular expression library to replace the error content with the modified content data, and generating the corrected document of the document to be loaded, comprises: The regular expression library is used to convert the modified content and the error content into a modified string and an error string respectively; The replacement function is called by using the error mode object, and the error content is replaced with the modification content data according to the modification character string and the error character string, so as to generate the correction document of the document to be loaded.

4. The method according to claim 2 or 3, characterized in that: The replacement function includes a target string, a replaced string and other replacement options.

5. A device for modifying document error content with one click based on icontent architecture, characterized in that: include: An import module is used to use a JavaScript script to import an icontent framework to modify an erroneous language code library with one click, wherein the language code library includes a regular expression library and a DOM operation library; A first acquisition module is used to monitor whether the document to be loaded is loaded through the DOMContentLoaded event, and to acquire the text content of the document to be loaded if the document to be loaded is loaded; A positioning module, used to locate a DOM element containing text content from the text content by using a selector provided by the DOM operation library, wherein the selector includes an element selector, a class selector, and an ID selector; A second acquisition module is used to acquire a text data set of all the DOM elements by using a method or attribute provided by the DOM operation library; A third acquisition module is used to traverse the text data set using the regular expression library to obtain error content and modification suggestions of the document to be loaded; A generating module, used for replacing the erroneous content with the modification content data of the modification suggestion by adopting a string method or a regular expression replacement method in a regular expression library, so as to generate a correction document of the document to be loaded; The output module is used to verify the accuracy of the revised document and output the revised document of the document to be loaded if the revised document contains no erroneous content.

6. The device according to claim 5, characterized in that Generate modules, including: A definition submodule, used to define an error pattern by adopting the string method or the regular expression replacement method in the regular expression library; A compiling submodule, used for compiling the error pattern into an error pattern object by using a compiling function provided by the regular expression library; The replacement submodule is used to use the error pattern object to call the replacement function provided by the regular expression library to replace the error content with the modified content data, so as to generate the corrected document of the document to be loaded.

7. The device according to claim 6, characterized in that Replace submodules, including: A conversion unit, used to convert the modified content and the error content into a modified string and an error string respectively by using the regular expression library; A generating unit is used to call the replacement function using the error mode object, replace the error content with the modified content data according to the modified character string and the error character string, and generate the corrected document of the document to be loaded.

8. The device according to claim 6 or 7, characterized in that The replacement function includes a target string, a replaced string and other replacement options.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 4.

10. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatically instrumenting set of web documents

    CN101821764A

  • Intelligent correction method and system, electronic equipment and storage medium

    CN112528651A