CN112445403A - Text processing method and device and text processing device - Google Patents

Text processing method and device and text processing device Download PDF

Info

Publication number
CN112445403A
CN112445403A CN202011381283.0A CN202011381283A CN112445403A CN 112445403 A CN112445403 A CN 112445403A CN 202011381283 A CN202011381283 A CN 202011381283A CN 112445403 A CN112445403 A CN 112445403A
Authority
CN
China
Prior art keywords
text
sliding operation
sliding
preset
range
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011381283.0A
Other languages
Chinese (zh)
Inventor
何福林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development 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 Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN202011381283.0A priority Critical patent/CN112445403A/en
Publication of CN112445403A publication Critical patent/CN112445403A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0487Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
    • G06F3/0488Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
    • G06F3/04886Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures by partitioning the display area of the touch-screen or the surface of the digitising tablet into independently controllable areas, e.g. virtual keyboards or menus

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention provides a text processing method and device and a text processing device. The method comprises the following steps: determining a target text in response to a trigger operation; receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area; and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area. The embodiment of the invention can improve the efficiency of selecting the text, and further improve the efficiency of processing the text.

Description

Text processing method and device and text processing device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a text processing method and apparatus, and an apparatus for text processing.
Background
At present, the application of the mobile terminal is very wide, the virtual keyboard replaces a physical keyboard, and a user can input text by touching the virtual keyboard.
When a user uses a virtual keyboard for input, if all or part of texts need to be deleted, the cursor needs to be positioned at the position needing to be deleted, then the deletion key is pressed for many times to delete the texts word by word, and the deletion operation is complicated. In addition, due to the limitation of a touch screen of the mobile terminal, the size of an input box in the mobile terminal is usually small, and it is difficult to manually select a specific position to be deleted, which brings inconvenience to the user operation and further affects the efficiency of text input in the mobile terminal.
Disclosure of Invention
The embodiment of the invention provides a text processing method and device and a text processing device, which can improve the efficiency of text processing.
In order to solve the above problem, an embodiment of the present invention discloses a text processing method, where the method includes:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
On the other hand, the embodiment of the invention discloses a text processing device, which comprises:
the text determination module is used for responding to the trigger operation to determine a target text;
the device comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a first sliding operation, and the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and the text selection module is used for determining a selected text corresponding to the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
In yet another aspect, an embodiment of the present invention discloses an apparatus for text processing, including a memory, and one or more programs, where the one or more programs are stored in the memory, and configured to be executed by the one or more processors includes instructions for:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
In yet another aspect, embodiments of the invention disclose a machine-readable medium having instructions stored thereon, which when executed by one or more processors, cause an apparatus to perform a text processing method as described in one or more of the preceding.
The embodiment of the invention has the following advantages:
the embodiment of the invention can respond to the trigger operation to determine the target text; and after receiving a first sliding operation, determining a corresponding selected text in the target text by the first sliding operation according to the range of the first sliding operation and the proportional relation between the range of the target text and the range of the preset sliding area. Thus, the preset text operation can be executed on the selected text. According to the embodiment of the invention, the selected text is determined through the first sliding operation, so that the operation of manually clicking a specific position by a user is avoided, and the operation steps of the user can be reduced. In addition, the embodiment of the invention changes the click operation which is difficult to execute into the sliding operation which is easy to execute, thereby reducing the operation difficulty of the user and improving the convenience of the user operation. And executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition. When the preset text operation is the deleting operation, the selected text can be directly deleted, and compared with the method of deleting the selected text word by pressing a deleting key for multiple times, the user operation can be reduced, the text deleting efficiency is improved, and the text inputting efficiency of the user in the mobile terminal can be improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a flow chart of the steps of one embodiment of a text processing method of the present invention;
FIG. 2 is a block diagram of a text processing apparatus according to an embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus 800 for text processing of the present invention;
fig. 4 is a schematic diagram of a server in some embodiments of the invention.
Detailed Description
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 some, not all, embodiments of the present invention. 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.
Method embodiment
Referring to fig. 1, a flowchart illustrating steps of an embodiment of a text processing method according to the present invention is shown, which may specifically include the following steps:
step 101, responding to a trigger operation to determine a target text;
102, receiving a first sliding operation, wherein the first sliding operation is a sliding operation along a first direction in a preset sliding area;
step 103, determining a selected text corresponding to the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area.
The text processing method provided by the embodiment of the invention can be applied to terminal equipment, and the terminal equipment refers to equipment capable of performing man-machine interaction through a touch display screen. The user can operate the touch display screen of the terminal device through the target object, so that the terminal device executes a specific function, and the terminal device can also display a user interface through the touch display screen. The terminal devices include but are not limited to: the system comprises a household intelligent terminal (comprising an air conditioner, a refrigerator, an electric cooker, a water heater and the like), a business intelligent terminal (comprising a video telephone, a conference desktop intelligent terminal and the like), a wearable device (comprising an intelligent watch, intelligent glasses and the like), a financial intelligent terminal, a smart phone, a tablet personal computer (PDA), a vehicle-mounted device, a computer and the like.
The target object is an object that can be detected and located by the touch display screen when approaching or contacting the touch display screen of the terminal device, for example, a human body (e.g., a human finger), a stylus, and other common manual input tools.
During the process of inputting text in the terminal device, the user may need to perform various operation processes on the text information that has been input or is being input, such as text operations of deleting, copying, cutting, translating, and the like. The text processing method provided by the embodiment of the invention can provide a more convenient text operation process for the user, so that the operation cost of the user is reduced, and the input efficiency of the user is improved.
The embodiment of the present invention may be applicable to various input modes, for example, the input modes may specifically include a keyboard symbol input mode or a handwritten information input mode, and the like, that is, a user may input text information in a terminal device in a mode of inputting a code character string through a keyboard or in a mode of inputting handwritten information in a handwritten area. In the following, only the input method of a code string (hereinafter, simply referred to as an input string) will be described as an example, and other input methods may be referred to each other.
The keyboard may be any physical or virtual keyboard including, but not limited to, a QWERTY full keyboard, a general cell phone keyboard (keypad), an alphabetical full keyboard, and a virtual keyboard of any custom layout.
It should be noted that, in the embodiment of the present invention, a scene of inputting text information to the terminal device through the keyboard is not limited. For example, the input scenario includes, but is not limited to, inputting instant messaging information in an input box of an instant messaging application, comment information input in a comment area of a social application, a query term input in a search box, and the like.
During the process of inputting text in the terminal device, the user may need to perform various operation processes on the text information that has been input or is being input, such as text operations of deleting, copying, cutting, translating, and the like. The embodiment of the invention can receive the triggering operation of the user on the preset key in the terminal equipment, and the user can be considered to have the intention of executing the preset text operation when the triggering operation on the preset key is received.
The preset key may be a preset key in the virtual keyboard, or the preset key may also be a preset floating button or the like. The preset key is used for triggering the terminal device to execute the preset text operation, and the specific form of the preset key is not limited in the embodiment of the invention.
In an optional embodiment of the present invention, the preset text operation includes, but is not limited to, any one of a delete operation, a copy operation, a cut operation, and a translate operation. For convenience of description, the deletion operation is mainly used as an example in the embodiment of the present invention, and the processes of other types of text operations are similar and may be referred to each other.
Taking the preset operation as the delete operation as an example, the preset key may be set as a delete key in the virtual keyboard. When a trigger operation of a user on a deletion key in the virtual keyboard is received, the user can be considered to have an operation intention of executing text deletion.
The triggering operation may be a touch operation, and the touch operation may be implemented by approaching or contacting a target object with a touch display screen of the terminal device. For example, when the user touches the position of the preset key in the touch display screen through the target object, that is, the target object performs a touch operation on the preset key. Therefore, it can be understood that the touch operation of the target object on the preset key is not a direct operation of the target object on the preset key, but the target object is touched to the area of the position displayed by the preset key through the touch display screen. In one example, the touch operation may include: clicking (including single clicking, double clicking, three continuous clicking) operation, long-time pressing operation, sliding operation and the like.
After receiving a trigger operation on a preset key, the terminal equipment responds to the trigger operation and determines a target text in a display interface of the terminal equipment. The target text refers to a text of a display interface of the terminal device, wherein the preset text operation is to be executed.
In an optional embodiment of the present invention, the determining the target text in response to the trigger operation may include:
responding to a trigger operation, and determining that an input string is a target text under the condition that the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
Wherein, the input string refers to the code character string input by the user through the keyboard. Taking the Chinese input method as an example, the input string may be a pinyin string. The input method program generates candidate items corresponding to the input strings by matching the lexicon, and the candidate items are displayed at the relevant positions of the input strings (such as the lower part of the input strings), and a plurality of candidate items can be provided for the user to select to go to the screen.
In practical applications, the input string and the candidate are text contents which are not displayed on the screen, which indicates that the user is currently performing the operation of inputting the text, and the candidate exists only when the input string exists. Therefore, after receiving the trigger operation on the preset key, the embodiment of the present invention may first determine whether an input string exists in the display interface of the terminal device, and if so, it indicates that the user is performing an operation of inputting a text, and in the input process, it may be necessary to perform operation processing such as deleting a text content that is currently being input but is not already on the screen. At this time, the input string may be the target text. Further, in the case that an input string exists in a display interface of the terminal device, the input string and a candidate corresponding to the input string may be determined as target texts, and a preset text operation is performed at the same time, such as deletion at the same time.
And if the input string does not exist in the display interface of the terminal equipment but the on-screen text exists, the user is indicated to perform on-screen operation on the input string. In this case, the displayed text before the cursor may be determined as the target text, and a preset text operation may be performed on the displayed text.
It should be noted that, the embodiment of the present invention does not limit the specific manner of determining the target text. The target text can be any text in the current display interface of the mobile terminal. For example, an input string being entered by a user via a keyboard, a candidate corresponding to the input string, a text already on screen, etc. That is, the target text may be a part of text specified in the current display interface of the mobile terminal, or the target text may also be all text in the current display interface of the mobile terminal. The displayed text can be the text in the input box, the text in the text processing file, and the like in any input scene.
In an optional embodiment of the present invention, the determining that the on-screen text before the cursor is the target text may include: and determining the current paragraph text in which the cursor is positioned as a target text in the on-screen text before the cursor.
If the on-screen text in front of the cursor comprises a plurality of paragraphs, the current paragraph text in which the cursor is located can be determined as the target text. Of course, it may also be determined that all the on-screen text before the cursor is the target text. The method specifically determines which paragraph text or paragraphs of texts are the target text, and can be set according to actual needs. In the embodiment of the present invention, a current paragraph text before a cursor is taken as an example of a target text for explanation.
Optionally, in the embodiment of the present invention, before receiving the triggering operation on the preset key, the terminal device may further receive a moving operation of a cursor, so as to move the cursor to an end of a target text where a text operation needs to be performed. Therefore, after the terminal device receives the triggering operation of the preset key, the current paragraph text in front of the cursor can be determined as the target text.
After receiving a triggering operation on a preset key, if a first sliding operation in a preset sliding area is received, the terminal equipment determines a selected text corresponding to the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area. The first sliding operation is a sliding operation in a first direction in the preset sliding region.
The preset sliding area is a designated area in a touch display screen of the terminal device, and it can be understood that the shape, size and range of the preset sliding area are not limited in the embodiment of the present invention. In one example, the preset sliding area may be a virtual keyboard area displayed in the touch display screen. Because the user may need to perform the preset text operation in the process of inputting the text, the preset sliding region is set as the virtual keyboard region, and the user can execute the first sliding operation in the process of inputting the text in the virtual keyboard region, so that the difficulty of the user operation can be reduced, the convenience of the user operation can be improved, and the efficiency of text processing can be further improved. Of course, the preset sliding region may be any designated region in the touch display screen, or the preset sliding region may also be the entire screen region of the touch display screen.
The first sliding operation is a sliding operation in a first direction in the preset sliding area, and the first sliding operation is used for further selecting text content needing to be processed in the target text. For example, after receiving a triggering operation on a preset key, the terminal device determines that a current paragraph text before a cursor is a target text. After receiving the first sliding operation, according to the corresponding relationship between the range of the target text and the range of the preset sliding area, the range of the text content corresponding to the range of the first sliding operation in the target text may be determined, that is, the selected text corresponding to the first sliding operation in the target text is determined.
It should be noted that, the embodiment of the present invention does not limit the first direction. In one example, in order to conform to most user operation habits on the terminal device, for example, the user usually inputs texts from left to right, and therefore, the first direction may be set to be a horizontal right-to-left direction, that is, the continuous selection is performed from the latest input text content to the front. Further, the starting point of the first sliding operation may be a preset key, and after the user performs the trigger operation on the preset key, the user may continuously press the preset key to directly perform the first sliding operation in the horizontal right-to-left direction, where the sliding range represents the range of the selected text.
It is understood that the first direction is a direction from right to left in the horizontal direction, and is only an application example of the present invention. The first direction may be set according to actual needs, for example, the first direction may also be a horizontal direction from left to right, a vertical direction from top to bottom, a vertical direction from bottom to top, a horizontal direction first and then a vertical direction, a vertical direction first and then a horizontal direction, and the like.
In the embodiment of the invention, the selected text of the text operation to be executed can be obtained by using less operations and shorter time by directly executing the sliding operation after the triggering operation is executed on the preset key. In addition, the starting point of the selected text can be determined while the trigger operation is executed on the preset key, so that the operation that a user manually clicks a specific position to be processed can be avoided, and the operation steps of the user can be reduced. In addition, the embodiment of the invention changes the click operation which is difficult to execute into the sliding operation which is easy to execute, thereby reducing the operation difficulty of the user and improving the convenience of the user operation.
In an optional embodiment of the present invention, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding region, a selected text corresponding to the first sliding operation in the target text includes:
determining a corresponding selected text in the target text by the first sliding operation according to the length of the first sliding operation and the corresponding relation between the length of the target text and the length of the preset sliding area; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
It is to be understood that the embodiments of the invention are not limited to the particular types of ranges described. For example, the range may be a length or an area of a region, etc.
Further, taking the range as the length as an example, after receiving the triggering operation of the preset key, the terminal device may calculate a correspondence between the length of the preset sliding region and the length of the target text. In this way, after the first sliding operation is received, the length of the selected text corresponding to the first sliding operation in the target text can be determined according to the corresponding relationship between the length of the preset sliding area and the length of the target text and the length of the first sliding operation.
It is understood that, for different scenes of the preset sliding region, the process of calculating the correspondence between the length of the preset sliding region and the length of the target text may be different.
For example, in the case where the preset slide area is a virtual keyboard area, the length of the virtual keyboard area in the horizontal direction may be assumed to be L1 as the length of the preset slide area. The length of the target text can be counted according to the number of characters contained in the target text, and assuming that the target text contains n characters, the length of the target text can be recorded as n.
In one example, the correspondence between the length of the preset sliding region and the length of the target text may be represented by the following formula: and n/L1, which represents the number of characters of the target text contained in the unit length of the preset sliding area. Assuming that the length of the first sliding operation is L2, according to the correspondence between the length of the preset sliding region and the length of the target text and the length of the first sliding operation, it may be determined that the length of the selected text corresponding to the first sliding operation in the target text is: (n/L1) × L2.
It is understood that, in practical applications, during the execution of the first sliding operation, since the position of the target object may change in real time when the target object slides on the touch display screen of the terminal device, the length L2 of the first sliding operation may change in real time. In an optional embodiment of the present invention, the determining, according to the length of the first sliding operation and the corresponding relationship between the length of the target text and the length of the preset sliding region, that the first sliding operation precedes a corresponding selected text in the target text, may further include:
step S11, when receiving the first sliding operation, recording a starting position of the first sliding operation, and in a process of executing the first sliding operation, recording a current position of the first sliding operation as an end position;
step S12, determining the length of the first sliding operation according to the starting point position and the end point position;
step S13, detecting whether the first sliding operation satisfies a preset end condition in real time, if the first sliding operation does not satisfy the preset end condition and the current position of the first sliding operation changes, updating the end point position according to the current position of the first sliding operation, and updating the length of the first sliding operation according to the updated end point position.
The length of the first sliding operation may be a horizontal distance between a start point position and an end point position of the first sliding operation. Optionally, the starting position of the first sliding operation may be a position corresponding to a triggering operation on a preset key, that is, a position of the preset key. That is, after the user performs the trigger operation on the preset key, the first sliding operation may be directly performed, so as to obtain the selected text of the text operation to be performed with less operations and in a shorter time.
After receiving a first sliding operation with a trigger operation of a preset key as a starting point, recording a position of the preset key as a starting point position of the first sliding operation, recording a current position of the first sliding operation as an end point position in an execution process of the first sliding operation, and determining a length of the first sliding operation according to the starting point position and the end point position. In the execution process of the first sliding operation, the embodiment of the invention calculates the length of the first sliding operation in real time.
And in the execution process of the first sliding operation, detecting whether the first sliding operation meets a preset end condition in real time, if not, updating the end position of the first sliding operation according to the current position of the first sliding operation, and updating the length of the first sliding operation according to the updated end position of the first sliding operation and the recorded starting position of the first sliding operation.
The preset end condition is used to indicate that the first sliding operation is completed, and for example, a preset distance from the target object to the touch display screen of the terminal device may be used as the end condition. The preset distance is an effective distance at which the target object can perform touch operation on the touch display screen, and when the distance between the target object and the touch display screen is greater than the preset distance, the target object cannot perform touch operation on the touch display screen any more, and at this time, it can be considered that the first sliding operation is performed completely.
In a case that it is detected that the first sliding operation does not satisfy the preset end condition, indicating that the first sliding operation is still being continuously executed and is not yet ended, it may be detected whether a current position of the first sliding operation is changed, and if so, the end position of the first sliding operation is updated according to the current position of the first sliding operation, and the length of the first sliding operation is updated according to the updated end position of the first sliding operation and the recorded start position of the first sliding operation. Therefore, in the execution process of the first sliding operation, the length of the first sliding operation is calculated in real time according to the range change of the first sliding operation, the selected text corresponding to the first sliding operation can be determined according to the length of the first sliding operation which changes in real time, and the selected text is displayed in a distinguishing manner, so that a user can intuitively know which text contents are selected by the currently executed first sliding operation.
It can be understood that the above-mentioned manner of calculating the proportional relationship between the length of the preset sliding region and the length of the target text and calculating the length of the selected text is only an application example of the present invention, and the embodiment of the present invention does not limit the specific calculation manner.
Under the condition that the range is the area, after receiving the triggering operation of the preset key, the terminal device may calculate a corresponding relationship between the area of the preset sliding area and the area of the target text. In this way, after the first sliding operation is received, the area of the selected text corresponding to the first sliding operation in the target text can be determined according to the corresponding relationship between the area of the preset sliding area and the area of the target text and the area of the first sliding operation.
For example, in the case where the preset slide region is the virtual keyboard region, the region area of the virtual keyboard region may be denoted as S1. The length of the target text may be counted according to the number of characters included in the area of the region corresponding to the target text, and assuming that the area of the region corresponding to the target text includes n characters, the area of the region of the target text may be denoted as n.
In one example, the correspondence between the area of the preset sliding region and the area of the target text may be represented by the following formula: and n/S1, which represents the number of characters of the target text contained in the unit area of the preset sliding area. Assuming that the area of the first sliding operation is S2, according to the corresponding relationship between the area of the preset sliding region and the area of the target text and the area of the first sliding operation, it may be determined that the area of the region of the selected text corresponding to the first sliding operation in the target text is: (n/S1) S2.
It can be understood that, in the embodiment of the present invention, the range is mainly described as an example, and when the range is an area, the process of determining the corresponding selected text in the target text by the first sliding operation is similar, and the process may be referred to each other.
In an optional embodiment of the present invention, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding region, a selected text corresponding to the first sliding operation in the target text includes:
step S21, determining at least one line of text corresponding to the range of the first sliding operation in the target text according to the corresponding relation between the range of the target text and the range of the preset sliding area;
and step S22, determining the at least one line of text as the corresponding selected text in the target text by the first sliding operation.
In the embodiment of the present invention, according to a corresponding relationship between the length or the area of the target text and the length or the area of the preset sliding region, at least one line of text corresponding to the length or the area of the first sliding operation in the target text may be determined, and then the at least one line of text may be determined as a selected text corresponding to the first sliding operation in the target text.
Under the condition that the target text contains multiple lines of texts, the embodiment of the invention can quickly select the multiple lines of texts through the first sliding operation, so that the efficiency of text selection can be improved, and the efficiency of text processing can be further improved.
In an optional embodiment of the present invention, after determining that the first sliding operation is performed on the corresponding selected text in the target text, the method may further include:
and executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
Under the condition that the first sliding operation is detected to meet a preset ending condition, for example, when a finger (or a touch pen, etc.) of a user is detected to leave a preset distance from a touch display screen of the terminal device, a preset text operation may be performed on the selected text. For example, selected text in the target text is deleted.
In an optional embodiment of the present invention, after determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding region, that the first sliding operation is on the corresponding selected text in the target text, the method may further include:
step S31, receiving a second sliding operation, where the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
step S32, determining a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relationship, and taking the remaining text in the selected text except the cancel text as the selected text.
In the specific implementation, a user may select more than one text during the first sliding operation, and at this time, if the user finishes the first sliding operation, the user needs to re-input more deleted texts, which brings inconvenience to the user operation. To solve the problem, an embodiment of the present invention may provide a second sliding operation, where the second sliding operation is a sliding operation in a second direction in a preset sliding area of the terminal device, and the second sliding operation may be used to cancel part or all of the selected text. Specifically, if a user selects a part of text more than necessary during the first sliding operation, the user may perform a second sliding operation to cancel a part or all of the text in the selected text while maintaining the touch operation.
In the embodiment of the present invention, a process of determining to cancel a text is similar to a process of determining to select a text, a starting point position of a second sliding operation may be recorded when the second sliding operation is received, and a corresponding cancel text of the second sliding operation in the selected text is determined according to a range of the second sliding operation and a correspondence between a range of the target text and a range of the preset sliding area. The second direction is different from the first direction, and further, in order to improve convenience of user operation, the second direction may be a direction opposite to the first direction. For example, the first direction is a horizontal right-to-left direction, and the second direction is a horizontal left-to-right direction. In the process of executing the first sliding operation, if the text content is selected more, the second sliding operation is executed from the current position of the first sliding operation in the opposite direction, namely, part or all of the text in the selected text can be cancelled. Therefore, the condition of re-input during the error deletion can be avoided, and the input efficiency of the user can be improved.
It is understood that the second direction is a direction from left to right in the horizontal direction, which is only an application example of the present invention, and the second direction can be set according to actual needs.
In an optional embodiment of the present invention, after determining that the first sliding operation is performed on the corresponding selected text in the target text, the method may further include: and in the target text, the selected text is displayed in a distinguishing way, so that the user can intuitively know which text contents are selected. If a part of texts are selected more, the second sliding operation can be directly executed, and the embodiment of the invention can cancel the differential display of the cancel texts corresponding to the second sliding operation and only perform the differential display of the final selected texts. It is understood that, during the execution of the first sliding operation, the selected text may change as the range of the first sliding operation changes. Or, in the execution process of the second sliding operation, the cancel text may change along with the change of the range of the second sliding operation, thereby causing the change of the selected text. The embodiment of the invention displays the currently selected text in a distinguishing way according to the real-time change of the selected text.
In an optional embodiment of the invention, the method may further comprise:
step S41, displaying a preset menu, wherein different menu items in the preset menu correspond to different text operations;
step S42, receiving selection operation of menu items in the preset menu;
the executing a preset text operation on the selected text may include: and executing the text operation corresponding to the menu item selected by the selection operation on the selected text.
In practical applications, preset keys in the terminal device may be used to trigger a single text operation function. For example, for triggering a delete operation, or for triggering a copy operation, etc.
Optionally, preset keys in the terminal device may also be used to trigger various text-manipulation functions. After receiving the triggering operation of the preset key, the mobile terminal can display a preset menu, wherein different menu items in the preset menu correspond to different text operations. For example, the preset menu includes a menu item for triggering a delete operation, a menu item for triggering a copy operation, a menu item for triggering a cut operation, a menu item for triggering a translate operation, and the like.
After a preset menu is displayed, a selection operation on a menu item in the preset menu may be received, and then after a selected text is determined and it is determined that a first sliding operation satisfies a preset end condition, a text operation corresponding to the menu item selected by the selection operation may be performed on the selected text.
In an optional embodiment of the present invention, the preset key may be a delete key, and when it is detected that the delete key is continuously clicked within a preset time, a prompt message may be displayed, where the prompt message is used to prompt a user to perform a first sliding operation, so as to quickly select text content to be deleted through the first sliding operation.
In practical application, if it is detected that the deletion key is continuously clicked within a preset time, which indicates that the user may delete the text content by clicking the deletion key multiple times, the prompt message may be displayed to prompt the user to quickly select the text content to be deleted through the first sliding operation. The preset time may be a short time period, such as 5 seconds, which is not limited in the embodiment of the present invention.
In summary, the embodiment of the present invention may determine the target text in response to the trigger operation; and after receiving a first sliding operation, determining a corresponding selected text in the target text by the first sliding operation according to the range of the first sliding operation and the proportional relation between the range of the target text and the range of the preset sliding area. Thus, the preset text operation can be executed on the selected text. According to the embodiment of the invention, the selected text is determined through the first sliding operation, so that the operation of manually clicking a specific position by a user is avoided, and the operation steps of the user can be reduced. In addition, the embodiment of the invention changes the click operation which is difficult to execute into the sliding operation which is easy to execute, thereby reducing the operation difficulty of the user and improving the convenience of the user operation. And executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition. When the preset text operation is the deleting operation, the selected text can be directly deleted, and compared with the method of deleting the selected text word by pressing a deleting key for multiple times, the user operation can be reduced, the text deleting efficiency is improved, and the text inputting efficiency of the user in the mobile terminal can be improved.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the illustrated order of acts, as some steps may occur in other orders or concurrently in accordance with the embodiments of the present invention. Further, those skilled in the art will appreciate that the embodiments described in the specification are presently preferred and that no particular act is required to implement the invention.
Device embodiment
Referring to fig. 2, a block diagram of a text processing apparatus according to an embodiment of the present invention is shown, where the apparatus may include:
a text determination module 201, configured to determine a target text in response to a trigger operation;
a first receiving module 202, configured to receive a first sliding operation, where the first sliding operation is a sliding operation in a first direction in a preset sliding region;
and the text selection module 203 is configured to determine, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding region, a selected text corresponding to the first sliding operation in the target text.
Optionally, the apparatus further comprises:
and the text processing module is used for executing preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
Optionally, the apparatus further comprises:
the menu display module is used for displaying a preset menu, and different menu items in the preset menu correspond to different text operations;
the menu selection module is used for receiving selection operation of menu items in the preset menu;
the text processing module is specifically configured to execute a text operation corresponding to the menu item selected by the selection operation on the selected text.
Optionally, the apparatus further comprises:
a second receiving module, configured to receive a second sliding operation, where the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
the text selection module is further configured to determine a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relationship, and use the remaining text in the selected text except the cancel text as the selected text.
Optionally, the text determining module is specifically configured to respond to a trigger operation, and determine that an input string is a target text when the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
Optionally, the text determining module is specifically configured to determine, in an already-displayed text before the cursor, that a current paragraph text where the cursor is located is a target text.
Optionally, the text selection module is specifically configured to determine, according to the length of the first sliding operation and a corresponding relationship between the length of the target text and the length of the preset sliding region, a selected text corresponding to the first sliding operation in the target text; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
Optionally, the text selection module includes:
the range determining submodule is used for determining at least one line of text corresponding to the range of the first sliding operation in the target text according to the corresponding relation between the range of the target text and the range of the preset sliding area;
and the text determination sub-module is used for determining the at least one line of text as the selected text corresponding to the first sliding operation in the target text.
Optionally, the preset text operation includes any one of a deletion operation, a copy operation, a cut operation, and a translation operation.
The embodiment of the invention can respond to the trigger operation to determine the target text; and after receiving a first sliding operation, determining a corresponding selected text in the target text by the first sliding operation according to the range of the first sliding operation and the proportional relation between the range of the target text and the range of the preset sliding area. Thus, the preset text operation can be executed on the selected text. According to the embodiment of the invention, the selected text is determined through the first sliding operation, so that the operation of manually clicking a specific position by a user is avoided, and the operation steps of the user can be reduced. In addition, the embodiment of the invention changes the click operation which is difficult to execute into the sliding operation which is easy to execute, thereby reducing the operation difficulty of the user and improving the convenience of the user operation. And executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition. When the preset text operation is the deleting operation, the selected text can be directly deleted, and compared with the method of deleting the selected text word by pressing a deleting key for multiple times, the user operation can be reduced, the text deleting efficiency is improved, and the text inputting efficiency of the user in the mobile terminal can be improved.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention provides an apparatus for text processing, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs configured to be executed by the one or more processors include instructions for: determining a target text in response to a trigger operation; receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area; and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
Fig. 3 is a block diagram illustrating an apparatus 800 for text processing according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 3, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice information processing mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the on/off status of the device 800, the relative positioning of components, such as a display and keypad of the apparatus 800, the sensor assembly 814 may also process a change in position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, orientation or acceleration/deceleration of the apparatus 800, and a change in temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on radio frequency information processing (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 4 is a schematic diagram of a server in some embodiments of the invention. The server 1900 may vary widely by configuration or performance and may include one or more Central Processing Units (CPUs) 1922 (e.g., one or more processors) and memory 1932, one or more storage media 1930 (e.g., one or more mass storage devices) storing applications 1942 or data 1944. Memory 1932 and storage medium 1930 can be, among other things, transient or persistent storage. The program stored in the storage medium 1930 may include one or more modules (not shown), each of which may include a series of instructions operating on a server. Still further, a central processor 1922 may be provided in communication with the storage medium 1930 to execute a series of instruction operations in the storage medium 1930 on the server 1900.
The server 1900 may also include one or more power supplies 1926, one or more wired or wireless network interfaces 1950, one or more input-output interfaces 1958, one or more keyboards 1956, and/or one or more operating systems 1941, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
A non-transitory computer-readable storage medium in which instructions, when executed by a processor of an apparatus (server or terminal), enable the apparatus to perform the text processing method shown in fig. 1.
A non-transitory computer readable storage medium in which instructions, when executed by a processor of an apparatus (server or terminal), enable the apparatus to perform a text processing method, the method comprising: determining a target text in response to a trigger operation; receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area; and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
The embodiment of the invention discloses A1 and a text processing method, which comprises the following steps:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
A2, the method of claim A1, the determining that the first swipe operation is subsequent to a corresponding selected one of the target texts, the method further comprising:
and executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
A3, the method of A2, the method further comprising:
displaying a preset menu, wherein different menu items in the preset menu correspond to different text operations;
receiving selection operation of menu items in the preset menu;
the executing of the preset text operation on the selected text comprises the following steps:
and executing the text operation corresponding to the menu item selected by the selection operation on the selected text.
A4, according to the method of A1, the method further includes the steps of determining that the first sliding operation is behind the corresponding selected text in the target text according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area:
receiving a second sliding operation, wherein the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
and determining a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relation, and taking the rest texts except the cancel text in the selected text as the selected text.
A5, the method of A1, wherein the determining the target text in response to the trigger operation comprises:
responding to a trigger operation, and determining that an input string is a target text under the condition that the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
A6, according to the method in A5, the determining that the on-screen text before the cursor is the target text includes:
and determining the current paragraph text in which the cursor is positioned as a target text in the on-screen text before the cursor.
A7, according to the method in A1, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area, a selected text corresponding to the first sliding operation in the target text includes:
determining a corresponding selected text in the target text by the first sliding operation according to the length of the first sliding operation and the corresponding relation between the length of the target text and the length of the preset sliding area; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
A8, according to the method in A1, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area, a selected text corresponding to the first sliding operation in the target text includes:
determining at least one line of text corresponding to the range of the first sliding operation in the target text according to the corresponding relation between the range of the target text and the range of the preset sliding area;
and determining the at least one line of text as the corresponding selected text in the target text by the first sliding operation.
A9, according to the method of any A2 to A8, wherein the preset text operation comprises any one of a deletion operation, a copy operation, a cut operation and a translation operation.
The embodiment of the invention discloses B10, a text processing device, comprising:
the text determination module is used for responding to the trigger operation to determine a target text;
the device comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a first sliding operation, and the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and the text selection module is used for determining a selected text corresponding to the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
B11, the apparatus of B10, the apparatus further comprising:
and the text processing module is used for executing preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
B12, the apparatus of B11, the apparatus further comprising:
the menu display module is used for displaying a preset menu, and different menu items in the preset menu correspond to different text operations;
the menu selection module is used for receiving selection operation of menu items in the preset menu;
the text processing module is specifically configured to execute a text operation corresponding to the menu item selected by the selection operation on the selected text.
B13, the apparatus of B10, the apparatus further comprising:
a second receiving module, configured to receive a second sliding operation, where the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
the text selection module is further configured to determine a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relationship, and use the remaining text in the selected text except the cancel text as the selected text.
B14, the apparatus according to B9, the text determination module, in particular, configured to determine, in response to a trigger operation, that an input string is a target text if the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
B15, according to the apparatus of B14, the text determination module is specifically configured to determine, in the on-screen text before the cursor, that the current paragraph text where the cursor is located is the target text.
B16, according to the apparatus of B10, the text selection module is specifically configured to determine a selected text corresponding to the first sliding operation in the target text according to the length of the first sliding operation and the corresponding relationship between the length of the target text and the length of the preset sliding region; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
B17, the apparatus of B10, the text selection module comprising:
the range determining submodule is used for determining at least one line of text corresponding to the range of the first sliding operation in the target text according to the corresponding relation between the range of the target text and the range of the preset sliding area;
and the text determination sub-module is used for determining the at least one line of text as the selected text corresponding to the first sliding operation in the target text.
B18, according to the device of any one of B11 to B17, the preset text operation comprises any one of a deleting operation, a copying operation, a cutting operation and a translating operation.
The embodiment of the invention discloses C19, a device for text processing, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs configured to be executed by the one or more processors comprise instructions for:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
C20, the device of C19, the device also configured to execute the one or more programs by one or more processors including instructions for:
and executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
C21, the device of C20, the device also configured to execute the one or more programs by one or more processors including instructions for:
displaying a preset menu, wherein different menu items in the preset menu correspond to different text operations;
receiving selection operation of menu items in the preset menu;
the executing of the preset text operation on the selected text comprises the following steps:
and executing the text operation corresponding to the menu item selected by the selection operation on the selected text.
C22, the device of C19, the device also configured to execute the one or more programs by one or more processors including instructions for:
receiving a second sliding operation, wherein the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
and determining a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relation, and taking the rest texts except the cancel text in the selected text as the selected text.
C23, the apparatus of C19, the response triggering operation determining the target text, comprising:
responding to a trigger operation, and determining that an input string is a target text under the condition that the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
C24, the device according to C23, the determining that the on-screen text before the cursor is the target text includes:
and determining the current paragraph text in which the cursor is positioned as a target text in the on-screen text before the cursor.
C25, the device according to C17, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area, the selected text corresponding to the first sliding operation in the target text, including:
determining a corresponding selected text in the target text by the first sliding operation according to the length of the first sliding operation and the corresponding relation between the length of the target text and the length of the preset sliding area; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
C26, the device according to C19, the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area, the selected text corresponding to the first sliding operation in the target text, including:
determining at least one line of text corresponding to the range of the first sliding operation in the target text according to the corresponding relation between the range of the target text and the range of the preset sliding area;
and determining the at least one line of text as the corresponding selected text in the target text by the first sliding operation.
C27, the device according to any one of C20 to C26, the preset text operation comprises any one of deletion operation, copy operation, cut operation and translation operation.
Embodiments of the present invention disclose D28, a machine-readable medium having instructions stored thereon, which when executed by one or more processors, cause an apparatus to perform a text processing method as described in one or more of a 1-a 9.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.
The text processing method, the text processing device and the device for text processing provided by the invention are described in detail, specific examples are applied in the text to explain the principle and the implementation mode of the invention, and the description of the above examples is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method of text processing, the method comprising:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
2. The method of claim 1, wherein the determination that the first swipe operation is subsequent to the corresponding selected text in the target text, further comprising:
and executing a preset text operation on the selected text under the condition that the first sliding operation is detected to meet a preset ending condition.
3. The method of claim 2, further comprising:
displaying a preset menu, wherein different menu items in the preset menu correspond to different text operations;
receiving selection operation of menu items in the preset menu;
the executing of the preset text operation on the selected text comprises the following steps:
and executing the text operation corresponding to the menu item selected by the selection operation on the selected text.
4. The method according to claim 1, wherein the first sliding operation is determined to be behind the corresponding selected text in the target text according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding area, and the method further comprises:
receiving a second sliding operation, wherein the second sliding operation is a sliding operation in a second direction in the preset sliding area, and the second direction is different from the first direction;
and determining a cancel text corresponding to the second sliding operation in the selected text according to the range of the second sliding operation and the corresponding relation, and taking the rest texts except the cancel text in the selected text as the selected text.
5. The method of claim 1, wherein determining the target text in response to the trigger operation comprises:
responding to a trigger operation, and determining that an input string is a target text under the condition that the input string exists; or, under the condition that an input string exists, determining the input string and a candidate item corresponding to the input string as target texts; alternatively, in the case where there is no input string but there is already on-screen text, the already-screen text before the cursor is determined to be the target text.
6. The method of claim 5, wherein the determining that the on-screen text before the cursor is the target text comprises:
and determining the current paragraph text in which the cursor is positioned as a target text in the on-screen text before the cursor.
7. The method according to claim 1, wherein the determining, according to the range of the first sliding operation and the corresponding relationship between the range of the target text and the range of the preset sliding region, the selected text corresponding to the first sliding operation in the target text comprises:
determining a corresponding selected text in the target text by the first sliding operation according to the length of the first sliding operation and the corresponding relation between the length of the target text and the length of the preset sliding area; alternatively, the first and second electrodes may be,
and determining the selected text corresponding to the first sliding operation in the target text according to the area of the first sliding operation and the corresponding relation between the area of the target text and the area of the preset sliding region.
8. A text processing apparatus, characterized in that the apparatus comprises:
the text determination module is used for responding to the trigger operation to determine a target text;
the device comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a first sliding operation, and the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and the text selection module is used for determining a selected text corresponding to the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
9. An apparatus for text processing comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors comprises instructions for:
determining a target text in response to a trigger operation;
receiving a first sliding operation, wherein the first sliding operation is a sliding operation in a first direction in a preset sliding area;
and determining the corresponding selected text of the first sliding operation in the target text according to the range of the first sliding operation and the corresponding relation between the range of the target text and the range of the preset sliding area.
10. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform the text processing method of any of claims 1 to 7.
CN202011381283.0A 2020-11-30 2020-11-30 Text processing method and device and text processing device Pending CN112445403A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011381283.0A CN112445403A (en) 2020-11-30 2020-11-30 Text processing method and device and text processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011381283.0A CN112445403A (en) 2020-11-30 2020-11-30 Text processing method and device and text processing device

Publications (1)

Publication Number Publication Date
CN112445403A true CN112445403A (en) 2021-03-05

Family

ID=74739150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011381283.0A Pending CN112445403A (en) 2020-11-30 2020-11-30 Text processing method and device and text processing device

Country Status (1)

Country Link
CN (1) CN112445403A (en)

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101694650A (en) * 2009-10-10 2010-04-14 宇龙计算机通信科技(深圳)有限公司 Method, device and mobile terminal for copying and pasting data
CN102866827A (en) * 2012-08-21 2013-01-09 刘炳林 Document editing method and device for man-machine interaction equipment
CN102981765A (en) * 2012-11-26 2013-03-20 中兴通讯股份有限公司 Text processing method and terminal
CN104199607A (en) * 2014-08-11 2014-12-10 北京搜狗科技发展有限公司 Candidate selection method and device based on input method
CN104778006A (en) * 2015-03-31 2015-07-15 深圳市万普拉斯科技有限公司 Information editing method and system
US20150277748A1 (en) * 2012-10-22 2015-10-01 Geun-Ho Shin Edit providing method according to multi-touch-based text block setting
CN106095215A (en) * 2015-03-19 2016-11-09 苹果公司 Touch input cursor manipulates
CN106155556A (en) * 2016-07-11 2016-11-23 北京小米移动软件有限公司 Method of attaching, device and mobile device
CN106598754A (en) * 2016-11-21 2017-04-26 深圳市金立通信设备有限公司 Pasting method and terminal
CN106648379A (en) * 2017-01-17 2017-05-10 维沃移动通信有限公司 Method and device for selecting text area
CN106951165A (en) * 2017-03-30 2017-07-14 维沃移动通信有限公司 A kind of word editing method and mobile terminal
US20170277430A1 (en) * 2015-03-03 2017-09-28 Omron Corporation Program for character input system, character input device, and information processing device
CN107479786A (en) * 2017-07-28 2017-12-15 珠海市魅族科技有限公司 A kind of method, apparatus, computer installation and computer-readable recording medium for deleting text
CN107506130A (en) * 2017-07-17 2017-12-22 维沃移动通信有限公司 A kind of word delet method and mobile terminal
CN107656693A (en) * 2013-02-28 2018-02-02 联想(北京)有限公司 A kind of method and device that cursor position is determined in touch-screen
CN107943388A (en) * 2017-11-14 2018-04-20 口碑(上海)信息技术有限公司 Information deletion method and device
CN109933213A (en) * 2017-12-19 2019-06-25 北京搜狗科技发展有限公司 Input method and device
CN110232174A (en) * 2019-04-22 2019-09-13 维沃移动通信有限公司 A kind of content chooses method and terminal device
CN111273827A (en) * 2020-01-17 2020-06-12 维沃移动通信有限公司 Text processing method and electronic equipment

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101694650A (en) * 2009-10-10 2010-04-14 宇龙计算机通信科技(深圳)有限公司 Method, device and mobile terminal for copying and pasting data
CN102866827A (en) * 2012-08-21 2013-01-09 刘炳林 Document editing method and device for man-machine interaction equipment
US20150277748A1 (en) * 2012-10-22 2015-10-01 Geun-Ho Shin Edit providing method according to multi-touch-based text block setting
CN102981765A (en) * 2012-11-26 2013-03-20 中兴通讯股份有限公司 Text processing method and terminal
CN107656693A (en) * 2013-02-28 2018-02-02 联想(北京)有限公司 A kind of method and device that cursor position is determined in touch-screen
CN104199607A (en) * 2014-08-11 2014-12-10 北京搜狗科技发展有限公司 Candidate selection method and device based on input method
US20170277430A1 (en) * 2015-03-03 2017-09-28 Omron Corporation Program for character input system, character input device, and information processing device
CN106095215A (en) * 2015-03-19 2016-11-09 苹果公司 Touch input cursor manipulates
CN110362245A (en) * 2015-03-19 2019-10-22 苹果公司 The manipulation of touch input cursor
CN104778006A (en) * 2015-03-31 2015-07-15 深圳市万普拉斯科技有限公司 Information editing method and system
CN106155556A (en) * 2016-07-11 2016-11-23 北京小米移动软件有限公司 Method of attaching, device and mobile device
CN106598754A (en) * 2016-11-21 2017-04-26 深圳市金立通信设备有限公司 Pasting method and terminal
CN106648379A (en) * 2017-01-17 2017-05-10 维沃移动通信有限公司 Method and device for selecting text area
CN106951165A (en) * 2017-03-30 2017-07-14 维沃移动通信有限公司 A kind of word editing method and mobile terminal
CN107506130A (en) * 2017-07-17 2017-12-22 维沃移动通信有限公司 A kind of word delet method and mobile terminal
CN107479786A (en) * 2017-07-28 2017-12-15 珠海市魅族科技有限公司 A kind of method, apparatus, computer installation and computer-readable recording medium for deleting text
CN107943388A (en) * 2017-11-14 2018-04-20 口碑(上海)信息技术有限公司 Information deletion method and device
CN109933213A (en) * 2017-12-19 2019-06-25 北京搜狗科技发展有限公司 Input method and device
CN110232174A (en) * 2019-04-22 2019-09-13 维沃移动通信有限公司 A kind of content chooses method and terminal device
CN111273827A (en) * 2020-01-17 2020-06-12 维沃移动通信有限公司 Text processing method and electronic equipment

Similar Documents

Publication Publication Date Title
CN107153541B (en) Browsing interaction processing method and device
US10296201B2 (en) Method and apparatus for text selection
CN108664201B (en) Text editing method and device and electronic equipment
CN108803892B (en) Method and device for calling third party application program in input method
CN108803891B (en) Information display method and device, electronic equipment and storage medium
CN110795014B (en) Data processing method and device and data processing device
CN112068764B (en) Language switching method and device for language switching
CN106020694B (en) Electronic equipment, and method and device for dynamically adjusting selected area
CN111679746A (en) Input method and device and electronic equipment
CN111092971A (en) Display method and device for displaying
CN107340881B (en) Input method and electronic equipment
CN112445403A (en) Text processing method and device and text processing device
CN112667124A (en) Information processing method and device and information processing device
CN112083811B (en) Candidate item display method and device
CN110673753B (en) Key false touch error correction method and device
CN110417987B (en) Operation response method, device, equipment and readable storage medium
CN108227952B (en) Method and system for generating custom word and device for generating custom word
CN112306251A (en) Input method, input device and input device
CN107977089B (en) Input method and device and input device
CN107024998B (en) Input method, input device and input device
CN110929484A (en) Text processing method, device and storage medium
CN114527919B (en) Information display method and device and electronic equipment
CN109388328B (en) Input method, device and medium
CN112214154B (en) Interface processing method and device and interface processing device
CN111124142B (en) Input method, device and device for inputting

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210305

RJ01 Rejection of invention patent application after publication