Method and device for visually displaying positions of retrieved error keywords
By displaying the location of text detection error keywords in the HTML page structure, the problem of inability to intuitively locate errors in the prior art is solved, and the user's positioning efficiency is improved.
Patent Information
- Application Number
- CN202510036111.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The prior art cannot intuitively display the location of wrong keywords in text detection, resulting in users needing to position themselves, which is inefficient.
By creating an HTML page structure, obtaining detection text and storing error keywords, recording and displaying keyword locations, users can locate error keywords through clicking event listeners.
It realizes intuitive display of wrong keyword locations, improving the efficiency and convenience of user error positioning.
Smart Images

Figure CN120067307A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text detection, and more specifically, to a method and device for intuitively displaying the positions of retrieved wrong keywords. Background Art
[0002] iContent can currently perform verification and detection on txt, doc, and docx, and display the problems in the content. However, it can only show the number of errors and cannot intuitively display the positions of the errors. For those who are not familiar with the content of the detected document, they still need to locate the errors by themselves, resulting in the technical problem of low processing efficiency. Summary of the Invention
[0003] Aiming at the deficiencies of the prior art, the present invention provides a method and device for intuitively displaying the positions of retrieved wrong keywords.
[0004] According to one aspect of the present invention, a method for intuitively displaying the positions of retrieved wrong keywords is provided, including:
[0005] Creating an HTML page structure for displaying the detected text and the list of wrong keywords in the detected text;
[0006] Obtaining the detected text from the iContent page for detection, obtaining the wrong keywords and storing them in the HTML page structure;
[0007] Searching for and recording the positions of each wrong keyword in the detected text, and adding the retrieved positions to the UL element list corresponding to the wrong keyword in the HTML page structure;
[0008] Obtaining the positions of each wrong keyword in the detected text through the click event listener of the UL element list in the HTML page structure.
[0009] Optionally, it further includes: processing the highlighting of the detected text and the wrong keywords in the HTML page structure by writing a script.
[0010] Optionally, it further includes: defining a div element in the HTML page structure for displaying the detected text.
[0011] Optionally, obtaining the positions of each wrong keyword in the detected text through the click event listener of the UL element list in the HTML page structure includes:
[0012] Highlighting the content corresponding to each wrong keyword in the detected text and determining the highlighted content of each wrong keyword;
[0013] According to the click event listener, making the page scroll to the positions of each wrong keyword of the highlighted content.
[0014] According to another aspect of the present invention, there is provided a device for intuitively displaying the positions of retrieved error keywords, comprising:
[0015] A creation module, configured to create an HTML page structure for displaying the detected text and a list of error keywords in the detected text;
[0016] A detection module, configured to obtain the detected text from the iContent page for detection, obtain the error keywords and store them in the HTML page structure;
[0017] An addition module, configured to search for and record the positions of each error keyword in the detected text, and add the retrieved positions to the UL element list corresponding to the error keywords in the HTML page structure;
[0018] An acquisition module, configured to obtain the positions of each error keyword in the detected text through a click event listener of the UL element list in the HTML page structure.
[0019] According to still another aspect of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method according to any one of the above aspects of the present invention.
[0020] According to still another aspect of the present invention, there is provided an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any one of the above aspects of the present invention.
[0021] Thus, the present invention provides a method for intuitively displaying the positions of retrieved error keywords. A user can select a keyword in the error keyword ul list and click to locate the position of the keyword in the text, providing a convenient and specific positioning function to help the user quickly find and locate the error keywords. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] By referring to the following drawings, the exemplary embodiments of the present invention can be more fully understood:
[0023] Figure 1 is a flowchart of a method for intuitively displaying the positions of retrieved error keywords provided by an exemplary embodiment of the present invention;
[0024] Figure 2 is a structural diagram of a device for intuitively displaying the positions of retrieved error keywords provided by an exemplary embodiment of the present invention;
[0025] Figure 3 is the structure of an electronic device provided by an exemplary embodiment of the present invention. Detailed implementation manners
[0026] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein.
[0027] It should be noted that: Unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention.
[0028] Those skilled in the art can understand that terms such as "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 an inevitable logical order between them.
[0029] It should also be understood that in the embodiments of the present invention, "a plurality of" may mean two or more, and "at least one" may mean one, two or more.
[0030] It should also be understood that for any component, data or structure mentioned in the embodiments of the present invention, without clear limitation or contrary indication in the context, it can generally be understood as one or more.
[0031] In addition, the term "and / or" in the present invention is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in the present invention generally represents an "or" relationship between the associated objects before and after.
[0032] It should also be understood that the present invention emphasizes the differences between the various embodiments. Their similarities or similarities can be referred to each other. For the sake of brevity, they will not be described one by one.
[0033] At the same time, it should be understood that for the convenience of description, the dimensions of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0034] The following description of at least one exemplary embodiment is merely illustrative in nature and in no way a limitation on the present invention or its application or use.
[0035] Techniques, methods and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, the techniques, methods and devices should be regarded as part of the specification.
[0036] It should be noted that like reference numerals and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
[0037] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate together with many other general-purpose or special-purpose 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, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above systems, and so on.
[0038] 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 a computer system. Generally, program modules can include routines, programs, target programs, components, logics, data structures, etc., which perform specific tasks or implement specific abstract data types. The computer system / server can be implemented in a distributed cloud computing environment where tasks are executed 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.
[0039] Exemplary method
[0040] Figure 1 is a flowchart showing a method for intuitively displaying the positions of retrieved error keywords provided by an exemplary embodiment of the present invention. This embodiment can be applied to an electronic device, such as Figure 1 As shown, the method 100 for intuitively displaying the positions of retrieved error keywords includes the following steps:
[0041] Step 101, create an HTML page structure for displaying the detected text and the list of error keywords in the detected text;
[0042] Step 102, obtain the detected text from the iContent page for detection, obtain the error keywords and store them in the HTML page structure;
[0043] Step 103, search for and record the positions of each error keyword in the detected text, and add the retrieved positions to the UL element list of the corresponding error keyword in the HTML page structure;
[0044] Step 104: Obtain the positions of each error keyword in the detected text through the click event listener of the UL element list in the HTML page structure.
[0045] Specifically, the function of retrieving the positions of error keywords in iContent is implemented by using a scripting language. In cooperation with the ul display, when an error keyword is selected, the ul can locate the position in the text. The specific implementation process is as follows:
[0046] 1. Technical purpose achieved: Create a basic HTML page structure for displaying text and a list of error keywords, and write JavaScript scripts to handle the highlighting of text and error keywords.
[0047] 2. Technology adopted: Select a scripting language.
[0048] Select the JavaScript scripting language, which is suitable for implementing the function of checking and displaying the positions of keywords on a web page. The functions of keyword checking and position recording can be implemented using JavaScript's string processing functions, regular expressions, etc. After the page is loaded, traverse the list of error keywords, create a list item for each keyword, bind a click event, highlight the keywords in the text through the highlightErrors function, and finally use the scrollToError function to scroll the page to the specified keyword position.
[0049] 3. Obtain the text content:
[0050] According to the selector or ID of the HTML element where the text content is located, use `document.querySelector()` or `document.getElementById()` to reference the element, and use the interface of iContent to call and upload to obtain the text content to be retrieved. Currently, iContent can upload local documents in the form of click upload or drag-and-drop. Define a Element to display text, and then define a An element is used to display the list of error keywords, and CSS styles are added to highlight the keywords.
[0051] 4. Parse the text to locate the keyword positions:
[0052] I. Obtain the text content to be retrieved from the iContent page and use the RegExp object and regular expressions in JavaScript for matching.
[0053] II. Create a regular expression object, use the error keyword entered by the user as the pattern, and set the flags of the regular expression (such as case-insensitive) to meet different requirements.
[0054] III. Use the match() method of the String object to search for and record the matching positions, and use JavaScript to create ` `element and add the matched error keyword to` `In the list.
[0055] 4) Add a click event to locate the position, in each ` Add a click event listener to the `element`. In the click event, use the `scrollIntoView()` method of JavaScript or other methods to locate the position corresponding to the error keyword in the text.
[0056] 5. Update the ul display:
[0057] According to the located keyword position, make corresponding updates to the ul element on the HTML page. Use JavaScript to operate on the DOM, modify the content, style, etc. of the ul element, and add the keyword location information to the ul display to achieve the selection and statistics of the error keywords, and follow the location on the page for intuitive and convenient modification.
[0058] Thus, the present invention provides a method for intuitively displaying the position of the retrieved error keywords. Users can select keywords in the error keyword ul list and click to locate the position of the keyword in the text, providing a convenient and specific positioning function to help users quickly find and locate the error keywords.
[0059] Exemplary device
[0060] Figure 2 It is a schematic structural diagram of a device for intuitively displaying the position of the retrieved error keywords provided by an exemplary embodiment of the present invention. As Figure 2 shown, the device 200 includes:
[0061] A creation module 210 for creating an HTML page structure for displaying the detected text and the error keyword list of the detected text;
[0062] A detection module 220 for obtaining the detected text from the iContent page for detection, obtaining error keywords and storing them in the HTML page structure;
[0063] An addition module 230 for searching and recording the positions of each error keyword in the detected text, and adding the retrieved positions to the UL element list corresponding to the error keywords in the HTML page structure;
[0064] An acquisition module 240 for obtaining the positions of each error keyword in the detected text through the click event listener of the UL element list in the HTML page structure.
[0065] Optionally, the device 200 further includes: a processing module for processing the highlighting of the detected text and the error keywords of the HTML page structure by writing a script.
[0066] Optionally, the apparatus 200 further includes: a defining module, configured to define a div element for displaying the detected text in the HTML page structure.
[0067] Optionally, the obtaining module 240 includes:
[0068] a processing sub-module, configured to perform highlighting processing on the content corresponding to each error keyword in the detected text, and determine the highlighted content of each error keyword;
[0069] a scrolling sub-module, configured to scroll the page to the positions of the error keywords of the highlighted content according to the click event listener.
[0070] Exemplary electronic device
[0071] Figure 3 is the structure of an electronic device provided by an exemplary embodiment of the present invention. As Figure 3 shown, the electronic device 30 includes one or more processors 31 and a memory 32.
[0072] The processor 31 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0073] The memory 32 may include one or more computer program products, and the computer program products 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, 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 media, 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 further include: an input device 33 and an output device 34, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0074] In addition, the input device 33 may further include, for example, a keyboard, a mouse, etc.
[0075] The output device 34 may output various information to the outside. The output device 34 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0076] Of course, for simplicity, Figure 3 Only some of the components related to the present invention in the electronic device are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device may further include any other appropriate components.
[0077] Exemplary computer program product and computer-readable storage medium
[0078] In addition to the above methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions that, when run on a processor, cause the processor to execute the steps in the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above of this specification.
[0079] The computer program product may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0080] Furthermore, an embodiment of the present invention may also be a computer-readable storage medium having stored thereon computer program instructions that, when run on a processor, cause the processor to execute the steps in the method of information mining of historical change records according to various embodiments of the present invention described in the "Exemplary Methods" section above of this specification.
[0081] The computer-readable storage medium may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having 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.
[0082] The basic principles of the present invention have been described in conjunction with specific embodiments. However, it should be noted that the advantages, benefits, effects, etc. mentioned in the present invention are only examples and not limitations. It cannot be considered that these advantages, benefits, effects, etc. are essential for each embodiment of the present invention. Additionally, the specific details disclosed above are only for illustrative and facilitating understanding purposes, and not for limitation. These details do not limit the present invention to necessarily implementing with the above specific details.
[0083] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. For the same or similar parts among the embodiments, reference can be made to each other. For system embodiments, since they basically correspond to method embodiments, the description is relatively simple. For relevant parts, reference can be made to the corresponding description in the method embodiments.
[0084] The block diagrams of the devices, systems, equipment, and systems involved in the present invention are only illustrative examples and do not intend to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open-ended terms, meaning "including but not limited to", and can be used interchangeably with each other. The word "or" and "and" used herein refer to the phrase "and / or", and can be used interchangeably with each other, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to", and can be used interchangeably with each other.
[0085] The methods and systems of the present invention can be implemented in many ways. For example, the methods and systems of the present invention can be implemented through software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of the steps for the methods is only for illustration, and the steps of the methods of the present invention are not limited to the specific order described above, unless otherwise specifically stated. Additionally, in some embodiments, the present invention can also be implemented as a program recorded in a recording medium, and these programs include machine-readable instructions for implementing the methods according to the present invention. Therefore, the present invention also covers the recording medium storing the programs for executing the methods according to the present invention.
[0086] It should also be noted that in the systems, devices, and methods of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations shall be regarded as equivalent solutions of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein 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 herein, but rather to the broadest scope consistent with the principles and novel features disclosed herein.
[0087] The above description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the present invention to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.
Claims
1. A method for intuitively displaying the location of retrieved incorrect keywords, characterized in that: include: Creating an HTML page structure for displaying the detected text and a list of incorrect keywords in the detected text; Obtain the detection text from the iContent page for detection, obtain error keywords and store them in the HTML page structure; Searching and recording the position of each erroneous keyword from the detection text, and adding the retrieved position to the UL element list corresponding to the erroneous keyword in the HTML page structure; The position of each erroneous keyword in the detection text is obtained through the click event listener of the UL element list in the HTML page structure.
2. The method according to claim 1, characterized in that Also includes: The detection text and the highlighting of the erroneous keywords of the HTML page structure are processed by writing a script.
3. The method according to claim 1, characterized in that Also includes: A div element for displaying the detected text is defined in the HTML page structure.
4. The method according to claim 2, characterized in that: Obtaining the position of each erroneous keyword in the detection text through the click event listener of the UL element list in the HTML page structure includes: Highlighting the content corresponding to each erroneous keyword in the detected text to determine the highlighted content of each erroneous keyword; According to the click event listener, the page is scrolled to the position of each erroneous keyword of the highlighted content.
5. A device for intuitively displaying the location of retrieved incorrect keywords, characterized in that: include: A creation module, used for creating an HTML page structure for displaying a detection text and a list of error keywords in the detection text; A detection module, used for acquiring the detection text from the iContent page for detection, acquiring error keywords and storing them in the HTML page structure; An adding module, used for searching and recording the position of each erroneous keyword from the detection text, and adding the retrieved position to the UL element list corresponding to the erroneous keyword in the HTML page structure; The acquisition module is used to acquire the position of each erroneous keyword in the detection text through the click event listener of the UL element list in the HTML page structure.
6. The device according to claim 5, characterized in that Also includes: A processing module is used to process the detection text and highlight the erroneous keywords of the HTML page structure by writing a script.
7. The device according to claim 5, characterized in that Also includes: A definition module is used to define a div element for displaying the detected text in the HTML page structure.
8. The device according to claim 6, characterized in that Get modules, including: A processing submodule, used for highlighting the content corresponding to each erroneous keyword in the detected text, and determining the highlighted content of each erroneous keyword; The scrolling submodule is used to scroll the page to the position of each erroneous keyword in the highlighted content according to the click event listener.
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
Method and device for processing detail pages of search results
CN104281671A
On-line state monitoring method and system
CN105450462A
Method and device for displaying error correction information on front-end page
CN110968989A
Method and device for identifying wrongly-identified words
CN113761881A
Abnormal link processing method and device, computer equipment and storage medium
CN114329287A