Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a flowchart illustrating a text presentation method according to an exemplary embodiment of the present application.
Referring to fig. 1, the text display method may be applied to a client installed in a terminal device, where the terminal device may include an intelligent device such as a smart phone, a tablet computer, a PC (Personal computer), a PDA (Personal Digital Assistant), and the like. The text presentation method may include the steps of:
and 101, extracting text keywords based on the service operation of the user.
In this embodiment, a user may complete a relevant service operation through a client, and the client may extract a text keyword according to the service operation of the user, so as to obtain information that the user pays attention to at ordinary times. The business operation may be an operation in which a user selects a business object, or the business operation may be an operation in which the user adds attention to the business object, and the like, which is not particularly limited in the present application. In this step, the client may extract an identifier of a business object selected or concerned by the user as the text keyword, such as: the client may extract the name of the business object selected by the user as the file keyword.
For example, assuming that the client is a client with stock buying and selling functions, the business operations may include: the operation of the user buying the stocks, the operation of the user adding the optional shares, of course, the business operation may also include the operation of the user searching the stocks, etc. In this step, the client may take stocks purchased by the user, optional shares, and stocks searched by the user as the text keywords, which cover stocks that the user pays attention to at ordinary times.
And step 102, after receiving a text browsing instruction, searching a target text segment matched with the text keyword in a target text.
In this embodiment, the text browsing instruction is usually triggered by a user, and after receiving the text browsing instruction, the client may search for a target text segment in a target text specified by the text browsing instruction, for example: the client may search the target text for the text keyword, and after the text keyword is searched, a sentence where the text keyword is located may be used as the target text segment. When determining the sentence where the text keyword is located, a period may be used as a reference, specifically, periods may be searched forward and backward respectively based on the text keyword, and the sentence between the two searched periods is used as the target text segment.
In this embodiment, if a target text segment matching the text keyword can be searched in the target text, step 103 may be executed. If the target text segment matching the text keyword is not searched in the target text, the process of the application can be ended, and the target text is displayed according to the display scheme provided in the related technology.
And 103, when the target text is displayed, differently displaying the target text segments in the target text.
Based on the foregoing step 102, when the target text segment matching the text keyword is searched, the target text segment may be displayed with a display parameter different from the non-target text segment in the target text. Wherein the presentation parameters may include: font color, font shading, highlighting parameters, etc. For example, when the target text is displayed, the target text segment in the target text may be highlighted, or may be displayed after underlining is added to the target text segment.
Optionally, in an example, in order to enable a user to intuitively know text keywords matching a target text segment, when the target text is displayed, a tag may be added to the target text segment in the target text to label the text keywords matching the target text segment. Still taking the client as the client with stock buying and selling functions as an example, please refer to fig. 2, and assume that the text keywords extracted by the client are: "China Zhongliang" and "Huayuan estate", then when the user browses the information with the title "two-line city entering Queen season central enterprise, national enterprise entitled the male land market", the client searches the target text segment matching the text keyword "China Zhongliang" in the text of the information, and when the information is displayed, adds underline to the target text segment matching "China Zhongliang", in addition, the client can also add the text keyword "China Zhongliang" to the target text segment, such as: and displaying Chinese Zhongliang in front of the target text segment in a form of a suspension box. Of course, in practical applications, the target text segment may also be labeled in other manners, which is not limited in this application.
The method and the device can extract the text keywords based on the service operation of the user, and differently display the target text segments matched with the text keywords in the target text when the target text is displayed, so that the content which the user is interested in can be marked in the target text, the information browsing efficiency of the user is improved, and the user experience is improved.
Optionally, in another example of the present application, the client may present a text keyword in a presentation page of the target text, and provide an integration option for the user. With continued reference to fig. 2, the client may display the text keywords "chinese traditional food" and "huayuan" in the display page of the target text, and provide integration options, such as: fig. 2 shows buttons on the right side of the text keyword.
In this embodiment, when the user triggers the integration option, the client may hide the non-target text segment in the target text, integrate the target text segment in the target text, and display the integrated target text segment. Optionally, when the client integrates the target text segments in the target text, the client may integrate the target text segments by using the text keywords as dimensions. For example, assuming that there are 3 target text segments in the target text, where a text keyword matched with two target text segments is a first text keyword, for convenience of description, the two target text segments may be referred to as a first target text segment, a text keyword matched with another target text segment is a second text keyword, and this target text segment may be referred to as a second target text segment, when target text segments are integrated, the first target text segment and the second target text segment may be distinguished. After the integration is completed, the client may display a first target text segment matching the first text keyword, and may display a second target text segment matching the second text keyword after the user triggers a switching option for the first target text segment. And analogizing in sequence, when a third target text segment matching a third text keyword exists in the target text, after the user triggers a switching option for the second target text segment, the first target text segment or the third target text segment can be displayed according to the switching option, so that switching among the target text segments is realized, and the user can browse conveniently.
Still taking the target text shown in fig. 2 as an example, please refer to fig. 3, after the user triggers and clicks the integration option provided in the page, the client integrates all target text segments in the target text with "chinese zhongliang" and "huayuan" as dimensions, and then displays the first target text segment matching "chinese zhongliang". When the user triggers the switch option, such as: the user enters a swipe gesture that slides to the left or the user clicks a button to the right, and the client may present a second target text segment that matches "huayuan. The user can intuitively know the text keywords matched with the current target text segment, and switches between the target text segments matched with different text keywords through the switching options, so that the information browsing efficiency of the user is greatly improved.
In this embodiment, when browsing the integrated target text segment, the user may exit the display page of the target text segment through an exit instruction to restore the display page of the target text. With continued reference to fig. 3, the user may click on the exit button in the upper right corner of the page and the client may restore the current page to the target text presentation page shown in fig. 2.
According to the method and the device, when the user triggers the integration option, the non-target text segment in the target text can be hidden, the integrated target text segment is displayed, and the user can conveniently browse the concerned information in a centralized manner.
Corresponding to the embodiment of the text display method, the application also provides an embodiment of a text display device.
The embodiment of the text display device can be applied to a client loaded on the terminal equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the terminal device where the device is located. In terms of hardware, as shown in fig. 4, the present application text shows a hardware structure diagram of a terminal device where the apparatus is located, and the terminal device where the apparatus is located in the embodiment may further include other hardware according to an actual function of the terminal device, in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, which is not described again.
Fig. 5 is a schematic structural diagram of a text display device according to an exemplary embodiment of the present application.
Referring to fig. 5, the text display apparatus 400 can be applied to the terminal device shown in fig. 4, and includes: a keyword extraction unit 401, a keyword search unit 402, a text presentation unit 403, an option providing unit 404, a section integration unit 405, a section presentation unit 406, a section switching unit 407, a section exit unit 408, and a tag addition unit 409.
The keyword extraction unit 401 extracts text keywords based on a service operation of a user;
the keyword searching unit 402 searches a target text segment matching the text keyword in a target text after receiving a text browsing instruction;
the text display unit 403 displays the target text segments in the target text differently when displaying the target text.
The option providing unit 404, providing an integration option in the display page of the target text;
the segment integration unit 405, when the user triggers the integration option, hides a non-target text segment in the target text and integrates a target text segment in the target text;
the segment displaying unit 406 displays the integrated target text segment.
Optionally, the segment integration unit 405 integrates the target text segment with a text keyword as a dimension;
the segment display unit 406 displays a first target text segment matching the first text keyword.
The segment switching unit 407, after the user triggers the switching option for the first target text segment, displays a second target text segment matching the second text keyword.
The segment exit unit 408, when receiving an exit instruction based on the display page of the first target text segment, restores the display page of the target text.
The tag adding unit 409 adds a tag to the target text segment, where the tag is a text keyword matched with the target text segment.
Optionally, the text displaying unit 403 displays the target text segment with a display parameter different from a non-target text segment in the target text when displaying the target text.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.