CN112685553A - Method, device, equipment and medium for searching and replacing online document - Google Patents

Method, device, equipment and medium for searching and replacing online document Download PDF

Info

Publication number
CN112685553A
CN112685553A CN201910998061.4A CN201910998061A CN112685553A CN 112685553 A CN112685553 A CN 112685553A CN 201910998061 A CN201910998061 A CN 201910998061A CN 112685553 A CN112685553 A CN 112685553A
Authority
CN
China
Prior art keywords
keyword
replacing
information
highlight
keywords
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910998061.4A
Other languages
Chinese (zh)
Inventor
谯虎
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaochuanchuhai Education Technology Beijing Co ltd
Original Assignee
Xiaochuanchuhai Education Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaochuanchuhai Education Technology Beijing Co ltd filed Critical Xiaochuanchuhai Education Technology Beijing Co ltd
Priority to CN201910998061.4A priority Critical patent/CN112685553A/en
Publication of CN112685553A publication Critical patent/CN112685553A/en
Pending legal-status Critical Current

Links

Images

Abstract

The specification discloses a method for searching and replacing an online document, which comprises the following steps: receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced; acquiring a text node according to configuration information of a document area to be searched, and determining parameter information of a first keyword when the text node is judged to contain the first keyword; and replacing the second keyword with the first keyword according to the parameter information of the first keyword. The method and the device for searching and replacing the online document acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that the online document is easy to generate errors during the search and replacement and the search and replacement in the prior art.

Description

