CN111460764B - Electronic book labeling method, electronic equipment and storage medium - Google Patents

Electronic book labeling method, electronic equipment and storage medium Download PDF

Info

Publication number
CN111460764B
CN111460764B CN202010236110.3A CN202010236110A CN111460764B CN 111460764 B CN111460764 B CN 111460764B CN 202010236110 A CN202010236110 A CN 202010236110A CN 111460764 B CN111460764 B CN 111460764B
Authority
CN
China
Prior art keywords
position information
text character
target text
character
region
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010236110.3A
Other languages
Chinese (zh)
Other versions
CN111460764A (en
Inventor
蔡小星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ireader Technology Co Ltd
Original Assignee
Ireader 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 Ireader Technology Co Ltd filed Critical Ireader Technology Co Ltd
Priority to CN202010236110.3A priority Critical patent/CN111460764B/en
Publication of CN111460764A publication Critical patent/CN111460764A/en
Application granted granted Critical
Publication of CN111460764B publication Critical patent/CN111460764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses an electronic book labeling method, electronic equipment and a storage medium, wherein the method comprises the following steps: analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object. By using the drawn regional graphic object, the processing mode of marking the regional graphic object word by word in the prior art is converted into the mode of marking the regional graphic object as a whole, so that the marking processing efficiency is greatly improved.

Description

Electronic book labeling method, electronic equipment and storage medium
Technical Field
The invention relates to the field of electronic book application, in particular to an electronic book labeling method, electronic equipment and a storage medium.
Background
The electronic books can be convenient for a user to read at any time and any place, after the user reads the content of the current page, the content of the next page can be read continuously through manual page turning, or the user can jump to the page where the appointed directory is located to read in a directory jumping mode, and the like, and various reading convenience is provided for the user through different reading modes.
The electronic books can be read by users, and the function of marking the electronic books by the users is provided, so that the users can conveniently select text characters in the electronic books to mark according to reading habits of the users. In the prior art, when a label is processed, generally, the label is searched in the range of all contents contained in an electronic book, and the label is processed word by word, so that the processing efficiency is low.
Disclosure of Invention
In view of the above problems, the present invention has been made to provide an electronic book labeling method, an electronic device, and a storage medium that overcome or at least partially solve the above problems.
According to one aspect of the present invention, there is provided an electronic book labeling method, including:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content;
creating a corresponding range object for at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and labeling at least one target text character according to the drawn region graphic object.
According to another aspect of the present invention, there is provided an electronic apparatus including: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the following operations:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content;
creating a corresponding range object for at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and labeling at least one target text character according to the drawn region graphic object.
According to yet another aspect of the present invention, there is provided a computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content;
creating a corresponding range object for at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and labeling at least one target text character according to the drawn region graphic object.
According to the electronic book labeling method, the electronic equipment and the storage medium, the page content displayed on the current terminal screen is analyzed, and at least one text character contained in the page content is obtained; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object. By using the drawn regional graphic object, the processing mode of marking the regional graphic object word by word in the prior art is converted into the mode of marking the regional graphic object as a whole, so that the marking processing efficiency is greatly improved. Further, in the prior art, when the content of the label is determined, the whole electronic book is taken as an object to be processed, so that the processing object is too large, and the problems of jamming, slow processing and the like are easily caused. The page content displayed on the current terminal screen is analyzed, the range marked by the user is reduced, and all the page content contained in the electronic book is reduced to the text characters contained in the page content displayed on the current terminal screen, so that the problems of jamming and the like caused by a large range contained in a processed object in operation are solved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow chart illustrating an electronic book labeling method according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating an electronic book labeling method according to another embodiment of the present invention;
FIG. 3 is a flow chart illustrating an electronic book labeling method according to another embodiment of the present invention;
fig. 4 shows a schematic structural diagram of an electronic device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a flow chart illustrating an electronic book labeling method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content.
When a user marks an electronic book, the page content displayed on the current terminal screen is generally marked, and the page content displayed on the current terminal screen also contains other characters except text characters, such as tag characters of a page, characters related to style display and the like, and the characters are irrelevant to user marking. If all characters of the electronic book are processed when the user triggers the selection operation request, the problems of jamming, slow processing and the like are caused when the selection operation request is processed due to a large processing object range. Therefore, in this embodiment, the page content displayed on the current terminal screen is analyzed to obtain at least one text character included in the page content, the range labeled by the user is narrowed, and the entire page content included in the electronic book is narrowed to the text character included in the page content displayed on the current terminal screen, so as to solve the problems of jamming and the like caused by a large range included in the processed object during the operation.
Specifically, the content of the page displayed on the current terminal screen is analyzed to obtain at least one i-level text node contained in the content of the page, wherein i is greater than or equal to 1. Here, the text node is a node in which text characters are included in the node. For example, the < div > weather is good today, the < div > node contains a text character of "weather is good today", and the < div > node is a text node. The page content can contain a plurality of text nodes, and sometimes the text nodes can also contain text nodes at the lower level, such as < div > < p > weather is good today, Beijing highest temperature 24 degrees </div >, and for the < div > text nodes at the first level, the page content also contains two < p > text nodes at the second level. All text nodes displayed in the current terminal screen can be obtained by traversing the page content displayed in the current terminal screen in an extensive manner.
After the text nodes are obtained, traversing all the text nodes from the first-level text node, and judging whether the number of text characters contained in at least one i-level text node (starting from i to 1) is larger than or equal to a preset number. The predetermined number may be set according to the implementation and the processing efficiency, for example, the predetermined number is 2000. When the number of the text characters contained in at least one i-level text node is judged to be less than the preset number 2000, the text characters contained in at least one i-level text node can be directly stored in a preset character array. If the number of the text characters contained in at least one i-level text node is judged to be greater than or equal to the preset number 2000, the i-level text node is further traversed downwards to reduce the number of the text characters contained in the i-level text node. And obtaining at least one i + 1-level text node in a downward traversal manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, continuously repeating the downward traversal to obtain the i + 2-level and i + 3-level text nodes, judging the number of text characters contained in the i + 2-level and i + 3-level text nodes until the number of text characters contained in the obtained text nodes is smaller than the preset number, and storing at least one text character contained in the text nodes to a preset character array. The text characters stored in the preset character array are used as at least one text character contained in the page content, the text characters are conveniently and directly processed according to the text characters stored in the preset character array, the text nodes where the text characters are located are accurately determined, the processing of all characters in the page content is converted into the processing of the text characters contained in the text nodes, and the processing magnitude is greatly reduced.
Further, in this embodiment, for the electronic book, the chapter contents in the electronic book may be written into the designated variable of the HTML file in a character string form, the designated variable is inserted into the target container of the HTML file, and the content in the designated variable in the target container is subjected to page rendering by using the browser kernel, so as to complete page display of the electronic book. Because the electronic book is subjected to paging display in an HTML file mode, the page content displayed by the HTML file on the current terminal screen can be conveniently and quickly acquired, and the text node in the page content is acquired.
Step S102, a corresponding range object is established for at least one text character, and the position information of the range object is obtained.
After determining at least one text character contained in the page content, it is further required to create a range object corresponding to each text character one by one, and record position information of the range object. The Range object can be created by adopting a Range interface in JavaScript, so that the Range object can be conveniently and directly set in an electronic book displayed in an HTML file mode, and the position information of the Range object is determined; alternatively, other ways may be used to establish the range objects corresponding to the text characters one by one, and the position information of the range objects is stored after establishment.
For the position information of the range object, a coordinate system can be established in the current terminal screen by taking the page turning direction of the electronic book as a transverse coordinate axis and taking the direction vertical to the transverse coordinate axis as a longitudinal coordinate axis, so that the position information of the range object can be accurately determined according to the coordinate position of the coordinate system. The origin of the coordinate system may be any position in the current terminal screen as the origin, and the region graphic object may be drawn without affecting the position information of the range object and the position information of the subsequent range object. For convenience of understanding, the present embodiment is described herein with the lower left corner of the current terminal screen as the origin, the page turning direction of the electronic book being the right direction, that is, the left and right directions of the current terminal screen being the horizontal coordinate axis, and the up and down directions of the current terminal screen being the vertical coordinate axis.
The position information of the range object includes height information, width information of the range object, and coordinate position information of the at least one text character in the coordinate system. The height information and the width information are determined according to the text characters, and the height information and the width information of the range object are determined according to the height information and the width information of the text characters in the coordinate system. And determining the coordinate position information of the text character in the coordinate system according to the horizontal coordinate position of the text character in the horizontal coordinate axis and the vertical coordinate position of the text character in the vertical coordinate axis of the coordinate system.
Step S103, receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of the range object corresponding to the at least one target text character.
The user can complete the marking processing and the like of the selected target text characters by carrying out selection operation on the text characters in the page content displayed on the current terminal screen. When receiving an operation request for selecting at least one target text character triggered by a user, drawing a region graphic object of the at least one target text character according to the position information accumulation of the range object and the determined position information of the range object of the selected at least one target text character. Specifically, if an operation request for selecting at least one target text character triggered by a user is made, the selected target text character is "air temperature", and a region graphic object including the text character "air temperature" can be drawn according to the position information of the range object corresponding to the text characters "air" and "temperature".
The position of the region graphic object may be determined according to the position information of the range object corresponding to the target text character. For example, the region graphic object may be an XML polygonal graphic object based on an XML markup language, such as a polygon graphic object, the position of the region graphic object may be recorded by using a points attribute thereof, the point attribute forms a closed polygon shape by using a group of straight line segments connected end to end, and the points attribute records the coordinate position information of the line segment end points of the group of straight line segments. When the method is embodied in an electronic book, a polygon object is a closed quadrilateral shape (a rectangular shape or a square shape) formed by a group of straight line segments which are connected end to end. For drawing the region graphic object containing the text character 'air temperature', the region graphic object is considered to draw a straight line segment from the lower left corner of 'air' to the upper left corner of 'air', then draw a straight line segment from the upper left corner of 'air' to the upper right corner of 'temperature', then draw a straight line segment from the upper right corner of 'temperature' to the lower left corner of 'air', and then draw a straight line segment from the lower right corner of 'temperature' to the lower left corner of 'air', so as to obtain the closed quadrilateral region graphic object. For the drawn region graphic object, the points attribute of the graphic object is recorded from the position coordinate of the lower left corner of 'gas', and the position coordinate of the upper left corner of 'gas', the position coordinate of the upper right corner of 'temperature' and the position coordinate of the lower right corner of 'temperature' are recorded in sequence. Taking the text character "qi" as an example, the position information of the corresponding range object includes height information of "qi," width information of "qi," and coordinate position information of "qi. The horizontal coordinate position and the vertical coordinate position of the 'qi' in the coordinate system can record the position coordinate of the lower left corner of the 'qi', and the position coordinate of the upper left corner of the 'qi' can be obtained by accumulating the height information of the 'qi'.
Further, the received operation request for selecting at least one target text character triggered by the user may also carry boundary information of the selected region. The boundary information includes start point position information of a start point of the selected operation in the coordinate system and end point position information of an end point of the selected operation in the coordinate system. Such as start point position information (0, 15) and end point position information (15, 18) in the boundary information. By the start point position information and the end point position information in the boundary information, it can be determined whether the position information of the scope object of the at least one target text character is located in the boundary information. If the horizontal coordinate position of the text character "qi" is 12, the vertical coordinate position is 15, the width information of the range object is 2, and the height information of the range object is 2, it can be determined that the position information of the range object corresponding to the text character "qi" is located in the boundary information. For target text characters for which the position information of the range object of the target text character is located in the boundary information, the target text characters may be stored into a target array. And drawing the region graphic object of the selected target text character according to the target text character stored in the target array.
Further, when the difference between the vertical coordinate position information of the start position information and the vertical coordinate position information of the end position information is not the entire height of one or more text characters, it may be impossible to accurately determine whether the position information of the range object of the target text character is located in the boundary information during line crossing. In the prior art, when determining, whether to cross a line needs to be determined according to whether the difference between the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information reaches an entire line height (or text character height). When the longitudinal coordinate position information of the starting point position information of the selection operation of the user is located at the middle position of the 3 rd row, and the longitudinal coordinate position information of the ending point position information of the selection operation of the user is located at the middle position of the 2 nd row, the cross-row selection operation of the target text character in the 3 rd row can be realized, and the selection operation mode is obviously inflexible and inflexible. In this embodiment, whether the position information of the range object of the at least one target text character reaches the preset line-crossing threshold value is determined according to the longitudinal coordinate position information of the start position information, the longitudinal coordinate position information of the end position information, and the longitudinal coordinate position information and the height information of the range object of the at least one target text character, so as to determine that the position information of the range object of the at least one target text character is located in the boundary information. The preset line crossing threshold may be determined by height information or line height of the range object, for example, the preset line crossing threshold is 50% of the height information of the range object. In this embodiment, when the longitudinal coordinate position information of the start position information of the selection operation by the user is located at the middle position of the 3 rd row, and when it is determined that the longitudinal coordinate position information of the end position information of the selection operation by the user is located at the bottom position of the 2 nd row, it is determined that the range object of the target text character located on the 3 rd row has reached the preset cross-row critical value according to the longitudinal coordinate position information and the height information of the range object of the target text character located on the 3 rd row, and it is determined that the position information of the range object of the target text character located on the 3 rd row is located in the boundary information, so that the cross-row selection operation on the target text character in the 3 rd row can be realized, and the cross-row operation is more sensitive.
Furthermore, after the user triggers and selects the operation request, the drawn region graphic object can be continuously dragged, and the range of the drawn region graphic object is enlarged. After a dragging request for the area graphic object triggered by a user is received, the boundary information needs to be updated according to dragging coordinate position information carried by the dragging request. When updating the boundary information, in order to guarantee the response speed to the drag request, updating the boundary information may be accomplished using a preset variable. Specifically, for example, preset variables boundary1 and boundary2, boundary1 and boundary2 are used, wherein boundary1 and boundary2 record drag coordinate position information in real time during dragging, and boundary1 and boundary2 initially copy coordinate position information of boundary1 and boundary2 to perform rounding correction processing, so that the problem of accuracy caused by decimal points and slow response caused by frequently acquiring drag coordinate position information is reduced. In the dragging process, the start point position information and the end point position information may be alternated, and if the alternation is processed, the calculation amount is large. At this time, a certain preset variable may be specified to be specially used for recording the start point and the end point of the boundary after dragging, for example, the _ boundary1 always records the position information of the start point after dragging, and the _ boundary2 always records the position information of the end point after dragging, so that the start point and the end point of the boundary after dragging can be determined according to the position information of the dragging coordinate after rounding and correction, and the start point position information and the end point position information of the boundary information can be updated directly according to the start point and the end point of the boundary after dragging. That is, the start position information of the boundary information is updated directly from the _ boundary1, and the end position information of the boundary information is updated directly from the _ boundary2, thereby reducing the amount of calculation of the boundary information. Here, after the drag request updates the boundary information, the region graphic object of at least one target text character is drawn according to the updated boundary information and the position information of the range object of the target text character to secure consistency of the boundary information with the drawn region graphic object. Specifically, according to the boundary information updated by the drag request, the target text characters stored in the target array can be traversed, further judgment is performed according to the position information of the range object corresponding to the target text characters and the updated boundary information, the position information of the range object of the target text characters is determined to be located in the updated boundary information, and the target text characters are stored in the target array. And redrawing the region graphic object of the selected target text character according to the target text character stored in the updated target array. When the region graphic objects are redrawn, the originally drawn region graphic objects can be directly deleted, and the deletion of one region graphic object by taking a single text character as a processing object is not needed, so that the dragging request can be responded more quickly, and the processing efficiency is improved.
And step S104, labeling at least one target text character according to the drawn region graphic object.
After the regional graphic object is obtained through drawing, at least one target text character in the regional graphic object can be labeled, labeling processing comprises highlighting, marking, adding ideas and the like, the text character does not need to be concerned during labeling processing, the regional graphic object can be directly operated, labeling processing of at least one target text character in the regional graphic object is completed, processing of a single target text character of a processing object is converted into processing of the regional graphic object, and labeling processing efficiency is greatly improved.
Further, for the page content displayed on the current terminal screen, if the user has performed annotation processing on some text characters of the current terminal screen, that is, when the page content displayed on the current terminal screen has the annotated target text characters, at this time, when the user clicks other text characters that are not annotated, the user needs to process the clicking operation of the user, and the annotated target text characters are cancelled. In the prior art, when processing, the labeled target text characters need to be obtained again to cancel the labeling, and the processing efficiency is low. The embodiment can create the area container object with the same size as the current terminal screen display area; at least one rendered region graphic object is contained in the region container object. When the click operation triggered by a user is received, and the coordinate position information of the click operation is judged not to be located in the position information of at least one drawn regional graphic object contained in the regional container object, the regional container object is directly obtained, the at least one terminal screen drawn regional graphic object contained in the regional container object is removed, and the single text character is not required to be used as the object to be processed one by one.
In order to better understand the present invention, in this embodiment, a left-to-right mode is taken as an example for explaining when text characters are displayed on a current terminal screen in an electronic book, but the present invention is not limited to the above display modes, and may be applied to display modes in any direction, such as right-to-left, top-to-bottom, and the like.
According to the electronic book labeling method provided by the invention, the page content displayed on the current terminal screen is analyzed to obtain at least one text character contained in the page content; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object. By using the drawn regional graphic object, the processing mode of marking the regional graphic object word by word in the prior art is converted into the mode of marking the regional graphic object as a whole, so that the marking processing efficiency is greatly improved. Further, in the prior art, when the content of the label is determined, the whole electronic book is taken as an object to be processed, so that the processing object is too large, and the problems of jamming, slow processing and the like are easily caused. The page content displayed on the current terminal screen is analyzed, the range marked by the user is reduced, and all the page content contained in the electronic book is reduced to the text characters contained in the page content displayed on the current terminal screen, so that the problems of jamming and the like caused by a large range contained in a processed object in operation are solved.
Example two
Fig. 2 is a schematic flow chart of an electronic book labeling method according to another embodiment of the present invention, as shown in fig. 2, the method includes the following steps:
step S201, analyzing the page content displayed on the current terminal screen to obtain at least one text character included in the page content.
Step S202, a corresponding range object is created for at least one text character, and position information of the range object is obtained.
Step S203, receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of the range object corresponding to the at least one target text character.
The above steps refer to the description of steps S101 to S103 in the first embodiment of fig. 1, and are not described again here.
Step S204, according to the drawn region graphic object, setting a filling parameter of the region graphic object so as to highlight at least one target text character.
After the regional graphic object is obtained through drawing, when at least one target text character is highlighted, the filling parameters of the regional graphic object are directly set without highlighting the single target text character one by one, and the at least one target text character can be highlighted in response to a selection operation request triggered by a user. Specifically, the region graphic object may be drawn by polygon, and highlight color is filled by setting a style attribute of polygon, so that the target text characters in the range of the polygon region graphic object are highlighted.
Further, in the present embodiment, an area container object having the same size as the display area of the current terminal screen is also created, for example, created by using svg, and the width information and the height information of svg are set to be the same as those of the display area of the current terminal screen. The svg region container object contains a polygon region graphic object. When the user clicks other areas of the non-highlighted text characters, the coordinate position information of the user clicking operation can be obtained, and when the coordinate position information of the clicking operation is judged not to be located in the position information of the drawn polygon area graphic object contained in the svg area container object, the drawn polygon area graphic object contained in the svg area container object can be directly removed without processing by taking a single text character as an object one by one.
According to the electronic book labeling method provided by the invention, according to the drawn region graphic object, the target text characters in the region graphic object can be directly highlighted by setting the filling parameters of the region graphic object without changing the target text characters, so that the highlighting processing efficiency is improved, and the whole electronic book labeling method is convenient to remove when highlighting is cancelled.
EXAMPLE III
Fig. 3 is a flowchart illustrating an electronic book labeling method according to another embodiment of the present invention, as shown in fig. 3, the method includes the following steps:
step S301, analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content.
Step S302, a corresponding range object is created for at least one text character, and the position information of the range object is obtained.
Step S303, receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of the range object corresponding to the at least one target text character.
The above steps refer to the description of steps S101 to S103 in the first embodiment of fig. 1, and are not described again here.
And step S304, performing line drawing processing on at least one target text character by taking the region graphic object as a unit according to the drawn region graphic object.
After drawing the corresponding area graphic object in accordance with the selection operation request of the user, the scribing process may be performed in accordance with the position information included in the area graphic object, with the area graphic object as a whole. Specifically, a scribe object is created from a polygon region graphic object, such as a plurality of pieces of coordinate information included in the polygon region graphic object. Such as line scribing the object line. The line scribing object line directly determines two ends of a line segment from a plurality of points of coordinate information contained in the polygon area graphic object, and connects the two ends of the line segment corresponding to the point coordinate information to obtain the line segment, so that scribing processing can be finished by taking the area graphic object as a unit. For example, the coordinate information of points included in the points attribute in the polygon region graphic object is the position coordinate of the lower left corner of 'qi', the position coordinate of the upper right corner of 'temperature' and the position coordinate of the lower right corner of 'temperature'. Taking the page content display mode as left-to-right display as an example, the scribing process can be completed directly according to the position coordinate of the lower left corner of the 'gas' and the position coordinate of the lower right corner of the 'temperature'. In specific implementation, appropriate point coordinate information can be selected from the region graphic object to perform scribing according to the page content display mode. Here, the line drawing objects correspond to the region graphic objects one to one, the length information of the line drawing objects is set according to the horizontal coordinate position information of the region graphic objects, and the position information of the line drawing objects is set for the vertical coordinate position information of the region graphic objects (for example, the vertical coordinate position information at the bottom of the recorded text characters of the region graphic objects).
Further, when drawing the region graphic object, the region graphic object may be a plurality of region graphic objects, each region graphic object including the target text character located in the same line, which facilitates the line drawing process in line units during the line drawing process. When a plurality of region graphic objects are provided, that is, when a plurality of lines of target text characters are included in the across lines, it is determined whether the drawn longitudinal coordinate position information of the plurality of region graphic objects is consistent when the target text characters of the plurality of lines are scribed, so as to trigger the across-line scribing. Specifically, for example, 2 area graphic objects are scribed according to the point coordinate information of the first area graphic object, and then it is determined whether the vertical coordinate position information of the point coordinate information of the second area graphic object is consistent with the vertical coordinate position information of the point coordinate information of the first area graphic object, and if not, it is determined that the second area graphic object is not in the same row as the first area graphic object, and scribing needs to be performed across rows. And performing line-crossing scribing treatment according to the point coordinate information of the second area graphic object to realize line-by-line scribing on the target text character in line units.
Further, the present embodiment is to perform the scribing process on the target text character based on the selected operation request, and performs the scribing process based on the position information of the area graphic object. However, when the blank character is at the line-feed position, the problem of abnormal width and height of the blank character occurs during line feed, so that the height information, width information and the like of the blank character at the line feed position are inconsistent with those of other target text characters in the same line, and the point coordinate information of the region-based graphic object cannot accurately feed back that the target text characters included in the region-based graphic object are in the same line. Therefore, in the embodiment, when step S303 is executed, it is further required to determine whether at least one target text character is a blank character, if so, the blank character is skipped, and the blank character is not included in the region graphic object, so as to avoid the problem of inaccurate line crossing and line drawing. Here, blank characters that do not affect line feed may not be processed. For the page content displayed on the current terminal screen in the HTML file, the blank characters at the beginning of the text node and the blank characters at the last line of the text node in the page content do not relate to line feed and can not be processed.
Further, for the target text character subjected to the ruling processing, when a long-press operation request for marking the target text character subjected to the ruling processing triggered by a user is received, for example, the user performs processes such as adding ideas to the target text character subjected to the ruling processing, in order to remind the user of the currently selected target text character, the user can conveniently confirm the target text character, filling parameters of an area graphic object corresponding to the target text character subjected to the ruling processing can be set, the target text character subjected to the ruling processing is highlighted, and the user can confirm whether operations such as adding ideas, ruling cancellation and sharing are performed on the target text character subjected to the highlighting processing.
In order to ensure that the long press operation request of the target text character can be normally triggered, or in order to facilitate the user to perform other processing on the whole target text character subjected to line drawing processing, a line drawing area object can be created for the target text character subjected to line drawing processing. And creating a drawing area object according to the area graphic object of the target text character subjected to drawing processing, and creating a drawing area object for the area graphic objects in the same line. Specifically, if the area graphic object is one, that is, only includes the target text characters located on the same line, the height information of the area graphic object is scribed (the difference value of the vertical coordinate position information of the area graphic object), and the width information of the scribe area object is the width information of the area graphic object (the difference value of the horizontal coordinate position information of the area graphic object); when the number of the area graphic objects is plural, the vertical coordinate position information of the plural area graphic objects is the same, that is, when the plural area graphic objects are all the area graphic objects in the same row, the height information of the scribe line area object is the height information of any one area graphic object (the difference value of the vertical coordinate position information of the area graphic object), and the width information of the scribe line area object is the sum of the width information of the plural area graphic objects (the difference value of the horizontal coordinate position information of the area graphic object). If there are a plurality of area graphic objects, the vertical coordinate position information of the plurality of area graphic objects is different, and when the scribing processing is performed across lines, a new scribing area object is created for the area graphic object after the line is crossed. And for the scribing region object, the height information of the scribing region object enables the scribing region object to cover the height of the target text character, and when the user clicks the blank region outside the two scribing objects, the user can be accurately positioned according to the scribing region object to respond to the clicking operation of the user.
For the whole operation of the marking area object, such as long-press operation, the marking area object svg is set with pointer-events: none attribute, the response capability of the marking area object svg to events is shielded, the whole normal response of the target text character subjected to marking processing to the long-press operation is ensured, and the long-press operation request is processed. For the click operation of the whole target text character subjected to line drawing processing, as the click operation is carried out from the start of clicking to the end of clicking, the point-events-none attribute of the object svg in the line drawing area can be dynamically removed when the clicking is finished, so that the whole target text character subjected to line drawing processing can normally respond to the click event, and the normal response of various operations of the whole object in the line drawing area is facilitated.
Further, the marking of the marking area object can be set corresponding to the marking area object, and the marking area objects of the same marking process have the same marking. When the subsequent operation of the user removes the ruling of some text characters or adds the ruling of some text characters, the same marking area object can be searched according to the marking of the ruling area object, and the corresponding ruling is fused, deleted and the like.
According to the electronic book labeling method provided by the invention, the drawing processing is carried out by drawing the region graphic object in units, and compared with the drawing processing of drawing the text characters one by one, the performance of the drawing processing can be greatly improved. When the line drawing processing involves line crossing, the line crossing line drawing processing can be conveniently carried out by judging the longitudinal coordinate position information of the drawn multiple region graphic objects, and line-by-line drawing is carried out on at least one target text character in line units.
Example four
The fourth embodiment of the present application provides a non-volatile computer storage medium, where the computer storage medium stores at least one executable instruction, and the computer executable instruction may execute the electronic book labeling method in any of the above method embodiments.
The executable instructions may be specifically configured to cause the processor to: analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object.
In an alternative embodiment, the executable instructions further cause the processor to: receiving a selection operation request of at least one target text character triggered by a user; the selected operation request carries boundary information of the selected area; judging whether the position information of the range object of at least one target text character is positioned in the boundary information or not according to the boundary information; if yes, storing at least one target text character into a target array; and drawing the regional graphic object of the at least one target text character according to the at least one target text character stored in the target array.
In an alternative embodiment, the executable instructions further cause the processor to: establishing a coordinate system by taking the page turning direction of the electronic book as a transverse coordinate axis and taking the direction vertical to the transverse coordinate axis as a longitudinal coordinate axis in the current terminal screen; the position information comprises height information and width information of the range object and coordinate position information of at least one text character in a coordinate system; the boundary information comprises starting point position information of a starting point of the selected operation in the coordinate system and end point position information of an end point of the selected operation in the coordinate system; judging whether the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information and the vertical coordinate position information and the height information of the range object of at least one target text character reach a preset line-crossing critical value or not; and if so, judging that the position information of the range object of at least one target text character is positioned in the boundary information.
In an alternative embodiment, the executable instructions further cause the processor to: receiving a dragging request for a regional graphic object triggered by a user, wherein the dragging request carries dragging coordinate position information; and updating the boundary information according to the position information of the dragging coordinate.
In an alternative embodiment, the executable instructions further cause the processor to: recording the position information of the dragging coordinate in real time by using a preset variable, and carrying out rounding correction processing on the position information of the dragging coordinate; and determining the starting point and the end point of the boundary after dragging according to the position information of the dragged coordinate after rounding and correction, and updating the position information of the starting point and the position information of the end point of the boundary information.
In an alternative embodiment, the executable instructions further cause the processor to: step S1, analyzing the page content displayed by the current terminal screen to obtain at least one i-level text node contained in the page content; the text node is a node containing text characters; i is greater than or equal to 1; step S2, determining whether the number of text characters contained in at least one i-level text node is greater than or equal to a preset number, if so, executing step S3, otherwise, executing step S4; step S3, obtaining at least one i + 1-level text node in a downward traversing manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, repeatedly executing the step S3 until the number of the text characters contained in the obtained text node is smaller than the preset number, and storing the at least one text character contained in the text node to a preset character array; step S4, storing the text characters contained in at least one i-level text node into a preset character array; step S5, the text characters stored in the preset character array are used as at least one text character included in the page content.
In an alternative embodiment, the executable instructions further cause the processor to: creating an area container object with the same size as a display area of a current terminal screen; the region container object contains at least one rendered region graphic object; receiving a click operation triggered by a user, and judging whether the coordinate position information of the click operation is located in the position information of at least one drawn region graphic object contained in the region container object; if not, removing at least one drawn region graphic object contained in the region container object.
In an alternative embodiment, the executable instructions further cause the processor to: and setting filling parameters of the region graphic object according to the drawn region graphic object so as to highlight at least one target text character.
In an alternative embodiment, the executable instructions further cause the processor to: and according to the drawn region graphic object, performing line drawing processing on at least one target text character by taking the region graphic object as a unit.
In an alternative embodiment, the executable instructions further cause the processor to: judging whether the longitudinal coordinate position information of the drawn graphic objects in the plurality of areas is consistent or not; if not, performing line-crossing scribing processing according to the drawn multiple region graphic objects, and performing line-by-line scribing on at least one target text character in line units; the number of the area graphic objects is multiple; each region graphical object contains target text characters located on the same line.
In an alternative embodiment, the executable instructions further cause the processor to: a line object and/or a line area object is created from the area graphical object of the target text character for the line process.
In an alternative embodiment, the executable instructions further cause the processor to: receiving an operation request for selecting at least one target text character triggered by a user, and judging whether the at least one target text character is a blank character; if so, skipping at least one target text character.
In an alternative embodiment, the executable instructions further cause the processor to: receiving a long press operation request which is triggered by a user and is used for marking the target text character which is subjected to line drawing, and setting filling parameters of the area graphic object corresponding to the target text character subjected to line drawing so as to highlight the target text character subjected to line drawing.
In an alternative embodiment, the rendered region graphical object is a polygonal graphical object in XML.
EXAMPLE five
Fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the electronic device.
As shown in fig. 4, the electronic device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
The processor 402 is configured to execute the program 410, and may specifically execute the relevant steps in the above-described electronic book labeling method embodiment.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU or an application Specific Integrated circuit asic or one or more Integrated circuits configured to implement embodiments of the present invention. The server comprises one or more processors, which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be configured to cause the processor 402 to perform the following operations: analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object.
In an alternative embodiment, program 410 is configured to cause processor 402 to receive a user-triggered selection action request for at least one target text character; the selected operation request carries boundary information of the selected area; judging whether the position information of the range object of at least one target text character is positioned in the boundary information or not according to the boundary information; if yes, storing at least one target text character into a target array; and drawing the regional graphic object of the at least one target text character according to the at least one target text character stored in the target array.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to establish a coordinate system in the current terminal screen by taking the page turning direction of the ebook as a horizontal coordinate axis and taking a direction perpendicular to the horizontal coordinate axis as a vertical coordinate axis; the position information comprises height information and width information of the range object and coordinate position information of at least one text character in a coordinate system; the boundary information comprises starting point position information of a starting point of the selected operation in the coordinate system and end point position information of an end point of the selected operation in the coordinate system; judging whether the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information and the vertical coordinate position information and the height information of the range object of at least one target text character reach a preset line-crossing critical value or not; and if so, judging that the position information of the range object of at least one target text character is positioned in the boundary information.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to receive a drag request for a region graphic object, where the drag request is triggered by a user and carries drag coordinate position information; and updating the boundary information according to the position information of the dragging coordinate.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to record the drag coordinate position information in real time by using a preset variable, and perform rounding correction processing on the drag coordinate position information; and determining the starting point and the end point of the boundary after dragging according to the position information of the dragged coordinate after rounding and correction, and updating the position information of the starting point and the position information of the end point of the boundary information.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to, step S1, parse the page content displayed on the current terminal screen to obtain at least one i-level text node included in the page content; the text node is a node containing text characters; i is greater than or equal to 1; step S2, determining whether the number of text characters contained in at least one i-level text node is greater than or equal to a preset number, if so, executing step S3, otherwise, executing step S4; step S3, obtaining at least one i + 1-level text node in a downward traversing manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, repeatedly executing the step S3 until the number of the text characters contained in the obtained text node is smaller than the preset number, and storing the at least one text character contained in the text node to a preset character array; step S4, storing the text characters contained in at least one i-level text node into a preset character array; step S5, the text characters stored in the preset character array are used as at least one text character included in the page content.
In an alternative embodiment, program 410 is operative to cause processor 402 to create a region container object of the same size as the current terminal screen display region; the region container object contains at least one rendered region graphic object; receiving a click operation triggered by a user, and judging whether the coordinate position information of the click operation is located in the position information of at least one drawn region graphic object contained in the region container object; if not, removing at least one drawn region graphic object contained in the region container object.
In an alternative embodiment, program 410 is operative to cause processor 402 to set a fill parameter for a region graphical object based on a rendered region graphical object to highlight at least one target text character.
In an alternative embodiment, the program 410 is configured to cause the processor 402 to scribe at least one target text character in units of a region graphic object according to the drawn region graphic object.
In an alternative embodiment, the program 410 is configured to cause the processor 402 to determine whether the vertical coordinate position information of the rendered plurality of region graphic objects is consistent; if not, performing line-crossing scribing processing according to the drawn multiple region graphic objects, and performing line-by-line scribing on at least one target text character in line units; the number of the area graphic objects is multiple; each region graphical object contains target text characters located on the same line.
In an alternative embodiment, the program 410 is operative to cause the processor 402 to create a stroke object and/or a stroke area object from a region graphical object of a target text character for a stroke process.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to receive a user-triggered selection operation request of at least one target text character, and determine whether the at least one target text character is a blank character; if so, skipping at least one target text character.
In an alternative embodiment, the program 410 is configured to enable the processor 402 to receive a user-triggered long press request for a target text character marked as a underlined text character, and set a filling parameter of a region graphic object corresponding to the underlined text character to highlight the underlined text character.
In an alternative embodiment, the rendered region graphical object is a polygonal graphical object in XML.
For specific implementation of each step in the program 410, reference may be made to corresponding descriptions in corresponding steps in the above-mentioned electronic book labeling embodiment, which is not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
By the scheme provided by the embodiment, the page content displayed on the current terminal screen is analyzed to obtain at least one text character contained in the page content; creating a corresponding range object for at least one text character to obtain position information of the range object; receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character; and labeling at least one target text character according to the drawn region graphic object. By using the drawn regional graphic object, the processing mode of marking the regional graphic object word by word in the prior art is converted into the mode of marking the regional graphic object as a whole, so that the marking processing efficiency is greatly improved. Further, in the prior art, when the content of the label is determined, the whole electronic book is taken as an object to be processed, so that the processing object is too large, and the problems of jamming, slow processing and the like are easily caused. The page content displayed on the current terminal screen is analyzed, the range marked by the user is reduced, and all the page content contained in the electronic book is reduced to the text characters contained in the page content displayed on the current terminal screen, so that the problems of jamming and the like caused by a large range contained in a processed object in operation are solved.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (42)

1. An electronic book labeling method, comprising:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; the method comprises the steps that chapter contents in the electronic book are written into a designated variable of an HTML file in a character string mode, the designated variable is inserted into a target container of the HTML file, content in the designated variable in the target container is subjected to paging rendering by utilizing a browser kernel, the electronic book is subjected to paging display in an HTML file mode, and page contents displayed by the HTML file on a current terminal screen are obtained;
creating a corresponding range object for the at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and operating the region graphic object according to the drawn region graphic object so as to finish the labeling processing of at least one target text character.
2. The method of claim 1, wherein the receiving a user-triggered selection operation request for at least one target text character, and drawing a regional graphic object of the at least one target text character according to position information of a scope object corresponding to the at least one target text character further comprises:
receiving a selection operation request of at least one target text character triggered by a user; the selected operation request carries boundary information of a selected area;
judging whether the position information of the range object of the at least one target text character is positioned in the boundary information or not according to the boundary information;
if yes, storing the at least one target text character into a target array;
and drawing a region graphic object of the at least one target text character according to the at least one target text character stored in the target array.
3. The method of claim 2, wherein the method further comprises:
establishing a coordinate system by taking the page turning direction of the electronic book as a transverse coordinate axis and taking the direction vertical to the transverse coordinate axis as a longitudinal coordinate axis in the current terminal screen;
the position information comprises height information and width information of the range object and coordinate position information of the at least one text character in a coordinate system; the boundary information comprises starting point position information of a starting point of the selected operation in a coordinate system and end point position information of an end point of the selected operation in the coordinate system;
the judging whether the position information of the range object of the selected text character is positioned in the boundary information according to the boundary information further comprises:
judging whether the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information and the vertical coordinate position information and the height information of the range object of at least one target text character reach a preset line-crossing critical value or not;
and if so, judging that the position information of the range object of at least one target text character is positioned in the boundary information.
4. The method of claim 3, wherein the method further comprises:
receiving a dragging request for the region graphic object, wherein the dragging request is triggered by a user and carries dragging coordinate position information;
and updating the boundary information according to the dragging coordinate position information.
5. The method of claim 4, wherein the updating the boundary information according to the drag coordinate position information further comprises:
recording dragging coordinate position information in real time by using a preset variable, and carrying out rounding correction processing on the dragging coordinate position information;
and determining the starting point and the end point of the boundary after dragging according to the position information of the dragged coordinate after rounding and correction, and updating the position information of the starting point and the position information of the end point of the boundary information.
6. The method according to any one of claims 1-5, wherein the parsing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content further comprises:
step S1, analyzing the page content displayed by the current terminal screen to obtain at least one i-level text node contained in the page content; the text node is a node containing text characters; i is greater than or equal to 1;
step S2, determining whether the number of text characters included in the at least one i-level text node is greater than or equal to a preset number, if so, executing step S3, and if not, executing step S4;
step S3, obtaining at least one i + 1-level text node in a downward traversing manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, repeatedly executing the step S3 until the number of the text characters contained in the obtained text node is smaller than the preset number, and storing the at least one text character contained in the text node to a preset character array;
step S4, storing text characters contained in the at least one i-level text node into a preset character array;
step S5, the text characters stored in the preset character array are used as at least one text character included in the page content.
7. The method according to any one of claims 1-5, wherein the method further comprises:
creating an area container object with the same size as a display area of a current terminal screen; the region container object contains at least one rendered region graphical object;
receiving a click operation triggered by a user, and judging whether the coordinate position information of the click operation is located in the position information of at least one drawn region graphic object contained in the region container object;
if not, removing at least one drawn region graphic object contained in the region container object.
8. The method of any of claims 1-5, wherein said operating on a region graphical object to complete annotation processing of at least one target text character according to a rendered region graphical object further comprises:
and setting filling parameters of the region graphic object according to the drawn region graphic object so as to highlight at least one target text character.
9. The method of any of claims 1-5, wherein said operating on a region graphical object to complete annotation processing of at least one target text character according to a rendered region graphical object further comprises:
and according to the drawn region graphic object, performing line drawing processing on at least one target text character by taking the region graphic object as a unit.
10. The method of claim 9, wherein the area graphic object is plural; each regional graphical object contains target text characters located on the same line;
the scribing at least one target text character in units of the region graphic object according to the drawn region graphic object further comprises:
judging whether the longitudinal coordinate position information of the drawn graphic objects in the plurality of areas is consistent or not;
if not, performing line-crossing scribing according to the drawn multiple area graphic objects, and performing line-by-line scribing on at least one target text character in line units.
11. The method of claim 9, wherein the method further comprises:
a line object and/or a line area object is created from the area graphical object of the target text character for the line process.
12. The method of claim 9, wherein the receiving a user-triggered selection operation request for at least one target text character, and drawing a regional graphic object of the at least one target text character according to the position information of the scope object corresponding to the at least one target text character further comprises:
receiving an operation request for selecting at least one target text character triggered by a user, and judging whether the at least one target text character is a blank character;
and if so, skipping the at least one target text character.
13. The method of claim 9, wherein the method further comprises:
receiving a long press operation request which is triggered by a user and is used for marking the target text character which is subjected to line drawing, and setting filling parameters of the area graphic object corresponding to the target text character subjected to line drawing so as to highlight the target text character subjected to line drawing.
14. The method of any of claims 1-5, wherein the rendered region graphical object is a polygon graphical object of XML.
15. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; the method comprises the steps that chapter contents in an electronic book are written into a designated variable of an HTML file in a character string mode, the designated variable is inserted into a target container of the HTML file, content in the designated variable in the target container is subjected to page rendering by utilizing a browser kernel, the electronic book is subjected to page display in an HTML file mode, and page contents displayed by the HTML file on a current terminal screen are obtained;
creating a corresponding range object for the at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and operating the region graphic object according to the drawn region graphic object so as to finish the labeling processing of at least one target text character.
16. The electronic device of claim 15, the executable instructions further cause the processor to:
receiving a selection operation request of at least one target text character triggered by a user; the selected operation request carries boundary information of a selected area;
judging whether the position information of the range object of the at least one target text character is positioned in the boundary information or not according to the boundary information;
if yes, storing the at least one target text character into a target array;
and drawing a region graphic object of the at least one target text character according to the at least one target text character stored in the target array.
17. The electronic device of claim 16, the executable instructions further cause the processor to:
establishing a coordinate system by taking the page turning direction of the electronic book as a transverse coordinate axis and taking the direction vertical to the transverse coordinate axis as a longitudinal coordinate axis in the current terminal screen;
the position information comprises height information and width information of the range object and coordinate position information of the at least one text character in a coordinate system; the boundary information comprises starting point position information of a starting point of the selected operation in a coordinate system and end point position information of an end point of the selected operation in the coordinate system;
judging whether the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information and the vertical coordinate position information and the height information of the range object of at least one target text character reach a preset line-crossing critical value or not;
and if so, judging that the position information of the range object of at least one target text character is positioned in the boundary information.
18. The electronic device of claim 17, the executable instructions further cause the processor to:
receiving a dragging request for the region graphic object, wherein the dragging request is triggered by a user and carries dragging coordinate position information;
and updating the boundary information according to the dragging coordinate position information.
19. The electronic device of claim 18, the executable instructions further cause the processor to:
recording dragging coordinate position information in real time by using a preset variable, and carrying out rounding correction processing on the dragging coordinate position information;
and determining the starting point and the end point of the boundary after dragging according to the position information of the dragged coordinate after rounding and correction, and updating the position information of the starting point and the position information of the end point of the boundary information.
20. The electronic device of any of claims 15-19, the executable instructions further cause the processor to:
step S1, analyzing the page content displayed by the current terminal screen to obtain at least one i-level text node contained in the page content; the text node is a node containing text characters; i is greater than or equal to 1;
step S2, determining whether the number of text characters included in the at least one i-level text node is greater than or equal to a preset number, if so, executing step S3, and if not, executing step S4;
step S3, obtaining at least one i + 1-level text node in a downward traversing manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, repeatedly executing the step S3 until the number of the text characters contained in the obtained text node is smaller than the preset number, and storing the at least one text character contained in the text node to a preset character array;
step S4, storing text characters contained in the at least one i-level text node into a preset character array;
step S5, the text characters stored in the preset character array are used as at least one text character included in the page content.
21. The electronic device of any of claims 15-19, the executable instructions further cause the processor to:
creating an area container object with the same size as a display area of a current terminal screen; the region container object contains at least one rendered region graphical object;
receiving a click operation triggered by a user, and judging whether the coordinate position information of the click operation is located in the position information of at least one drawn region graphic object contained in the region container object;
if not, removing at least one drawn region graphic object contained in the region container object.
22. The electronic device of any of claims 15-19, the executable instructions further cause the processor to:
and setting filling parameters of the region graphic object according to the drawn region graphic object so as to highlight at least one target text character.
23. The electronic device of any of claims 15-19, the executable instructions further cause the processor to:
and according to the drawn region graphic object, performing line drawing processing on at least one target text character by taking the region graphic object as a unit.
24. The electronic device of claim 23, the area graphical object being a plurality; each regional graphical object contains target text characters located on the same line;
the executable instructions further cause the processor to:
judging whether the longitudinal coordinate position information of the drawn graphic objects in the plurality of areas is consistent or not;
if not, performing line-crossing scribing according to the drawn multiple area graphic objects, and performing line-by-line scribing on at least one target text character in line units.
25. The electronic device of claim 23, the executable instructions further cause the processor to:
a line object and/or a line area object is created from the area graphical object of the target text character for the line process.
26. The electronic device of claim 23, the executable instructions further cause the processor to:
receiving an operation request for selecting at least one target text character triggered by a user, and judging whether the at least one target text character is a blank character;
and if so, skipping the at least one target text character.
27. The electronic device of claim 23, the executable instructions further cause the processor to:
receiving a long press operation request which is triggered by a user and is used for marking the target text character which is subjected to line drawing, and setting filling parameters of the area graphic object corresponding to the target text character subjected to line drawing so as to highlight the target text character subjected to line drawing.
28. The electronic device of any of claims 15-19, the rendered region graphical object being a polygonal graphical object of XML.
29. A computer storage medium having at least one executable instruction stored therein, the executable instruction causing a processor to:
analyzing the page content displayed on the current terminal screen to obtain at least one text character contained in the page content; the method comprises the steps that chapter contents in an electronic book are written into a designated variable of an HTML file in a character string mode, the designated variable is inserted into a target container of the HTML file, content in the designated variable in the target container is subjected to page rendering by utilizing a browser kernel, the electronic book is subjected to page display in an HTML file mode, and page contents displayed by the HTML file on a current terminal screen are obtained;
creating a corresponding range object for the at least one text character to obtain position information of the range object;
receiving an operation request for selecting at least one target text character triggered by a user, and drawing a region graphic object of the at least one target text character according to the position information of a range object corresponding to the at least one target text character;
and operating the region graphic object according to the drawn region graphic object so as to finish the labeling processing of at least one target text character.
30. The computer storage medium of claim 29, the executable instructions further causing the processor to:
receiving a selection operation request of at least one target text character triggered by a user; the selected operation request carries boundary information of a selected area;
judging whether the position information of the range object of the at least one target text character is positioned in the boundary information or not according to the boundary information;
if yes, storing the at least one target text character into a target array;
and drawing a region graphic object of the at least one target text character according to the at least one target text character stored in the target array.
31. The computer storage medium of claim 30, the executable instructions further causing the processor to:
establishing a coordinate system by taking the page turning direction of the electronic book as a transverse coordinate axis and taking the direction vertical to the transverse coordinate axis as a longitudinal coordinate axis in the current terminal screen;
the position information comprises height information and width information of the range object and coordinate position information of the at least one text character in a coordinate system; the boundary information comprises starting point position information of a starting point of the selected operation in a coordinate system and end point position information of an end point of the selected operation in the coordinate system;
judging whether the vertical coordinate position information of the starting point position information and the vertical coordinate position information of the end point position information and the vertical coordinate position information and the height information of the range object of at least one target text character reach a preset line-crossing critical value or not;
and if so, judging that the position information of the range object of at least one target text character is positioned in the boundary information.
32. The computer storage medium of claim 31, the executable instructions further causing the processor to:
receiving a dragging request for the region graphic object, wherein the dragging request is triggered by a user and carries dragging coordinate position information;
and updating the boundary information according to the dragging coordinate position information.
33. The computer storage medium of claim 32, the executable instructions further causing the processor to:
recording dragging coordinate position information in real time by using a preset variable, and carrying out rounding correction processing on the dragging coordinate position information;
and determining the starting point and the end point of the boundary after dragging according to the position information of the dragged coordinate after rounding and correction, and updating the position information of the starting point and the position information of the end point of the boundary information.
34. The computer storage medium of any of claims 29-33, the executable instructions further causing the processor to:
step S1, analyzing the page content displayed by the current terminal screen to obtain at least one i-level text node contained in the page content; the text node is a node containing text characters; i is greater than or equal to 1;
step S2, determining whether the number of text characters included in the at least one i-level text node is greater than or equal to a preset number, if so, executing step S3, and if not, executing step S4;
step S3, obtaining at least one i + 1-level text node in a downward traversing manner, judging whether the number of text characters contained in the at least one i + 1-level text node is larger than or equal to a preset number, if so, repeatedly executing the step S3 until the number of the text characters contained in the obtained text node is smaller than the preset number, and storing the at least one text character contained in the text node to a preset character array;
step S4, storing text characters contained in the at least one i-level text node into a preset character array;
step S5, the text characters stored in the preset character array are used as at least one text character included in the page content.
35. The computer storage medium of any of claims 29-33, the executable instructions further causing the processor to:
creating an area container object with the same size as a display area of a current terminal screen; the region container object contains at least one rendered region graphical object;
receiving a click operation triggered by a user, and judging whether the coordinate position information of the click operation is located in the position information of at least one drawn region graphic object contained in the region container object;
if not, removing at least one drawn region graphic object contained in the region container object.
36. The computer storage medium of any of claims 29-33, the executable instructions further causing the processor to:
and setting filling parameters of the region graphic object according to the drawn region graphic object so as to highlight at least one target text character.
37. The computer storage medium of any of claims 29-33, the executable instructions further causing the processor to:
and according to the drawn region graphic object, performing line drawing processing on at least one target text character by taking the region graphic object as a unit.
38. The computer storage medium of claim 37, the region graphical object being a plurality; each regional graphical object contains target text characters located on the same line;
the executable instructions further cause the processor to:
judging whether the longitudinal coordinate position information of the drawn graphic objects in the plurality of areas is consistent or not;
if not, performing line-crossing scribing according to the drawn multiple area graphic objects, and performing line-by-line scribing on at least one target text character in line units.
39. The computer storage medium of claim 37, the executable instructions further causing the processor to:
a line object and/or a line area object is created from the area graphical object of the target text character for the line process.
40. The computer storage medium of claim 37, the executable instructions further causing the processor to:
receiving an operation request for selecting at least one target text character triggered by a user, and judging whether the at least one target text character is a blank character;
and if so, skipping the at least one target text character.
41. The computer storage medium of claim 37, the executable instructions further causing the processor to:
receiving a long press operation request which is triggered by a user and is used for marking the target text character which is subjected to line drawing, and setting filling parameters of the area graphic object corresponding to the target text character subjected to line drawing so as to highlight the target text character subjected to line drawing.
42. The computer storage medium of any of claims 29-33, the rendered region graphical object being a polygon graphical object of XML.
CN202010236110.3A 2020-03-30 2020-03-30 Electronic book labeling method, electronic equipment and storage medium Active CN111460764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010236110.3A CN111460764B (en) 2020-03-30 2020-03-30 Electronic book labeling method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010236110.3A CN111460764B (en) 2020-03-30 2020-03-30 Electronic book labeling method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111460764A CN111460764A (en) 2020-07-28
CN111460764B true CN111460764B (en) 2021-09-03

Family

ID=71685025

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010236110.3A Active CN111460764B (en) 2020-03-30 2020-03-30 Electronic book labeling method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111460764B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508003B (en) * 2020-12-18 2023-10-13 北京百度网讯科技有限公司 Character recognition processing method and device
CN116166165B (en) * 2023-04-25 2023-06-27 福昕鲲鹏(北京)信息科技有限公司 Visual text selection method, visual text selection device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102799573B (en) * 2012-06-27 2015-07-01 北京经舆典网络科技有限公司 Method and system for annotating webpage
CN104820704A (en) * 2015-05-12 2015-08-05 东南大学 Creating method and browsing method for inline marked comment of web text
CN107368465B (en) * 2016-05-13 2020-03-03 北京京东尚科信息技术有限公司 System and method for processing screenshot note of streaming document
CN108154792B (en) * 2016-12-06 2020-12-15 阿里巴巴(中国)有限公司 Graphic character annotation method and device
CN107180090B (en) * 2017-05-12 2018-05-25 掌阅科技股份有限公司 Reading punch card method, electronic equipment and computer storage media based on e-book

Also Published As

Publication number Publication date
CN111460764A (en) 2020-07-28

Similar Documents

Publication Publication Date Title
CN106095917B (en) Bookmark storage and display method and device and browser
CA2773152C (en) A method for users to create and edit web page layouts
CN111460764B (en) Electronic book labeling method, electronic equipment and storage medium
US20130061124A1 (en) Managing forms in electronic documents
CN108052662B (en) Webpage-based component layout method, device, equipment and storage medium
US20210019006A1 (en) Adaptive user interface for a multimedia creative design system
CN104820589B (en) A kind of method and its device of dynamic adaptation webpage
CN104598103B (en) A kind of method and apparatus that figure is handled in the page
CN107945248A (en) A kind of bubble diagram word methods of exhibiting and device
CN111291533B (en) Sentence segment to be displayed display method and device, computer equipment and storage medium
US20160012022A1 (en) User terminal device and scroll method supporting high-speed web scroll of web document
CN111460345B (en) Electronic book loading display method, electronic equipment and storage medium
CN108958612B (en) Method for controlling page sliding, method and system for controlling page, terminal device and medium
CA2699242A1 (en) Method, apparatus and program for facilitating selection of objects on display screens
JP7185044B2 (en) Element rendering method, device, computer program and computer device
CN111061478B (en) Page form modification method, device and equipment and readable storage medium
CN114579912A (en) Page layout method, device, equipment and medium
CN109976865B (en) Task progress display method and device and terminal equipment
JP6377743B2 (en) Method and apparatus for building an intermediate character library
CN111199568B (en) Vector diagram drawing method and device and computer readable storage medium
CN112861481A (en) Paging processing method and device, electronic equipment and computer readable storage medium
CN111783007A (en) Display rendering method and device, electronic equipment and storage medium
CN117390195A (en) Knowledge traceability connecting method, system, equipment and medium based on graph editor
CN109992182B (en) Electronic book batch page turning method, electronic equipment and computer storage medium
CN109800039B (en) User interface display method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant