CN114330253B - Document editing method, device and equipment and readable storage medium - Google Patents

Document editing method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN114330253B
CN114330253B CN202111662123.8A CN202111662123A CN114330253B CN 114330253 B CN114330253 B CN 114330253B CN 202111662123 A CN202111662123 A CN 202111662123A CN 114330253 B CN114330253 B CN 114330253B
Authority
CN
China
Prior art keywords
mark
annotation
document
stroke data
handwritten stroke
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
CN202111662123.8A
Other languages
Chinese (zh)
Other versions
CN114330253A (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.)
ONYX INTERNATIONAL Inc
Original Assignee
ONYX INTERNATIONAL Inc
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 ONYX INTERNATIONAL Inc filed Critical ONYX INTERNATIONAL Inc
Priority to CN202111662123.8A priority Critical patent/CN114330253B/en
Publication of CN114330253A publication Critical patent/CN114330253A/en
Application granted granted Critical
Publication of CN114330253B publication Critical patent/CN114330253B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The application discloses a document editing method, a document editing device, a document editing apparatus and a readable storage medium. Handwritten stroke data may be acquired and recognized; judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not; if the handwritten stroke data contains the text annotation and a preset annotation mark symbol, adding an annotation mark to the document content related to the handwritten stroke data, wherein the annotation mark comprises the annotation mark symbol and the text annotation in an annotation box of the annotation mark symbol; and if the preset deleting mark symbol is included, acquiring a target mark corresponding to the deleting mark symbol, and deleting the target mark. When a user edits an electronic document, a handwriting pen can be directly used for adding annotation marks to the selected document content and deleting marks existing in the electronic document; the electronic document can be marked quickly, accurately and efficiently; furthermore, the user can close the hand touch function of the reading device, so that the effect of preventing mistaken touch is achieved, the efficiency of editing the electronic document is improved better, and the reading experience of the user is improved.

Description

Document editing method, device and equipment and readable storage medium
Technical Field
The present application relates to the field of document processing technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for editing a document.
Background
With the development of scientific technology, more and more users are used to reading by using electronic devices, and in order to facilitate the users to read better, many devices for reading electronic books are equipped with a plurality of functions all the time. For example, to provide a better reading experience for the user, many reading devices are equipped with a stylus for the user to take notes on an electronic document.
When a user reads an electronic document and wants to process the electronic document, for example, when some contents of the electronic document are annotated, the user needs to firstly press a screen of a reading device for a preset period of time to trigger a text selection editing mode of the electronic document, then two touch blocks which can be dragged are displayed at the head and the tail of the text contents selected by pressing the screen of the reading device for a preset period of time, the user adjusts the text selection contents by dragging the two touch blocks forwards or backwards, finally, an icon of an annotation mark is clicked on a menu, and the text contents are input into an annotation frame of the added annotation mark, so that the operation of adding the annotation mark can be completed. When the user wants to delete the existing marks on the electronic document, the user firstly needs to select the marks to be deleted by touching the screen of the reading device and select the mark menu, and then the existing marks in the electronic document can be deleted through the mark modification module. Since the efficiency of editing a document is not high, how to efficiently edit an electronic document is a concern.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device and a readable storage medium for editing a document, which are used to solve the problem that an electronic document cannot be efficiently edited.
A method of document editing, comprising:
acquiring handwritten stroke data;
recognizing the handwritten stroke data to obtain a recognition result of the handwritten stroke data;
judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not;
if the recognition result of the handwritten stroke data contains text annotation and preset annotation mark symbols, adding annotation marks to the document content related to the handwritten stroke data, wherein the annotation marks comprise annotation mark symbols and text annotations in annotation boxes of the annotation mark symbols;
and if the recognition result of the handwritten stroke data contains a preset deletion mark symbol, acquiring a target mark corresponding to the deletion mark symbol in the document, and deleting the target mark.
Preferably, the method further comprises:
in the document content related to the handwritten stroke data, the position which is far away from the handwritten stroke data reaches a preset range, and the existing mark in the document is searched;
and determining whether the matching degree of the existing marks in the document and the track of the handwritten stroke data reaches a set threshold value, and if so, deleting the existing marks searched in the document.
Preferably, if the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, adding an annotation mark to the document content associated with the handwritten stroke data, where the annotation mark includes an annotation mark symbol and a text annotation in an annotation box of the annotation mark symbol, includes:
if the recognition result of the handwritten stroke data contains text annotation and a preset annotation mark symbol, acquiring document content related to the handwritten stroke data;
adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data;
converting the handwritten text annotation into a text annotation in a preset format, and adding the text annotation into an annotation box of the annotation mark symbol;
and/or;
and adding the handwritten text annotation associated with the annotation mark symbol into an annotation box of the annotation mark symbol.
Preferably, the method further comprises:
if the recognition result of the handwritten stroke data contains a preset insertion mark symbol, acquiring document content related to the handwritten stroke data;
and adding a mark corresponding to the inserted mark symbol to the document content.
Preferably, the method further comprises:
determining a menu function corresponding to a menu icon selected by a user;
and editing the document based on the menu function corresponding to the menu icon selected by the user.
A document editing apparatus comprising:
the data acquisition unit is used for acquiring handwritten stroke data;
the data identification unit is used for identifying the handwritten stroke data to obtain an identification result of the handwritten stroke data;
the judging unit is used for judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not;
the annotation adding unit is used for adding annotation marks to the document content related to the handwritten stroke data when the execution result of the judging unit is yes and the recognition result of the handwritten stroke data is determined to contain a text annotation and a preset annotation mark symbol, wherein the annotation marks comprise the annotation mark symbol and a text annotation in an annotation box of the annotation mark symbol;
and the first mark deleting unit is used for acquiring a target mark corresponding to the deleted mark symbol in the document and deleting the target mark when the execution result of the judging unit is yes and the recognition result of the handwritten stroke data is determined to contain the preset deleted mark symbol.
Preferably, the apparatus further comprises:
the mark searching unit is used for searching existing marks in the document when the distance between the mark searching unit and the position of the handwritten stroke data in the document content related to the handwritten stroke data reaches a preset range;
and the second mark deleting unit is used for deleting the existing mark searched in the document when the matching degree of the existing mark in the document and the track of the handwritten stroke data reaches a set threshold value.
Preferably, the apparatus further comprises:
the content acquisition unit is used for acquiring document content related to the handwritten stroke data when the execution result of the judgment unit is yes and the recognition result of the handwritten stroke data contains a preset insertion mark symbol;
and the mark inserting unit is used for adding a mark corresponding to the inserted mark symbol to the document content.
A document editing device comprising a memory and a processor;
the memory is used for storing programs;
the processor is configured to execute the program to implement the steps of the document editing method as described above.
A readable storage medium, having stored thereon a computer program which, when executed by a processor, carries out the steps of the document editing method as introduced above.
According to the technical scheme, the document editing method can acquire handwritten stroke data; recognizing the handwritten stroke data to obtain a recognition result of the handwritten stroke data; judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not; if the recognition result of the handwritten stroke data contains text annotation and preset annotation mark symbols, adding annotation marks to the document content related to the handwritten stroke data, wherein the annotation marks comprise annotation mark symbols and text annotations in annotation boxes of the annotation mark symbols; and if the recognition result of the handwritten stroke data contains a preset deletion mark symbol, acquiring a target mark corresponding to the deletion mark symbol in the document, and deleting the target mark. According to the method and the device, when a user edits the electronic document, the user can directly use a stylus pen to add annotation marks to the selected document content and delete existing marks in the electronic document; the electronic document can be marked quickly, accurately and efficiently; furthermore, the user can close the function of the hand touch of the reading device, so that the effect of preventing the error touch is realized, the efficiency of editing the electronic document is better improved, and the reading experience of the user is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart illustrating an alternative method for implementing document editing according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating the effect of quickly deleting existing marks in a document according to an embodiment of the present application;
FIG. 3 is a flowchart of another alternative method for implementing document editing according to an embodiment of the present application;
FIG. 4 is a diagram of another fast deleting existing mark effects in a document according to an embodiment of the present application;
FIG. 5 is a diagram illustrating an effect of quickly adding annotation marks to a document according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of a document editing apparatus according to an example of the present application;
fig. 7 is a block diagram of a hardware structure of a document editing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
With the rapid development of the mobile internet and the popularization of intelligent devices, more and more intelligent devices have a function of editing documents, for example, an ink screen electronic book reader, which is a device specially used for reading electronic books and generally provided with a stylus pen for users to write and take notes in electronic documents. Along with the popularization of intelligent equipment, a plurality of matched intelligent editing software, such as NeoReader reading software, also come into play. The NeoReader reading software is reading software capable of being applied to an ink screen electronic book reader, can support opening of electronic books in various formats, and can directly edit documents through a handwriting pen after the electronic books are opened. When a user edits an electronic document through document reading software by using a handwriting pen and leaves handwritten note data, the handwritten note data of the user can be identified to be associated with characters, graphs, symbols, formulas and the like through analyzing the handwritten note coordinate data and the pressure data. In addition to writing and taking notes on an electronic document by using a handwriting pen, various types of marks can be made on the electronic document, for example, marks such as highlighting, underlining, wavy underlining, double underlining, dashed underlining and the like can be made on the document; the user may also switch the type of flag. Although both smart reading software and smart reading devices are popular, how to efficiently utilize smart devices and smart reading software to edit electronic documents is still a concern.
Therefore, a document editing method is needed to solve the problem that the electronic document cannot be edited efficiently.
In order to solve the problem, the application provides a document editing method which can be used for solving the problem that the electronic document cannot be efficiently edited.
The method can be applied to any equipment capable of realizing document editing, and optionally, the equipment capable of realizing document editing can be terminals with data processing capability, such as an ink screen e-book reader, a tablet computer, a mobile phone and the like.
The following describes a flow of a document editing method according to an embodiment of the present application with reference to fig. 1, where the flow may include the following steps:
step S101, acquiring handwritten stroke data.
Specifically, in the electronic document, the handwritten stroke data of the user includes coordinates and pressure of all points in the stroke, for example, each point includes data represented by { x, y, size }, where x is an abscissa value, the value range is [0, width of screen ], y is an ordinate value, the value range is [0, height of screen ], size is a pressure value, the value range is [0, pressure maximum value ], a stroke includes n points, and then the data of the stroke is an array of data of the n points in order, for example [ point 1, point 2,.., point n ]. Accordingly, handwritten stroke data may be acquired first for further processing.
And S102, recognizing the handwritten stroke data to obtain a recognition result of the handwritten stroke data.
Specifically, after acquiring the handwritten stroke data, the handwritten stroke data may be recognized by the handwriting recognition processor, and a recognition result and recognized data may be acquired. Wherein the data result after the handwritten stroke data recognition may include:
(1) Type of handwritten stroke data: text, straight line, wavy line, circular, oval, rectangle, polygon, triangle, rhombus, parallelogram, hand drawing graffiti, arrow, arc, the arc of taking the arrow, the straight line of taking the arrow.
(2) Text content associated with the handwritten stroke data.
Step S103, judging whether the recognition result of the handwritten stroke data contains a preset mark symbol.
Specifically, after the recognition result of the handwritten stroke data is obtained, the operation performed on the document may be judged by analyzing the recognition result of the handwritten stroke data. Therefore, after the recognition result of the handwritten stroke data is obtained, whether the recognition result of the handwritten stroke data contains a preset mark symbol or not can be judged. If the recognition result of the handwritten stroke data contains text annotations and preset annotation mark symbols, which indicate that annotation marks need to be added to the document, step S104 may be executed; if the recognition result of the handwritten stroke data includes a preset deletion mark symbol indicating that the existing mark of the document needs to be deleted, step S105 may be executed.
And step S104, adding annotation marks to the document content associated with the handwritten stroke data, wherein the annotation marks comprise annotation mark symbols and text annotations in annotation boxes of the annotation mark symbols.
Specifically, as can be seen from the above steps, if the recognition result of the handwritten stroke data includes a text comment and a preset comment mark symbol, which indicates that a comment mark needs to be added to a document, a comment mark may be added to the document content associated with the handwritten stroke data based on a text comment included in the handwritten stroke data and the document content associated with the handwritten note data, where the comment mark may include a comment mark symbol and a text comment in a comment box of the comment mark symbol.
Step S105, obtaining the target mark corresponding to the deleting mark symbol in the document, and deleting the target mark.
Specifically, it can be seen from the above steps that, if the recognition result of the handwritten stroke data includes a preset deletion marker symbol, it indicates that the existing marker in the document needs to be deleted. And acquiring the target mark corresponding to the deletion mark symbol in the document, and deleting the target mark.
Wherein the deletion marker symbol may be set to the characters "X" or "X", "D".
For example, if the recognition result of the handwritten stroke data is a text, text content included in the recognition result may be further acquired, and if the text content included in the recognition result includes one or more characters, and the characters are any one or more of "X" or "X", "D", and "D", the target mark may be deleted after the target mark is acquired according to the target mark corresponding to the handwritten stroke data existing in the acquired document.
For example, fig. 2 illustrates an effect diagram of quickly deleting a mark already existing in a document, as shown in fig. 2, when a user draws two "X" in an annotation mark already existing in the document with a handwriting pen, and after recognizing the handwriting stroke data, it can be recognized that the handwriting stroke data contains two characters "X", it can be confirmed that a mark corresponding to the character "X" needs to be deleted, and then the target mark can be deleted after acquiring the target mark according to acquiring a target mark corresponding to the handwriting stroke data already existing in the document.
According to the technical scheme, the document editing method provided by the embodiment of the application can realize that when a user edits the electronic document, a handwriting pen can be directly used for adding annotation marks to the selected document content and deleting marks existing in the electronic document; the electronic document can be marked quickly, accurately and efficiently; furthermore, the user can close the function of the hand touch of the reading device, so that the effect of preventing the user from touching by mistake is realized, the efficiency of editing the electronic document is better improved, and the reading experience of the user is improved.
In consideration of the fact that in practical application, when a user wants to delete a mark made on an electronic document after a certain time interval after the user makes the mark on the electronic document, the method and the device can realize the quick deletion of the mark made on the electronic document by the user.
Next, referring to fig. 3, another document editing method that can implement quick deletion of existing marks in an electronic document will be described, which may include the following steps.
Step S201, in the document content related to the handwritten stroke data, the position away from the handwritten stroke data reaches a preset range, and existing marks in the document are searched.
Specifically, after the handwritten stroke data is recognized, whether a mark exists in a document may be found in a document when a position of the document from the handwritten stroke data reaches a preset range in document content associated with the handwritten stroke data, and if the mark exists in the document when the position of the document from the handwritten stroke data reaches the preset range, step S202 may be executed.
Step S202, judging whether the matching degree of the mark existing in the document and the track of the handwritten stroke data reaches a set threshold value.
Specifically, if it is found that a mark exists in the document within a preset range from the position of the handwritten stroke data, it may be further determined whether the matching degree between the mark existing in the document and the track of the handwritten stroke data reaches a set threshold. If it is determined that the matching degree between the existing mark in the document and the trajectory of the handwritten stroke data reaches the predetermined threshold, it indicates that the existing mark in the document and the handwritten stroke data may be repeated mark symbols, and step S203 may be performed.
In step S203, the existing mark found in the document is deleted.
Specifically, as can be seen from the above steps, if it is determined that the matching degree between the existing mark in the document and the trajectory of the handwritten stroke data reaches the predetermined threshold, it indicates that the existing mark in the document and the handwritten stroke data may be repeated mark symbols, and the existing mark found in the document may be deleted.
For example, if it is found that a mark exists in a document within a preset range from the position of the handwritten stroke data, it may be further determined whether the matching degree between the mark existing in the document and the track of the handwritten stroke data reaches a set threshold. If the matching degree of the mark already existing in the document and the track of the handwritten stroke data reaches a set threshold value, the current handwritten stroke data is possibly the repeated mark of the user. Existing tags found in the document may be deleted and the document no longer marked any more for handwritten stroke data.
For example, if the recognition result type of the handwritten stroke data is a freehand scribble, the coordinates (left 1, top 2) of the upper left point of the circumscribed rectangle corresponding to the document content associated with the handwritten stroke data may be obtained as a starting point 1, and the coordinates (right 1, bottom 1) of the upper right point of the circumscribed rectangle corresponding to the document content associated with the handwritten stroke data may be obtained as an ending point 1. Acquiring a character associated with the handwritten stroke data as a starting character A through coordinates of a starting point 1, and acquiring an index corresponding to the character A; and acquiring a character associated with the handwritten stroke data as a starting character B through the coordinates of the end point 1, acquiring an index corresponding to the character B, and assuming that the index corresponding to the character A is 100 and the index corresponding to the character B is 101, determining that the recognition result of the handwritten stroke data is a text content < AB >, the text index range of < AB > is [100,101], and determining the document index range as a preset search range. And searching a matching index range in all marks existing in the document based on the index range [100,101], if the index range matched with the index range [100,101] is searched in all marks existing in the document, and the matching degree of the marks existing in the document and the track of the handwritten stroke data reaches a set threshold, determining that the matching of the marks existing in the document and the track of the handwritten stroke data is successful, acquiring the marks corresponding to the index range [100,101] existing in the document, and deleting the marks.
For example, fig. 4 illustrates an effect diagram of quickly deleting existing marks in a document, as shown in fig. 4, an annotation mark symbol and a handwritten annotation text "× T" having a circumscribed rectangle connected to an arrowed line already exist in the document, after a user repeatedly draws a circumscribed rectangle and an arrowed line in existing annotation marks in the document with a handwriting pen, after confirming that the stroke type of the recognition result of the handwritten stroke data is the handwritten graffiti, that is, recognizing that the user repeatedly draws a circumscribed rectangle and an arrowed line in existing annotation marks of the document, whether an existing mark exists in document contents associated with the handwritten stroke data can be searched for according to a track of the handwritten stroke data as a reference point, and if so, the existing annotation mark in the document can be deleted.
According to the technical scheme, when a user wants to delete the existing mark in the document, the mark which the user wants to delete can be quickly identified and the existing mark in the document can be deleted, and the user does not need to delete the existing mark through the mark deleting function in the menu function after selecting the mark to be deleted. The efficiency of the user for editing the document is further improved.
As can be seen from the above description, if the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, an annotation mark is added to the document content associated with the handwritten stroke data, where the annotation mark includes the annotation mark symbol and a text annotation in an annotation box of the annotation mark symbol.
Next, the process is described, which can be implemented in several ways, specifically as follows:
in the first kind of the chemical reaction, the first,
step S301, obtaining the document content associated with the handwritten stroke data.
Specifically, as can be seen from the above description, if the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, it indicates that an annotation mark needs to be added to the document content associated with the handwritten stroke data, and therefore, the document content associated with the handwritten stroke data can be obtained. After obtaining the document content associated with the handwritten stroke data, step S302 may be performed.
Step S302, corresponding annotation mark symbols are added to the document content related to the handwritten stroke data.
Specifically, after obtaining the document content associated with the handwritten stroke data, a corresponding annotation mark symbol may be added to the document content associated with the handwritten stroke data.
Step S303, converting the handwritten text annotation into a text annotation in a preset format, and adding the text annotation into an annotation frame of the annotation mark symbol.
Specifically, after adding a corresponding annotation mark symbol to the document content associated with the handwritten stroke data, in order to make the text annotation of the annotation mark look more beautiful and standard, the handwritten text annotation may be converted into a text annotation in a preset format and added into an annotation box of the annotation mark symbol. To accomplish the addition of annotation tags to the document content associated with the handwritten stroke data.
In the case of the second type 2,
step S401, obtaining the document content associated with the handwritten stroke data.
Specifically, the document content associated with the handwritten stroke data may be obtained, and if the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, step S402 may be executed.
Step S402, adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data.
Step S403, adding the handwritten text annotation associated with the annotation mark symbol into an annotation box of the annotation mark symbol.
Specifically, after adding the corresponding annotation mark symbol to the document content associated with the handwritten stroke data, if the user wants to directly add the handwritten text annotation to the annotation box of the annotation mark symbol, the handwritten stroke data in the recognition result may be directly added to the annotation box of the annotation mark symbol.
In the case of the (3) rd species,
step S501, obtaining the document content related to the handwritten stroke data.
Specifically, if the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, after obtaining the document content associated with the handwritten stroke data, step S502 may be executed.
Step S502, adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data.
Step S503, converting the handwritten text annotation into a text annotation in a preset format and a handwritten text annotation associated with the annotation mark symbol, and adding the text annotation into an annotation box of the annotation mark symbol.
Specifically, if the user only wants to convert a part of the handwritten text annotation into a text annotation in a preset format, and the remaining part of the handwritten text annotation is not converted, the text annotation content converted into the preset format may be added to the annotation box of the annotation mark symbol together with the unconverted handwritten text annotation content. For example, if a user wants to convert a text portion of a handwritten text annotation into a text annotation in a preset format and original handwritten note data of a part of a drawn graph is retained, the handwritten text annotation can be converted into a text annotation in the preset format and a handwritten text annotation associated with the annotation mark symbol and added into an annotation box of the annotation mark symbol.
The preset annotation mark symbol may be: an arc with an arrow and a straight line with an arrow.
When the handwritten stroke data is recognized to contain the preset annotation mark symbol, whether two ends of the document content related to the handwritten stroke data are the preset annotation mark symbol and the handwritten text annotation or not can be judged. And if the two ends of the document content associated with the handwritten stroke data are the preset annotation mark symbol and the handwritten text annotation. The next processing can be performed.
For example, if the type of the predetermined annotation mark symbol included in the recognition result of the handwritten stroke data is a straight line with an arrow, an end coordinate point (x) of the straight line with the arrow may be obtained 1 ,y 1 ) And matching is performed in the handwritten stroke data list. Judging whether the document content associated with the handwritten stroke data has a circumscribed rectangle, if so, judging whether the document content has a circumscribed rectangleIf the document content associated with the writing stroke data contains a circumscribed rectangle, whether the range associated with the circumscribed rectangle contains a coordinate point (x) of a segment of a straight line with an arrow or not is further judged 1 ,y 1 ) Or judging the range and coordinate point (x) associated with the circumscribed rectangle 1 ,y 1 ) Is less than a preset threshold. For example, the preset threshold may be 10 pixels. The preset threshold may be adjusted with reference to the width of the handwritten stroke data so that the accuracy of recognition may be improved. If the range associated with the circumscribed rectangle comprises a coordinate point (x) of a segment of a straight line with an arrow 1 ,y 1 ) Or the range and coordinate point (x) associated with the circumscribed rectangle 1 ,y 1 ) Is less than a preset threshold, it may be determined that the handwritten stroke data content was successfully recognized.
After determining that the handwritten stroke data is successfully recognized, the coordinate point (x) at the other end of the straight line may be taken 2 ,y 2 ) And obtaining a coordinate point (x) 2 ,y 2 ) The corresponding text character. When the coordinate point (x) is acquired 2 ,y 2 ) After the corresponding text character, a coordinate point (x) is obtained 2 ,y 2 ) Character index corresponding to the corresponding text character, e.g. the coordinate point (x) obtained 2 ,y 2 ) If the character index of the corresponding text character is 101, it may be determined in a preset mark list whether a marked text index range in the preset mark list includes a coordinate point (x) 2 ,y 2 ) Corresponding text characters, e.g. having a range of marked-up text indexes of [100,120]The coordinate point (x) obtained 2 ,y 2 ) The character index of the corresponding text character is 101 and falls within the tagged text index range 100,120]Then, it may be confirmed that the identification of the document content associated with the handwritten stroke data is successful, and a straight line with an arrow included in the handwritten stroke data may be further obtained.
After the straight line with the arrow included in the handwritten stroke data is obtained, the handwritten text characters associated with the straight line with the arrow may be further obtained, for example, a recognition result of the handwritten stroke data may be obtained through a handwriting recognition technology, content of a handwritten text annotation associated with the handwritten stroke data may be obtained, the content of the handwritten text annotation may be converted into a text annotation in a preset format, for example, the content of the handwritten text annotation may be converted into a text annotation in a format with a font of song and a font size of small four, and then the text annotation with the font of song and the font size of small four is added into an annotation box of an annotation mark corresponding to the straight line with the arrow. To accomplish the addition of annotation tags to the document content associated with the handwritten stroke data.
For example, fig. 5 illustrates an effect diagram for quickly adding annotation marks to a document, as shown in fig. 5, when a user draws a circumscribed rectangle, a straight line with an arrow, and a handwritten text annotation "× T" in the document with a handwriting pen, it may be confirmed that the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, it may be recognized that the recognition result of the handwritten stroke data includes a text annotation as a character "× T", and the annotation mark symbol is a circumscribed rectangle connected by a straight line with an arrow, and after the handwritten text annotation "× T" is converted into a preset format, an annotation mark with a straight line with an arrow connected by a circumscribed rectangle may be added at a document content associated with the handwritten stroke data.
Furthermore, the user can set a corner mark on the annotation mark corresponding to the straight line with the arrow according to requirements, and when the user wants to read the annotation content of the annotation mark, the user can display the annotation content in the form of text by clicking the corner mark. When the user does not want the annotation content of the annotation mark to be displayed in the document, the annotation mark can be folded, and the annotation mark can only show one corner mark symbol and does not show the annotation content of the annotation mark.
According to the technical scheme, when the recognition result of the handwritten stroke data comprises a text annotation and a preset annotation mark symbol, annotation marks can be added to the document content related to the handwritten stroke data according to the requirements of a user. And the annotation mark can be quickly added to the document. The efficiency of document editing is improved.
As can be appreciated from the above description, the present application may determine whether the recognition result of the handwritten stroke data includes a predetermined marker. In an actual application process, if the recognition result of the handwritten stroke data includes a preset insertion mark symbol, the implementation manners of the corresponding document editing methods may also be different, and the process is described next, and the implementation process of the process is specifically as follows:
step S601, obtaining the document content associated with the handwritten stroke data.
Specifically, as can be seen from the above description, if the recognition result of the handwritten stroke data includes a preset insertion mark symbol, it indicates that a mark needs to be inserted into the document. To insert a marker in a document, the document content associated with the handwritten stroke data may be obtained.
Step S602, adding a mark corresponding to the insertion mark symbol to the document content.
Specifically, after obtaining the document content associated with the handwritten stroke data, after further judging the category of the preset inserted mark symbol included in the recognition result of the handwritten stroke data, a mark corresponding to the inserted mark symbol may be added to the document content.
For example, the preset insertion flag symbol may be set as: straight lines, wavy lines, circles, ellipses, rectangles, polygons, triangles, diamonds, parallelograms;
for example, if the preset insertion mark symbol included in the recognition result of the handwritten stroke data is a rectangle, the coordinates (left 12, top 2) of the upper left point of the circumscribed rectangle in the recognition result of the handwritten stroke data may be obtained as a starting point 2, and the coordinates (right 2, bottom 2) of the upper right point of the circumscribed rectangle in the recognition result of the handwritten stroke data may be obtained as an ending point 2; through the coordinate of the starting point 2, the character corresponding to the starting point 2 is obtained as a starting character C, and through the coordinate of the ending point 2, the character corresponding to the ending point 2 is obtained as a starting character D, so that the characters C, D and the characters between the characters D can be determined as the text content < c.. D > included in the recognition result of the handwritten stroke data.
Besides the characters contained in the text content contained in the recognition result of the handwritten stroke data, the index range of all the characters in the document can be obtained. Assuming that the character index range of a document starts from 1, for example, the full text of the document has 1000 characters, all the character ranges of the document are [1,1000]. If the character C is the 100 th character of the document, the index of the character C is 100, and if the character D is the 120 th character, the index of the character D is 120; then the text content < c.. D > corresponds to an index range of [100,120].
When the preset inserted mark symbol contained in the recognition result of the handwritten stroke data is determined to be a rectangle, the text content of the document associated with the rectangle is < C. A rectangular marker may be inserted in the document at an index range of [100,120] for the text index range of < c.
In addition, it may be further configured to add a highlighted mark to text content associated with a rectangle when a preset insertion mark symbol included in the recognition result of the handwritten stroke data is the rectangle.
For example, if the recognition result of the handwritten stroke data is a straight line or a wavy line, the first coordinate point (x) of the straight line or the wavy line included in the recognition result of the handwritten stroke data may be obtained 3 ,y 3 ) Obtaining the last coordinate point (x) of the straight line or wave line contained in the recognition result of the handwritten stroke data as a starting point 3 4 ,y 4 ) Endpoint 3. Generally, when a text content of a document is underlined, the underlining is generally below the words of the text content. If the text content of the document cannot be acquired at the starting point 3, the correct character can be acquired only by upwards offsetting for a certain distance; therefore, an offset F may be set to adjust the position of the straight line or wavy line contained in the handwritten stroke data, wherein the predetermined offset F may be predetermined to be 5 pixels fixed, or predetermined as described aboveHalf the word size. Both the start point 3 and the end point 3 are shifted upward by a preset shift amount F. Coordinate point (x) corresponding to shifted starting point 3 3 ,y 3 -F), coordinate point (x) corresponding to the end point 3 4 ,y 4 F), the corresponding character can be obtained as the start character E by the shifted coordinates of the start point 3, and the corresponding character can be obtained as the end character F by the shifted coordinates of the end point 3, then the characters E and F and the characters in between can be determined as the obtained text content<E...F>. Underline marks of straight lines or wavy lines are added below the characters E and F and the characters in between.
Further, the user can change the symbol marked by the underline and the color of the symbol marked by the underline according to the requirement. For example, underlining is changed to double underlining straight lines, double underlining wavy lines.
For example, it may be determined whether the recognition result of the handwritten stroke data includes a preset modification mark symbol; the preset modification flag may be set as: it is U or U.
If the recognition result of the handwritten stroke data contains a preset modification mark symbol, searching for an existing mark in the document content associated with the handwritten stroke data within a preset range; if the existing mark is found within the preset range, the mark found in the document can be modified according to the requirement.
It can be seen from the foregoing technical solutions that, in the embodiment of the present application, when the recognition result of the handwritten stroke data includes a preset insertion mark symbol, a corresponding mark may be inserted at a document content associated with the handwritten stroke data. Further, when the recognition result of the handwritten stroke data contains a preset modification mark symbol, the mark existing in the document can be searched in a preset range and modified. The document editing can be completed quickly, and the document editing efficiency is improved.
For example, a preset mark menu is popped up above the text content related to the mark, two touch blocks capable of being dragged are displayed at the head and the tail of the related text content, a user adjusts the text selection content by dragging the two touch blocks forwards or backwards, and finally, a change mark icon on the menu is clicked to finish changing the text content related to the mark.
According to the embodiment of the application, the function triggered by the user can be judged according to the menu icon selected by the user, and corresponding editing is carried out. The process is as follows:
step S701, determining a menu function corresponding to the menu icon selected by the user.
Step S702, editing the document based on the menu function corresponding to the menu icon selected by the user.
For example, when a user selects a copy mark to associate with document content, it may be determined that the user selects the document content with which the copy mark is associated; when a user selects the annotation text of the editing annotation mark, the text content of the annotation box of the editing annotation mark in the document can be edited; when a user selects and changes the marking style, the marking style can be switched to highlight, underline wavy line, underline dotted line, double underline straight line, double underline wavy line and the like at will, and meanwhile, the color of the marking can be changed.
According to the technical scheme, the function triggered by the user can be judged according to the menu icon selected by the user, and corresponding editing is carried out. And personalized editing of the document by the user is met.
In the following, the document editing apparatus provided in the embodiments of the present application is introduced, and the document editing apparatus described below and the document editing method described above may be referred to correspondingly.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a document editing apparatus according to an embodiment of the present application.
As shown in fig. 6, the document editing apparatus may include:
a data acquisition unit 101 configured to acquire handwritten stroke data;
the data identification unit 102 is used for identifying the handwritten stroke data to obtain an identification result of the handwritten stroke data;
a judging unit 103, configured to judge whether a recognition result of the handwritten stroke data includes a preset mark symbol;
an annotation adding unit 104, configured to add an annotation mark to the document content associated with the handwritten stroke data when the execution result of the determining unit is yes and it is determined that the recognition result of the handwritten stroke data includes a text annotation and a preset annotation mark symbol, where the annotation mark includes the annotation mark symbol and a text annotation in an annotation box of the annotation mark symbol;
and the first mark deleting unit 105 is configured to, when the execution result of the determining unit is yes and it is determined that the recognition result of the handwritten stroke data includes a preset deletion mark symbol, obtain a target mark corresponding to the deletion mark symbol in the document, and delete the target mark.
The device of the embodiment of the application can utilize the data acquisition unit 101 to acquire handwritten stroke data; recognizing the handwritten stroke data by using a data recognition unit 102 to obtain a recognition result of the handwritten stroke data; judging whether the recognition result of the handwritten stroke data contains a preset mark symbol by using a judging unit 103; when the recognition result of the handwritten stroke data contains the text annotation and a preset annotation mark symbol, adding an annotation mark to the document content associated with the handwritten stroke data by using an annotation adding unit 104; when it is determined that the recognition result of the handwritten stroke data includes a preset deletion marker symbol, the first marker deleting unit 105 acquires a target marker corresponding to the deletion marker symbol in the document, and deletes the target marker. The document editing device provided by the embodiment of the application can realize that when a user edits an electronic document, a handwriting pen can be directly used for adding annotation marks to the selected document content and deleting marks existing in the electronic document; the electronic document can be marked quickly, accurately and efficiently; furthermore, the user can close the function of the hand touch of the reading device, so that the effect of preventing the error touch is realized, the efficiency of editing the electronic document is better improved, and the reading experience of the user is improved.
Further optionally, the document editing apparatus may further include:
the mark searching unit is used for searching existing marks in the document when the distance between the mark searching unit and the position of the handwritten stroke data in the document content related to the handwritten stroke data reaches a preset range;
and the second mark deleting unit is used for deleting the existing mark searched in the document when the matching degree of the existing mark in the document and the track of the handwritten stroke data reaches a set threshold value.
Further optionally, the execution process of the comment adding unit 104 may include:
if the recognition result of the handwritten stroke data contains text annotation and a preset annotation mark symbol, acquiring document content related to the handwritten stroke data;
adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data;
converting the handwritten text annotation into a text annotation in a preset format, and adding the text annotation into an annotation box of the annotation mark symbol;
and/or;
and adding the handwritten text annotation associated with the annotation mark symbol into an annotation box of the annotation mark symbol.
Further optionally, the document editing apparatus may further include:
the content acquisition unit is used for acquiring document content related to the handwritten stroke data when the execution result of the judgment unit is yes and the recognition result of the handwritten stroke data contains a preset insertion mark symbol;
and the mark inserting unit is used for adding a mark corresponding to the inserted mark symbol to the document content.
Further optionally, the document editing apparatus may further include:
the menu determining unit is used for determining the menu function corresponding to the menu icon selected by the user;
and the editing unit is used for editing the document based on the menu function corresponding to the menu icon selected by the user.
The specific processing flow of each unit included in the document editing apparatus may refer to the related description of the foregoing method, and is not described herein again.
The document editing apparatus provided by the embodiment of the present application may be applied to a document editing device, such as a terminal: ink screen e-book readers, mobile phones, computers, etc. Alternatively, fig. 7 shows a block diagram of a hardware structure of the document editing apparatus, and referring to fig. 7, the hardware structure of the document editing apparatus may include: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4.
In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 complete mutual communication through the communication bus 4.
The processor 1 may be a central processing unit CPU, or an Application Specific Integrated Circuit ASIC (Application Specific Integrated Circuit), or one or more Integrated circuits configured to implement embodiments of the present invention, etc.;
the memory 3 may include a high-speed RAM memory, and may further include a non-volatile memory (non-volatile memory) or the like, such as at least one disk memory;
wherein the memory stores a program and the processor can call the program stored in the memory, the program for: and realizing each processing flow in the terminal document editing scheme.
Embodiments of the present application further provide a readable storage medium, where the storage medium may store a program adapted to be executed by a processor, where the program is configured to: and realizing each processing flow of the terminal in the document editing scheme.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. The various embodiments may be combined with each other. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (9)