Method, device, equipment and medium for searching and replacing online document
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for searching and replacing an online document.
Background
With the development and growth of the internet industry, many office-type document tools (e.g., word, excel) are gradually walking up to the Web end from the very beginning windows/mac client. Due to the environment difference between the Web side and the windows/mac client side, the functions available on the Web by the document tool are few compared with the traditional client side, and especially the function support for searching and replacing keywords in the document is poor. In the process of editing the document at the Web end, a user is easy to have errors in the scene of searching for the replacement keyword, so that the user experience is influenced.
Disclosure of Invention
The present specification provides a method, an apparatus, a device and a medium for searching and replacing an online document, which solve the problem in the prior art that an error is easily generated when searching and replacing the online document.
To solve the above technical problem, the present specification is implemented as follows:
the present specification provides a method for searching and replacing an online document, including:
receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
acquiring a text node according to configuration information of a document area to be searched, and determining parameter information of a first keyword when the text node is judged to contain the first keyword;
and replacing the second keyword with the first keyword according to the parameter information of the first keyword.
Further, the configuration information includes page node information related to the required search area, container information corresponding to the page node, and identification information of the page node.
Further, the configuration information further comprises a highlight container for placing a highlight floating layer;
after the parameter information of the first keyword is determined, the method further includes:
and adding a first highlight floating layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight floating layer in the highlight container.
Further, after replacing the second keyword with the first keyword, the method further includes:
and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
Further, the parameter information includes location information;
the position information of the first keyword is represented by a two-dimensional array, and the two-dimensional array respectively represents the position number of the text node where the first keyword is located and the sequence number of the keyword where the first keyword is located.
Further, the parameter information further includes attribute information, where the attribute information includes a distance from the first keyword to the left side of the container corresponding to the page node, a distance from the first keyword to the upper side of the container corresponding to the page node, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node.
Further, the replacing the second keyword with the first keyword specifically includes:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords.
The present specification provides an apparatus for searching and replacing online documents, which includes:
the receiving unit is used for receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
the determining unit is used for acquiring a text node according to the configuration information of the document area to be searched, and determining the parameter information of the first keyword when the text node is judged to contain the first keyword;
and the replacing unit is used for replacing the second keyword with the first keyword according to the parameter information of the first keyword.
Further, the configuration information includes page node information related to the required search area, container information corresponding to the page node, and identification information of the page node.
Further, the configuration information further comprises a highlight container for placing a highlight floating layer;
the device further comprises:
and the adding unit is used for adding a first highlight layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight layer in the highlight container.
Further, the adding unit is further configured to: and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
Further, the parameter information includes location information;
the position information of the first keyword is represented by a two-dimensional array, and the two-dimensional array respectively represents the position number of the text node where the first keyword is located and the sequence number of the keyword where the first keyword is located.
Further, the parameter information further includes attribute information, where the attribute information includes a distance from the first keyword to the left side of the container corresponding to the page node, a distance from the first keyword to the upper side of the container corresponding to the page node, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node.
Further, the replacing unit is specifically configured to:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords.
The present specification provides a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to perform the steps of:
receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
acquiring a text node according to configuration information of a document area to be searched, and determining parameter information of a first keyword when the text node is judged to contain the first keyword;
and replacing the second keyword with the first keyword according to the parameter information of the first keyword.
An apparatus for online document lookup replacement provided by the present specification, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the following:
the receiving unit is used for receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
the determining unit is used for acquiring a text node according to the configuration information of the document area to be searched, and determining the parameter information of the first keyword when the text node is judged to contain the first keyword;
and the replacing unit is used for replacing the second keyword with the first keyword according to the parameter information of the first keyword.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
the method and the device for searching and replacing the document area acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that errors are easy to occur in the search and replacement of the online document and the search and replacement in the prior art.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the specification, and for those skilled in the art, other drawings can be derived based on the drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an alternative method for searching for an online document according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an alternative method for searching for an online document according to a second embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an online document search replacement device provided in the third embodiment of the present specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present disclosure without making any creative effort, shall fall within the protection scope of the present disclosure.
Fig. 1 is a schematic flowchart of an online document search replacement method provided in an embodiment of the present specification, where the schematic flowchart includes:
step S101, receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced.
Step S102, obtaining a text node according to the configuration information of the document area needing to be searched, and determining the parameter information of the first keyword when the text node is judged to contain the first keyword.
Step S103, replacing the second keyword with the first keyword according to the parameter information of the first keyword.
The method and the device for searching and replacing the online document acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that the online document is easy to generate errors during the search and replacement in the prior art.
Correspondingly to the above embodiment, the second embodiment of the present invention further provides an online document searching and replacing method, referring to the flow diagram of the online document searching and replacing method shown in fig. 2, where the flow diagram includes:
step S201, receiving configuration information of a document region to be searched, a first keyword to be searched, and a second keyword to be replaced.
In step S201 of the embodiment of the present specification, the configuration information includes page node information related to the required search area, container information corresponding to the page node, and identification information of the page node.
Step S202, a text node is obtained according to the configuration information of the document area needing to be searched, and when the text node is judged to contain the first keyword, the parameter information of the first keyword is determined.
In step S202 in this embodiment of the present specification, the first keyword is a single character, and the first keyword needs to be queried when performing a search, or the keyword is composed of multiple first keywords, for example, the text content of a text node is "i am an example is not me", in this text node, "i am" is a keyword that needs to be queried, "i am" is the first keyword, but only the first keyword "i am" is not a content that needs to be searched. The position information of the first keyword is represented by a two-dimensional array, the two-dimensional array respectively represents the position number of the text node where the first keyword is located and the character sequence number of the keyword where the first keyword is located, and each character in the keyword where the first keyword is located can be numbered according to the sequence. For example, a keyword is set as "my" and each character in the keyword is numbered in sequence, that is, the number of "my" is set as 0, the number of "yes" is set as "1", text nodes from position number 1 to position number 10 are document areas to be searched, and "my" is located at the 1 st position of a page node, then the two-dimensional array of the keyword "my" can be represented as position [1] [0], and the two-dimensional array of the keyword "yes" can be represented as position [1] [1 ].
Further, in step S202 in the embodiment of the present specification, determining a position number in the parameter information specifically includes:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, numbering each character of a text node in sequence, querying keywords related to the first keywords, then determining the position number of the first keywords, namely determining position information of the first keywords, for example, if the text node is 'my comes from test', the keywords are 'my is', the first keywords are 'me', and each character in the text node is numbered in sequence, namely, if me (1) is (2) comes from (3) to test (4) (6) to test (5), determining that the position number of the first keywords is 1;
if the number of the first keywords is multiple, numbering each character of the text node in sequence, inquiring the keywords related to the first keyword, then determining the position number of the first keyword, namely determining the position information of the first keyword, then deleting the number of the characters before the keyword corresponding to the first keyword, numbering the rest characters of the text node in sequence, inquiring the keywords related to the second first keyword, then determining the position number of the second keyword, adding the number of the deletion numbers for the first time, namely determining the position information of the second first keyword, repeating the steps, inquiring the keywords related to all the first keywords, and numbering the positions of all the first keywords. For example, if a text node is "my from me is an example", a keyword is "my is", a first keyword is "me", each character in the text node is numbered in sequence, that is, if i (1) is (2) to (3) to test (4) and (6) i (7) to test (5) is (8) to show (9) (10), it is determined that the position number of the first keyword is 1, and then it is determined that the numbering position of the second first keyword is 1+6 to 7, where 6 is the number of the first deletion numbers.
Further, in step S202 in this embodiment of the present specification, after the first keyword is queried, parameter information of each keyword in the keywords needs to be respectively represented, and finally, information of each keyword needs to be merged and displayed, but if a cross-text node exists in a keyword, the merged display is not performed.
Further, in step S202 in this embodiment of the present specification, the parameter information further includes attribute information, where the attribute information includes a distance from the page node to the left side of the container, a distance from the page node to the upper side of the container, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node. In this embodiment, the distance from the first keyword to the left side of the container corresponding to the page node, the distance from the first keyword to the upper side of the container corresponding to the page node, the width of the first keyword displayed in the page node, and the height of the first keyword displayed in the page node are determined, so that the specific position of the first keyword in the container can be further positioned, and the subsequent operation steps can be further completed.
Further, in step S202 of this embodiment of the present specification, the configuration information further includes a highlight container for placing a highlight floating layer.
After determining the parameter information of the first keyword, the method further includes:
and adding a first highlight floating layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight floating layer in the highlight container.
Step S203, replacing the second keyword with the first keyword according to the parameter information of the first keyword.
In step S203 in this embodiment of the present specification, replacing the second keyword with the first keyword specifically includes:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords. In this embodiment, when a first keyword is replaced, successive replacement is required, after the first keyword is replaced, parameter information of a second first keyword needs to be recalculated, because the number of characters of a keyword where the replaced second keyword is located may be different from the number of characters of a keyword where the first keyword is located, and the parameter information of the second first keyword may be changed, the parameter information of the second first keyword needs to be determined again, for example, when the keyword where the first keyword is located is "keyword", the keyword where the second keyword is "hello", if the first "keyword" is replaced by "hello", the parameter information of other characters changes after the first replacement because the numbers of the two characters are different, and the parameter information of the second keyword needs to be determined again.
Specifically, in this embodiment, when replacing the keyword where the first keyword is located, the last character of the keyword where the first keyword is located may be deleted first, then the penultimate character of the keyword where the first keyword is located may be deleted, and the above steps may be repeated until the first character of the keyword where the first keyword is located is retained, and then the keyword where the second keyword is located may be replaced to the position of the first character of the keyword where the first keyword is located, so that the replacement of the keyword where the first keyword is located by the keyword where the second keyword is located is completed, for example, "hello" needs to be replaced by "keyword", and when executing, the "eyword" may be deleted first, and then "hello" may be replaced by "k".
Further, after replacing the second keyword with the first keyword, the method further includes:
and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
The page node in the application can be a DOM node applied to an online document in a web end, and the DOM node means that each component in the online document is a node.
The method and the device for searching and replacing the online document acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that the online document is easy to generate errors during the search and replacement in the prior art.
Corresponding to the above embodiment, a third embodiment of the present invention further provides an apparatus for searching and replacing an online document, referring to a schematic structural diagram of the apparatus for searching and replacing an online document shown in fig. 3, where the schematic structural diagram includes: a receiving unit 1, a determining unit 2, a replacing unit 3 and an adding unit 4.
The receiving unit 1 is used for receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced.
The configuration information comprises page node information related to the required search area, container information corresponding to the page nodes and identification information of the page nodes.
The determining unit 2 is configured to obtain a text node according to configuration information of a document area to be searched, and determine parameter information of the first keyword when it is determined that the text node includes the first keyword.
The first keyword is a single character, and when searching, the first keyword or a plurality of first keywords are required to be searched to form a keyword, for example, the text content of the text node is "i am an example and is not me", in the text node, "i am" is a keyword required to be searched, and "i" is a first keyword, but only the first keyword "i" is not a content required to be searched. The position information of the first keyword is represented by a two-dimensional array, the two-dimensional array respectively represents the position number of the text node where the first keyword is located and the character sequence number of the keyword where the first keyword is located, and each character in the keyword where the first keyword is located can be numbered according to the sequence. For example, a keyword is set as "my" and each character in the keyword is numbered in sequence, that is, the number of "my" is set as 0, the number of "yes" is set as "1", text nodes from position number 1 to position number 10 are document areas to be searched, and "my" is located at the 1 st position of a page node, then the two-dimensional array of the keyword "my" can be represented as position [1] [0], and the two-dimensional array of the keyword "yes" can be represented as position [1] [1 ].
Further, determining the position number in the parameter information specifically includes:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, numbering each character of a text node in sequence, querying keywords related to the first keywords, then determining the position number of the first keywords, namely determining position information of the first keywords, for example, if the text node is 'my comes from test', the keywords are 'my is', the first keywords are 'me', and each character in the text node is numbered in sequence, namely, if me (1) is (2) comes from (3) to test (4) (6) to test (5), determining that the position number of the first keywords is 1;
if the number of the first keywords is multiple, numbering each character of the text node in sequence, inquiring the keywords related to the first keyword, then determining the position number of the first keyword, namely determining the position information of the first keyword, then deleting the number of the characters before the keyword corresponding to the first keyword, numbering the rest characters of the text node in sequence, inquiring the keywords related to the second first keyword, then determining the position number of the second keyword, adding the number of the deletion numbers for the first time, namely determining the position information of the second first keyword, repeating the steps, inquiring the keywords related to all the first keywords, and numbering the positions of all the first keywords. For example, if a text node is "my from me is an example", a keyword is "my is", a first keyword is "me", each character in the text node is numbered in sequence, that is, if i (1) is (2) to (3) to test (4) and (6) i (7) to test (5) is (8) to show (9) (10), it is determined that the position number of the first keyword is 1, and then it is determined that the numbering position of the second first keyword is 1+6 to 7, where 6 is the number of the first deletion numbers.
Furthermore, after the first keyword is queried, the parameter information of each keyword in the keywords needs to be respectively represented, and finally the information of each keyword needs to be merged and displayed, but if the keywords in the keywords have cross-text nodes, the merged display is not performed.
Further, the parameter information further includes attribute information, where the attribute information includes a distance from the first keyword to the left side of the container corresponding to the page node, a distance from the first keyword to the upper side of the container corresponding to the page node, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node. In this embodiment, the distance from the first keyword to the left side of the container corresponding to the page node, the distance from the first keyword to the upper side of the container corresponding to the page node, the width of the first keyword displayed in the page node, and the height of the first keyword displayed in the page node are determined, so that the specific position of the first keyword in the container can be further positioned, and the subsequent operation steps can be further completed.
Further, the configuration information further comprises a highlight container for placing the highlight floating layer.
The determination unit 2 is further configured to: and adding a first highlight floating layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight floating layer in the highlight container.
The replacing unit 3 is configured to replace the second keyword with the first keyword according to parameter information of the first keyword.
The configuration information comprises page node information related to the required search area, container information corresponding to the page nodes and identification information of the page nodes.
The configuration information also includes a highlight container for placing a highlight float.
The adding unit 4 is configured to add a first highlight layer to the first keyword according to parameter information of the first keyword, and place the first highlight layer in the highlight container.
The adding unit 4 is also used for: and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
The parameter information includes location information;
the position information of the first keyword is represented by two-dimensional arrays, and the two-dimensional arrays respectively represent the position number of a text node where the first keyword is located and the sequence number of the keyword where the first keyword is located.
The parameter information further comprises attribute information, wherein the attribute information comprises the distance from the first keyword to the left side of the container corresponding to the page node, the distance from the first keyword to the upper side of the container corresponding to the page node, the width of the first keyword displayed in the page node and the height of the first keyword displayed in the page node.
The replacing unit 3 is specifically configured to:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords. In this embodiment, when a first keyword is replaced, successive replacement is required, after the first keyword is replaced, parameter information of a second first keyword needs to be recalculated, because the number of characters of a keyword where the replaced second keyword is located may be different from the number of characters of a keyword where the first keyword is located, and the parameter information of the second first keyword may be changed, the parameter information of the second first keyword needs to be determined again, for example, when the keyword where the first keyword is located is "keyword", the keyword where the second keyword is "hello", if the first "keyword" is replaced by "hello", the parameter information of other characters changes after the first replacement because the numbers of the two characters are different, and the parameter information of the second keyword needs to be determined again.
Specifically, in this embodiment, when replacing the keyword where the first keyword is located, the last character of the keyword where the first keyword is located may be deleted first, then the penultimate character of the keyword where the first keyword is located may be deleted, and the above steps may be repeated until the first character of the keyword where the first keyword is located is retained, and then the keyword where the second keyword is located may be replaced to the position of the first character of the keyword where the first keyword is located, so that the replacement of the keyword where the first keyword is located by the keyword where the second keyword is located is completed, for example, "hello" needs to be replaced by "keyword", and when executing, the "eyword" may be deleted first, and then "hello" may be replaced by "k".
The method and the device for searching and replacing the online document acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that the online document is easy to generate errors during the search and replacement in the prior art.
The present specification provides a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to perform the steps of:
receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
acquiring a text node according to configuration information of a document area to be searched, and determining parameter information of a first keyword when the text node is judged to contain the first keyword;
and replacing the second keyword with the first keyword according to the parameter information of the first keyword.
An apparatus for online document lookup replacement provided by the present specification, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the following:
the receiving unit is used for receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
the determining unit is used for acquiring a text node according to the configuration information of the document area to be searched, and determining the parameter information of the first keyword when the text node is judged to contain the first keyword;
and the replacing unit is used for replacing the second keyword with the first keyword according to the parameter information of the first keyword.
The method and the device for searching and replacing the online document acquire the text node to be searched under the condition of determining the search range by receiving the configuration information of the document area to be searched, and finally complete the search and replacement, thereby solving the problem that the online document is easy to generate errors during the search and replacement in the prior art.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an integrated circuit chip, such programming is mostly implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific programming Language, which is called Hardware Description Language (HDL), and the HDL is not only one but many, and it should be clear to those skilled in the art that the Hardware circuit for implementing the logic method flow can be easily obtained by only slightly programming the logic of the method flow in the above Hardware Description languages and programming the integrated circuit.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PlC18F26K20, and silicon Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium which can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for finding alternatives for an online document, the method comprising:
receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
acquiring a text node according to configuration information of a document area to be searched, and determining parameter information of a first keyword when the text node is judged to contain the first keyword;
and replacing the second keyword with the first keyword according to the parameter information of the first keyword.
2. The method of on-line document searching and replacing as claimed in claim 1, wherein the configuration information includes page node information related to the required searching area, container information corresponding to the page node, and identification information of the page node;
preferably, the configuration information further comprises a highlight container for placing a highlight floating layer;
after the parameter information of the first keyword is determined, the method further includes:
adding a first highlight floating layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight floating layer in the highlight container;
preferably, after replacing the second keyword with the first keyword, the method further includes:
and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
3. The method of claim 2, wherein the parameter information comprises location information;
the position information of the first keyword is represented by a two-dimensional array, and the two-dimensional array respectively represents the position number of a text node where the first keyword is located and the sequence number of the keyword where the first keyword is located;
preferably, the parameter information further includes attribute information, where the attribute information includes a distance from the first keyword to the left side of the container corresponding to the page node, a distance from the first keyword to the upper side of the container corresponding to the page node, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node.
4. The method for searching and replacing online documents according to claim 1, wherein the replacing the second keyword with the first keyword specifically comprises:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords.
5. An apparatus for online document lookup replacement, the apparatus comprising:
the receiving unit is used for receiving configuration information of a document area needing to be searched, a first keyword needing to be searched and a second keyword needing to be replaced;
the determining unit is used for acquiring a text node according to the configuration information of the document area to be searched, and determining the parameter information of the first keyword when the text node is judged to contain the first keyword;
and the replacing unit is used for replacing the second keyword with the first keyword according to the parameter information of the first keyword.
6. The apparatus for on-line document searching and replacing as claimed in claim 5, wherein the configuration information includes page node information related to the required searching area, container information corresponding to the page node, and identification information of the page node;
preferably, the configuration information further comprises a highlight container for placing a highlight floating layer;
the device further comprises:
the adding unit is used for adding a first highlight layer to the first keyword according to the parameter information of the first keyword, and placing the first highlight layer in the highlight container;
preferably, the adding unit is further configured to: and deleting the first highlight floating layer in the highlight container, and adding a second highlight floating layer to the second keyword.
7. The apparatus of claim 5, wherein the parameter information comprises location information;
the position information of the first keyword is represented by a two-dimensional array, and the two-dimensional array respectively represents the position number of a text node where the first keyword is located and the sequence number of the keyword where the first keyword is located;
preferably, the parameter information further includes attribute information, where the attribute information includes a distance from the first keyword to the left side of the container corresponding to the page node, a distance from the first keyword to the upper side of the container corresponding to the page node, a width of the first keyword displayed in the page node, and a height of the first keyword displayed in the page node.
8. The apparatus for searching and replacing online document according to claim 5, wherein the replacing unit is specifically configured to:
calculating the number of the first keywords according to the configuration information of the document area to be searched;
if the number of the first keywords is one, replacing the second keywords with the first keywords to complete online document searching and replacing;
if the number of the first keywords is multiple, after replacing the second keyword with the first keyword, according to the configuration information of the document area to be searched and the first keyword, determining the parameter information of the first keyword, replacing the second keyword with the second first keyword, and repeating the steps until the second keyword is replaced with all the first keywords.
9. A computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to perform the method of any one of claims 1-4.
10. An apparatus for online document lookup replacement, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the apparatus of any of claims 5-9.
CN201910998061.4A 2019-10-18 2019-10-18 Method, device, equipment and medium for searching and replacing online document Pending CN112685553A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910998061.4A CN112685553A (en) 2019-10-18 2019-10-18 Method, device, equipment and medium for searching and replacing online document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910998061.4A CN112685553A (en) 2019-10-18 2019-10-18 Method, device, equipment and medium for searching and replacing online document

Publications (1)

Publication Number Publication Date
CN112685553A true CN112685553A (en) 2021-04-20

Family

ID=75445249

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910998061.4A Pending CN112685553A (en) 2019-10-18 2019-10-18 Method, device, equipment and medium for searching and replacing online document

Country Status (1)

Country Link
CN (1) CN112685553A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114741632A (en) * 2022-03-31 2022-07-12 网易有道信息技术(北京)有限公司 Method for displaying keywords in webpage and related product thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6349302B1 (en) * 1997-07-08 2002-02-19 Hitachi, Ltd. Document processing method and system, and computer-readable recording medium having document processing program recorded therein
CN102789484A (en) * 2012-06-28 2012-11-21 奇智软件(北京)有限公司 Method and device for webpage information processing
CN107943782A (en) * 2017-10-10 2018-04-20 深圳市金立通信设备有限公司 A kind of character processing method and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6349302B1 (en) * 1997-07-08 2002-02-19 Hitachi, Ltd. Document processing method and system, and computer-readable recording medium having document processing program recorded therein
CN102789484A (en) * 2012-06-28 2012-11-21 奇智软件(北京)有限公司 Method and device for webpage information processing
CN107943782A (en) * 2017-10-10 2018-04-20 深圳市金立通信设备有限公司 A kind of character processing method and terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114741632A (en) * 2022-03-31 2022-07-12 网易有道信息技术(北京)有限公司 Method for displaying keywords in webpage and related product thereof

