CN104156344B - Method for editing text and device - Google Patents

Method for editing text and device Download PDF

Info

Publication number
CN104156344B
CN104156344B CN201410345952.7A CN201410345952A CN104156344B CN 104156344 B CN104156344 B CN 104156344B CN 201410345952 A CN201410345952 A CN 201410345952A CN 104156344 B CN104156344 B CN 104156344B
Authority
CN
China
Prior art keywords
text
editor
terminal
point
content
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
CN201410345952.7A
Other languages
Chinese (zh)
Other versions
CN104156344A (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.)
Xiaomi Inc
Original Assignee
Xiaomi 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 Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201410345952.7A priority Critical patent/CN104156344B/en
Publication of CN104156344A publication Critical patent/CN104156344A/en
Application granted granted Critical
Publication of CN104156344B publication Critical patent/CN104156344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The disclosure discloses a kind of method for editing text and device, belongs to field of computer technology.Described method for editing text includes: receive text editing operations;Determine described text editing operations in-point in text and editor's terminal, described in-point is the offset location between initial character and the original position of described text in the content of text of request editor, and described editor's terminal is the offset location between last character and the end position of described text in the content of text of request editor;Described in-point, described editor's terminal and the content of text between described in-point and described editor's terminal are associated storage;According to content of text described in described text editing operations editor.The problem needing when solving terminal buffers text in correlation technique to consume a large amount of internal memory;Reach to reduce terminal and needed the content of caching, and then reduced the effect of the internal memory that needs take.

Description

Method for editing text and device
Technical field
It relates to field of computer technology, particularly to a kind of method for editing text and device.
Background technology
Along with popularizing of computer, text editing has become as one of common operative scenario.
Cancel to make user be capable of text in text editing process, a kind of literary composition that correlation technique provides This edit methods includes: terminal receives text editing operations, caches whole text, according to receive Content of text in text file is edited by text editing operations.So, cancel when terminal receives During operation, terminal can directly use the text of caching to replace the text after editing.
Open people, during realizing the disclosure, finds that correlation technique at least had following defects that due to end End needs the whole text before caching editor, so needs when this results in terminal buffers text Consume substantial amounts of internal memory.
Summary of the invention
Need to consume asking of a large amount of internal memory to solve in correlation technique the text before terminal buffers editor Topic, present disclose provides a kind of method for editing text and device.Described technical scheme is as follows:
First aspect according to disclosure embodiment, it is provided that a kind of method for editing text, including:
Receive text editing operations;
Determining described text editing operations in-point in text and editor's terminal, described editor rises Point is the side-play amount between initial character and the original position of described text in the content of text of request editor Position, described editor's terminal is the end of the last character in the content of text of request editor and described text Offset location between position;
By described in-point, described editor's terminal and be positioned at described in-point and described editor's terminal it Between content of text be associated storage;
According to content of text described in described text editing operations editor.
Alternatively, described determine described text editing operations in-point in text and editor terminal, Including:
If described text editing operations is input operation, then initial according to location cursor and described text Side-play amount between position calculates described in-point, and according to described location cursor and described text Side-play amount between end position calculates described editor's terminal;
If described text editing operations is forward direction deletion action, then according to location cursor slow astern character after Side-play amount between position and the original position of described text at place calculates described in-point, and root Side-play amount between the position and the end position of described text that are currently located according to described location cursor calculates Described editor's terminal;
If described text editing operations is backward deletion action, then the position being currently located according to described location cursor Put the side-play amount between the original position of described text and calculate described in-point, and according to described fixed Position cursor advances after a character side-play amount between position and the end position of described text at place Calculate described editor's terminal;
If described text editing operations is the selected deletion action to selected content of text, then according to described choosing Side-play amount between position and the original position of described text at first character place in fixed content of text Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal;
If described text editing operations is replacement operation, then according to replacing the text occurring searching in region first Side-play amount between position and the original position of described text of the first character in content calculates described volume Collect starting point, and the last character in the content of text of described lookup occurs according to last in described replacement region Side-play amount between position and the end position of described text of symbol calculates described editor's terminal;
If described text editing operations is the change operation of the form to the content of text chosen, then according to described choosing In content of text in first character place position and the original position of described text between side-play amount Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal.
Alternatively, described method also includes:
When described text editing operations is input operation, forward direction deletion action or backward deletion action, inspection Whether survey described text editing operations with the last history text edit operation received is operation associated;
If described text editing operations is operation associated with described history text edit operation, then from described literary composition The in-point of this edit operation and the in-point of described history text edit operation select minimum edit Point, selects from editor's terminal of described text editing operations and editor's terminal of described history text edit operation Select maximum editor's terminal;
Described minimum in-point, described maximum are edited terminal and be positioned at described minimum in-point and institute The content of text stated between maximum editor's terminal is associated storage;
If described text editing operations is not operation associated with described history text edit operation, then perform institute State described in-point, described editor's terminal and between described in-point and described editor's terminal Content of text be associated storage step.
Alternatively, the described text editing operations of described detection and the last history text editor received behaviour Whether it is operation associated, including:
Detect described text editing operations and whether described history text edit operation is same type of editor behaviour Make;
And/or,
Detect described text editing operations and whether described history text edit operation is that editor position continuous print is compiled Collect operation;
And/or,
Whether the edit session interval detecting described text editing operations and described history text edit operation is less than Predetermined time interval.
Alternatively, described method also includes:
Receive destruction operation;
From storage respectively organize in-point, editor terminal and content of text select corresponding with described destruction operation One group of in-point, editor's terminal and content of text;
Use selects to be in, in the content of text the obtained described text of replacement, the described editor selecting to obtain and rises Content of text between point and described editor's terminal.
Second aspect according to disclosure embodiment, it is provided that a kind of text editing apparatus, including:
Edit operation receiver module, is configured to receive text editing operations;
First determines module, is configured to determine that the described text that described edit operation receiver module receives is compiled Collecting operation in-point in text and editor's terminal, described in-point is the text that request is edited The offset location between initial character and the original position of described text in content, described editor's terminal It it is the offset bit between last character and the end position of described text in the content of text of request editor Put;
First memory module, is configured to determine described first described in-point that module determines, described Editor's terminal and the content of text between described in-point and described editor's terminal are associated depositing Storage;
Text editing module, is configured to according to content of text described in described text editing operations editor.
Alternatively, described first determines module, is configured to:
When described text editing operations is input operation, initial according to location cursor and described text Side-play amount between position calculates described in-point, and according to described location cursor and described text Side-play amount between end position calculates described editor's terminal;
When described text editing operations is forward direction deletion action, after cursor slow astern the character of location Side-play amount between position and the original position of described text at place calculates described in-point, and root Side-play amount between the position and the end position of described text that are currently located according to described location cursor calculates Described editor's terminal;
After described text editing operations is when deletion action, the position being currently located according to described location cursor Put the side-play amount between the original position of described text and calculate described in-point, and according to described fixed Position cursor advances after a character side-play amount between position and the end position of described text at place Calculate described editor's terminal;
When described text editing operations is to the selected deletion action of selected content of text, according to described choosing Side-play amount between position and the original position of described text at first character place in fixed content of text Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal;
When described text editing operations is replacement operation, then according to replacing the literary composition occurring searching in region first Side-play amount between position and the original position of described text of the first character in this content calculates described In-point, and last in the content of text of described lookup occurs according to last in described replacement region Side-play amount between position and the end position of described text of character calculates described editor's terminal;
When described text editing operations is the change operation of the form to the content of text chosen, according to described choosing In content of text in first character place position and the original position of described text between side-play amount Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal.
Alternatively, described device also includes:
Operation detection module, being configured at described text editing operations is input operation, forward direction deletion action Or during backward deletion action, detect described text editing operations and compile with the last history text received Collect whether operation is operation associated;
Second determines module, and being configured in the testing result of described operation detection module is described text editing When operation and described history text edit operation are operation associated, from the in-point of described text editing operations In-point minimum with selection in the in-point of described history text edit operation, grasps from described text editing The editor's terminal made and editor's terminal of described history text edit operation select maximum editor's terminal;
Second memory module, be configured to determine described second described minimum in-point that module determines, Described maximum editor's terminal and the text between described minimum in-point and described maximum editor's terminal Content is associated storage;
Described first memory module, being configured in the testing result of described operation detection module is described text When edit operation and described history text edit operation are not operation associated, perform described by described in-point, Described editor's terminal and the content of text between described in-point and described editor's terminal are associated The step of storage.
Alternatively, described operation detection module, including:
First detector unit, is configured to detect described text editing operations and described history text edit operation Whether it is same type of edit operation;
And/or,
Second detector unit, is configured to detect described text editing operations and described history text edit operation Whether it is editor's position continuous print edit operation;
And/or,
3rd detector unit, is configured to detect described text editing operations and described history text edit operation Edit session interval whether less than predetermined time interval.
Alternatively, described device also includes:
Destruction operation receiver module, is configured to receive destruction operation;
Information choice module, is configured to respectively organizing in-point, editor's terminal and content of text from storage Select one group in-point, editor terminal and the content of text corresponding with described destruction operation;
Content replacement module, the content of text being configured with selecting to obtain replaces place in described text In selecting the content of text between described in-point and the described editor's terminal obtained.
The third aspect according to disclosure embodiment, it is provided that a kind of text editing apparatus, including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
Receive text editing operations;
Determining described text editing operations in-point in text and editor's terminal, described editor rises Point is the side-play amount between initial character and the original position of described text in the content of text of request editor Position, described editor's terminal is the end of the last character in the content of text of request editor and described text Offset location between position;
By described in-point, described editor's terminal and be positioned at described in-point and described editor's terminal it Between content of text be associated storage;
According to content of text described in described text editing operations editor.
Embodiment of the disclosure that the technical scheme of offer can include following beneficial effect:
By by the in-point of text editing operations, edit terminal and be positioned at in-point and editor terminal Between content of text be associated storage so that terminal can without caching the full content in text, But only cache the partial content between in-point and editor's terminal, and then it is slow to solve terminal in correlation technique The problem needing when depositing text to consume a large amount of internal memory;Reach to reduce terminal and needed the content of caching, And then reduce the effect of the internal memory that needs take.
It should be appreciated that it is only exemplary that above general description and details hereinafter describe, can not Limit the disclosure.
Accompanying drawing explanation
Accompanying drawing herein is merged in description and constitutes the part of this specification, it is shown that meet the present invention Embodiment, and in description together for explaining the principle of the present invention.
Fig. 1 is the flow chart according to a kind of method for editing text shown in an exemplary embodiment.
Fig. 2 A is the flow chart according to a kind of method for editing text shown in another exemplary embodiment.
Fig. 2 B is the in-point determined according to the terminal shown in an exemplary embodiment and the signal of editor's terminal Figure.
Fig. 2 C is the in-point determined according to the terminal shown in an exemplary embodiment and the signal of editor's terminal Figure.
Fig. 2 D is the flow chart according to the another kind of method for editing text shown in another exemplary embodiment.
Fig. 3 is the block diagram according to a kind of text editing apparatus shown in an exemplary embodiment.
Fig. 4 is the block diagram according to a kind of text editing apparatus shown in another exemplary embodiment.
Fig. 5 is the block diagram according to a kind of device for text editing shown in an exemplary embodiment.
Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Following retouches Stating when relating to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element. Embodiment described in following exemplary embodiment does not represent all embodiment party consistent with the present invention Formula.On the contrary, they only with describe in detail in appended claims, the present invention some in terms of mutually one The example of the apparatus and method caused.
Fig. 1 is the flow chart according to a kind of method for editing text shown in an exemplary embodiment, such as Fig. 1 institute Showing, text edit methods may comprise steps of.
In a step 101, text editing operations is received.
In a step 102, text editing operations in-point in text and editor's terminal are determined.
Wherein, the initial character during in-point is the content of text of request editor and the original position of text Between offset location, editor's terminal is last character and the text in the content of text of request editor Offset location between end position.
In step 103, by in-point, terminal is edited and between in-point and editor's terminal Content of text be associated storage.
At step 104, according to text editing operations editor's content of text.
In sum, the method for editing text provided in disclosure embodiment, by by text editing operations In-point, editor's terminal and the content of text between in-point and editor's terminal are associated depositing Storage so that terminal without caching the full content in text, but can only cache in-point and volume Collect the partial content between terminal, and then solve to need to consume greatly during terminal buffers text in correlation technique The problem of amount internal memory;Reach to reduce terminal and needed the content of caching, and then reduce need to take interior The effect deposited.
The method provided in disclosure embodiment, may be used in the text editing of the multiple application such as note.
Fig. 2 A is the flow chart according to a kind of method for editing text shown in an exemplary embodiment, such as Fig. 2 A Shown in, text edit methods may comprise steps of.
In step 201, text editing operations is received.
When user needs to edit the content of text in text, user can apply text editing Operation, accordingly, terminal can receive text editing operations.
Such as, when user wants a certain position in text to increase content of text newly, user can be by Location cursor moves to this position, then performs input operation;Wherein, input operation can be that user passes through The input operation of input through keyboard, it is also possible to be user's input of being carried out by the insertion function in toolbar inputting Operation, this is not limited by the present embodiment.
When user wants a certain character deleting in the content of text of text, user can will position light The mobile position to this character of mark;When positioning cursor and moving the position before this character, User can use ' delete ' key to apply backward deletion action;In location, cursor moves after this character During position, user can use ' backspace ' key to apply forward direction deletion action.Wherein, in the present embodiment Backward deletion action is specific bit cursor when being positioned at a certain position, corresponding to user's pressing once ' delete ' key Operation;Forward direction deletion action is specific bit cursor when being positioned at a certain position, and user presses once ' backspace ' Operation corresponding to key.
When user wants the part content of text deleting text, user can select text content, Then ' backspace ' key or ' delete ' key is used to perform selected deletion action.
When user wants to be replaced a part of content of text in content of text, user can input to be needed Content of text to be searched, then performs the content of text of the lookup replaced in region is replaced to other texts The replacement operation of content;Wherein, replacing region can be the region that user selects, it is also possible to be from text literary composition The original position of part is to the Zone Full of end position, it is also possible to be from location cursor present position to head The region of last character position of the secondary content of text occurring searching, this is not done by the present embodiment Limit.
When user needs to carry out the part content of text in text form change, user can choose Text content, then performs the change operation of the form to the content of text chosen.
In step 202., text editing operations in-point in text and editor's terminal are determined.
After terminal receives text editing operations, for the execution of subsequent step, terminal may determine that text Edit operation in-point in text and editor's terminal.
Wherein, the initial character during in-point is the content of text of request editor and the original position of text Between offset location, editor's terminal is last character and the text in the content of text of request editor Offset location between end position.
When actual realization, according to the difference of the text editing operations that terminal receives, terminal determines edits The step of point and editor's terminal can include following several possible implementation:
In the implementation that the first is possible,
If text editing operations is input operation, then according between location cursor and the original position of text Side-play amount calculate in-point, and according to location cursor and the end position of text between side-play amount Calculate editor's terminal;
If the text editing operations received is input operation, then terminal can calculate from text Beginning position is to the first side-play amount of cursor position, location, by the side-play amount between original position for calculating The position of the first side-play amount obtained is defined as in-point;Meanwhile, terminal calculates the end from text Position is to the second side-play amount of cursor position, location, by the side-play amount between end position for calculating To the position of the second side-play amount be defined as editing terminal.
In the implementation that the second is possible,
If text editing operations is forward direction deletion action, then according to place after cursor slow astern the character of location Position and the original position of text between side-play amount calculate in-point, and according to location cursor work as Side-play amount between position and the end position of text at front place calculates editor's terminal;
If the text editing operations that terminal receives is forward direction deletion action, then terminal can calculate from text The original position of file is inclined to the position cursor position after present position slow astern character the 3rd Shifting amount, is defined as in-point by the position that the side-play amount between original position is the 3rd side-play amount;Meanwhile, Terminal calculates from the end position of text to the 4th side-play amount of location cursor present position, will be with Side-play amount between end position is that the position of the 4th side-play amount is defined as editing terminal.
In the implementation that the third is possible,
If text editing operations is backward deletion action, then the position being currently located according to location cursor and text Side-play amount between the original position of file calculates in-point, and according to location cursor advance a character it Side-play amount between position and the end position of text at rear place calculates editor's terminal;
If the text editing operations received is backward deletion action, then terminal can calculate from text Original position to location cursor position the 5th side-play amount, by the side-play amount between original position be The position of the 5th side-play amount is defined as in-point;Meanwhile, terminal calculate from the end position of text to Location cursor is the 6th side-play amount of position after a character is advanced in current location, will be with end position Between the position that side-play amount is the 6th side-play amount be defined as edit terminal.
In the 4th kind of possible implementation,
If text editing operations is the selected deletion action to selected content of text, then according to selected text In content, the side-play amount calculating between position and the original position of text at first character place is edited Point, according to the end position of the position at last character place in the content of text chosen and text it Between side-play amount calculate editor terminal;
If the text editing operations received is that then terminal can be counted to the selected deletion action choosing content Calculate the 7th the first character position from the original position of text to the content of text chosen Side-play amount, is defined as in-point by the position that the side-play amount between original position is the 7th side-play amount;With Time, terminal can also calculate the last character from the end position of text to the content of text chosen The 8th side-play amount between symbol position, by the position that the side-play amount between end position is the 8th side-play amount Put and be defined as editing terminal.
In the 5th kind of possible implementation,
If text editing operations is replacement operation, then according to replacing the content of text occurring searching in region first In first character position and the original position of text between side-play amount calculate in-point, and root Position and text according to last character replaced in the content of text that in region, last appearance is searched Side-play amount between end position calculates editor's terminal;
If the text editing operations received is replacement operation, then during terminal may determine that replacement region first The position of the first character in the content of text that appearance is searched, calculates from the original position of text to determining First character position between the 9th side-play amount, be the 9th skew by the side-play amount between original position The position of amount is defined as in-point;Meanwhile, in during terminal determines replacement region, there is the text searched in last The position of last character in appearance, calculates from the end position of text to the last character determined Tenth side-play amount of the position of symbol, determines the position that the side-play amount between end position is the tenth side-play amount For editor's terminal.
In the 6th kind of possible implementation,
If text editing operations is the change operation of the form to the content of text chosen, then according to the text chosen In content, the side-play amount calculating between position and the original position of text at first character place is edited Point, according to the end position of the position at last character place in the content of text chosen and text it Between side-play amount calculate editor terminal.
If the text editing operations received is that the form choosing content is changed operation, then terminal can be counted Calculate the tenth the first character position from the original position of text to the content of text chosen One side-play amount, is defined as in-point by the position that the side-play amount between original position is the 11st side-play amount; Meanwhile, terminal can also calculate last from the end position of text to the content of text chosen The 12nd side-play amount between character position, is the 12nd skew by the side-play amount between end position The position of amount is defined as editing terminal.
Such as, it is as a example by backward deletion action by text editing operations, refer to Fig. 2 B, after terminal receives When deletion action, the location location A that is marked in text of light, then terminal can by location A and from B location after location A one character of advance is defined as in-point and editor's terminal;It is similar to, with literary composition As a example by this edit operation is replacement operation, refer to Fig. 2 C, replacing region is the shadow region in figure, searches Content of text be ' content of text ', then location of C and D position can be defined as in-point and volume by terminal Collect terminal.
Need explanation on the other hand, when text editing operations is the volume that the content of text selected adds annotation When collecting operation, terminal can calculate the inclined of the first character in the content of text selected from original position to user Shifting amount, is defined as in-point by the position that the side-play amount between original position is calculated side-play amount; Meanwhile, last character during terminal can also calculate the content of text selected from end position to user Side-play amount, is defined as editor eventually by the position that the side-play amount between end position is calculated side-play amount Point, the present embodiment does not repeats them here.
In step 203, by in-point, terminal is edited and between in-point and editor's terminal Content of text be associated storage.
After terminal determines in-point and editor's terminal, terminal may determine that to be positioned in text and edits Content of text between point and editor's terminal, then by in-point, editor's terminal and the text determined Hold and be associated storage.Being as a example by backward deletion action by text editing operations, terminal can be by location A, B Position and ' civilian ' between location A and B location are associated storage.
When actual realization, terminal can safeguard that one is cancelled storehouse, when terminal receives text editing operations Time, terminal can be by the text of the in-point corresponding to text editing operations, editor's terminal and correspondence Hold combination to store to cancelling in storehouse.And when terminal receives multiple text editing operations, terminal is permissible The in-point corresponding to text editing operations, editor's terminal and the content of text that to receive successively every time Store to cancelling in storehouse.
It should be noted is that, when text editing operations is input operation, in-point in text And there is no content of text between editor's terminal, now terminal can be by the literary composition between in-point and editor's terminal This curriculum offering is empty.
Need explanation on the other hand, when text editing operations is the volume that the content of text selected adds annotation During volume operation, terminal can use content in the annotation that user adds replace in-point and editor's terminal it Between content of text store.
In step 204, according to text editing operations editor's content of text.
Such as, it is still that as a example by backward deletion action, deletion is in location A by terminal by text editing operations And ' civilian ' between B location.
It should be noted that the present embodiment simply first carries out by terminal as a example by performing step 204 after step 203, When actual realization, terminal performs step 203 after can also first carrying out step 204, or performs step simultaneously 203 and step 204, it is only necessary to ensure that step 203 and step 204 perform after step 202, right Its actual execution sequence does not limit.
In step 205, destruction operation is received;
After the content of text of text is edited by terminal, when user wants to return to content of text During state before editor, user can click on and cancel button, and accordingly, terminal can receive and cancel behaviour Make.
It should be noted that step 205 is step 201 to the step performed after step 204, in reality When realizing, step 201 to step 204 can perform repeatedly before step 205, it is also possible to performs once, This is not limited by the present embodiment.
In step 206, in-point, editor's terminal and content of text select from respectively organizing of storage and removes One group of in-point, editor's terminal and the content of text that pin operation is corresponding;
Wherein, corresponding with destruction operation one group of in-point, editor's terminal and content of text refer to: terminal Before receiving destruction operation, the in-point corresponding to text editing operations that the last time receives, Editor's terminal and content of text.
When actual realization, terminal can select storehouse to be in the in-point at storehouse top, volume from cancelling Volume terminal and content of text, the in-point that selection is obtained, editor's terminal and content of text as with this One group of in-point, editor's terminal and the content of text that destruction operation is corresponding.
In step 207, the content of text using selection to obtain is replaced and is in what selection obtained in text Content of text between in-point and editor's terminal.
Terminal can use and select the content of text that obtains to replace in text to be in the editor selecting to obtain to rise Content of text between point and editor's terminal.
Such as, terminal selects in-point, editor's terminal and content of text are followed successively by location A, B position Put and ' civilian ';Then terminal can use ' civilian ' to replace in text to be between location A and B location Content of text, also will ' civilian ' add between location A and B location.
It should be noted that after terminal performs to cancel, when user wants the text recovered before cancelling civilian During part, user can also click on recovery button, and accordingly, terminal can receive recovery operation.Connect in terminal After receiving recovery operation, terminal can select the in-point corresponding with recovery operation, editor's terminal and Content of text between in-point and editor's terminal, then uses and selects the content of text obtained to replace text In file in-point and editor terminal between content of text.
When actual realization, after terminal execution text is cancelled, the editor that selection obtains can be risen by terminal Point, editor's terminal and the content of text combination replaced store to recovering in storehouse.Further, connect when terminal When receiving repeatedly destruction operation, terminal can be by the in-point corresponding to each destruction operation, editor's terminal And content of text combines successively and stores to recovering in storehouse.Hereafter, when terminal receives recovery operation, Terminal can select in-point, editor's terminal and the content of text recovering to be in storehouse top in storehouse, will Select the in-point obtained, editor's terminal be defined as with content of text the in-point corresponding with recovery operation, Editor's terminal and content of text.
Additionally, after terminal performs text recovery, in-point, editor that selection can be obtained by terminal are whole Point and the content of text combination replaced store to cancelling in storehouse, and the present embodiment does not repeats them here.
In sum, the method for editing text provided in disclosure embodiment, by by text editing operations In-point, editor's terminal and the content of text between in-point and editor's terminal are associated depositing Storage so that terminal without caching the full content in text, but can only cache in-point and volume Collect the partial content between terminal, and then solve to need to consume greatly during terminal buffers text in correlation technique The problem of amount internal memory;Reach to reduce terminal and needed the content of caching, and then reduce need to take interior The effect deposited.
It should be noted that refer to Fig. 2 D, before performing step 203, terminal can also carry out as follows Step:
In a step 208, it is input operation, forward direction deletion action or backward deletion when text editing operations During operation, whether the history text edit operation that detection text editing operations received with the last time associates Operation, if testing result is for being operation associated, then performs step 209;If testing result is not for being association Operation, then perform step 203.
Wherein, at least one during this step can include following detection mode:
The first:
Whether detection text editing operations and history text edit operation are same type of edit operations;
Whether terminal detection text editing operations and history text edit operation are same type of edit operations, If testing result is for being same type of edit operation, then terminal may determine that text editing operations and history Text editing operations is operation associated, otherwise, it not the most operation associated.
Such as, text editing operations is input operation, and the history text edit operation that the last time receives is also Be input operation, then terminal may determine that text editing operations and history text edit operation are operation associated. And if text editing operations is input operation, and history text edit operation be forward direction deletion action or after To deletion action or replacement operation, then terminal may determine that text editing operations and history text edit operation It not operation associated.
It should be noted that it is equal to the purpose of deletion action or backward deletion action before execution due to user Being to delete the content of text in text, so in the present embodiment, terminal can be by forward direction deletion action Being defined as operation associated with backward deletion action, this is not limited by the present embodiment.
The second:
Whether detection text editing operations and history text edit operation are editor's position continuous print edit operations;
Terminal can also detect text editing operations and whether history text edit operation is editor position continuous print Edit operation, if testing result is for being editor's position continuous print edit operation, then terminal may determine that text Edit operation and history text edit operation are operation associated, otherwise, it not the most operation associated.Wherein, compile Collect position refer to the in-point of text editing operations continuously or edit terminal and history text edit operation In-point or editor's terminal are same point.
The third:
Whether the edit session interval of detection text editing operations and history text edit operation is less than the scheduled time Interval.
The edit session interval that terminal can also detect text editing operations and history text edit operation is the least In predetermined time interval, such as whether detection edit session interval is less than ' 2S ', if testing result is for editor Between interval less than predetermined time interval, it is determined that text editing operations is to associate behaviour with history text edit operation Make, otherwise, it not the most operation associated.
In step 209, from the editor of the in-point of text editing operations and history text edit operation Point selects minimum in-point, from editor's terminal and the volume of history text edit operation of text editing operations Collect and terminal selects maximum editor's terminal.
If the testing result of terminal is text editing operations and history text edit operation is operation associated, then Terminal can select from the in-point of the in-point of text editing operations and history text edit operation Little in-point, and from editor's terminal of text editing operations and editor's terminal of history text edit operation Select maximum editor's terminal.Wherein, minimum in-point is the volume that the side-play amount between original position is minimum Collecting starting point, maximum editor's terminal is editor's terminal that the side-play amount between end position is minimum.
In step 210, by minimum in-point, maximum editor's terminal and be positioned at minimum in-point and Content of text between maximum editor's terminal is associated storage.
After terminal selects to obtain minimum in-point and maximum editor's terminal, terminal can be by minimum editor Starting point, maximum in-point and the content of text between minimum in-point and maximum editor's terminal enter Row association storage.
Edit terminal in terminal storage minimum in-point, maximum and be positioned at minimum in-point and maximum volume After collecting the content of text between terminal, when terminal receives destruction operation, terminal can recover minimum volume Collecting the whole content of edit between starting point and maximum editor's terminal, decreasing user needs perform to cancel step, Improve text and cancel efficiency.Additionally, terminal only need to be to minimum in-point, maximum editor's terminal and position Content of text between minimum in-point and maximum editor's terminal stores, and without to each text The in-point of edit operation, the content of text between editor's terminal and in-point and editor's terminal are carried out Storage, decreasing terminal needs the in-point of storage, editor's terminal and the number of content of text, reduces The internal memory taken is needed during terminal buffers.
Following for disclosure device embodiment, may be used for performing method of disclosure embodiment.For the disclosure The details not disclosed in device embodiment, refer to method of disclosure embodiment.
Fig. 3 is the block diagram according to a kind of text editing apparatus shown in an exemplary embodiment, as it is shown on figure 3, Text editing device can include but not limited to: edit operation receiver module 301, first determine module 302, First memory module 303 and text editing module 304.
Edit operation receiver module 301, is configured to receive text editing operations;
First determines module 302, is configured to determine that the text editing that edit operation receiver module 301 receives Operation in-point in text and editor's terminal, in-point is in the content of text of request editor Initial character and the original position of text between offset location, editor terminal be request editor literary composition The offset location between last character and the end position of text in this content;
First memory module 303, is configured to determine first in-point that module 302 determines, editor eventually Point and the content of text between in-point and editor's terminal are associated storage;
Text editing module 304, is configured to according to text editing operations editor's content of text.
In sum, the text editing apparatus provided in disclosure embodiment, by by text editing operations In-point, editor's terminal and the content of text between in-point and editor's terminal are associated depositing Storage so that terminal without caching the full content in text, but can only cache in-point and volume Collect the partial content between terminal, and then solve to need to consume greatly during terminal buffers text in correlation technique The problem of amount internal memory;Reach to reduce terminal and needed the content of caching, and then reduce need to take interior The effect deposited.
Fig. 4 is the block diagram according to a kind of text editing apparatus shown in another exemplary embodiment, such as Fig. 4 institute Showing, text editing device can include but not limited to: edit operation receiver module 401, first determines module 402, the first memory module 403 and text editing module 404.
Edit operation receiver module 401, is configured to receive text editing operations;
First determines module 402, is configured to determine that the text editing that edit operation receiver module 401 receives Operation in-point in text and editor's terminal, in-point is in the content of text of request editor Initial character and the original position of text between offset location, editor terminal be request editor literary composition The offset location between last character and the end position of text in this content;
First memory module 403, is configured to determine first in-point that module 402 determines, editor eventually Point and the content of text between in-point and editor's terminal are associated storage;
Text editing module 404, is configured to according to text editing operations editor's content of text.
In the first possible implementation of the present embodiment, first determines module 402, is configured to:
According to the side-play amount calculating in-point between location cursor and the original position of text, and according to Side-play amount between location cursor and the end position of text calculates editor's terminal;
When text editing operations is forward direction deletion action, according to place after cursor slow astern the character of location Position and the original position of text between side-play amount calculate in-point, and according to location cursor work as Side-play amount between position and the end position of text at front place calculates editor's terminal;
After text editing operations is when deletion action, the position being currently located according to location cursor and text Side-play amount between the original position of file calculates in-point, and according to location cursor advance a character it Side-play amount between position and the end position of text at rear place calculates editor's terminal;
When text editing operations is to the selected deletion action of selected content of text, according to selected text In content, the side-play amount calculating between position and the original position of text at first character place is edited Point, according to the end position of the position at last character place in the content of text chosen and text it Between side-play amount calculate editor terminal;
When text editing operations is replacement operation, then according to replacing in the text occurring searching in region first Side-play amount between position and the original position of text of the first character in appearance calculates in-point, and Position according to last character replaced in the content of text that in region, last appearance is searched and text End position between side-play amount calculate editor terminal;
When text editing operations is the change operation of the form to the content of text chosen, according to the text chosen In content, the side-play amount calculating between position and the original position of text at first character place is edited Point, according to the end position of the position at last character place in the content of text chosen and text it Between side-play amount calculate editor terminal.
In the implementation that the second of the present embodiment is possible, device also includes:
Operation detection module 405, be configured to text editing operations be input operation, forward direction deletion action or After person when deletion action, detection text editing operations and the last history text edit operation received Whether it is operation associated;
Second determines module 406, and being configured in the testing result of operation detection module 405 is text editing behaviour When work and history text edit operation are operation associated, from in-point and the history text of text editing operations The in-point of edit operation selects minimum in-point, from editor's terminal and the history of text editing operations Editor's terminal of text editing operations selects maximum editor's terminal;
Second memory module 407, is configured to determine second minimum in-point that module 406 determines, Great editor terminal and the content of text between minimum in-point and maximum editor's terminal are associated depositing Storage;
First memory module 403, being configured in the testing result of operation detection module 405 is text editing behaviour When work and history text edit operation are not operation associated, perform in-point, editor's terminal and be positioned at Content of text between in-point and editor's terminal is associated the step of storage.
In the third possible implementation of the present embodiment, operate detection module 405, including:
First detector unit 405a, is configured to whether detect text editing operations and history text edit operation It it is same type of edit operation;
And/or,
Second detector unit 405b, is configured to whether detect text editing operations and history text edit operation It it is editor's position continuous print edit operation;
And/or,
3rd detector unit 405c, is configured to the volume detecting text editing operations with history text edit operation Whether collect time interval less than predetermined time interval.
In the 4th kind of possible implementation of the present embodiment, device also includes:
Destruction operation receiver module 408, is configured to receive destruction operation;
Information choice module 409, is configured to respectively organize in-point, editor's terminal and content of text from store One group of in-point, editor's terminal and the content of text that middle selection is corresponding with destruction operation;
Content replacement module 410, is configured with selecting the content of text obtained to replace in text and is in Select the content of text between in-point and the editor's terminal obtained.
In sum, the text editing apparatus provided in disclosure embodiment, by by text editing operations In-point, editor's terminal and the content of text between in-point and editor's terminal are associated depositing Storage so that terminal without caching the full content in text, but can only cache in-point and volume Collect the partial content between terminal, and then solve to need to consume greatly during terminal buffers text in correlation technique The problem of amount internal memory;Reach to reduce terminal and needed the content of caching, and then reduce need to take interior The effect deposited.
About the device in above-described embodiment, wherein modules performs the concrete mode of operation relevant The embodiment of the method is described in detail, explanation will be not set forth in detail herein.
Fig. 5 is the block diagram according to a kind of text editing apparatus 500 shown in an exemplary embodiment.Such as, Device 500 can be mobile phone, computer, digital broadcast terminal, messaging devices, and game controls Platform, tablet device, armarium, body-building equipment, personal digital assistant etc..
With reference to Fig. 5, device 500 can include following one or more assembly: processes assembly 502, memorizer 504, power supply module 506, multimedia groupware 508, audio-frequency assembly 510, the interface of input/output (I/O) 512, sensor cluster 514, and communications component 516.
Process assembly 502 and generally control the integrated operation of device 500, such as with display, call, number The operation being associated according to communication, camera operation and record operation.Process assembly 502 and can include one or many Individual processor 518 performs instruction, to complete all or part of step of above-mentioned method.Additionally, process Assembly 502 can include one or more module, it is simple to process between assembly 502 and other assemblies is mutual. Such as, process assembly 502 and can include multi-media module, to facilitate multimedia groupware 508 and to process assembly Mutual between 502.
Memorizer 504 is configured to store various types of data to support the operation at device 500.These The example of data includes any application program for operating on device 500 or the instruction of method, contact person Data, telephone book data, message, picture, video etc..Memorizer 504 can be by any kind of volatile Property or non-volatile memory device or combinations thereof realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), Programmable read only memory (PROM), read only memory (ROM), magnetic memory, flash memory, Disk or CD.
The various assemblies that power supply module 506 is device 500 provide electric power.Power supply module 506 can include electricity Management system, one or more power supplys, and other generate, manage and distribute electric power phase with for device 500 The assembly of association.
The screen of one output interface of offer that multimedia groupware 508 is included between described device 500 and user Curtain.In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).As Really screen includes that touch panel, screen may be implemented as touch screen, to receive the input signal from user. Touch panel includes that one or more touch sensor is with the gesture on sensing touch, slip and touch panel. Described touch sensor can not only sense touch or the border of sliding action, but also detects and described touch Or slide relevant persistent period and pressure.In certain embodiments, multimedia groupware 508 includes one Individual front-facing camera and/or post-positioned pick-up head.When device 500 is in operator scheme, such as screening-mode or video During pattern, front-facing camera and/or post-positioned pick-up head can receive the multi-medium data of outside.Each preposition take the photograph As head and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom energy Power.
Audio-frequency assembly 510 is configured to output and/or input audio signal.Such as, audio-frequency assembly 510 includes One mike (MIC), when device 500 is in operator scheme, such as call model, logging mode and voice During recognition mode, mike is configured to receive external audio signal.The audio signal received can be entered One step is stored in memorizer 504 or sends via communications component 516.In certain embodiments, audio-frequency assembly 510 also include a speaker, are used for exporting audio signal.
I/O interface 512 provides interface, above-mentioned peripheral interface for processing between assembly 502 and peripheral interface module Module can be keyboard, puts striking wheel, button etc..These buttons may include but be not limited to: home button, sound Amount button, start button and locking press button.
Sensor cluster 514 includes one or more sensor, for providing various aspects for device 500 State estimation.Such as, what sensor cluster 514 can detect device 500 opens/closed mode, assembly Relative localization, the most described assembly is display and the keypad of device 500, and sensor cluster 514 is also Device 500 or the position change of 500 1 assemblies of device, user and depositing that device 500 contacts can be detected Or do not exist, device 500 orientation or acceleration/deceleration and the variations in temperature of device 500.Sensor cluster 514 Proximity transducer can be included, be configured to when there is no any physical contact depositing of object near detection ?.Sensor cluster 514 can also include optical sensor, such as CMOS or ccd image sensor, is used for Imaging applications uses.In certain embodiments, this sensor cluster 514 can also include that acceleration passes Sensor, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 516 is configured to facilitate the logical of wired or wireless mode between device 500 and other equipment Letter.Device 500 can access wireless network based on communication standard, such as WiFi, 2G or 3G, or they Combination.In one exemplary embodiment, communications component 516 receives wide from outside via broadcast channel The broadcast singal of broadcast management system or broadcast related information.In one exemplary embodiment, described communication set Part 516 also includes near-field communication (NFC) module, to promote junction service.Such as, can in NFC module Based on RF identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra broadband (UWB) skill Art, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 500 can by one or more application specific integrated circuits (ASIC), Digital signal processor (DSP), digital signal processing appts (DSPD), PLD (PLD), Field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are real Existing, it is used for performing said method.
In the exemplary embodiment, a kind of non-transitory computer-readable storage medium including instruction is additionally provided Matter, such as, include the memorizer 504 of instruction, and above-mentioned instruction can be performed by the processor 518 of device 500 with complete Become said method.Such as, described non-transitory computer-readable recording medium can be ROM, random access memory Memorizer (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
It should be appreciated that the invention is not limited in accurate knot described above and illustrated in the accompanying drawings Structure, and various modifications and changes can carried out without departing from the scope.The scope of the present invention is only by appended Claim limits.

Claims (9)

1. a method for editing text, it is characterised in that including:
Receive text editing operations;
Determining described text editing operations in-point in text and editor's terminal, described editor rises Point is the side-play amount between initial character and the original position of described text in the content of text of request editor Position, described editor's terminal is the end of the last character in the content of text of request editor and described text Offset location between position;
By described in-point, described editor's terminal and be positioned at described in-point and described editor's terminal it Between content of text be associated storage;
According to content of text described in described text editing operations editor;
Wherein, described determine described text editing operations in-point in text and editor terminal, Including:
If described text editing operations is input operation, then initial according to location cursor and described text Side-play amount between position calculates described in-point, and according to described location cursor and described text Side-play amount between end position calculates described editor's terminal;
If described text editing operations is forward direction deletion action, then according to location cursor slow astern character after Side-play amount between position and the original position of described text at place calculates described in-point, and root Side-play amount between the position and the end position of described text that are currently located according to described location cursor calculates Described editor's terminal;
If described text editing operations is backward deletion action, then the position being currently located according to described location cursor Put the side-play amount between the original position of described text and calculate described in-point, and according to described fixed Position cursor advances after a character side-play amount between position and the end position of described text at place Calculate described editor's terminal;
If described text editing operations is the selected deletion action to selected content of text, then according to described choosing Side-play amount between position and the original position of described text at first character place in fixed content of text Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal;
If described text editing operations is replacement operation, then according to replacing the text occurring searching in region first Side-play amount between position and the original position of described text of the first character in content calculates described volume Collect starting point, and the last character in the content of text of described lookup occurs according to last in described replacement region Side-play amount between position and the end position of described text of symbol calculates described editor's terminal;
If described text editing operations is the change operation of the form to the content of text chosen, then according to described choosing In content of text in first character place position and the original position of described text between side-play amount Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal.
Method the most according to claim 1, it is characterised in that described method also includes:
When described text editing operations is input operation, forward direction deletion action or backward deletion action, inspection Whether survey described text editing operations with the last history text edit operation received is operation associated;
If described text editing operations is operation associated with described history text edit operation, then from described literary composition The in-point of this edit operation and the in-point of described history text edit operation select minimum edit Point, selects from editor's terminal of described text editing operations and editor's terminal of described history text edit operation Select maximum editor's terminal;
Described minimum in-point, described maximum are edited terminal and be positioned at described minimum in-point and institute The content of text stated between maximum editor's terminal is associated storage;
If described text editing operations is not operation associated with described history text edit operation, then perform institute State described in-point, described editor's terminal and between described in-point and described editor's terminal Content of text be associated storage step.
Method the most according to claim 2, it is characterised in that the described text editing operations of described detection Whether the history text edit operation received with the last time is operation associated, including:
Detect described text editing operations and whether described history text edit operation is same type of editor behaviour Make;
And/or,
Detect described text editing operations and whether described history text edit operation is that editor position continuous print is compiled Collect operation;
And/or,
Whether the edit session interval detecting described text editing operations and described history text edit operation is less than Predetermined time interval.
4. according to the arbitrary described method of claims 1 to 3, it is characterised in that described method also includes:
Receive destruction operation;
From storage respectively organize in-point, editor terminal and content of text select corresponding with described destruction operation One group of in-point, editor's terminal and content of text;
Use selects to be in, in the content of text the obtained described text of replacement, the described editor selecting to obtain and rises Content of text between point and described editor's terminal.
5. a text editing apparatus, it is characterised in that including:
Edit operation receiver module, is configured to receive text editing operations;
First determines module, is configured to determine that the described text that described edit operation receiver module receives is compiled Collecting operation in-point in text and editor's terminal, described in-point is the text that request is edited The offset location between initial character and the original position of described text in content, described editor's terminal It it is the offset bit between last character and the end position of described text in the content of text of request editor Put;
First memory module, is configured to determine described first described in-point that module determines, described Editor's terminal and the content of text between described in-point and described editor's terminal are associated depositing Storage;
Text editing module, is configured to according to content of text described in described text editing operations editor;
Wherein, described first determines module, is configured to:
When described text editing operations is input operation, initial according to location cursor and described text Side-play amount between position calculates described in-point, and according to described location cursor and described text Side-play amount between end position calculates described editor's terminal;
When described text editing operations is forward direction deletion action, after cursor slow astern the character of location Side-play amount between position and the original position of described text at place calculates described in-point, and root Side-play amount between the position and the end position of described text that are currently located according to described location cursor calculates Described editor's terminal;
After described text editing operations is when deletion action, the position being currently located according to described location cursor Put the side-play amount between the original position of described text and calculate described in-point, and according to described fixed Position cursor advances after a character side-play amount between position and the end position of described text at place Calculate described editor's terminal;
When described text editing operations is to the selected deletion action of selected content of text, according to described choosing Side-play amount between position and the original position of described text at first character place in fixed content of text Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal;
When described text editing operations is replacement operation, then according to replacing the literary composition occurring searching in region first Side-play amount between position and the original position of described text of the first character in this content calculates described In-point, and last in the content of text of described lookup occurs according to last in described replacement region Side-play amount between position and the end position of described text of character calculates described editor's terminal;
When described text editing operations is the change operation of the form to the content of text chosen, according to described choosing In content of text in first character place position and the original position of described text between side-play amount Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal.
Device the most according to claim 5, it is characterised in that described device also includes:
Operation detection module, being configured at described text editing operations is input operation, forward direction deletion action Or during backward deletion action, detect described text editing operations and compile with the last history text received Collect whether operation is operation associated;
Second determines module, and being configured in the testing result of described operation detection module is described text editing When operation and described history text edit operation are operation associated, from the in-point of described text editing operations In-point minimum with selection in the in-point of described history text edit operation, grasps from described text editing The editor's terminal made and editor's terminal of described history text edit operation select maximum editor's terminal;
Second memory module, be configured to determine described second described minimum in-point that module determines, Described maximum editor's terminal and the text between described minimum in-point and described maximum editor's terminal Content is associated storage;
Described first memory module, being configured in the testing result of described operation detection module is described text When edit operation and described history text edit operation are not operation associated, perform described by described in-point, Described editor's terminal and the content of text between described in-point and described editor's terminal are associated The step of storage.
Device the most according to claim 6, it is characterised in that described operation detection module, including:
First detector unit, is configured to detect described text editing operations and described history text edit operation Whether it is same type of edit operation;
And/or,
Second detector unit, is configured to detect described text editing operations and described history text edit operation Whether it is editor's position continuous print edit operation;
And/or,
3rd detector unit, is configured to detect described text editing operations and described history text edit operation Edit session interval whether less than predetermined time interval.
8. according to the arbitrary described device of claim 5 to 7, it is characterised in that described device also includes:
Destruction operation receiver module, is configured to receive destruction operation;
Information choice module, is configured to respectively organizing in-point, editor's terminal and content of text from storage Select one group in-point, editor terminal and the content of text corresponding with described destruction operation;
Content replacement module, the content of text being configured with selecting to obtain replaces place in described text In selecting the content of text between described in-point and the described editor's terminal obtained.
9. a text editing apparatus, it is characterised in that including:
Processor;
For storing the memorizer of processor executable;
Wherein, described processor is configured to:
Receive text editing operations;
Determining described text editing operations in-point in text and editor's terminal, described editor rises Point is the side-play amount between initial character and the original position of described text in the content of text of request editor Position, described editor's terminal is the end of the last character in the content of text of request editor and described text Offset location between position;
By described in-point, described editor's terminal and be positioned at described in-point and described editor's terminal it Between content of text be associated storage;
According to content of text described in described text editing operations editor;
Wherein, described determine described text editing operations in-point in text and editor terminal, Including:
If described text editing operations is input operation, then initial according to location cursor and described text Side-play amount between position calculates described in-point, and according to described location cursor and described text Side-play amount between end position calculates described editor's terminal;
If described text editing operations is forward direction deletion action, then according to location cursor slow astern character after Side-play amount between position and the original position of described text at place calculates described in-point, and root Side-play amount between the position and the end position of described text that are currently located according to described location cursor calculates Described editor's terminal;
If described text editing operations is backward deletion action, then the position being currently located according to described location cursor Put the side-play amount between the original position of described text and calculate described in-point, and according to described fixed Position cursor advances after a character side-play amount between position and the end position of described text at place Calculate described editor's terminal;
If described text editing operations is the selected deletion action to selected content of text, then according to described choosing Side-play amount between position and the original position of described text at first character place in fixed content of text Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal;
If described text editing operations is replacement operation, then according to replacing the text occurring searching in region first Side-play amount between position and the original position of described text of the first character in content calculates described volume Collect starting point, and the last character in the content of text of described lookup occurs according to last in described replacement region Side-play amount between position and the end position of described text of symbol calculates described editor's terminal;
If described text editing operations is the change operation of the form to the content of text chosen, then according to described choosing In content of text in first character place position and the original position of described text between side-play amount Calculate described in-point, according to the position at last character place in the described content of text chosen and institute State the side-play amount between the end position of text and calculate described editor's terminal.
CN201410345952.7A 2014-07-21 2014-07-21 Method for editing text and device Active CN104156344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410345952.7A CN104156344B (en) 2014-07-21 2014-07-21 Method for editing text and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410345952.7A CN104156344B (en) 2014-07-21 2014-07-21 Method for editing text and device

Publications (2)

Publication Number Publication Date
CN104156344A CN104156344A (en) 2014-11-19
CN104156344B true CN104156344B (en) 2016-09-28

Family

ID=51881849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410345952.7A Active CN104156344B (en) 2014-07-21 2014-07-21 Method for editing text and device

Country Status (1)

Country Link
CN (1) CN104156344B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201017A (en) * 2016-07-19 2016-12-07 深圳市金立通信设备有限公司 A kind of input method and terminal
CN107423267B (en) * 2017-03-20 2021-03-05 广州视源电子科技股份有限公司 Method and system for transmitting and combining modified files based on cursor positioning
CN108646962B (en) * 2018-05-11 2021-06-29 Oppo(重庆)智能科技有限公司 Editing method and device for terminal desktop layout, storage medium and mobile terminal
CN112784545B (en) * 2020-07-15 2023-06-27 山东核电有限公司 Dynamic chart editing method of radioactive gamma nuclide report file

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5604853A (en) * 1991-05-18 1997-02-18 Fujitsu Limited Text editor using insert, update and delete structures for undo and redo operations
CN101031911A (en) * 2004-11-12 2007-09-05 佳思腾软件公司 Document processing device, and document processing method
CN101040250A (en) * 2004-11-12 2007-09-19 佳思腾软件公司 Data processing device and data processing method
CN102414679A (en) * 2009-04-29 2012-04-11 微软公司 Maintaining undo and redo capability across metadata merges
CN104424169A (en) * 2013-08-20 2015-03-18 柯尼卡美能达株式会社 Document Editing Apparatus And Document Editing Method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8892435B2 (en) * 2008-04-03 2014-11-18 Nec Corporation Text data processing apparatus, text data processing method, and recording medium storing text data processing program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5604853A (en) * 1991-05-18 1997-02-18 Fujitsu Limited Text editor using insert, update and delete structures for undo and redo operations
CN101031911A (en) * 2004-11-12 2007-09-05 佳思腾软件公司 Document processing device, and document processing method
CN101040250A (en) * 2004-11-12 2007-09-19 佳思腾软件公司 Data processing device and data processing method
CN102414679A (en) * 2009-04-29 2012-04-11 微软公司 Maintaining undo and redo capability across metadata merges
CN104424169A (en) * 2013-08-20 2015-03-18 柯尼卡美能达株式会社 Document Editing Apparatus And Document Editing Method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"多步无限撤销及恢复算法与实现";赵高长;《西安科技大学学报》;20090731;第29卷(第4期);第500-504页 *

Also Published As

Publication number Publication date
CN104156344A (en) 2014-11-19

Similar Documents

Publication Publication Date Title
CN105159871B (en) Text message detection method and device
CN107239535A (en) Similar pictures search method and device
CN105094814A (en) Method and device for notification information display
CN103995648B (en) The method and apparatus of browsing list
CN108108418A (en) Picture management method, device and storage medium
CN104834433B (en) Method for editing text, device and terminal
CN104156344B (en) Method for editing text and device
CN106202223A (en) Content collection method, device and for collecting the device of content in application program
CN107203505A (en) Text message edit methods and device
CN105608462A (en) Character similarity judgment method and device
CN105654533A (en) Picture editing method and picture editing device
CN104503690A (en) Arrangement method and device for application icons
CN105447109A (en) Key word searching method and apparatus
CN106096009A (en) Method for generating message and device
CN109413478A (en) Video editing method, device, electronic equipment and storage medium
CN104615663A (en) File sorting method and device and terminal
CN104461348A (en) Method and device for selecting information
CN106547547A (en) Collecting method and device
CN105956067A (en) Resource searching method and apparatus
CN105354284A (en) Template processing method and apparatus and short message identification method and apparatus
CN104035764B (en) Object control method and relevant apparatus
CN105630749A (en) Extraction method and device of digital information
CN107729098A (en) Method for displaying user interface and device
CN104681049B (en) The display methods and device of prompt message
CN105487799A (en) Content conversion method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant