Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a text processing method and a text processing device, which can facilitate a user to operate keywords in a text.
The embodiment of the invention provides a text processing method, which comprises the following steps:
responding to external touch sensed by a touch terminal, and acquiring position information of the external touch;
determining a word segmentation area according to the external touch position information;
identifying characters in the word segmentation area to obtain a first text;
performing word segmentation on characters in the first text to obtain word segmentation results;
and displaying the word segmentation result.
Preferably, the determining a word segmentation area according to the external touch position information specifically includes:
acquiring area position information of each display area on the touch terminal;
detecting the position relation between the external touch and each display area on the touch terminal one by one according to the position information of the external touch and the area position information of each display area on the touch terminal;
when the outside touch control is located in a first display area, determining that the first display area is the word segmentation area, and the first display area is a display area on the touch control terminal.
Preferably, the displaying the word segmentation result specifically includes:
generating a word segmentation display interface and at least one view control;
adding each word in the word segmentation result to one view control respectively;
and displaying all view controls on the word segmentation display interface.
Preferably, the word segmentation is performed on the characters in the first text to obtain a word segmentation result, and the method specifically includes:
judging whether the number of characters of the first text is larger than a preset value;
if not, performing word segmentation on all characters in the first text to obtain a word segmentation result;
if so, determining a second text according to the external touch position information, and performing word segmentation on all characters in the second text to obtain the word segmentation result, wherein the first text comprises all characters in the second text, and the number of characters in the second text is equal to the preset value.
Preferably, the displaying the word segmentation result further comprises:
receiving a keyword selection instruction triggered by a user, wherein the keyword selection instruction is sent according to the word segmentation result;
acquiring the keywords selected by the user from the word segmentation result according to the keyword selection instruction;
displaying the keyword;
receiving a keyword operation instruction triggered by the user, wherein the keyword operation instruction carries an operation type, and the operation type comprises searching and sharing;
and operating the keywords according to the operation type.
An embodiment of the present invention further provides a text processing apparatus, including: the device comprises an acquisition unit, a determination unit, a recognition unit, a word segmentation unit and a display unit;
the acquiring unit is used for responding to external touch sensed by the touch terminal and acquiring position information of the external touch;
the determining unit is used for determining a word segmentation area according to the external touch position information;
the recognition unit is used for recognizing characters in the word segmentation area to obtain a first text;
the word segmentation unit is used for segmenting words in the first text to obtain word segmentation results;
and the display unit is used for displaying the word segmentation result.
Preferably, the determining unit includes: the method comprises the steps of obtaining a subunit, a detecting subunit and a first determining subunit;
the acquisition subunit is configured to acquire area position information of each display area on the touch terminal;
the detection subunit is configured to detect, one by one, a position relationship between the external touch and each display area on the touch terminal according to the position information of the external touch and the area position information of each display area on the touch terminal;
the first determining subunit is configured to determine, when the detecting subunit detects that the external touch falls within a first display area, that the first display area is the word segmentation area, and the first display area is a display area on the touch terminal.
Preferably, the display unit includes: the system comprises a generating subunit, a displaying subunit and an adding subunit;
the generating subunit is used for generating a word segmentation display interface and at least one view control;
the adding subunit is configured to add each word in the word segmentation result to one view control respectively;
and the display subunit is used for displaying all the view controls on the word segmentation display interface.
Preferably, the word segmentation unit comprises: the word segmentation sub-unit comprises a judgment sub-unit, a word segmentation sub-unit and a second determination sub-unit;
the judging subunit is configured to judge whether the number of characters of the first text is greater than a preset value;
the word segmentation subunit is configured to, when the judgment subunit judges that the number of characters in the first text is not greater than the preset value, segment all characters in the first text to obtain the word segmentation result;
the second determining subunit is configured to determine, according to the external touch position information, a second text when the determining subunit determines that the number of characters of the first text is greater than the preset value, where the first text includes all characters in the second text, and the number of characters in the second text is equal to the preset value;
the word segmentation subunit is further configured to perform word segmentation on all characters in the second text to obtain the word segmentation result when the second determining subunit determines the second text.
Preferably, the method further comprises the following steps: a receiving unit and an operating unit;
the receiving unit is used for receiving a keyword selection instruction triggered by a user, and the keyword selection instruction is sent out according to the word segmentation result;
the obtaining unit is further configured to obtain the keyword selected by the user from the word segmentation result according to the keyword selection instruction;
the display unit is also used for displaying the keywords;
the receiving unit is further configured to receive a keyword operation instruction triggered by the user, where the keyword operation instruction carries an operation type, and the operation type includes search and sharing;
and the operation unit is used for operating the keywords according to the operation type.
The embodiment of the invention also provides a text processing method, which comprises the following steps:
displaying a text area on the touch screen;
responding to external touch control on the character area, and performing word segmentation on characters in the character area;
and displaying the word segmentation result.
Preferably, the displaying the word segmentation result specifically includes:
generating a word segmentation display interface, wherein the word segmentation display interface comprises at least one sub-view;
and displaying one word in the word segmentation result in each sub-view respectively.
An embodiment of the present invention further provides a text processing apparatus, including: the word segmentation device comprises a character area display unit, a word segmentation unit and a word segmentation result display unit;
the character area display unit is used for displaying a character area on the touch screen;
the word segmentation unit is used for responding to external touch control on the character area and performing word segmentation on the question of the character area;
and the word segmentation result display unit is used for displaying the word segmentation result.
Preferably, the word segmentation result display unit includes: a generating subunit and a display subunit;
the generating subunit is configured to generate a word segmentation display interface, where the word segmentation display interface includes at least one sub-view;
and the display subunit is used for respectively displaying one word in the word segmentation result in each sub-view.
Compared with the prior art, the invention has at least the following advantages:
according to the text processing method and device provided by the embodiment of the invention, after the external touch is sensed by the touch terminal, the position information of the external touch is acquired. And determining a word segmentation area according to the position information of external touch. The word segmentation area is an area to which the keywords which are required to be further operated by the user belong. And then, recognizing characters in the word segmentation area to obtain a first text, and then segmenting the first text to obtain a word segmentation result. At this time, the word segmentation result is displayed, so that the user can select one or more keywords from the word segmentation result and then perform the next operation. As can be seen from the above, the text processing method and apparatus provided in the embodiments of the present invention combine touch sensing, character recognition and word segmentation, efficiently and quickly obtain characters, words, named entities, and the like in the area indicated by external touch, so that a user can directly select keywords in a text, and does not need to additionally input keywords during subsequent operations, thereby improving the operation efficiency.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Before describing embodiments of the present invention, a number of technical terms related to the embodiments of the present invention will be described.
Pressure touch control: when a touch terminal such as a touch screen mobile phone senses external pressure, the system can capture pressure information.
Word segmentation: refers to the segmentation of a word sequence into a single word, term, or named entity, etc. The word segmentation process is a process of recombining continuous character sequences into a single character, word or named entity sequence according to a certain specification.
Naming an entity: the name of a person, the name of an organization, the name of a place and all other entities marked by the name are referred to. The broader entities also include numbers, dates, currencies, addresses, and the like.
Key words: a segment of text in a complete sentence that is of interest to the user.
It should be further noted that the text processing method and apparatus provided in the embodiments of the present invention can be implemented when the touch terminal runs any application program. The application programs include but are not limited to short messages, web browsing, real-time communication and other programs with text display functions.
The first embodiment of the method comprises the following steps:
referring to fig. 1, the figure is a flowchart of a first embodiment of a text processing method provided by the present invention.
The text processing method provided by the embodiment comprises the following steps:
s101: responding to external touch sensed by a touch terminal, and acquiring position information of the external touch;
it is understood that the touch terminal may be any device having a touch sensing function, including but not limited to a mobile phone, a tablet computer, and the like. The sensed external touch includes, but is not limited to, single-point or multi-point pressing, single-point or multi-point sliding operation, single-point or multi-point touching, single-point or multi-point pressure touch, touch area sensing, and the like. When the external operation meets the corresponding sensing threshold, the touch terminal can sense the corresponding external operation.
It should be noted that when the touch terminal senses an external touch, position information, such as coordinates, of the external touch on the touch terminal is obtained. The acquired position information of the external touch is coordinates (generally composed of X-axis coordinates and Y-axis coordinates) of the external touch on the touch terminal. At this time, the system can identify the position of the external touch application so as to perform various corresponding operations on the touch area.
S102: determining a word segmentation area according to the external touch position information;
it can be understood that the word segmentation area can be determined according to the current display view of the touch terminal and the position information of external touch. Generally, a touch terminal system includes a picture display module and a text display module. The character display module also comprises a plurality of different character display sub-modules, such as short message character frames and the like. Each display module, the text box and the like are divided by the area coordinates. The system generally stores position information of each module on the touch terminal. When external touch is sensed and the position information of the external touch is acquired, which display module in the system the external touch is located in can be identified according to the position information, and then the word segmentation area can be determined by the display module.
The following describes in detail the process of determining the word segmentation area in this embodiment by taking an example of displaying a short message application screen on a touch terminal. It is to be understood that the following is illustrative only and is not intended to limit the invention in any way.
As shown in fig. 7(a), the external touch is located in an area surrounded by a circle of a finger on the touch terminal. At this time, the system can acquire position information of external touch, and determine the word segmentation area as the area divided by the short message text box where the finger is located according to the position information of the external touch.
In addition, when a full-screen display application, such as a web page, a reader, etc., is run on the touch terminal system, there is no actually displayed line distinction in each display area on the touch terminal. At this time, the area displayed on the screen can be divided into a picture display area and a character display area, and each area is also represented by the picture display module and the character display module and is divided by the position information. When the external touch is in the text display area, the whole text display area on the touch terminal is the word segmentation area.
It should be further noted that fig. 7(a) only illustrates how to determine the word segmentation area by taking a single finger pressing activation of the external touch as an example, and the present invention does not limit how to activate the external touch.
S103: identifying characters in the word segmentation area to obtain a first text;
it can be understood that when the content information of each display module is stored in the system, the first text can be obtained by directly acquiring the text content in the text display module represented by the word segmentation area. Taking short message display as an example, the first text is a set of all characters in a short message box; taking the reader as an example, the first text is a set of all characters displayed on the screen at that time.
S104: performing word segmentation on characters in the first text to obtain word segmentation results;
s105: and displaying the word segmentation result.
After the first text is segmented, a plurality of words, characters, phrases, named entities, and the like are obtained, that is, a segmentation result is shown in fig. 7 (b). It should be noted that a natural language algorithm may be used to perform word segmentation on the first text according to the specific semantics of the characters in the first text, and the specific word segmentation method and process are not described herein again.
And after the text in the word segmentation area is segmented, displaying the word segmentation result. Therefore, the user can directly select the keywords needing further operation from the word segmentation result, and the user can directly operate the keywords in the text conveniently.
It should be noted that, as shown in fig. 8(a) -8 (c), the user may select one or more words, terms, or named entities from the word segmentation result, and may also select continuous or discontinuous words, terms, or named entities. In addition, the form of displaying the word segmentation result can be as shown in fig. 8, and other display manners can also be used, such as creating a window display near the external touch area. The person skilled in the art can specifically set the way of displaying the word segmentation result and the arrangement sequence of each word when displaying the word segmentation result according to the actual situation. The individual characters, words or named entities in the word segmentation result may have intervals as shown in fig. 8(a) -8 (c), or may have no intervals separated by lines. When the word segmentation results are too many to ensure that the user can distinguish the display content under the condition of completely displaying the word segmentation results, the word segmentation results can be displayed for the user in a sliding mode once or in multiple modes.
According to the text processing method provided by the embodiment, after the external touch is sensed by the touch terminal, the position information of the external touch is acquired. And determining a word segmentation area according to the position information of external touch. The word segmentation area is an area to which the keywords which are required to be further operated by the user belong. And then, recognizing characters in the word segmentation area to obtain a first text, and then segmenting the first text to obtain a word segmentation result. At this time, the word segmentation result is displayed, so that the user can select one or more keywords from the word segmentation result and then perform the next operation. As can be seen from the above, the text processing method provided in this embodiment combines touch sensing, character recognition and word segmentation, efficiently and quickly obtains characters, words, named entities and the like in the area indicated by external touch, facilitates a user to directly select keywords in a text, does not need to additionally input keywords during subsequent operations, and improves operation efficiency.
The second method embodiment:
referring to fig. 2, the figure is a flowchart of a second embodiment of the text processing method provided by the present invention. Compared with fig. 1, the embodiment provides a more specific text processing method.
S201 in this embodiment is the same as S101 in the first embodiment, and is not described again here.
The text processing method provided by the embodiment further includes:
s202: acquiring area position information of each display area on the touch terminal;
it can be understood that the position of each display area on the touch terminal can be changed according to the operation. Therefore, in order to ensure that the text in the area of interest of the user is correctly obtained, the word segmentation area should be determined by sensing the position of each display area on the touch terminal when external touch is performed.
S203: detecting the position relation between the external touch and each display area on the touch terminal one by one according to the position information of the external touch and the area position information of each display area on the touch terminal;
s204: when the outside touch control is located in a first display area, determining that the first display area is the word segmentation area, and the first display area is a display area on the touch control terminal.
Taking the coordinates as an example, the area position information of each display area on the touch terminal is a coordinate range area. After the coordinates of the external touch are obtained, the coordinate range of which display area on the touch terminal the external touch falls in can be judged. And the display area to which the external touch belongs is the word segmentation area.
In addition, the content displayed on the touch terminal can include not only characters, but also pictures and the like. It is obvious that the text processing method provided by the invention is the operation on the characters. Therefore, the text processing method provided in this embodiment further includes a step of determining whether the word segmentation area includes a word. If the word segmentation area does not comprise characters, ending the text processing process; if the word segmentation area includes a character, step S205 is performed.
S205: judging whether the number of characters of the first text is larger than a preset value; if not, go to step S206; if so, step S207 is performed.
It should be noted that the preset value may be 100 or 200, and may also be specifically set or obtained according to actual needs, which are not listed here.
S206: performing word segmentation on all characters in the first text to obtain a word segmentation result;
since the number of words included in the text processing area may be excessive. In actual operation, all characters in the first text are subjected to word segmentation operation, so that excessive word segmentation results can be obtained, and the user is inconvenient to select keywords from the word segmentation results. Therefore, in order to improve the word segmentation efficiency and facilitate the user to select the keywords from the word segmentation results, the text processing method provided by this embodiment may further perform word segmentation on a part of the characters in the word segmentation region according to the actual situation, so that the user selects the keywords from the word segmentation results of the part of the characters, thereby improving the interaction experience of the user.
At this time, the text processing method provided in this embodiment further includes:
s207: determining a second text according to the external touch position information, and performing word segmentation on all characters in the second text to obtain the word segmentation result, wherein the first text comprises all characters in the second text, and the number of characters in the second text is equal to the preset value.
When the position information of the external touch is obtained, it can be known which character in the first text the external touch is located near. At this time, characters with the number equal to the preset value near the external touch can be obtained according to preset rules, a second text is generated, and word segmentation is performed on the second text to obtain word segmentation results. For example, taking 50 or 100 words near the pressure-sensitive area generates the second text. These 50 or 100 words may be half the number of words forward from the outside touch and half the number of words backward from the outside touch. The person skilled in the art can also specifically set the manner of obtaining the second text according to the actual situation, and the details are not listed here.
The third method embodiment:
referring to fig. 3, the figure is a flowchart of a third embodiment of the text processing method provided by the present invention. Compared with fig. 1, the embodiment provides a more specific text processing method.
S301 to S304 in this embodiment are the same as S101 to S104 in the first embodiment, and are not described again here.
It will be appreciated that the word segmentation results obtained in the above embodiments may be displayed to the user in a window. Also, the user may choose to close the keyword selection window to terminate the keyword selection process.
The text processing method provided by the embodiment further includes:
s305: generating a word segmentation display interface and at least one view control;
s306: and respectively adding each word in the word segmentation result to one view control, and displaying all the view controls on the word segmentation display interface.
Fig. 8(a) -8 (c) show a specific implementation form of the word segmentation display interface. Each rectangular block in the word segmentation display interface is a displayed view control, and each view control is used for displaying a word (a character, a word or a named entity) in the word segmentation result. The display size, display position and the like of each view control can be specifically set according to actual conditions. For example, each view control may be displayed discretely in the segmentation display interface to facilitate a user selecting keywords from. Meanwhile, the skilled person can also display the characters, words or named entities in the word segmentation result by using different colors, fonts, sizes and the like according to the requirement, for example, display the numbers in the word segmentation result by using different display effects or display the words with high probability of user selection. When the user selects the keywords from the word segmentation result, the corresponding view control in the word segmentation display interface can be directly clicked.
In addition, the participle display interface or window includes a close key, such as the "X" key shown in the lower left corner of fig. 8(c), and the user closes the participle display interface or window by clicking the close key.
The text processing method provided by the embodiment further includes:
s307: receiving a keyword selection instruction triggered by a user, wherein the keyword selection instruction is sent according to the word segmentation result;
it should be noted that, as shown in fig. 8(a) -8 (c), the user may select one or more words or named entities from the segmentation result and also select continuous or discontinuous words or named entities by clicking one or more view controls.
S308: acquiring the keywords selected by the user from the word segmentation result according to the keyword selection instruction;
s309: displaying the keyword;
as shown in fig. 9(a) and 9(b), the user triggers a keyword selection instruction by clicking on a word or a named entity in the word segmentation result. Upon receiving a keyword selection instruction, the user-selected keyword is highlighted (e.g., highlighted, the color of the view control or word is changed, the font is changed, etc.) for subsequent operation on the keyword by the user.
S310: receiving a keyword operation instruction triggered by the user, wherein the keyword operation instruction carries an operation type, and the operation type comprises searching and sharing;
s311: and operating the keywords according to the operation type.
And after the user selects one or more view controls, generating operation keys corresponding to various operation types at corresponding positions. Then, the user triggers a corresponding keyword operation instruction for the keyword by clicking an operation key near the keyword, and different operation keys represent different operation types. Then, the keywords selected by the user can be operated according to the operation type. Including but not limited to searching and sharing, etc. Fig. 9(a) is an example of a search operation performed on a keyword, and fig. 9(b) is an example of a sharing operation performed on a keyword. Including operating on a single word, a word or a named entity and a plurality of words, words or named entities in the word result.
In the above embodiments, it should be particularly noted that fig. 7, 8 and 9 are only examples of the text processing method provided for facilitating understanding of the present invention, and are not intended to limit the present invention. Those skilled in the art can specifically set the specific implementation of the text processing method provided by the present invention according to the actual situation, and details are not repeated here.
Based on the text processing method provided by the embodiment, the embodiment of the invention also provides a text processing device.
The first embodiment of the device:
referring to fig. 4, it is a diagram of a first embodiment of a text processing apparatus according to the present invention.
The text processing apparatus provided in this embodiment includes: the device comprises an acquisition unit 100, a determination unit 200, a recognition unit 300, a word segmentation unit 400 and a display unit 500;
the acquiring unit 100 is configured to acquire position information of an external touch in response to the external touch sensed by the touch terminal;
it is understood that the touch terminal may be any device having a touch sensing function, including but not limited to a mobile phone, a tablet computer, and the like.
The determining unit 200 is configured to determine a word segmentation area according to the external touch position information;
the recognition unit 300 is configured to recognize the characters in the word segmentation area to obtain a first text;
the word segmentation unit 400 is configured to perform word segmentation on the characters in the first text to obtain a word segmentation result;
the display unit 500 is configured to display the word segmentation result.
In the text processing apparatus provided in this embodiment, after the external touch is sensed by the touch terminal, the obtaining unit obtains the position information of the external touch. The determining unit determines the word segmentation area according to the position information of external touch. The word segmentation area is an area to which the keywords which are required to be further operated by the user belong. And then, the recognition unit recognizes the characters in the word segmentation area to obtain a first text, and then the word segmentation unit performs word segmentation on the first text to obtain a word segmentation result. At this time, the display unit displays the word segmentation result, so that the user can select the keyword from the word segmentation result and then perform the next operation. As can be seen from the above, the text processing device provided in this embodiment combines touch sensing, character recognition and word segmentation, efficiently and quickly obtains characters, words, named entities and the like in the area indicated by external touch, facilitates a user to directly select keywords in a text, does not need to additionally input keywords during subsequent operations, and improves operation efficiency.
The second device embodiment:
referring to fig. 5, it is a diagram of a second embodiment of a text processing apparatus according to the present invention. Compared with fig. 4, the embodiment provides a more specific text processing apparatus.
In the text processing apparatus provided in this embodiment, the determining unit includes: an acquisition subunit 201, a detection subunit 202, and a first determination subunit 203;
the acquiring subunit 201 is configured to acquire area position information of each display area on the touch terminal;
the detecting subunit 202 is configured to detect, one by one, a position relationship between the external touch and each display area on the touch terminal according to the position information of the external touch and the area position information of each display area on the touch terminal;
the first determining subunit 203 is configured to determine, when the detecting subunit 202 detects that the external touch falls within a first display area, that the first display area is the word segmentation area, and the first display area is a display area on the touch terminal.
In the text processing apparatus provided in this embodiment, the word segmentation unit includes: a judgment subunit 401, a participle subunit 402 and a second determination subunit 403;
the judging subunit 401 is configured to judge whether the number of characters of the first text is greater than a preset value;
the word segmentation subunit 402 is configured to, when the judging subunit 401 judges that the number of characters in the first text is not greater than the preset value, perform word segmentation on all characters in the first text to obtain the word segmentation result;
the second determining subunit 403 is configured to determine, according to the external touch position information, a second text when the determining subunit 401 determines that the number of characters of the first text is greater than the preset value, where the first text includes all characters in the second text, and the number of characters in the second text is equal to the preset value;
the word segmentation subunit 402 is further configured to perform word segmentation on all characters in the second text to obtain the word segmentation result when the second determining subunit 403 determines the second text.
The third device embodiment:
referring to fig. 6, it is a diagram of a third embodiment of a text processing apparatus according to the present invention.
In the text processing apparatus provided in this embodiment, the display unit includes: a generation subunit 501, a display subunit 502, and an addition subunit 503;
the generating subunit 501 is configured to generate a word segmentation display interface and at least one view control;
the adding subunit 503 is configured to add each word in the word segmentation result to one view control respectively;
the display subunit 502 is configured to display all view controls on the word segmentation display interface.
The text processing apparatus provided in this embodiment further includes: a receiving unit 600 and an operating unit 700;
the receiving unit 600 is configured to receive a keyword selection instruction triggered by a user, where the keyword selection instruction is sent according to the word segmentation result;
the obtaining unit 100 is further configured to obtain the keyword selected by the user from the word segmentation result according to the keyword selection instruction;
the display unit 500 is further configured to display the keyword;
the receiving unit 600 is further configured to receive a keyword operation instruction triggered by the user, where the keyword operation instruction carries an operation type, and the operation type includes search and sharing;
the operation unit 700 is configured to operate the keyword according to the operation type.
The method comprises the following steps:
referring to fig. 10, the figure is a schematic flow chart of a fourth embodiment of the text processing method provided by the present invention.
It should be noted that the text processing method provided in this embodiment may be applied to a client, where the client is any device with a touch sensing function, including but not limited to a mobile phone, a tablet computer, and the like.
The text processing method provided by the embodiment comprises the following steps:
s1001: displaying a text area on the touch screen;
it is understood that the touch screen is a display device on the client, for example, the display screen of the mobile phone is the touch screen. The client displays different types of content on the touch screen in different areas, and the content can comprise one or more text areas, one or more picture areas and the like.
S1002: responding to external touch control on the character area, and performing word segmentation on characters in the character area;
the content in which part of the display area on the touch screen needs to be operated can be determined by sensing the external touch of the user on the corresponding text area. The external touch includes, but is not limited to, single-point or multi-point pressing, single-point or multi-point sliding operation, single-point or multi-point touching, single-point or multi-point pressure touch, touch area sensing, and the like. When the external operation meets the corresponding sensing threshold, the client can sense the corresponding external touch. After the words in the text area are segmented, a plurality of words, characters, phrases, named entities and the like are obtained, namely the segmentation result. Words in the text region may be obtained using word recognition techniques.
S1003: and displaying the word segmentation result.
And after the text in the word segmentation area is segmented, displaying the word segmentation result. Therefore, the user can directly select the keywords needing further operation from the word segmentation result, and the user can directly operate the keywords in the text conveniently.
The specific operation process can be seen in fig. 7-8, and is not described herein again. It should be noted that fig. 7-8 are only exemplary illustrations and do not limit the present invention in any way.
How the word segmentation result is displayed in detail will be exemplified below. It is understood that, those skilled in the art can also specifically set the display mode of the word segmentation result according to the actual situation, and the display mode is not listed one by one here.
Generating a word segmentation display interface, wherein the word segmentation display interface comprises at least one sub-view;
and displaying one word in the word segmentation result in each sub-view respectively.
Fig. 8(a) -8 (c) show a specific implementation form of the word segmentation display interface. Each rectangular block in the word segmentation display interface is a displayed sub-view, and each sub-view is used for displaying a word (a character, a word or a named entity) in the word segmentation result. The display size, display position, etc. of each sub-view can be specifically set according to actual conditions. For example, the display size of the sub-views may be based on the number of characters to be displayed, the font style, and the font size, and each sub-view is dispersedly displayed in the word segmentation display interface, so as to facilitate the user to select the keyword therefrom. Meanwhile, the skilled person can also display the characters, words or named entities in the word segmentation result by using different colors, fonts, sizes and the like according to the requirement, for example, display the numbers in the word segmentation result by using different display effects or display the words with high probability of user selection. When the user selects the keywords from the word segmentation result, the corresponding sub-view in the word segmentation display interface can be directly clicked.
In the text processing method provided by this embodiment, after a text area is displayed on a touch screen, when an external touch to the text area is sensed, words of the text in the text area are segmented. And then, displaying the word segmentation result so that the user can select one or more keywords from the word segmentation result and then perform the next operation. According to the text processing method provided by the embodiment, touch sensing, character recognition and word segmentation are combined, characters, words, named entities and the like in the area indicated by external touch are efficiently and quickly obtained, a user can conveniently and directly select keywords in the text, the user does not need to additionally input the keywords in subsequent operations, and the operation efficiency is improved.
Based on the text processing method provided by the above embodiment, the embodiment of the invention also provides a text processing device.
The fourth device embodiment:
referring to fig. 11, it is a schematic structural diagram of a fourth embodiment of the text processing apparatus provided in the present invention.
The text processing apparatus provided in this embodiment includes: a text area display unit 10, a word segmentation unit 20 and a word segmentation result display unit 30;
the text area display unit 10 is used for displaying a text area on the touch screen;
the word segmentation unit 20 is configured to respond to external touch on the text area and perform word segmentation on the question of the text area;
the word segmentation result display unit 30 is configured to display the word segmentation result.
The following will exemplify how the segmentation result display unit 30 displays the segmentation result. It is understood that, those skilled in the art can also specifically set the display mode of the word segmentation result according to the actual situation, and the display mode is not listed one by one here.
The word segmentation result display unit 30 includes: a generation subunit 31 and a display subunit 32;
the generating subunit 31 is configured to generate a word segmentation display interface, where the word segmentation display interface includes at least one sub-view;
the display subunit 32 is configured to display a word in the word segmentation result in each sub-view.
In the text processing apparatus provided in this embodiment, after the text area display unit displays the text area on the touch screen, when the word segmentation unit senses an external touch to the text area, words of the text in the text area are segmented. And then, the word segmentation result display unit displays the word segmentation result so that the user can select one or more keywords from the word segmentation result and then perform the next operation. The text processing device provided by the embodiment combines touch sensing, character recognition and word segmentation, efficiently and quickly obtains characters, words, named entities and the like in the area indicated by external touch, facilitates the user to directly select keywords in the text, does not need the user to additionally input the keywords in the subsequent operation, and improves the operation efficiency.
It should be noted that, in the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, 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 identical elements in a process, method, article, or apparatus that comprises the element.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The foregoing is merely a preferred embodiment of the invention and is not intended to limit the invention in any manner. Although the present invention has been described with reference to the preferred embodiments, it is not intended to be limited thereto. Those skilled in the art can make numerous possible variations and modifications to the present teachings, or modify equivalent embodiments to equivalent variations, without departing from the scope of the present teachings, using the methods and techniques disclosed above. Therefore, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention are still within the scope of the protection of the technical solution of the present invention, unless the contents of the technical solution of the present invention are departed.