CN106970899B - Text processing method and device - Google Patents

Text processing method and device Download PDF

Info

Publication number
CN106970899B
CN106970899B CN201710321558.3A CN201710321558A CN106970899B CN 106970899 B CN106970899 B CN 106970899B CN 201710321558 A CN201710321558 A CN 201710321558A CN 106970899 B CN106970899 B CN 106970899B
Authority
CN
China
Prior art keywords
target text
segmentation result
word segmentation
display
module
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.)
Active
Application number
CN201710321558.3A
Other languages
Chinese (zh)
Other versions
CN106970899A (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201710321558.3A priority Critical patent/CN106970899B/en
Publication of CN106970899A publication Critical patent/CN106970899A/en
Application granted granted Critical
Publication of CN106970899B publication Critical patent/CN106970899B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • User Interface Of Digital Computer (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the invention discloses a text processing method which is applied to a mobile terminal and comprises the following steps: displaying a first segmentation result of the first target text; responding to the display updating operation of the user, and judging whether the first word segmentation result is completely displayed in the display updating direction corresponding to the display updating operation; and if so, displaying a second word segmentation result of the second target text, wherein the second target text is in the display updating direction of the first target text. When the user does not find satisfactory keywords in the currently displayed first segmentation result, displaying a second segmentation result of a second target text adjacent to the first target text in the display updating direction to the user, so that the user can continuously select keywords from the second segmentation result, displaying more segmentation results to the user without redundant steps, and selecting the keywords required by subsequent operation from the segmentation results, wherein the operation process is simpler and more convenient, and the operation efficiency is further improved.

Description

Text processing method and device
Technical Field
The invention relates to the technical field of computers, in particular to a text processing method and device.
Background
With the popularization of mobile phones, people receive a large amount of text information on portable devices such as mobile phones or tablet computers every day. For example, messages pushed by instant messaging software or other software, web page contents, text news and the like. When people want to copy, search or translate the interesting character content in the text information, the interesting character content needs to be selected in the text information firstly, and then the subsequent operation is carried out on the selected character, for example, if a user wants to inquire a rarely-used character in the text, the rarely-used character generally needs to be copied after being selected in the text, and then the rarely-used character is pasted in a dictionary or a query column of a website for query so as to determine the meaning, pronunciation and the like of the rarely-used character, and the operation process is complicated and inconvenient.
Disclosure of Invention
In view of this, the present invention provides a text processing method and device, which can solve the problems of complicated operation process and inconvenient operation when performing subsequent operation on content of interest in text information in the prior art.
The text processing method provided by the embodiment of the invention is applied to a mobile terminal and comprises the following steps:
displaying a first segmentation result of the first target text;
responding to a display updating operation of a user, and judging whether the first segmentation result is completely displayed in a display updating direction corresponding to the display updating operation;
if so, displaying a second word segmentation result of a second target text, wherein the second target text is in the display updating direction of the first target text.
Optionally, the determining whether the first segmentation result is completely displayed in the display updating direction corresponding to the sliding operation specifically includes:
when the display updating direction is upward, judging whether an undisplayed or incompletely displayed first segmentation result exists above a currently displayed first segmentation result; correspondingly, the second target text is positioned above the first target text, and the second target text is adjacent to the first target text;
when the display updating direction is below, judging whether a first segmentation result which is not displayed or not completely displayed exists below a currently displayed first segmentation result; correspondingly, the second target text is located below the first target text, and the second target text is adjacent to the first target text.
Optionally, the displaying the first segmentation result of the first target text further includes:
responding to word segmentation operation triggered by a user, and acquiring position information of the word segmentation operation;
determining a word segmentation area according to the position information of the word segmentation operation, wherein the word segmentation operation is positioned in the word segmentation area;
identifying characters in the word segmentation area to obtain the first target text;
and performing word segmentation on characters in the first target text to obtain a first word segmentation result.
Optionally, the displaying the first segmentation result of the first target text specifically includes:
generating a word segmentation display interface, wherein the word segmentation display interface comprises at least one view control;
and displaying each word of the first word segmentation result in the view control one by one, and displaying one word in the first word segmentation result in one view control.
Optionally, the displaying the first segmentation result of the first target text further includes:
responding to the selection operation of the view control, and judging whether the words displayed in the view control are words of a preset type or not, wherein the words of the preset type comprise a telephone number and/or an email address;
if yes, displaying an operation function key corresponding to the preset type of word outside the view control; the operation function keys corresponding to the phone number comprise any one or more of dialing, sending short messages, storing contact information, inquiring call records, copying, sharing and searching, and the operation function keys corresponding to the email address comprise any one or more of sending emails, storing contact information, copying, sharing and searching;
and responding to the triggering of the user on the operation function key, and executing the operation corresponding to the operation function key on the words displayed in the view control.
The text processing device provided by the embodiment of the invention is applied to a mobile terminal and comprises: the device comprises a display module and a first judgment module;
the display module is used for displaying a first segmentation result of the first target text;
the first judging module is used for responding to a display updating operation of a user and judging whether the first segmentation result is completely displayed in a display updating direction corresponding to the display updating operation;
the display module is further configured to display a second word segmentation result of a second target text when the determination result of the first determination module is yes, where the second target text is in the display update direction of the first target text.
Optionally, the first determining module specifically includes: a first judgment submodule and a second judgment submodule;
the first judgment sub-module is configured to judge whether an undisplayed or incompletely displayed first segmentation result exists above a currently displayed first segmentation result when the display updating direction is upward; correspondingly, the second target text is positioned above the first target text, and the second target text is adjacent to the first target text;
the second judging submodule is used for judging whether an undisplayed or incompletely displayed first segmentation result exists below the currently displayed first segmentation result when the display updating direction is below; correspondingly, the second target text is located below the first target text, and the second target text is adjacent to the first target text.
Optionally, the method further includes: the system comprises an acquisition module, a determination module, an identification module and a word segmentation module;
the acquisition module is used for responding to word segmentation operation triggered by a user and acquiring position information of the word segmentation operation;
the determining module is used for determining a word segmentation area according to the position information of the word segmentation operation, and the word segmentation operation is located in the word segmentation area;
the recognition module is used for recognizing characters in the word segmentation area to obtain the first target text;
and the word segmentation module is used for segmenting words in the first target text to obtain the first word segmentation result.
Optionally, the display module specifically includes: the interface generation submodule and the display submodule;
the interface generation submodule is used for generating a word segmentation display interface, and the word segmentation display interface comprises at least one view control;
the display sub-module is configured to display each word of the first word segmentation result in the view control one by one, and one word of the first word segmentation result is displayed in one view control.
Optionally, the method further includes: a second judgment module and an execution module;
the second judging module is used for responding to the selection operation of the view control and judging whether the words displayed in the view control are words of a preset type, wherein the words of the preset type comprise telephone numbers and/or email addresses;
the display module is further configured to display, outside the view control, an operation function key corresponding to the preset type of word when the judgment result of the second judgment module is yes; the operation function keys corresponding to the phone number comprise any one or more of dialing, sending short messages, storing contact information, inquiring call records, copying, sharing and searching, and the operation function keys corresponding to the email address comprise any one or more of sending emails, storing contact information, copying, sharing and searching;
and the execution module is used for responding to the triggering of the user on the operation function key and executing the operation corresponding to the operation function key on the words displayed in the view control.
Compared with the prior art, the invention has at least the following advantages:
in the embodiment of the invention, the mobile terminal firstly displays the first word segmentation result of the first target text for the user to select interested keywords from the first word segmentation result for the next operation, so that the user can directly select the keywords in the text conveniently, the operation on the keywords can be realized without multiple operations of the user, and the operation efficiency is improved. And when the first word segmentation result is completely displayed in the display updating direction corresponding to the display updating operation, the user does not find a satisfactory keyword in the currently displayed first word segmentation result. At the moment, the second word segmentation result of the second target text adjacent to the first target text in the display updating direction is displayed to the user, so that the user can continuously select the keywords from the second word segmentation result, more word segmentation results can be displayed to the user without redundant steps, the user can select the keywords required by subsequent operation from the word segmentation results, the operation process is simple and convenient, and the operation efficiency is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a text processing method according to an embodiment of the present invention;
FIGS. 2 a-2 d are schematic diagrams illustrating the result of the second segmentation in the embodiment of the present invention;
FIG. 3 is a flowchart illustrating a process of generating a first segmentation result according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of another text processing method according to an embodiment of the present invention;
FIGS. 5 a-5 b are schematic diagrams illustrating operations performed on words of a predetermined type according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a text processing apparatus according to an embodiment of the present invention.
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.
Generally, when a specific content in a text is operated, a user needs to select the content from the text first and then copy the content into corresponding operating software to perform a corresponding operation, for example, a search operation needs to copy the content into a search engine to perform a search, which is inconvenient for the user to operate the specific content in the text efficiently.
In view of this, in the existing text processing method, the text is segmented and then displayed to the user, and the user can directly select an interested segmentation result from the segmented text to perform subsequent operations, thereby improving the operation efficiency. However, this text processing method requires the user to select the text to be segmented first, and then segment the text selected by the user. When the user selects the text, the user can only select the content in one paragraph or one dialog box at a time, that is, the user can only segment the content in one paragraph or one dialog box at a time, so that the user can select the keywords related to the subsequent operation from the segmented content. If the keywords desired by the user are located in two independent paragraphs or dialog boxes respectively, the user still needs to perform multiple operations to obtain the complete keywords, for example, after the keywords of the first part are selected and copied from the word segmentation result of the first paragraph or the first dialog box and are pasted to the query box of the search engine, the content of the second paragraph or the first dialog box is segmented, the keywords of the remaining part are selected and copied from the segmented keywords, and the keywords are pasted to the keywords of the first part in the query box of the search engine, and then the complete keywords are searched, which is cumbersome and convenient in operation process.
Therefore, embodiments of the present invention provide a text processing method and apparatus, when a first segmentation result of a first target text is displayed to a user for the user to select a keyword, and when the user updates the displayed first segmentation result through a display update operation, and there is no first segmentation result that is not displayed or is not completely displayed in a display update direction corresponding to the display update operation, it is indicated that the user has not selected a complete keyword from the displayed first segmentation results. At the moment, the word segmentation result of the second target text in the display updating direction of the first target text is directly and continuously displayed to the user for the user to select the keywords, more word segmentation results can be provided for the user without redundant operation, the complete keywords are selected, the operation process is simple and convenient, and the operation efficiency is further improved.
It should be noted that the text processing method and apparatus provided in the embodiments of the present invention are applied to a mobile terminal, which may be a device with a touch sensing function (i.e., a touch terminal), such as a touch-sensitive mobile phone, a tablet computer, and other mobile terminals with a touch screen, and the external touch sensed by the mobile terminal 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 touch meets the corresponding sensing threshold, the touch terminal can sense the external touch. Of course, the mobile terminal may also be other devices connected with an operation device (such as a mouse, a keyboard, etc.) and having a display function, and the content displayed by the device can be operated through the operation device.
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 mobile terminal runs any application program, where the application program includes, but is not limited to, short messages, web browsing, real-time communication, and other programs with a text display function.
Before describing embodiments of the present invention, a number of technical terms related to the embodiments of the present invention will be described.
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.
In order to make the aforementioned objects, features and advantages of the present invention more comprehensible, embodiments accompanying the drawings are described in detail below.
The method comprises the following steps:
referring to fig. 1, the figure is a schematic flow chart of a text processing method according to an embodiment of the present invention.
The text processing method provided by the embodiment comprises the following steps S101-S103.
S101: and displaying the first segmentation result of the first target text.
The first segmentation result is obtained after performing a segmentation operation on the first target text, that is, the first segmentation result is a sequence of individual words, terms, or named entities included in the first target text. When the first target text is segmented, a natural language algorithm can be adopted to segment the first target text according to the specific semantics of the characters in the first target text, and the specific segmentation method and process are not repeated here.
It should be noted here that, when the first segmentation result is displayed, a new window may be created to display the first segmentation result, and there may be a space between each character, word, or named entity in the first segmentation result, or there may be no space that is separated by a line. When the number of the first segmentation results is too large, and the user cannot be guaranteed to distinguish the display content under the condition that all the first segmentation results are displayed at one time, all the first segmentation results can be displayed to the user in a sliding mode, and part of the first segmentation results can be displayed to the user in a grading mode. That is, the user can see the complete first-word segmentation result through the display updating operation.
It can be understood that, through the selection of the words in the first word segmentation result, the user can directly select the keywords in the first target text, and the operation efficiency is improved.
As an example, step S101 specifically includes S1011-S1012.
S1011: and generating a word segmentation display interface, wherein the word segmentation display interface comprises at least one view control.
S1012: and displaying each word in the first word segmentation result in the view control one by one, and displaying one word in the first word segmentation result in one view control.
The view control can be dispersedly displayed in the word segmentation display interface. The user can select one or more continuous or discontinuous words or named entities from the word segmentation result through selecting the view control, and the words displayed by the view control are selected as the keywords.
S102: and responding to the display updating operation of the user, and judging whether the first segmentation result is completely displayed in the display updating direction corresponding to the display updating operation.
In short, step S102 determines whether there is a first segmentation result that is not displayed or not completely displayed to the user in the direction that the user desires to view.
It can be understood that, generally, on a touch terminal such as a mobile phone or a tablet computer, a user can scroll characters on a screen upwards through an upward sliding operation (i.e., a display updating operation), and new display content appears below the screen (i.e., a display updating direction); the user can scroll down the text on the screen by a slide-down operation (i.e., a display update operation), and new display contents appear above the screen (i.e., a display update direction). In this case, the direction of the display update operation instruction is opposite to the display update direction.
On a non-touch computer, a user can drag a scroll bar upwards (namely display updating operation) to enable characters on a screen to scroll downwards, and new display content appears above the screen (namely display updating direction); the user may cause new display content to appear below the screen (i.e., in the display update direction) by dragging the scroll bar downward (i.e., in the display update operation) to cause the text on the screen to scroll upward. In this case, the direction of the display update operation instruction is opposite to the display update direction.
As an example, when the display update direction is the top, determining whether the first segmentation result is completely displayed in the display update direction corresponding to the display update operation, that is, determining whether a first segmentation result that is not displayed or is not completely displayed exists above the currently displayed first segmentation result; and when the display updating direction is the lower direction, judging whether the first segmentation result is completely displayed in the display updating direction corresponding to the display updating operation, namely judging whether the first segmentation result which is not displayed or not completely displayed exists below the currently displayed first segmentation result.
S103: and if so, displaying the word segmentation result of the second target text, wherein the second target text is in the display updating direction of the first target text.
As an example, when the display update direction is up, the second target text is located above the first target text, and the second target text is adjacent to the first target text; when the display updating direction is lower, correspondingly, the second target text is positioned below the first target text, and the second target text is adjacent to the first target text.
It is to be understood that the first target text and the second target text are adjacent, i.e. there is no other text content between the first target text and the second target text.
In actual operation, when the user browses the first segmentation result through the up-down sliding operation, if the first segmentation result is already displayed when the user slides downwards (or upwards), the user can continue to pull downwards (or upwards), and when the user releases the finger to cancel the sliding operation, the second segmentation result is displayed.
For example, referring to fig. 2 a-2 d, the currently displayed text content is "phone number" (i.e., the first target text) and its next segment "13800000000" (i.e., the second target text). The user selects the first content "phone number" to perform word segmentation, and the displayed word segmentation result (i.e. the first word segmentation result) is "phone number", i.e. as shown in fig. 2a, of course, the word segmentation results obtained by different rules of word segmentation are also different, and the word segmentation result of "phone number" can also be "phone" and "number". Then, the user may slide upward on the touch screen to view the segmentation result of the first segment, and at the end of the segmentation result of the first segment, a text prompt may be displayed to remind the user whether to continue to view the segmentation result of the next segment, as shown in fig. 2 b. The user continues to slide up to view the segmentation result for the second paragraph "13800000000" and a text prompt is displayed below the display page to prompt the user whether the segmentation result for the next paragraph needs to be displayed, as shown in FIG. 2 c. When the user releases his hand to cancel the sliding operation, the tokenization result (i.e., the second tokenization result) of the second paragraph "13800000000" is displayed, as shown in FIG. 2 d.
It should be noted that the obtaining and displaying manner of the second segmentation result is similar to the obtaining and displaying manner of the first segmentation result, and reference may be specifically made to the above description, which is not described herein again.
As an example, when the second segmentation result of the second target text is displayed, only the second segmentation result may be displayed in the current display interface, or the segmentation result of the content in the rear part of the second target text may be displayed directly above the first segmentation result, or the segmentation result of the content in the front part of the second target text may be displayed below the first segmentation result. The technical personnel in the field can also set the concrete setting according to the actual situation, the invention does not make any limitation to the display mode of the word result, and the display mode is not listed any more.
Therefore, the mobile terminal directly displays the first word segmentation result of the first target text and the second word segmentation result of the adjacent second text to the user at the same time, the user can select the expected keyword from the first word segmentation result and the user can select the content in the second section or the second dialog box without redundant operation, the operation flow is simplified, and the selection operation of the keyword is more convenient.
In the embodiment of the invention, the mobile terminal firstly displays the first word segmentation result of the first target text for the user to select interested keywords from the first word segmentation result for the next operation, so that the user can directly select the keywords in the text conveniently, the operation on the keywords can be realized without multiple operations of the user, and the operation efficiency is improved. And when the first word segmentation result is completely displayed in the display updating direction corresponding to the display updating operation, the user does not find a satisfactory keyword in the currently displayed first word segmentation result. At the moment, the second word segmentation result of the second target text adjacent to the first target text in the display updating direction is displayed to the user, so that the user can continuously select the keywords from the second word segmentation result, more word segmentation results can be displayed to the user without redundant steps, the user can select the keywords required by subsequent operation from the word segmentation results, the operation process is simple and convenient, and the operation efficiency is further improved.
The following illustrates a specific method for generating the first segmentation result, see fig. 3, comprising steps S301-S304 before step S101.
S301: and responding to word segmentation operation triggered by a user, and acquiring position information of the word segmentation operation.
It is understood that the mobile 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 mobile terminal can sense the corresponding external operation.
It will be apparent that the system can identify the location of the application of the operation in order to perform various corresponding operations on the location of the application of the operation. Then, when the mobile terminal senses a word segmentation operation, position information, such as coordinates, of the word segmentation operation on the mobile terminal is obtained. The position information of the word segmentation operation is the coordinates (generally composed of X-axis coordinates and Y-axis coordinates) of the word segmentation operation on the mobile terminal.
S302: and determining a word segmentation area according to the position information of the word segmentation operation, wherein the word segmentation operation is positioned in the word segmentation area.
Generally, display areas for various contents, such as an area for displaying text and an area for displaying an image, are displayed at different positions of a mobile terminal. The display areas are divided by area coordinates. The system generally stores the position coordinates of each display area on the mobile terminal. After the position information of the word segmentation operation is obtained, the display area in which the word segmentation operation is located can be identified according to the position coordinates of each display area on the mobile terminal and the position information of external touch. Then, the display area may be determined as a word segmentation area.
Taking the coordinates as an example, the area position information of each display area on the mobile terminal is a coordinate range area. After the coordinates of the word segmentation operation are obtained, the coordinate range of which display area on the mobile terminal the word segmentation operation falls in can be judged. The display area to which the word segmentation operation belongs is the word segmentation area.
S303: and identifying characters in the word segmentation area to obtain a first target text.
It can be understood that when the content information of each display module is stored in the system, the first target 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 target text is a set of all characters in a short message box; taking the reader as an example, the first target text is a set of all characters displayed on the screen at that time.
However, since there may be incompatibility between different systems, the text displayed on the mobile terminal cannot be directly acquired. In some possible implementations of the embodiment, in order to process the text displayed on the mobile terminal, a text image on which the text is displayed may be obtained by performing screen capture on a display area of the mobile terminal. Then, an image Recognition technique, such as an Optical Character Recognition (OCR) technique, is applied to recognize the text in the text image. The recognized words can then be processed. Therefore, the characters displayed on the touch terminal can be operated under the condition that the characters displayed on the touch terminal cannot be directly acquired.
S304: and performing word segmentation on characters in the first target text to obtain a first word segmentation result.
When the first target text is segmented, a natural language algorithm can be adopted to segment the first target text according to the specific semantics of characters in the first target text.
Another text processing method provided by the embodiment of the present invention is shown in fig. 4.
Steps S401 to S402 in this embodiment are the same as steps S1011 to S1012 in the above embodiment, and are not described again.
In order to facilitate subsequent operations of the user, after the user selects one or more view controls, operation keys corresponding to various operation types can be generated at corresponding positions. And then, the user triggers a corresponding operation instruction by clicking an operation key near the selected view control, wherein different operation keys represent different operation types, and the operation types comprise but are not limited to searching, sharing and the like. However, for some special keywords, there may be differences in the types of operations that users operate on. Therefore, in order to further improve the efficiency of the operation, steps S403 to S405 are also included in the present embodiment.
S403: and responding to the selection operation of the view control, and judging whether the words displayed in the view control are words of a preset type, wherein the words of the preset type comprise a telephone number and/or an email address.
It is understood that whether the word displayed in the view control is a mobile phone number can be determined by determining whether the word is 11 consecutive digits and the beginning of the digit is 13, 18, 15, 17, etc., whether the word is a landline phone number can be determined by determining whether the word includes an area code or 7 or 8 consecutive digits, and whether the word is a telephone number can be determined by matching a preset telephone yellow page. And when judging whether the address is the email address, judging according to whether the words displayed in the view control include "@".
It can be understood that, according to the actual situation, a person skilled in the art may specifically set how to determine whether the word selected by the user is a phone number or an email address, which is not listed here.
S404: and if so, displaying the operation function keys corresponding to the preset type of words outside the view control.
Generally, when the keyword selected by the user from the first segmentation result (or the second segmentation result) is a telephone number, there is a high possibility that the subsequent operation is to make a call, send a short message, or newly create/update a contact person, etc. Similarly, when the keyword selected by the user from the first segmentation result (or the second segmentation result) is the email address, the subsequent operation has a high possibility of sending an email or creating/updating a contact person, and the like. Therefore, when the keyword selected by the user is a telephone number or an email address, the operation function key corresponding to the subsequent operation can be directly displayed to the user for clicking. The user can directly execute corresponding operation on the selected keyword by triggering the operation function key.
As an example, the operation function keys corresponding to the telephone number include any one or more of dialing, sending a short message, storing a contact (i.e. creating/updating a contact), inquiring a call record, copying, sharing and searching. The operation function keys corresponding to the email address comprise any one or more of sending email, storing contact information (namely creating/updating contacts), copying, sharing and searching.
S405: and responding to the triggering of the user on the operation function key, and executing the operation corresponding to the operation function key on the words displayed in the view control.
When the operation function key triggered by the user is searching, calling a search interface to search the words displayed by the view control; when the operation function key triggered by the user is sharing, calling a sharing interface (such as a sharing interface of real-time communication software such as WeChat, QQ and microblog) to share the words displayed by the view control; when the operation function key triggered by the user to the email address is to send an email, a new email page is called out, and the email address is filled in to a receiver. Those skilled in the art can specifically set the operation corresponding to the operation function key according to the actual situation, which is not listed here.
For example, referring to fig. 5 a-5 b, in an actual operation, if the keyword selected by the user is a phone number, a plurality of operation function keys are displayed near the phone number, and respectively correspond to search, contact, short message, telephone, copy, and share, as shown in fig. 5 a. The user can call the interface shown in fig. 5b by clicking the contact button, so as to perform subsequent operations of creating a new contact, adding the new contact to an existing contact, inquiring a call record, dialing a call, sending a short message, performing a video call, and the like.
In this embodiment, after the user selects a keyword from the word segmentation result, an operation function key corresponding to the keyword is generated and displayed for the user to trigger. When the user triggers the operation function key, the corresponding operation is directly executed on the keyword, the keyword operation can be completed without the need of the user to perform complicated operation, and the operation efficiency is improved.
In the above embodiments, it should be specifically noted that fig. 2a to 2d and fig. 5a to 5b are only examples of text processing methods provided for facilitating understanding of the embodiments 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.
The embodiment of the device is as follows:
referring to fig. 6, it is a schematic structural diagram of a text processing apparatus according to an embodiment of the present invention.
The text processing device provided by the embodiment of the invention comprises: a display module 100 and a first judgment module 200.
The display module 100 is configured to display a first segmentation result of the first target text.
The first determining module 200 is configured to determine, in response to a display update operation of a user, whether a first segmentation result is completely displayed in a display update direction corresponding to the display update operation.
The display module 100 is further configured to display a second segmentation result of the second target text when the determination result of the first determination module 200 is yes, where the second target text is in the display update direction of the first target text.
In some possible implementation manners of this embodiment, the first determining module 200 specifically includes: a first judgment submodule and a second judgment submodule.
The first judgment sub-module is used for judging whether an undisplayed or incompletely displayed first segmentation result exists above the currently displayed first segmentation result when the display updating direction is upward; correspondingly, the second target text is located above the first target text, and the second target text is adjacent to the first target text.
The second judgment submodule is used for judging whether the first segmentation result which is not displayed or not completely displayed exists below the currently displayed first segmentation result when the display updating direction is lower; correspondingly, the second target text is located below the first target text, and the second target text is adjacent to the first target text.
In some possible implementations of this embodiment, the apparatus further includes: the device comprises an acquisition module, a determination module, an identification module and a word segmentation module.
And the acquisition module is used for responding to word segmentation operation triggered by a user and acquiring position information of the word segmentation operation.
And the determining module is used for determining a word segmentation area according to the position information of the word segmentation operation, and the word segmentation operation is positioned in the word segmentation area.
And the recognition module is used for recognizing the characters in the word segmentation area to obtain a first target text.
And the word segmentation module is used for segmenting words in the first target text to obtain a first word segmentation result.
In some possible implementation manners of this embodiment, the display module 100 specifically includes: the interface generation submodule and the display submodule.
And the interface generation submodule is used for generating a word segmentation display interface, and the word segmentation display interface comprises at least one view control.
And the display sub-module is used for displaying each word of the first word segmentation result in the view control one by one, and one word in the first word segmentation result is displayed in one view control.
In some possible implementations of this embodiment, the apparatus further includes: a second judging module and an executing module.
And the second judgment module is used for responding to the selection operation of the view control and judging whether the words displayed in the view control are words of a preset type, wherein the words of the preset type comprise a telephone number and/or an email address.
The display module 100 is further configured to display, outside the view control, an operation function key corresponding to the preset type of word when the determination result of the second determination module is yes.
The operation function keys corresponding to the telephone number comprise any one or more of dialing, sending short messages, storing contact information, inquiring call records, copying, sharing and searching, and the operation function keys corresponding to the email address comprise any one or more of sending emails, storing contact information, copying, sharing and searching.
And the execution module is used for responding to the triggering of the user on the operation function key and executing the operation corresponding to the operation function key on the words displayed in the view control.
In the embodiment of the invention, the mobile terminal firstly displays the first word segmentation result of the first target text for the user to select interested keywords from the first word segmentation result for the next operation, so that the user can directly select the keywords in the text conveniently, the operation on the keywords can be realized without multiple operations of the user, and the operation efficiency is improved. And when the first word segmentation result is completely displayed in the display updating direction corresponding to the display updating operation, the user does not find a satisfactory keyword in the currently displayed first word segmentation result. At the moment, the second word segmentation result of the second target text adjacent to the first target text in the display updating direction is displayed to the user, so that the user can continuously select the keywords from the second word segmentation result, more word segmentation results can be displayed to the user without redundant steps, the user can select the keywords required by subsequent operation from the word segmentation results, the operation process is simple and convenient, and the operation efficiency is further improved.
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 part 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.

Claims (10)

1. A text processing method is applied to a mobile terminal and comprises the following steps:
displaying a first segmentation result of the first target text;
responding to a display updating operation of a user, and judging whether the first segmentation result is completely displayed in a display updating direction corresponding to the display updating operation;
if so, displaying a second word segmentation result of a second target text, wherein the second target text is in the display updating direction of the first target text;
the displaying of the second segmentation result of the second target text comprises:
and segmenting words of the second target text to obtain a second segmentation result, and displaying the second segmentation result of the second target text.
2. The method according to claim 1, wherein the determining whether the first segmentation result is completely displayed in the display update direction corresponding to the display update operation includes:
when the display updating direction is upward, judging whether an undisplayed or incompletely displayed first segmentation result exists above a currently displayed first segmentation result; correspondingly, the second target text is positioned above the first target text, and the second target text is adjacent to the first target text;
when the display updating direction is below, judging whether a first segmentation result which is not displayed or not completely displayed exists below a currently displayed first segmentation result; correspondingly, the second target text is located below the first target text, and the second target text is adjacent to the first target text.
3. The method of claim 1, wherein the displaying the first segmentation result of the first target text further comprises:
responding to word segmentation operation triggered by a user, and acquiring position information of the word segmentation operation;
determining a word segmentation area according to the position information of the word segmentation operation, wherein the word segmentation operation is positioned in the word segmentation area;
identifying characters in the word segmentation area to obtain the first target text;
and performing word segmentation on characters in the first target text to obtain a first word segmentation result.
4. The text processing method according to claim 1, wherein the displaying the first segmentation result of the first target text specifically includes:
generating a word segmentation display interface, wherein the word segmentation display interface comprises at least one view control;
and displaying each word of the first word segmentation result in the view control one by one, and displaying one word in the first word segmentation result in one view control.
5. The method of claim 4, wherein displaying the first segmentation result of the first target text further comprises:
responding to the selection operation of the view control, and judging whether the words displayed in the view control are words of a preset type or not, wherein the words of the preset type comprise a telephone number and/or an email address;
if yes, displaying an operation function key corresponding to the preset type of word outside the view control; the operation function keys corresponding to the phone number comprise any one or more of dialing, sending short messages, storing contact information, inquiring call records, copying, sharing and searching, and the operation function keys corresponding to the email address comprise any one or more of sending emails, storing contact information, copying, sharing and searching;
and responding to the triggering of the user on the operation function key, and executing the operation corresponding to the operation function key on the words displayed in the view control.
6. A text processing device, applied to a mobile terminal, includes: the device comprises a display module and a first judgment module;
the display module is used for displaying a first segmentation result of the first target text;
the first judging module is used for responding to a display updating operation of a user and judging whether the first segmentation result is completely displayed in a display updating direction corresponding to the display updating operation;
the display module is further configured to display a second word segmentation result of a second target text when the determination result of the first determination module is yes, where the second target text is in the display update direction of the first target text;
the displaying of the second segmentation result of the second target text comprises:
and segmenting words of the second target text to obtain a second segmentation result, and displaying the second segmentation result of the second target text.
7. The text processing apparatus according to claim 6, wherein the first determining module specifically includes: a first judgment submodule and a second judgment submodule;
the first judgment sub-module is configured to judge whether an undisplayed or incompletely displayed first segmentation result exists above a currently displayed first segmentation result when the display updating direction is upward; correspondingly, the second target text is positioned above the first target text, and the second target text is adjacent to the first target text;
the second judging submodule is used for judging whether an undisplayed or incompletely displayed first segmentation result exists below the currently displayed first segmentation result when the display updating direction is below; correspondingly, the second target text is located below the first target text, and the second target text is adjacent to the first target text.
8. The text processing apparatus according to claim 6, further comprising: the system comprises an acquisition module, a determination module, an identification module and a word segmentation module;
the acquisition module is used for responding to word segmentation operation triggered by a user and acquiring position information of the word segmentation operation;
the determining module is used for determining a word segmentation area according to the position information of the word segmentation operation, and the word segmentation operation is located in the word segmentation area;
the recognition module is used for recognizing characters in the word segmentation area to obtain the first target text;
and the word segmentation module is used for segmenting words in the first target text to obtain the first word segmentation result.
9. The text processing apparatus according to claim 6, wherein the display module specifically includes: the interface generation submodule and the display submodule;
the interface generation submodule is used for generating a word segmentation display interface, and the word segmentation display interface comprises at least one view control;
the display sub-module is configured to display each word of the first word segmentation result in the view control one by one, and one word of the first word segmentation result is displayed in one view control.
10. The text processing apparatus according to claim 9, further comprising: a second judgment module and an execution module;
the second judging module is used for responding to the selection operation of the view control and judging whether the words displayed in the view control are words of a preset type, wherein the words of the preset type comprise telephone numbers and/or email addresses;
the display module is further configured to display, outside the view control, an operation function key corresponding to the preset type of word when the judgment result of the second judgment module is yes; the operation function keys corresponding to the phone number comprise any one or more of dialing, sending short messages, storing contact information, inquiring call records, copying, sharing and searching, and the operation function keys corresponding to the email address comprise any one or more of sending emails, storing contact information, copying, sharing and searching;
and the execution module is used for responding to the triggering of the user on the operation function key and executing the operation corresponding to the operation function key on the words displayed in the view control.
CN201710321558.3A 2017-05-09 2017-05-09 Text processing method and device Active CN106970899B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710321558.3A CN106970899B (en) 2017-05-09 2017-05-09 Text processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710321558.3A CN106970899B (en) 2017-05-09 2017-05-09 Text processing method and device

Publications (2)

Publication Number Publication Date
CN106970899A CN106970899A (en) 2017-07-21
CN106970899B true CN106970899B (en) 2020-03-27

Family

ID=59330749

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710321558.3A Active CN106970899B (en) 2017-05-09 2017-05-09 Text processing method and device

Country Status (1)

Country Link
CN (1) CN106970899B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426662A (en) * 2017-08-25 2019-03-05 阿里巴巴集团控股有限公司 Exchange method and equipment
CN109582768B (en) * 2018-11-23 2021-08-24 北京搜狗科技发展有限公司 Text input method and device
CN110890095A (en) * 2019-12-26 2020-03-17 北京大米未来科技有限公司 Voice detection method, recommendation method, device, storage medium and electronic equipment
CN112004138A (en) * 2020-09-01 2020-11-27 天脉聚源(杭州)传媒科技有限公司 Intelligent video material searching and matching method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484266A (en) * 2016-10-18 2017-03-08 北京锤子数码科技有限公司 A kind of text handling method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103425416B (en) * 2012-05-20 2017-11-07 北京千橡网景科技发展有限公司 Display control method and device for portable set
CN103699313B (en) * 2012-09-27 2017-09-22 腾讯科技(深圳)有限公司 A kind of method and apparatus for dragging refresh data
US20140123163A1 (en) * 2012-10-26 2014-05-01 International Business Machines Corporation Managing display of content in a content feed
CN103559223A (en) * 2013-10-21 2014-02-05 东莞市东信网络技术有限公司 Table data refreshing system and method
CN106325688B (en) * 2016-08-17 2020-01-14 北京字节跳动网络技术有限公司 Text processing method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484266A (en) * 2016-10-18 2017-03-08 北京锤子数码科技有限公司 A kind of text handling method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Chinese Word Segmentation and Named Entity Recognition:A Pragmatic Approach;Jianfeng Gao等;《Computational Linguistics》;20051231;第31卷(第4期);第531-574页 *
一种基于MapReduce的改进文本输入方式的并行分词方法研究;徐宏博 等;《电脑知识与技术》;20160912;第12卷(第22期);第171-175页 *

Also Published As

Publication number Publication date
CN106970899A (en) 2017-07-21

Similar Documents

Publication Publication Date Title
CN106484266B (en) Text processing method and device
CN106325688B (en) Text processing method and device
US11573939B2 (en) Process and apparatus for selecting an item from a database
US8966395B2 (en) Mobile terminal and control method thereof
WO2018019169A1 (en) Two-dimensional code identification method and device, and mobile terminal
WO2018176977A1 (en) Text editing method and device, and electronic apparatus
KR101639074B1 (en) Apparatus and method for character recognition and input using touch screen
CN106970899B (en) Text processing method and device
CN107861932B (en) Text editing method, device and system and terminal equipment
US20140109009A1 (en) Method and apparatus for text searching on a touch terminal
CN112988006B (en) Display method, display device, electronic equipment and storage medium
US20140089841A1 (en) Device and method for providing application interface based on writing input
KR20150023151A (en) Electronic device and method for executing application thereof
CN112068947A (en) Application program entering method and device, terminal equipment and computer readable medium
CN113672154B (en) Page interaction method, medium, device and computing equipment
KR101789234B1 (en) Data tagging apparatus and method thereof, and data search method using the same
CN111176545B (en) Equipment control method, system, electronic equipment and storage medium
CN113589983A (en) Graphic identifier display method and electronic equipment
CN107423273B (en) Text editing method and device
CN112698734A (en) Candidate word display method and device and electronic equipment
CN113407099A (en) Input method, device and machine readable medium
CN111459351A (en) Quick search method and device for terminal and computer storage medium
CN112346643B (en) Text processing method and device, electronic equipment and readable storage medium
CN112783400B (en) Document content selection method and device, electronic equipment and storage medium
KR20150093045A (en) Sketch Retrieval system, user equipment, service equipment and service method based on meteorological phenomena information and computer readable medium having computer program recorded therefor

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190118

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: BEIJING ZIJIE TIAODONG NETWORK TECHNOLOGY CO., LTD.

Address before: 100176 Beijing Daxing District Beijing economic and Technological Development Zone, Chuang Chuang fourteen Street 99, 33 D building 3 floors 309, 310 rooms.

Applicant before: Beijing hammer numeral science and technology company limited

GR01 Patent grant
GR01 Patent grant