Background technology
Data processing equipment such as computer, smart mobile phone have been widely applied in the production and life of people.Data
A kind of important function of processing equipment is the processing to word.Therefore various character input methods are used and given birth to.
The character input method is generally manufactured to character input method software, the common word input of character input method software
Process is:(1) user starts input method software;(2) user by keyboard operation to input method software input coding, the coding
Pinyin coding, root coding in being inputted such as Chinese character, the character code in English input etc.;(3) input method software is by input
Code conversion is that candidate character is shown in candidate frame;(4) user selects the word in candidate frame, triggers upper screen key, common
Upper screen key such as space bar, enter key, digital selective key etc.;(5) the word input that user selects is shown to number by input method software
According to the cursor position on processing equipment screen, the operation that the word chosen input is shown to screen is also referred to as " upper screen " by this,
The word being input to every time by the operation of the step (2) to step (5) on screen is referred to as once " above shielding word ".
In input method, the upper screen word that user is inputted by input method software is recorded usually using dictionary.It is generally every
Once the upper screen word of upper screen operation will be used as one to learn word and be included in dictionary.Dictionary includes learning corresponding to each upper screen word
Word and its number is included in, a upper screen word generally visually as one is learned word and is included in the process of dictionary by industry to be called and " learn
Practise storage " process.Input method software determines follow-up prioritizing selection meter under the same conditions according to the number that is included in of dictionary middle school word
Word more than indegree, and preferentially it is illustrated in candidate regions.
During word is inputted, often due to input error needs to modify to the word inputted, and to word
Word in storehouse is corrected accordingly.The dictionary data antidote of existing character input method generally has two kinds.
Fig. 1 is a kind of flow chart of the dictionary data antidote of the character input method of prior art one., should referring to Fig. 1
Method includes:After often inputting once upper screen word, it is stored in word is shielded on this in a temporal cache, judges whether to continue afterwards
Next upper screen word is have input, if having input, judges to confirm that screen word is to learn word on this in the temporal cache, by this
Screen word is included in dictionary as word is learned on this in temporal cache;If not continuing to input next upper screen word, but carry out
Other modification operations, then remove the upper screen word in the temporal cache.
Fig. 2 is a kind of flow chart of the dictionary data antidote of the character input method software of prior art two.Referring to figure
2, this method does not need temporal cache, but after often inputting once upper screen word, just it is included in word using screen word on this as word is learned
Storehouse, such as upper screen word " Liu Yuanfang " is inputted once, " Liu Yuanfang " is just included in dictionary as word is learned, judges that user is again afterwards
No backspace modification, if it is rollback last time word, so-called rollback are exactly the word that revocation is included in dictionary recently, and the revocation is just
It is to say to delete from dictionary if screen word on this is included in dictionary for the first time, this is then reduced if not dictionary is included in for the first time
That learns word is included in number;If user does not have backspace modification, continue to input next upper screen word.
Although above-mentioned prior art can avoid the word of study mistake to a certain extent, have a disadvantage that:
1) during user is using input method software input word, the situation of input error, such as upper screen are often had
Word " Liu Yuanfang ", if the user find that error, this people are " Liu Yuanfang " in fact, now, user is deleted " remote by backspace key
Side " is re-entered " member virtue "." Liu Yuanfang " in temporal cache is then removed in the way of prior art one, at upper screen " member virtue "
And " member virtue " is included in dictionary as word after confirmation.Method according to prior art two then cancels the word for being included in dictionary
" Liu Yuanfang ", " member virtue " is included in dictionary as word again.But although above-mentioned prior art is not included in mistake to dictionary
Word " Liu Yuanfang ", but be not also included in dictionary and correctly learn word " Liu Yuanfang ", but be included in mistake to dictionary again
Word " member virtue ".Therefore, the accuracy for causing dictionary data to be corrected is relatively low, tends not to be included in dictionary and correctly learns word.
2) if user persistently have input a period of time, for example input " Liu Yuanfang | do not hesitate to do what is right | | story " (its
In | represent the process for shielding operation in gradation) after, the mistake in " distant place " is now just found, now user carries out retraction operation, and incites somebody to action
" distant place " is changed to " member virtue ", still, according to the scheme of above-mentioned prior art can not but be corrected in dictionary revocation " Liu Yuanfang " this
Individual wrong word, because " not the hesitating to do what is right " of follow-up the last input confirms " Liu Yuanfang " of above upper screen, will
Shield word on this as word is learned and be included in dictionary.And what is really cancelled is the upper screen word " story " shielded on the last time, this
Clearly wrong, and the word " member virtue " of mistake has been included in dictionary again.Therefore, the word inputted above in user's change
When, dictionary data, which are corrected, occurs mistake, and the accuracy of dictionary data correction is relatively low.
The content of the invention
In view of this, it is a primary object of the present invention to provide the dictionary data antidote and dress of a kind of character input method
Put, to improve the accuracy of dictionary data correction.
The technical proposal of the invention is realized in this way:
A kind of dictionary data antidote of character input method, including:
By the upper screen writing record shielded in each input to recording areas, mutually shield in the recording areas in differentiation every time upper
Shield word, while the cursor position on the recording areas subsequent screen and modification operate;
The upper screen word of upper screen every time is included in dictionary as word is learned;
Operated according to the inter-sync cursor position in the recording areas and modification, judge whether to have modified in the recording areas
The upper screen word of record, if it is the content before and after the modification for the upper screen word that determination is changed, cancels modification from dictionary
Word is learned on this preceding corresponding to screen word, amended screen word on this is included in dictionary as word.
A kind of dictionary data apparatus for correcting of character input method, including:
Logging modle, for providing recording areas, by the upper screen writing record shielded in each input to the recording areas, in the note
Record the upper screen word that upper screen is mutually distinguished every time in area;
Monitoring module, cursor position and modification in monitor screen operate, in recording areas synchronization user's cursor
Position and modification operate;
Word module is learned, for using the upper screen word that upper upper the screen word and judging treatmenting module shielded is specified every time as word
It is included in dictionary;
Judging treatmenting module, for being operated according to the inter-sync cursor position in the recording areas and modification, judge whether to repair
Change upper screen word recorded in the recording areas, it is if it is interior before and after the modification for the upper screen word that determination is changed
Hold, triggering revocation module cancel from dictionary this before modification on learn word corresponding to screen word, and trigger learn word module will modification
Screen word is included in dictionary as word is learned on afterwards this;
Cancel module, the word specified for cancelling the judging treatmenting module from dictionary.
Compared with prior art, firstly, since the present invention mutually distinguishes the upper screen text shielded on every time in the recording areas
Word, and carry out revocation using the entirety of a upper screen word as an operating unit and learn word and be included in amended word again
Operation, even if user only have modified the partial content of a upper screen word, and screen word on this is integrally cancelled and is included in and is repaiied
The full content of screen word on this after changing, therefore avoid and cause dictionary data due to have modified partial content in the prior art
The problem of correcting a mistake, improve the accuracy of dictionary data correction.Secondly, if user persistently have input one section
Between, then all can be according in the inter-sync cursor position in the recording areas no matter which upper screen word that user's modification inputs before
The position for operating the upper screen word for determining to be changed and content are put and change, screen word pair on this from dictionary before revocation modification
The word answered, dictionary is included in using amended screen word on this as word is learned, therefore overcomes prior art before user changes
During the word of text input, dictionary data correct the problem of mistake occurs, improve the accuracy of dictionary data correction.
Embodiment
Below in conjunction with the accompanying drawings and specific embodiment the present invention is further described in more detail.
The core technology scheme of the present invention is a kind of dictionary data antidote of character input method, including:Will be defeated every time
Enter the upper screen writing record of upper screen to recording areas, the upper screen word mutually shielded in the recording areas in differentiation every time, while at this
Cursor position and modification on the subsequent screen of recording areas operate;The upper screen word of upper screen every time is included in dictionary as word is learned;Root
Operated according to the inter-sync cursor position in the recording areas and modification, judge whether have modified upper screen recorded in the recording areas
Word, if it is determines the content before and after the modification of upper screen word changed, screen on this from dictionary before revocation modification
Word is learned corresponding to word, amended screen word on this is included in dictionary as word.
Fig. 3 is a kind of composition schematic diagram of the dictionary data apparatus for correcting of character input method of the present invention.The dictionary number
It is used to perform the method described in the present invention according to apparatus for correcting.The device specifically includes:
Logging modle 301, for providing recording areas, by the upper screen writing record shielded in each input to the recording areas,
The upper screen word of upper screen is mutually distinguished every time in the recording areas.
Monitoring module 302, cursor position and modification in monitor screen operate, in recording areas synchronization user's light
Cursor position and modification operate.
Word module 303 is learned, for the upper screen word of upper screen every time to be included in into dictionary;And by follow-up judging treatmenting module
The 304 upper screen words specified are included in dictionary as word is learned, i.e., are included in dictionary using amended upper screen word as word is learned.
Judging treatmenting module 304, for being operated according to the inter-sync cursor position in the recording areas and modification, judge whether
Upper screen word recorded in the recording areas is have modified, it is if it is interior before and after the modification for the upper screen word that determination is changed
Hold, the revocation module 305 of triggering following cancel from dictionary and learns word corresponding to screen word on this before changing, and triggers word mould
Block 303 is included in dictionary using amended screen word on this as word is learned.
Cancel module 305, the word specified for cancelling the judging treatmenting module 304 from dictionary, that is, before changing
Word is learned on this corresponding to screen word.
In the present invention, the recording areas is specifically as follows:Buffer area or daily record or file (such as notepad).Below
A buffer area exemplified by recording areas as illustrating in embodiment.
Fig. 4 is a kind of particular flow sheet of the dictionary data antidote of character input method of the present invention.Referring to Fig. 4,
The handling process includes:
Step 401, the input instruction for receiving user, and operated by upper screen to shielding word in input on screen.
Detailed process is:The coding of user's input is received, the Pinyin coding, radical in the input of the coding such as Chinese character are compiled
Code, the character code in English input etc.;It is that candidate character is included in candidate frame by the code conversion of input;User selects to wait
The word of inframe is selected, triggers upper screen key, common upper screen key such as space bar, enter key, digital selective key etc.;Input method software will
The word input of user's selection is shown to the cursor position on screen, and the word chosen input is shown to the operation of screen by this
Also referred to as " upper screen operation ", the word being input to every time by the upper screen operation on screen are referred to as once " above shielding word ".
Step 402, the upper screen writing record shielded will be inputted every time to buffer area, mutually distinguished in the buffer area each
The upper screen word of upper screen, while operated in cursor position of the buffer area synchronization user in screen and modification.
In this step, the specific method of upper screen word that shields on every time mutually distinguished in the recording areas can be with
For:Separate the upper screen word of upper screen each time using the list separator specified.Such as the separator can be appointed as newline,
Separator can certainly be used as by the use of other symbols such as comma, branch.Fig. 5 a are the upper screen word that is shown on screen and described
A kind of control schematic diagram of the upper screen word of buffer area institute synchronous recording.Referring to Fig. 5, such as when user have input on four respectively
Shield word:" Liu Yuanfang ", " not hesitating to do what is right ", " ", " story ", although being shown on screen 501, " Liu Yuanfang is not hesitate to do what is right
Story ", but the content recorded in the buffer area 502 is:
Liu Yuanfang
Do not hesitate to do what is right
's
Story
Wherein each upper screen word is separated with newline, a certain for can definitely be found in subsequent treatment
Shield the entire content of word.Content i.e. between each two separator is exactly a complete upper screen word, and text is shielded on some
, it is necessary to which corresponding word is cancelled in dictionary by the complete upper screen word before modification after the content modification of word, and will repair
Complete upper screen word after changing is included in dictionary again as word is learned.
Separate the upper screen word shielded on each time due to having used separator in the buffer area, therefore in the caching
It need to ignore the list separator during area's synchronization user's cursor position.Fig. 5 b are in the screen and buffer area synchronization user's cursor
A kind of control schematic diagram of position.Referring to Fig. 5 b, wherein vertical arrow represents cursor position, it is assumed for example that user's cursor initially exists
At the position 511 of the word " story that Liu Yuanfang is not hesitate to do what is right " shown on the screen 501, then in buffer area 502, cursor
Position is initially at the position 521;When user presses No. 4 return keys, the cursor on screen is returned at position 512, then phase
Ground is answered in buffer area 502, cursor needs synchronous No. 4 return keys, but the presence of the separator is neglected in synchronization, leads to
Synchronous No. 4 return keys are crossed, cursor synchronization has been arrived at position 522, therefore can be ensured the cursor position in buffer area and shielded
The uniformity of cursor position in curtain.
It is described in cursor position of the buffer area synchronization user on screen and the specific side of modification operation in this step
Method can be realized using corresponding application programming interface (api interface) in data processing equipment operating system, such as
In windows operating systems, the api interface of keyboard operation and mouse action can be followed the trail of by having, can be with by these api interfaces
Monitor the operational order of keyboard and mouse on screen, such as cursor moving command, and the modification such as deletion, insertion, modification
Order etc., these operational order synchronization implementations are given to the buffer area by these api interfaces.
Step 403, the upper screen word of upper screen every time is included in dictionary as word.The certain step 402 and step 403
There is no strict tandem or perform step 402 after first carrying out step 403, or perform simultaneously.
Step 404, basis operate in the inter-sync cursor position of the buffer area and modification, judge whether that have modified this delays
Deposit upper screen word recorded in area, if it is treat as user and have modified the content inputted above, perform step 405 and after
Continuous step is corrected to dictionary data;Otherwise dictionary data are not corrected, and it is new at the ending for currently inputting word
After inputting word, return to step 402.
Content before and after the modification for the upper screen word that step 405, determination are changed.
The specific method of content before and after the modification of upper screen word for determining to be changed described in this step can be:Same
When walking the cursor position in the buffer area, tracking replicates the complete upper screen word of present cursor position, such as shown in Fig. 5 c
For screen word is separated by line feed number on each time in buffer area 502, and each upper screen word is all considered as an overall list
Member, it is assumed that cursor is synchronized at position 523, then the complete upper screen word that tracking replicates the opening position is " Liu Yuanfang ", when
After user to be revised as to " member virtue " by " distant place ", once synchronous cursor leaves the current upper screen word, then confirm to screen text on this
Word modification finishes, and the full unit " Liu Yuanfang " now replicated following the trail of is as the upper screen word before modification, by screen on this
The current complete content " Liu Yuanfang " of word is used as amended upper screen word, and performs step 405 and carry out dictionary data
Correction.
In a kind of special circumstances, if cursor is synchronized at position 524, due to being between two upper screen words herein
Position, do not know that in next step previous or the latter can be changed, a kind of processing method now is can be by before and after at the cursor
Two upper screen words are that " Liu Yuanfang " and " not hesitating to do what is right " are all replicated, and will be replicated if user have modified " Liu Yuanfang "
" Liu Yuanfang " is as the upper screen word before modification, if user have modified " not hesitating to do what is right ", " not the hesitating to do what is right " that will be replicated
As the upper screen word before modification.
Learn word in step 406, this from dictionary before revocation modification corresponding to screen word, and will amended screen on this it is literary
Word is included in dictionary as word is learned.Such as then shield word " Liu Yuan in revocation if " distant place " to be changed to " member virtue " described in Fig. 5 c
Word is learned corresponding to side ", " Liu Yuanfang " is included in dictionary as word is learned.
So-called revocation learns word and is not equal to delete herein, and refers to if the word " Liu Yuanfang " is only included in dictionary once
(i.e. it is included in number as 0) is then deleted from dictionary, the meter of the word " Liu Yuanfang " is reduced if dictionary is included in more than once
Indegree.
The so-called word that is included in also is not equal to simply increase herein, but if does not have the word " Liu Yuan in dictionary
Virtue ", then increase the word, and count once;If having there is the word " Liu Yuanfang " in dictionary, it is secondary to increase being included in for the word
Number.
As described in above-mentioned step 404 and 405, the present invention is carried out using the entirety of a upper screen word as an operating unit
Revocation learns word and is included in the operation of amended word again, even if user only have modified the partial content of a upper screen word,
And screen word on this is integrally cancelled and is included in the full content of amended screen word on this, therefore avoid prior art
In due to have modified the problem of partial content causes dictionary data to correct a mistake, improve the accuracy of dictionary data correction.
Also, if user persistently have input a period of time, no matter which upper screen that user's modification inputs before
Word, then the present invention can be according to the upper screen text for determining to be changed in the inter-sync cursor position in the recording areas and modification operation
The position of word and content, word is learned corresponding to screen word on this from dictionary before revocation modification, by amended screen word on this
Dictionary is included in as word is learned, therefore overcomes prior art in the word that user's change inputs above, the correction meeting of dictionary data
There is the problem of wrong, improve the accuracy of dictionary data correction.
In the present invention, it can be judged as have modified upper screen word recorded in buffer area and need to carry out corresponding word
The modification operation of storehouse data correction can have a variety of, such as following table is typical several modification operations, for convenience of reading, its
The place of middle modification is marked with underscore:
1) tail portion for shielding word on some is changed.
2) center section for shielding word on some is changed.
3) the center section modification raw content and insertion new content of word are shielded on some.
4) the ending insertion new content for shielding word on other of word is shielded on except last.
But not all modification operation can be judged as have modified it is recorded upper in buffer area
Screen word simultaneously needs to carry out corresponding dictionary data correction.
For example, if being to insert new content to shielding the ending of word in last in buffer area, then treat as new to add
Upper screen word, rather than upper screen word recorded in buffer area is modified, therefore dictionary data need not be entered
Row correction, but it is included in dictionary using newly-increased upper screen word as word is learned.
The operation of new word is inserted before shielding word for example on a certain again, although can be determined that to have modified buffer area
In recorded upper screen word, but the content relation of the word and screen word on this in the insertion of upper screen word front end is little,
Therefore dictionary data correction corresponding to need not carrying out, but it is included in dictionary using the word of insertion as new word of learning.Such as following table institute
Show:
In addition, in the present invention, can be to word in the event of the above-mentioned modification operation for needing to carry out dictionary data correction
Storehouse data are corrected, and this processing method is more relaxed;If it is desired to more strict correction behaviour is carried out to the word of learning of dictionary
Make, can also be there occurs the above-mentioned modification operation to need to carry out dictionary data correction, and the upper screen text changed is determined
After content before and after the modification of word, the determination strategy more refined, such as the plans such as number of words is equal, coding is consistent are further set
Slightly, if reaching the requirement of these determination strategies, further correction corresponding to dictionary data, so can be more precisely right
Dictionary data are corrected.Such as:
In one embodiment, it is determined that after content before and after the modification for the upper screen word changed, determine whether
Whether the number of words of amended upper screen word identical with the number of words of screen word on this before modification, only when number of words is identical just from
Learn word on this in dictionary before revocation modification corresponding to screen word, and amended screen word on this is included in word as word
Storehouse.Otherwise, word is learned on this not from dictionary before revocation modification corresponding to screen word, but will amended screen word work on this
Dictionary is included in for new word of learning.
In another embodiment, it is determined that after content before and after the modification for the upper screen word changed, further sentence
The coding (such as Pinyin coding, root coding, character code) for the amended upper screen word that breaks whether with screen on this before modification
The coding of word is identical, only just shields when encoding identical on this from dictionary before revocation modification and learns word corresponding to word, and
Dictionary is included in using amended screen word on this as word is learned.It is in this case it is necessary to same when shielding word in user's input
Encoded corresponding to step record.
In the present invention, the capacity of the recording areas can not be infinitely great, therefore can set the capacity of the recording areas, when
After the content of the upper screen word of recording areas record reaches the maximum size of the recording areas, then need to delete earliest upper screen text
Word, newest upper screen word is recorded, by the content maintenance that recording areas records in a rational capacity.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
God any modification, equivalent substitution and improvements done etc., should be included within the scope of protection of the invention with principle.