Similar Documents

Publication Publication Date Title
CN107526777B (en) Method and equipment for processing file based on version number
CN110245279B (en) Dependency tree generation method, device, equipment and storage medium
CN109241026B (en) Data management method, device and system
CN105824830A (en) Page displaying method, client and equipment
CN108846069B (en) Document execution method and device based on markup language
CN113011483A (en) Method and device for model training and business processing
CN107451204B (en) Data query method, device and equipment
CN113434533A (en) Data tracing tool construction method, data processing method, device and equipment
CN113641894A (en) Information recommendation method and device
CN108959330B (en) Database processing and data query method and device
CN112685553A (en) Method, device, equipment and medium for searching and replacing online document
CN112231531A (en) Data display method, equipment and medium based on openstb
CN116303625A (en) Data query method and device, storage medium and electronic equipment
CN110019295B (en) Database retrieval method, device, system and storage medium
CN115391426A (en) Data query method and device, storage medium and electronic equipment
CN112183181A (en) Information display method
CN106649364B (en) Table target column positioning method and device
CN110704742B (en) Feature extraction method and device
CN110245136B (en) Data retrieval method, device, equipment and storage equipment
CN108241695B (en) Information processing method and device
CN112860912A (en) Method and device for updating knowledge graph
CN111209277A (en) Data processing method, device, equipment and medium
CN111695056A (en) Page processing method, page return processing method, device and equipment
CN107220034B (en) Program code marking method and device
CN107391525B (en) Instruction processing method and device for database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination