CN114265525A - Text selection method and device, electronic equipment and readable storage medium - Google Patents

Text selection method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114265525A
CN114265525A CN202111611799.4A CN202111611799A CN114265525A CN 114265525 A CN114265525 A CN 114265525A CN 202111611799 A CN202111611799 A CN 202111611799A CN 114265525 A CN114265525 A CN 114265525A
Authority
CN
China
Prior art keywords
target text
paragraph
text region
line
input
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
CN202111611799.4A
Other languages
Chinese (zh)
Inventor
佘志强
杨光
许兵
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
MIGU Digital Media Co Ltd
MIGU Culture Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
MIGU Digital Media Co Ltd
MIGU Culture Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, MIGU Digital Media Co Ltd, MIGU Culture Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202111611799.4A priority Critical patent/CN114265525A/en
Publication of CN114265525A publication Critical patent/CN114265525A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a text selection method and device, electronic equipment and a readable storage medium, and belongs to the technical field of data processing. The text selection method of the embodiment of the application comprises the following steps: receiving a first input of a user to the text display interface; determining a first location and a second location on the text display interface in response to a first input; determining a target text region according to the first position and the second position; the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position; and marking the target text included in the target text area. According to the scheme in the application, the text content can be selected discontinuously based on the user input, so that the accuracy of the selected text content is improved.

Description

Text selection method and device, electronic equipment and readable storage medium
Technical Field
The application belongs to the technical field of data processing, and particularly relates to a text selection method and device, electronic equipment and a readable storage medium.
Background
In the prior art, for text content on a text display interface of an electronic device such as a mobile phone, a conventional selection method is as follows: and long-time pressing the screen of the electronic equipment, triggering content selection logic, and selecting the text content of the whole sliding area by up-and-down sliding of a finger. In this case, since the user is interested in only a part of the text content of the entire sliding region, for example, the user only wants to select a part of words of each of the plurality of lines, the accuracy of the selected text content will be low.
Disclosure of Invention
The embodiment of the application aims to provide a text selection method, a text selection device, electronic equipment and a readable storage medium, so as to solve the problem that the accuracy of the existing text selection method is low.
In order to solve the technical problem, the present application is implemented as follows:
in a first aspect, a text selection method is provided, which is applied to an electronic device, and includes:
receiving a first input of a user to the text display interface;
determining a first location and a second location on the text display interface in response to the first input;
determining a target text region according to the first position and the second position; wherein the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position;
and marking the target text included in the target text area.
Optionally, the target text region satisfies that a start position of each line is related to the first position, and an end position of each line is related to the second position; the first position is a starting position of a starting line of the target text region, and the second position is an ending position of an ending line of the target text region; the determining a target text region according to the first location and the second location includes:
and determining the rectangular target text area by taking the connecting line of the first position and the second position as a diagonal line.
Optionally, the target text region satisfies that a start position of each paragraph is associated with the first position, and an end position of an end paragraph is associated with the second position; the first position is a start position of a start paragraph of the target text region, and the second position is an end position of an end paragraph of the target text region; the determining a target text region according to the first location and the second location includes:
determining a starting position of each paragraph of the target text region according to the first position;
determining the ending positions of other paragraphs of the target text region except the ending paragraph as the ending positions of the other paragraphs relative to the text display interface.
Optionally, in a case that the target text region satisfies that a start position of each line is related to the first position and an end position of each line is related to the second position, after determining the target text region, the method further includes:
displaying a start mark at a start position of each line of the target text region, and displaying an end mark at an end position of each line of the target text region.
Optionally, the method further includes:
receiving second input of a user on a starting mark and/or an ending mark of any line of the target text area;
in response to the second input, performing at least one of:
adjusting the starting position and/or the ending position of any line;
adjusting a start position and/or an end position of a line of the target text region that is associated with the second input;
increasing or decreasing the lines covered by the target text area.
Optionally, in a case that the target text region satisfies that the start position of each paragraph is related to the first position, and the end position of each paragraph or the end paragraph is related to the second position, after determining the target text region, the method further includes:
displaying a start mark at a start position of each paragraph of the target text region, and displaying an end mark at an end position of each paragraph of the target text region.
Optionally, the method further includes:
receiving a third input of a start identifier and/or an end identifier of any paragraph of the target text region from a user;
in response to the third input, performing at least one of:
adjusting the start position and/or the end position of any paragraph;
adjusting a start position and/or an end position of a paragraph of the target text region that is related to the second input;
increasing or decreasing paragraphs covered by the target text region.
Optionally, the method further includes:
receiving a fourth input from the user;
in response to the fourth input, independently outputting the target text of each line of the target text region according to the line of the target text region, or combining and outputting the target text of each line of the target text region.
In a second aspect, a text selection apparatus is provided, which is applied to an electronic device, and includes:
the first receiving module is used for receiving a first input of a user to the text display interface;
a first determination module to determine a first location and a second location on the text display interface in response to the first input;
a second determining module, configured to determine a target text region according to the first location and the second location; wherein the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position;
and the marking module is used for marking the target text included in the target text region.
Optionally, the target text region satisfies that a start position of each line is related to the first position, and an end position of each line is related to the second position; the first position is a starting position of a starting line of the target text region, and the second position is an ending position of an ending line of the target text region; the second determining module is specifically configured to: and determining the rectangular target text area by taking the connecting line of the first position and the second position as a diagonal line.
Optionally, the target text region satisfies that a start position of each paragraph is associated with the first position, and an end position of an end paragraph is associated with the second position; the first position is a start position of a start paragraph of the target text region, and the second position is an end position of an end paragraph of the target text region; the second determining module includes:
a first determination unit configured to determine a start position of each paragraph of the target text region according to the first position;
a second determining unit, configured to determine an end position of a paragraph other than the end paragraph in the target text region as an end position of the paragraph with respect to the text display interface.
Optionally, in a case that the target text region satisfies that the start position of each line is related to the first position, and the end position of each line is related to the second position, the text selection apparatus 80 further includes:
the first display module is used for displaying a starting mark at the starting position of each line of the target text area and displaying an ending mark at the ending position of each line of the target text area.
Optionally, the text selection apparatus further includes:
the second receiving module is used for receiving second input of the starting mark and/or the ending mark of any line of the target text area by a user;
a first execution module to, in response to the second input, execute at least one of:
adjusting the starting position and/or the ending position of any line;
adjusting a start position and/or an end position of a line of the target text region that is associated with the second input;
increasing or decreasing the lines covered by the target text area.
Optionally, in a case that the target text region satisfies that the start position of each paragraph is related to the first position, and the end position of each paragraph or the end paragraph is related to the second position, the text selection apparatus further includes:
and the second display module is used for displaying a start identifier at the start position of each paragraph in the target text region and displaying an end identifier at the end position of each paragraph in the target text region.
Optionally, the text selection apparatus further includes:
a third receiving module, configured to receive a third input of a start identifier and/or an end identifier of any paragraph in the target text region from a user;
a second execution module to, in response to the third input, execute at least one of:
adjusting the start position and/or the end position of any paragraph;
adjusting a start position and/or an end position of a paragraph of the target text region that is related to the second input;
increasing or decreasing paragraphs covered by the target text region.
Optionally, the text selection apparatus further includes:
the fourth receiving module is used for receiving a fourth input of the user;
and the output module is used for responding to the fourth input, independently outputting the target text of each line according to each line of the target text region, or combining and outputting the target text of each line of the target text region.
In a third aspect, an electronic device is provided, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method according to the first aspect.
In a fourth aspect, a readable storage medium is provided, on which a program or instructions are stored, which when executed by a processor, implement the steps of the method according to the first aspect.
In the embodiment of the application, after receiving a first input of a user to a text display interface, determining a first position and a second position on the text display interface in response to the first input, determining a target text region according to the first position and the second position, and marking a target text included in the target text region; the target text region satisfies any one of: the start position of each row is associated with a first position and the end position of each row is associated with a second position; the start position of each paragraph is associated with a first position and the end position of each paragraph or an end paragraph is associated with a second position. Therefore, the text content can be selected discontinuously based on the user input instead of continuously based on the whole sliding area corresponding to the user input, and therefore the accuracy of the selected text content is improved.
Drawings
Fig. 1 is a flowchart of a text selection method provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a text selection mode according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a text by row selection according to an embodiment of the present application;
FIG. 4 is a diagram illustrating an adjustment of a target text region according to an embodiment of the present application;
FIG. 5 is a schematic diagram of selecting text by paragraph according to an embodiment of the present application;
FIG. 6 is a second illustration of the adjustment of the target text region according to the embodiment of the present application;
FIG. 7 is a schematic diagram of a function selection menu according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a text selection apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. 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 application.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The text selection method, the text selection device, the electronic device, and the readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a flowchart of a text selection method provided in an embodiment of the present application, where the method is applied to an electronic device, and as shown in fig. 1, the method includes the following steps:
step 11: a first input of a user to a text display interface is received.
In this embodiment, a text display interface may be displayed on a touch screen of the electronic device. For example, the text display interface may be an interface of a reading program APP of an electronic device such as a mobile phone, and the corresponding text selection process is executed by the reading APP.
In some embodiments, before receiving a first input of a user to the text display Interface, a user's pressing operation may be recognized by the reading APP through an Application Programming Interface (API), a selection logic is triggered, and a virtual button identifying a text selection manner for the user to select may be popped up, where the text selection manner may include normal, selection by pressing, and selection by pressing a paragraph, as shown in fig. 2. Accordingly, the user may select normal, by line selection, or by paragraph selection. If the user selects common, selecting the text content according to the existing mode; and if the user selects to select according to the line or paragraph, the text content is selected by adopting the method in the embodiment. Note that the "circle" in fig. 2 represents text, and the text content thereof is not limited.
Step 12: in response to the first input, a first location and a second location on the text display interface are determined.
Alternatively, the first input may include, but is not limited to, a pressing operation exceeding a preset time, a sliding operation, a clicking operation, and the like. For the first position and the second position, it may be determined by recognizing the operation position coordinates of the first input. For example, the operating position coordinates of the first input may be identified by the reading APP to determine the first position and the second position.
It will be appreciated that for each paragraph, line, character, or even each location on the text display interface, the electronic device can obtain the corresponding coordinates to determine the corresponding location.
Step 13: determining a target text region according to the first position and the second position;
wherein the target text region may satisfy any one of:
the start position of each row is associated with a first position and the end position of each row is associated with a second position; for example, the abscissa of the start position of each line is the same as the abscissa of the first position, and the abscissa of the end position of each line is the same as the abscissa of the second position, i.e., the start position and the end position of each line are vertically coincident, but unless the abscissa of a line with respect to the end position of the text display interface is smaller than the abscissa of the second position, the end position with respect to the text display interface is determined as the end position of the line within the target text region;
the start position of each paragraph is associated with a first position and the end position of each paragraph or end paragraph is associated with a second position; for example, the abscissa of the start position of each paragraph is the same as the abscissa of the first position, and the abscissa of the end position of each paragraph is the same as the abscissa of the second position, i.e., the start position and the end position of each paragraph are vertically coincident, but unless the abscissa of a paragraph relative to the end position of the text display interface is smaller than the abscissa of the second position, the end position relative to the text display interface is determined as the end position of the paragraph in the target text region; or the abscissa of the start position of each paragraph is the same as the abscissa of the first position, the end position of the end paragraph is the second position, and the end positions of the paragraphs of the target text region other than the end paragraph are the end positions of the paragraphs originally corresponding to the text display interface, that is, the start position of each paragraph is kept consistent in the vertical direction.
It can be understood that if the text selection mode selected by the user is selected by line selection, the determined target text region satisfies that the start position of each line is related to the first position, and the end position of each line is related to the second position. If the text selection mode selected by the user is selected according to paragraphs, the determined target text region satisfies that the start position of each paragraph is related to the first position, and the end position of each paragraph or the end paragraph is related to the second position.
Step 14: the target text included in the target text region is marked.
Optionally, when the target text included in the target text region is marked, the background color of the target text may be directly changed, for example, the background color of the target text is changed into blue, yellow, or the like, or the target text may be marked at the bottom of the target text by using a wavy line or a straight line, which is not limited herein.
According to the text selection method, after first input of a user to a text display interface is received, a first position and a second position on the text display interface can be determined in response to the first input, a target text area is determined according to the first position and the second position, and a target text included in the target text area is marked; the target text region satisfies any one of: the start position of each row is associated with a first position and the end position of each row is associated with a second position; the start position of each paragraph is associated with a first position and the end position of each paragraph or an end paragraph is associated with a second position. Therefore, the text content can be selected discontinuously based on the user input instead of continuously based on the whole sliding area input by the user, so that the accuracy of the selected text content is improved.
Optionally, if the text content is selected according to the line selection, that is, the target text region satisfies that the start position of each line is related to the first position, the end position of each line is related to the second position, the first position is the start position of the start line of the target text region, and the second position is the end position of the end line of the target text region, when the target text region is determined, a connecting line between the first position and the second position may be used as a diagonal line, and the rectangular target text region is determined.
In some embodiments, the first input may be a user clicking on the text display interface and sliding from top to bottom by touch to trigger a multi-line selection and sliding at the end line. In response to the first input, the reading APP identifies a start position (a first position shown in fig. 3) of a user click, such as by identifying a pressing event, determines start positions of all lines based on the start position, and identifies a line selected by a user sliding operation, the line covered by a target text region of the selected line, and identifies a touch end position (a second position shown in fig. 3) of the user at the end line, such as by identifying a pressing event, the end position of the line selected by the reading APP, and determines an end position of all lines based on the end position, the corresponding target text region being a region a shown in fig. 3. Note that the "circle" in fig. 3 indicates text, and the text content thereof is not limited.
In other embodiments, the first input may be the user clicking on the text display interface and sliding from bottom to top by touch to trigger a multi-line selection and sliding at the end line. In response to the first input, the reading APP identifies a start position of a user click, such as by identifying a press event, determines start positions of all lines based on the position, identifies a line selected by a user sliding operation, the line covered by the selected line target text area, and identifies a touch end position of the user at the end line, such as by identifying a press event, the position being an end position of the line selection, and determines end positions of all lines based on the position.
It should be noted that, the embodiment of the present application does not limit the specific form of the first input, and may be selected based on the specific setting of the electronic device.
Alternatively, if the text content is selected according to the line selection, that is, the target text region satisfies that the start position of each line is associated with the first position and the end position of each line is associated with the second position, after the target text region is determined, a start mark may be displayed at the start position of each line of the target text region and an end mark may be displayed at the end position of each line of the target text region to identify the region selected by each line of the target text region. As shown in fig. 3, "' may be used to represent a start mark and an end mark, and to display a start position and an end position of each line in the target text area. However, other symbols may be used to indicate the start flag and the end flag, and the present invention is not limited thereto.
In some embodiments, if the text content is selected according to a row, the process of marking the target text included in the target text region may be: s1: judging whether a text paragraph on a text display interface has an overlapping area with a target text area; s2: if the paragraph has an overlapping region with the target text region, comparing whether each line of the paragraph has an overlapping region with the target text region; s3: if at least one line of the paragraph is overlapped with the target text region, detecting whether each word of the line is in the target text region; s4: for the first character in the target text area in the line, adding a starting identifier in front of the character and changing the background color of the character; for the last character in the target text region in the line, adding an end mark behind the character, changing the background color of the character, and directly changing the background color of other characters in the target text region in the line. Thus, it is possible to realize labeling of the target text included in the target text region, and add the start flag and the end flag to each line of the target text region.
Optionally, after displaying the start identifier and the end identifier for each line of the target text region, a second input of the start identifier and/or the end identifier for any line of the target text region by the user may be received, and in response to the second input, at least one of the following may be performed:
adjusting the starting position and/or the ending position of the arbitrary line;
adjusting a start position and/or an end position of a line of the target text region associated with the second input;
increasing or decreasing the lines covered by the target text area.
For example, the user may adjust the start position and/or the end position of any line of the target text region by dragging the start identifier and/or the end identifier of the line, thereby expanding or contracting the selection range of the line.
For another example, the user may trigger the cross-line selection by dragging the start identifier and/or the end identifier of any line of the target text region to move from the current line to the line above or below the current line, and the logic is: and reselecting the selected original position and the selection range of the end row, wherein the selection rows which are not related remain the original selection. For example, if the user drags the 2 nd ending mark to move 4 characters to the right and 3 lines to the bottom on the basis of the target text area shown in fig. 3, the newly selected target text area B is, as shown in fig. 4: the originally selected line 1 is unchanged, the text contents covered by the lines 2 and 4 are increased, the line 5 is newly added, and the thick frame part in fig. 4 is the selected contents after the lines 2, 3, 4 and 5 are adjusted.
Optionally, if the text content is selected according to paragraphs, that is, the start position of each paragraph is associated with a first position, and the end position of each paragraph or end paragraph is associated with a second position, where the first position is the start position of the start paragraph in the target text region, and the second position is the end position of the end paragraph in the target text region, when determining the target text region, the start position of each paragraph in the target text region may be determined according to the first position, for example, the start position of each paragraph is kept consistent in the vertical direction, and the end positions of paragraphs other than the end paragraph in the target text region are determined as the end positions of other paragraphs relative to the text display interface.
In some embodiments, the first input may be the user clicking on the text display interface and sliding by touch from top to bottom to trigger the multi-paragraph selection and sliding at the ending line. In response to the first input, the reading APP identifies a start position (a first position shown in fig. 5) of a user click, such as by identifying a pressing event, determines start positions of all paragraphs based on the start positions, and identifies a paragraph selected by a user sliding operation, where the selected paragraph is a paragraph covered by the target text region, and identifies a touch end position (a second position shown in fig. 5) of the user on an end line, such as by identifying a pressing event, where the selected paragraph is an end position of the paragraph selection and is also an end position of the end paragraph, and a background of the corresponding target text region is a dotted region C shown in fig. 5. The reading App can automatically select the content of the area covered by the starting position and the ending position, and the content in the paragraph is selected in a whole-line mode; if the selected area is the first line of the new paragraph, the selection is started according to the character corresponding to the abscissa of the starting point of the selected area.
Alternatively, if the text content is selected by paragraphs, that is, the target text region satisfies that the start position of each paragraph is associated with the first position and the end position of each paragraph or the end paragraph is associated with the second position, after the target text region is determined, a start identifier may be displayed at the start position of each paragraph in the target text region and an end identifier may be displayed at the end position of each paragraph in the target text region to identify the region selected by each paragraph in the target text region. As shown in fig. 5, "' may be used to represent a start identifier and an end identifier and to display a start position and an end position of each paragraph in the target text area. However, other symbols may be used to indicate the start flag and the end flag, and the present invention is not limited thereto.
In some embodiments, if the text content is selected by paragraph, the process of marking the target text included in the target text region may be: s1: judging whether each text paragraph on the text display interface has a superposition area with the target text area; s2: if there is a paragraph and the target text region have a coincidence region, then determining the first line of the paragraph coincident with the target text region; s3: detecting a first character of a line in the target text region by the first line having a coincidence with the target text region; s4: for the first character in the target text area in the line, adding a starting identifier in front of the character and changing the background color of the character; an end marker is added behind the last symbol of the paragraph and the background color of the character is changed and directly the background color of the middle character of the paragraph is changed. Thus, it is possible to realize labeling of the target text included in the target text region, and add the start flag and the end flag to each paragraph of the target text region.
Optionally, after each paragraph of the target text region displays the start identifier and the end identifier, a third input of the start identifier and/or the end identifier of any one paragraph of the target text region by the user may be received, and in response to the third input, at least one of the following may be performed:
adjusting the start position and/or the end position of the any paragraph;
adjusting a start position and/or an end position of a paragraph of the target text region that is related to the second input;
increasing or decreasing paragraphs covered by the target text area.
For example, the user may adjust the start position and/or the end position of any one paragraph in the target text region by dragging the start identifier and/or the end identifier of the paragraph, thereby expanding or contracting the selection range of the paragraph.
For another example, the user may trigger the cross-paragraph selection by dragging the start identifier and/or the end identifier of any one paragraph in the target text region to move from the current paragraph to the paragraph above or the paragraph below the current paragraph, and the logic is: and selecting a new paragraph according to the starting position of the current paragraph and the sliding ending position, wherein the selected paragraphs which are not related remain the same as the original paragraphs. For example, if the user moves the start position of the 3 rd paragraph forward by 2 characters on the basis of the target text region shown in fig. 5, as shown by the horizontal arrow in fig. 6, and moves the end mark of the 3 rd paragraph downward by 5 lines, as shown by the vertical arrow in fig. 7, then the newly selected target text region is, as shown in fig. 6: the original selected 1 st and 2 nd sections are not changed, the text content covered by the 3 rd section is increased, the 4 th section is newly added, and the thick frame part in fig. 6 is the selected content after the adjustment of the 3 rd and 4 th lines.
In some embodiments, after determining the target text region, a function selection menu may be added on the text display interface, for example, a function selection menu may be added below the target text region, and the function selection menu may include virtual buttons for copying, sharing, note taking, error correcting, and the like, as shown in fig. 7, for the user to select a corresponding operation on the target text included in the target text region.
In the embodiment of the application, the output mode of the target text in the target text area can be determined through the personalized setting of the user. Alternatively, the electronic device may receive a fourth input from the user, and then output the target text for each line of the target text region independently for each line of the target text region or output the target text for each line of the target text region in a combined manner in response to the fourth input. The text area can be output independently according to each line of the target text area by default, namely, each line is output independently and then is automatically changed. The fourth input may be, but is not limited to, a user's click operation on a virtual button "output" in the function selection menu shown in fig. 7, or other preset input operations.
For example, assuming that the line 1 text of the target text region a shown in fig. 3 is xxxxxxx, the line 2 text is yyyyyyyyy, the line 3 text is zzzzzzzzz, and the line 4 text is aaaaaaaaaa, if the target text of each line is independently output for each line of the target text region, the output content is as follows:
xxxxxxxxx
yyyyyyyyy
zzzzzzzz
aaaaaaaaa
if the target texts in each line of the target text area are merged and output, the output content is as follows: xxxxxxxxxxxyyyyyyyyzzzzzzzzzaaaaaaa.
It should be noted that x, y, z and a are only text of different lines, and the specific text content is not limited.
Optionally, the application may also combine an Optical Character Recognition (OCR) technology, determine a selection range by touching and sliding, perform OCR Recognition on the contents of the picture or PDF within the selection range, recognize the text contents and the start and end coordinates within the selection range, and mark the start and end positions of each line on the picture or PDF. The user can adjust the selection range by dragging the start and end identifiers, which simultaneously triggers OCR recognition again of the content of the new selection range.
It can be understood that the present solution is also applicable to a mixed mode of texts and pictures, and if the determined target text region includes a picture and a text, the picture in the target text region may be marked at the same time when the text is marked, and/or the picture in the target text region may be copied at the same time when the text is copied.
It should be noted that, in the text selection method provided in the embodiment of the present application, the execution main body may be a text selection device, or a control module in the text selection device for executing the text selection method. The text selection device provided by the embodiment of the present application is described by taking an example of a text selection method executed by a text selection device.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a text selection apparatus provided in an embodiment of the present application, where the text selection apparatus is applied to an electronic device, and as shown in fig. 8, the text selection apparatus 80 may include:
the first receiving module 81 is configured to receive a first input of the text display interface from the user;
a first determining module 82, configured to determine a first location and a second location on the text display interface in response to the first input;
a second determining module 83, configured to determine a target text region according to the first location and the second location; wherein the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position;
a marking module 84, configured to mark the target text included in the target text region.
Optionally, the target text region satisfies that a start position of each line is related to the first position, and an end position of each line is related to the second position; the first position is a starting position of a starting line of the target text region, and the second position is an ending position of an ending line of the target text region; the second determining module 83 is specifically configured to: and determining the rectangular target text area by taking the connecting line of the first position and the second position as a diagonal line.
Optionally, the target text region satisfies that a start position of each paragraph is associated with the first position, and an end position of an end paragraph is associated with the second position; the first position is a start position of a start paragraph of the target text region, and the second position is an end position of an end paragraph of the target text region; the second determining module 83 includes:
a first determination unit configured to determine a start position of each paragraph of the target text region according to the first position;
a second determining unit, configured to determine an end position of a paragraph other than the end paragraph in the target text region as an end position of the paragraph with respect to the text display interface.
Optionally, in a case that the target text region satisfies that the start position of each line is related to the first position, and the end position of each line is related to the second position, the text selection apparatus 80 further includes:
the first display module is used for displaying a starting mark at the starting position of each line of the target text area and displaying an ending mark at the ending position of each line of the target text area.
Optionally, the text selection apparatus 80 further includes:
the second receiving module is used for receiving second input of the starting mark and/or the ending mark of any line of the target text area by a user;
a first execution module to, in response to the second input, execute at least one of:
adjusting the starting position and/or the ending position of any line;
adjusting a start position and/or an end position of a line of the target text region that is associated with the second input;
increasing or decreasing the lines covered by the target text area.
Optionally, in a case that the target text region satisfies that the start position of each paragraph is related to the first position, and the end position of each paragraph or the end paragraph is related to the second position, the text selection apparatus 80 further includes:
and the second display module is used for displaying a start identifier at the start position of each paragraph in the target text region and displaying an end identifier at the end position of each paragraph in the target text region.
Optionally, the text selection apparatus 80 further includes:
a third receiving module, configured to receive a third input of a start identifier and/or an end identifier of any paragraph in the target text region from a user;
a second execution module to, in response to the third input, execute at least one of:
adjusting the start position and/or the end position of any paragraph;
adjusting a start position and/or an end position of a paragraph of the target text region that is related to the second input;
increasing or decreasing paragraphs covered by the target text region.
Optionally, the text selection apparatus 80 further includes:
the fourth receiving module is used for receiving a fourth input of the user;
and the output module is used for responding to the fourth input, independently outputting the target text of each line according to each line of the target text region, or combining and outputting the target text of each line of the target text region.
The text selection device in the embodiment of the present application may be a device, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a Personal Computer (PC), a Television (TV), a teller machine, a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The text selection device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, and embodiments of the present application are not limited specifically.
The text selection apparatus 80 according to the embodiment of the present application can implement each process of the method embodiment shown in fig. 1, and can achieve the same technical effect, and is not described herein again to avoid repetition.
Optionally, as shown in fig. 9, an electronic device 90 is further provided in this embodiment of the present application, and includes a processor 91, a memory 92, and a program or an instruction stored in the memory 92 and executable on the processor 91, where the program or the instruction is executed by the processor 91 to implement each process of the above-mentioned text selection method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored, and when the program or the instruction is executed by a processor, the process of the text selection method embodiment may be implemented and the same technical effect may be achieved, and in order to avoid repetition, details are not repeated here.
Computer-readable media, which include both non-transitory and non-transitory, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a service classification device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A text selection method is applied to electronic equipment and is characterized by comprising the following steps:
receiving a first input of a user to the text display interface;
determining a first location and a second location on the text display interface in response to the first input;
determining a target text region according to the first position and the second position; wherein the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position;
and marking the target text included in the target text area.
2. The method of claim 1, wherein the target text region satisfies that a starting position of each line is associated with the first position and an ending position of each line is associated with the second position; the first position is a starting position of a starting line of the target text region, and the second position is an ending position of an ending line of the target text region; the determining a target text region according to the first location and the second location includes:
and determining the rectangular target text area by taking the connecting line of the first position and the second position as a diagonal line.
3. The method of claim 1, wherein the target text region satisfies that a start position of each paragraph is associated with the first position and an end position of an end paragraph is associated with the second position; the first position is a start position of a start paragraph of the target text region, and the second position is an end position of an end paragraph of the target text region; the determining a target text region according to the first location and the second location includes:
determining a starting position of each paragraph of the target text region according to the first position;
determining the ending positions of other paragraphs of the target text region except the ending paragraph as the ending positions of the other paragraphs relative to the text display interface.
4. The method of claim 1, wherein, in a case that the target text region satisfies that a starting position of each line is related to the first position and an ending position of each line is related to the second position, the method further comprises, after determining the target text region:
displaying a start mark at a start position of each line of the target text region, and displaying an end mark at an end position of each line of the target text region.
5. The method of claim 4, further comprising:
receiving second input of a user on a starting mark and/or an ending mark of any line of the target text area;
in response to the second input, performing at least one of:
adjusting the starting position and/or the ending position of any line;
adjusting a start position and/or an end position of a line of the target text region that is associated with the second input;
increasing or decreasing the lines covered by the target text area.
6. The method of claim 1, wherein, in the case that the target text region satisfies that a start position of each paragraph is associated with the first position and an end position of each paragraph or an end paragraph is associated with the second position, the method further comprises, after determining the target text region:
displaying a start mark at a start position of each paragraph of the target text region, and displaying an end mark at an end position of each paragraph of the target text region.
7. The method of claim 6, further comprising:
receiving a third input of a start identifier and/or an end identifier of any paragraph of the target text region from a user;
in response to the third input, performing at least one of:
adjusting the start position and/or the end position of any paragraph;
adjusting a start position and/or an end position of a paragraph of the target text region that is related to the second input;
increasing or decreasing paragraphs covered by the target text region.
8. The method according to any one of claims 1-7, further comprising:
receiving a fourth input from the user;
in response to the fourth input, independently outputting the target text of each line of the target text region according to the line of the target text region, or combining and outputting the target text of each line of the target text region.
9. A text selection device applied to electronic equipment is characterized by comprising:
the first receiving module is used for receiving a first input of a user to the text display interface;
a first determination module to determine a first location and a second location on the text display interface in response to the first input;
a second determining module, configured to determine a target text region according to the first location and the second location; wherein the target text region satisfies any one of: a starting position of each row is associated with the first position and an ending position of each row is associated with the second position; the start position of each paragraph is associated with the first position and the end position of each paragraph or end paragraph is associated with the second position;
and the marking module is used for marking the target text included in the target text region.
10. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the text selection method of any one of claims 1-8.
11. A readable storage medium, on which a program or instructions are stored, which when executed by a processor, carry out the steps of the text selection method according to any one of claims 1 to 8.
CN202111611799.4A 2021-12-27 2021-12-27 Text selection method and device, electronic equipment and readable storage medium Pending CN114265525A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111611799.4A CN114265525A (en) 2021-12-27 2021-12-27 Text selection method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111611799.4A CN114265525A (en) 2021-12-27 2021-12-27 Text selection method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114265525A true CN114265525A (en) 2022-04-01

Family

ID=80830311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111611799.4A Pending CN114265525A (en) 2021-12-27 2021-12-27 Text selection method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114265525A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324440A (en) * 2013-07-05 2013-09-25 广东欧珀移动通信有限公司 Text content selecting method utilizing multi-point touch control
CN104298437A (en) * 2013-07-15 2015-01-21 中兴通讯股份有限公司 Text selection method, device and terminal
CN106126052A (en) * 2016-06-23 2016-11-16 北京小米移动软件有限公司 Text selection method and device
CN109683798A (en) * 2018-12-28 2019-04-26 咪咕音乐有限公司 A kind of text determines method, terminal and computer readable storage medium
CN110032324A (en) * 2018-01-11 2019-07-19 华为终端有限公司 A kind of text chooses method and terminal
CN110286820A (en) * 2019-06-25 2019-09-27 掌阅科技股份有限公司 The connective marker method of eBook content, electronic equipment, storage medium
CN112748842A (en) * 2020-12-31 2021-05-04 维沃移动通信有限公司 Text selection method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103324440A (en) * 2013-07-05 2013-09-25 广东欧珀移动通信有限公司 Text content selecting method utilizing multi-point touch control
CN104298437A (en) * 2013-07-15 2015-01-21 中兴通讯股份有限公司 Text selection method, device and terminal
CN106126052A (en) * 2016-06-23 2016-11-16 北京小米移动软件有限公司 Text selection method and device
CN110032324A (en) * 2018-01-11 2019-07-19 华为终端有限公司 A kind of text chooses method and terminal
CN109683798A (en) * 2018-12-28 2019-04-26 咪咕音乐有限公司 A kind of text determines method, terminal and computer readable storage medium
CN110286820A (en) * 2019-06-25 2019-09-27 掌阅科技股份有限公司 The connective marker method of eBook content, electronic equipment, storage medium
CN112748842A (en) * 2020-12-31 2021-05-04 维沃移动通信有限公司 Text selection method and device

Similar Documents

Publication Publication Date Title
US11393017B2 (en) Two-dimensional code identification method and device, and mobile terminal
CN106484266B (en) Text processing method and device
CN109005283B (en) Method, device, terminal and storage medium for displaying notification message
US10992622B2 (en) Method, terminal equipment and storage medium of sharing user information
CN107315595B (en) Desktop layout method and device and user terminal
CN112866790A (en) Video playing method and system
US20230117213A1 (en) Page display method and electronic device
CN105745612A (en) Resizing technique for display content
CN112269519B (en) Document processing method and device and electronic equipment
CN112333240A (en) Message push display method and device, readable storage medium and computer equipment
CN111046290A (en) Advertisement processing method and device, electronic equipment and storage medium
CN112286416A (en) Information display method and device and electronic equipment
CN111694490B (en) Setting method and device and electronic equipment
CN111190677A (en) Information display method, information display device and terminal equipment
CN114756778A (en) Method, device, equipment and storage medium for page interaction
CN111159599A (en) Method, device, electronic equipment and storage medium for processing advertisement
CN113553129A (en) Interface display method, device, terminal and medium
US20160342291A1 (en) Electronic apparatus and controlling method thereof
CN111897607A (en) Application interface loading and interaction method, device and storage medium
CN114265525A (en) Text selection method and device, electronic equipment and readable storage medium
CN114968464A (en) Recent content display method, device, terminal and storage medium
CN114895815A (en) Data processing method and electronic equipment
CN114168035A (en) Application page layout adjusting method and device, electronic equipment and storage medium
CN113467671A (en) Text selection method and device, terminal equipment and readable storage medium
CN113342222A (en) Application classification method and device and electronic equipment

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