1. A method of document editing, comprising:
acquiring handwritten stroke data;
recognizing the handwritten stroke data to obtain a recognition result of the handwritten stroke data, wherein the handwritten stroke data comprises coordinates and pressure of all points in a stroke;
judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not;
if the recognition result of the handwritten stroke data contains text annotation and preset annotation mark symbols, acquiring document content associated with the handwritten stroke data, adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data, converting the handwritten text annotation into text annotation in a preset format, and adding the text annotation into an annotation frame of the annotation mark symbols; and/or adding a handwritten text annotation associated with the annotation mark symbol into an annotation box of the annotation mark symbol;
and if the recognition result of the handwritten stroke data contains a preset deletion mark symbol, acquiring a target mark corresponding to the deletion mark symbol in the document, and deleting the target mark.
2. The document editing method according to claim 1, characterized by further comprising:
in the document content related to the handwritten stroke data, the position away from the handwritten stroke data reaches a preset range, and existing marks in the document are searched;
and determining whether the matching degree of the existing mark in the document and the track of the handwritten stroke data reaches a set threshold value, and if so, deleting the existing mark searched in the document.
3. The document editing method according to claim 1, characterized by further comprising:
if the recognition result of the handwritten stroke data contains a preset insertion mark symbol, acquiring document content related to the handwritten stroke data;
and adding a mark corresponding to the inserted mark symbol to the document content.
4. The document editing method according to any one of claims 1 to 3, characterized in that the method further comprises:
determining a menu function corresponding to a menu icon selected by a user;
and editing the document based on the menu function corresponding to the menu icon selected by the user.
5. A document editing apparatus, comprising:
the data acquisition unit is used for acquiring handwritten stroke data;
the data identification unit is used for identifying the handwritten stroke data to obtain an identification result of the handwritten stroke data, wherein the handwritten stroke data comprises coordinates and pressure of all points in a stroke;
the judging unit is used for judging whether the recognition result of the handwritten stroke data contains a preset mark symbol or not;
the annotation adding unit is used for acquiring document content associated with the handwritten stroke data, adding corresponding annotation mark symbols to the document content associated with the handwritten stroke data, converting the handwritten text annotation into a text annotation in a preset format, and adding the text annotation into an annotation frame of the annotation mark symbols when the execution result of the judging unit is yes and the recognition result of the handwritten stroke data is determined to contain the text annotation and the preset annotation mark symbols; and/or adding a handwritten text annotation associated with the annotation mark symbol into an annotation box of the annotation mark symbol;
and the first mark deleting unit is used for acquiring a target mark corresponding to the deleted mark symbol in the document and deleting the target mark when the execution result of the judging unit is yes and the recognition result of the handwritten stroke data is determined to contain the preset deleted mark symbol.
6. The document editing apparatus according to claim 5, characterized in that the apparatus further comprises:
the mark searching unit is used for searching existing marks in the document when the distance between the mark searching unit and the position of the handwritten stroke data in the document content related to the handwritten stroke data reaches a preset range;
and the second mark deleting unit is used for deleting the existing mark searched in the document when the matching degree of the existing mark in the document and the track of the handwritten stroke data reaches a set threshold value.
7. The document editing apparatus according to claim 5, characterized in that the apparatus further comprises:
the content acquisition unit is used for acquiring document content related to the handwritten stroke data when the execution result of the judgment unit is yes and the recognition result of the handwritten stroke data contains a preset insertion mark symbol;
and the mark inserting unit is used for adding a mark corresponding to the inserted mark symbol to the document content.
8. A document editing apparatus comprising a memory and a processor;
the memory is used for storing programs;
the processor, executing the program, implementing the steps of the document editing method of any one of claims 1-4.
9. A readable storage medium, having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, carries out the steps of the document editing method as claimed in any one of the claims 1-4.
CN202111662123.8A 2021-12-30 2021-12-30 Document editing method, device and equipment and readable storage medium Active CN114330253B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111662123.8A CN114330253B (en) 2021-12-30 2021-12-30 Document editing method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111662123.8A CN114330253B (en) 2021-12-30 2021-12-30 Document editing method, device and equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN114330253A CN114330253A (en) 2022-04-12
CN114330253B true CN114330253B (en) 2022-10-04

Family

ID=81021767

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111662123.8A Active CN114330253B (en) 2021-12-30 2021-12-30 Document editing method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114330253B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934647B (en) * 2022-10-21 2023-10-13 广州文石信息科技有限公司 Notebook label generation method and device, storage medium and computer equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678977A (en) * 2003-01-30 2005-10-05 富士通株式会社 Handwriting-input device and method
CN101882384A (en) * 2010-06-29 2010-11-10 汉王科技股份有限公司 Method for note management on electronic book and electronic book equipment
CN104794107A (en) * 2015-02-16 2015-07-22 北京道明科技有限公司 Handwriting editing method
CN105264517A (en) * 2013-05-20 2016-01-20 微软技术许可有限责任公司 Ink to text representation conversion
CN106484413A (en) * 2016-09-30 2017-03-08 深圳市华傲数据技术有限公司 Document editor and document edit method
CN113705178A (en) * 2021-08-31 2021-11-26 维沃移动通信有限公司 Document processing method, document processing device, electronic equipment and medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01183765A (en) * 1988-01-18 1989-07-21 Nec Corp Document editing device
JP5619066B2 (en) * 2012-04-27 2014-11-05 京セラドキュメントソリューションズ株式会社 Document management apparatus and document management program
CN103677637B (en) * 2013-12-06 2018-10-12 上海斐讯数据通信技术有限公司 Delete the method and electronic equipment of the word of display on the touchscreen
US10346510B2 (en) * 2015-09-29 2019-07-09 Apple Inc. Device, method, and graphical user interface for providing handwriting support in document editing
CN107943324A (en) * 2017-09-08 2018-04-20 陈新昆 A kind of man-machine interactive system and method based on writing
CN109445676B (en) * 2018-09-11 2022-05-20 宁波思骏科技有限公司 Method for deleting handwritten stroke information input by user on handwriting equipment
CN112749537A (en) * 2021-01-14 2021-05-04 浙江红极互联网科技有限公司 Role-based electronic engineering document management method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1678977A (en) * 2003-01-30 2005-10-05 富士通株式会社 Handwriting-input device and method
CN101882384A (en) * 2010-06-29 2010-11-10 汉王科技股份有限公司 Method for note management on electronic book and electronic book equipment
CN105264517A (en) * 2013-05-20 2016-01-20 微软技术许可有限责任公司 Ink to text representation conversion
CN104794107A (en) * 2015-02-16 2015-07-22 北京道明科技有限公司 Handwriting editing method
CN106484413A (en) * 2016-09-30 2017-03-08 深圳市华傲数据技术有限公司 Document editor and document edit method
CN113705178A (en) * 2021-08-31 2021-11-26 维沃移动通信有限公司 Document processing method, document processing device, electronic equipment and medium

Also Published As

Publication number Publication date
CN114330253A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
US10778928B2 (en) Device and method for inputting note information into image of photographed object
US6941507B2 (en) Insertion point bungee space tool
US7701449B2 (en) Ink correction pad
US9483453B2 (en) Clipping view
US10296170B2 (en) Electronic apparatus and method for managing content
US7735007B2 (en) Adding and removing white space from a document
EP3220252B1 (en) Gesture based document editor
US9158450B2 (en) Handwriting input device and handwriting input control program
US20040172595A1 (en) System and method for annotating web-based document
TWI533194B (en) Methods for generating reflow-content electronic-book and website system thereof
US7284200B2 (en) Organization of handwritten notes using handwritten titles
CN109710144B (en) Notebook page processing method, computer device and storage medium
CN114330253B (en) Document editing method, device and equipment and readable storage medium
US20160117548A1 (en) Electronic apparatus, method and storage medium
JP2014127158A (en) Electronic apparatus, display method, and program
CN111310421A (en) Text batch marking method, terminal and computer storage medium
CN113378526A (en) PDF paragraph processing method, device, storage medium and equipment
KR20210135195A (en) Apparatus and method for annotating document
JP2003115032A (en) Handwritten character input device and program for implementing the device
KR102458191B1 (en) Apparatus and method for annotating document

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