Summary of the invention
The technical matters that the embodiment of the invention will solve provides a kind of input method implementation method and device, client, can export candidate word quickly and easily.
For solving the problems of the technologies described above, embodiment provided by the present invention is achieved through the following technical solutions:
The embodiment of the invention provides a kind of input method implementation method, comprising:
Obtain the preceding character of cursor;
Inquire about the user logic corresponding with described character; Described user logic comprises user's grammer logic and user's word logic; If described character is empty, then inquire about initial user's grammer logic and initial user's word logic; If described character is symbol a or speech A, then inquire about user's grammer logic with the part of speech beginning of described symbol a or speech A, reach user's word logic with described symbol a or speech A beginning; Inquire about the candidate word of described character correspondence;
According to the frequency order from high to low of described user logic, described candidate word is carried out sequencing display.
Preferably, above-mentioned frequency according to described user logic, the step of described candidate word being carried out sequencing display comprises afterwards:
According to the candidate word that the user chooses described user logic frequency is upgraded.
Preferably, the above-mentioned candidate word of choosing according to the user is carried out updating steps to described user logic frequency and is specifically comprised:
If the candidate word chosen of user is speech B, if described character is a, and a is terminating symbol, and perhaps described character be a sky, then
The part of speech of identification speech B;
User's grammer logical frequency that part of speech with speech B is started improves default value;
User's word logical frequency with speech B beginning is improved default value.
Preferably, the above-mentioned candidate word of choosing according to the user is carried out updating steps to described user logic frequency and is specifically comprised:
If the candidate word chosen of user is speech B, if described character is a, and a is the punctuate symbol or is beginning loop symbol, then
User's grammer logical frequency with symbol a beginning is improved default value;
The part of speech of identification speech B;
Follow the user's grammer logical frequency behind symbol a to improve default value to the part of speech of speech B;
Follow the user's word logical frequency behind symbol a to improve default value to speech B.
Preferably, the above-mentioned candidate word of choosing according to the user is carried out updating steps to described user logic frequency and is specifically comprised:
If the candidate word that the user chooses is speech B, if described character is speech A, then
The part of speech of identification speech B;
Follow the user's grammer logical frequency after the part of speech of speech A to improve default value the part of speech of speech B;
Follow the user's word logical frequency behind speech A to improve default value speech B.
Preferably, if described character is a, and a is beginning loop symbol, and then described method further comprises after the user imports the end loop symbol b of described beginning loop symbol correspondence:
User's grammer logical frequency that the part of speech of described loop symbol ab and speech B is constituted improves default value;
User's word logical frequency of described loop symbol ab and speech B formation is improved default value.
Preferably, the candidate word of the described character correspondence of above-mentioned inquiry is specially:
From user's grammer logic, search the part of speech of candidate word;
From user's word logic, search the candidate word of described part of speech correspondence.
Preferably, above-mentioned frequency order from high to low according to described user logic, the step of described candidate word being carried out sequencing display specifically comprises:
If user's grammer logic has only one, then candidate word is presented at the candidate word window according to user's word logical frequency order from high to low;
If user's grammer logic comprises at least: first user's grammer logic and second user's grammer logic, and first user's grammer logical frequency is higher than second user's grammer logical frequency, then
The candidate word that will meet first user's grammer logic is presented at the candidate word window according to user's word logical frequency order from high to low;
The candidate word that will meet second user's grammer logic is presented at the candidate word window according to user's word logical frequency order from high to low;
The described candidate word that meets second user's grammer logic is presented at after the described candidate word that meets first user's grammer logic.
Preferably, above-mentioned candidate word is carried out comprising before the step of sequencing display:
The user's grammer logical and preset universal grammer logic that finds is mated;
Number according to the user's grammer logic that is complementary with described preset universal grammer logic carries out sequencing display to described candidate word.
Preferably, if described character is empty, the part of speech of then described identification speech B specifically comprises:
The part of speech of in default part of speech storehouse, searching speech B, if do not write down the part of speech of speech B in the described part of speech storehouse, then the part of speech of the predicate B of institute is the acquiescence part of speech;
If described character is symbol a or speech A, the part of speech of then described identification speech B specifically comprises:
Search with the highest user's grammer logic of symbol a or speech A beginning frequency, the part of speech of the predicate B of institute is the part of speech behind symbol a or speech A of following that writes down in described user's grammer logic.
The embodiment of the invention also provides a kind of input method implementation method, comprising:
Receive the pinyin string of user's input;
Inquire about the candidate word set of described pinyin string correspondence, comprise a candidate word corresponding at least in the described candidate word set with described pinyin string;
Obtain the preceding character of cursor;
Inquire about the user logic corresponding with described character; Described user logic comprises user's grammer logic and user's word logic; If described character is empty, then inquire about user's grammer logical frequency with the part of speech beginning of described candidate word, reach user's word logical frequency with described candidate word beginning; If described character is symbol a or speech A, then inquire about user's grammer logic with the part of speech beginning of described symbol a or speech A, reach user's word logic with described symbol a or speech A beginning;
According to the frequency order from high to low of described user logic, described candidate word is carried out sequencing display.
The embodiment of the invention also provides a kind of input method implement device, comprising:
The character acquiring unit is used to obtain the preceding character of cursor;
The Boolean query unit is used to inquire about the user logic of described character correspondence; Described user logic comprises user's grammer logic and user's word logic; The candidate word query unit is used to inquire about the candidate word of described character correspondence;
Display unit is used for the frequency order from high to low according to described user logic, and the candidate word of described character correspondence is carried out sequencing display.
Above-mentioned Boolean query unit comprises:
First searches the unit, is used for if described character for empty, is then inquired about initial user's grammer logic and initial user's word logic;
Second searches the unit, is used for if described character is symbol a or speech A, then inquires about the user's grammer logic with the part of speech beginning of described symbol a or speech A, reaches the user's word logic with described symbol a or speech A beginning.
Preferably, above-mentioned candidate word query unit specifically comprises:
Part of speech is searched the unit, is used for searching from user's grammer logic the part of speech of candidate word;
The candidate word acquiring unit is used for searching from user's word logic the candidate word of described part of speech correspondence.
Preferably, said apparatus further comprises:
The part of speech recognition unit is used for after the user selects candidate word B, the part of speech of identification speech B;
First user's grammer logical renewal unit, be used for when described character be that sky or character are symbol a, and a is when being terminating symbol, and the user's grammer logical frequency with the part of speech beginning of speech B is improved default value;
First user's word logical renewal unit, be used for when described character be that sky or character are symbol a, and a improves default value to the user's word logical frequency with speech B beginning when being terminating symbol.
Preferably, said apparatus further comprises;
Second user's grammer logical renewal unit, be used for when described character be symbol a, and a improves default value to the user's grammer logical frequency with symbol a beginning when being punctuate symbol or beginning loop symbol;
The 3rd user's grammer logical renewal unit is used for following the user's grammer logical frequency behind symbol a to improve default value to the part of speech of speech B;
Second user's word logical renewal unit is used for following the user's word logical frequency behind symbol a to improve default value to speech B.
Preferably, said apparatus further comprises:
The 5th user's grammer logical renewal unit, being used for working as described character is speech A, after the user selects candidate word B, follows the user's grammer logical frequency after the part of speech of speech A to improve default value to the part of speech of speech B;
Four-function family word logical renewal unit, being used for working as described character is speech A, after the user selects candidate word B, follows the user's word logical frequency behind speech A to improve default value to speech B.
Technique scheme has following beneficial effect:
When cursor appeared at input window, the technical scheme that the embodiment of the invention provides can be obtained the character before the cursor, and user logic has write down user's term custom.Therefore, the technical scheme that the embodiment of the invention provides can be with character correspondence before the cursor, and the candidate word that meets the user logic custom is shown to the user quickly and easily, make and the candidate word of the output real speech habits of being close to the users more to have promoted the intelligent of input method.
The Chinese character coding input method implementation method that Fig. 1 provides for first embodiment of the invention;
The Chinese character coding input method implementation method that Fig. 2 provides for second embodiment of the invention;
Embodiment
For the purpose that makes the embodiment of the invention, technical scheme, and advantage clearer, below the technical scheme that the embodiment of the invention provides is elaborated with reference to accompanying drawing.
The input method implementation method that the embodiment of the invention provides has write down user's term sentence-making custom, can not carry out under the situation of any input behavior the user, according to the user's term sentence-making custom that has write down, exporting candidate word efficiently selects for the user, and, the candidate word of the output true term sentence-making custom of being close to the users more promotes the intelligent of input method, and better user experience is provided.
Input method implementation method embodiment in the embodiment of the invention comprises:
(1) obtains the preceding character of cursor;
In present embodiment and the subsequent embodiment, all being that example describes with the input in Chinese, being understandable that, can be the literal of other types equally, and the flow process of idiographic flow and Chinese language processing is similar.
In the present embodiment, described cursor is in the input window, be used for indicating the symbol of current input position to the user, and, if user's input habit is for from left to right, character before the then described cursor is the character that is positioned at the cursor left side, if user's input habit is for from right to left, the character before the then described cursor is the character that is positioned at the cursor right side, this shows, be meant logical place before the cursor in the present embodiment, rather than the locus.
(2) the inquiry user logic corresponding with described character;
(3) candidate word of the described character correspondence of inquiry;
(4) according to the frequency of described user logic, the candidate word of described character correspondence is carried out sequencing display.
Said method realized to the user selects and the show candidate speech, and after the user chooses candidate word, and the method that provides of inventive embodiments has further write down user's term sentence-making custom.
Below at first introduce the Chinese character coding input method implementation method recording user term sentence-making custom process that the embodiment of the invention provides.
In the recording user term sentence-making custom process that the embodiment of the invention provides, at first the character before the input cursor is discerned, if the character before the input cursor is empty, being illustrated in client does not also have input results, the Chinese character coding input method implementation method recording user term sentence-making custom that then adopts first embodiment of the invention to provide; If the character before the input cursor is symbol a (in actual applications, symbol a can be optional signs such as comma, fullstop, branch), the Chinese character coding input method implementation method recording user term sentence-making custom that then adopts second embodiment of the invention to provide; If the character of input before the cursor is speech A (in actual applications, speech A can be a vocabulary arbitrarily), the Chinese character coding input method implementation method recording user term sentence-making custom that then adopts third embodiment of the invention to provide.
Seeing also Fig. 1, be the Chinese character coding input method implementation method that first embodiment of the invention provides, be sky before the input cursor, then after the user selects candidate word A, and execution in step 101.
Step 101: the part of speech of identification speech A;
Wherein, described part of speech comprises: verb, noun, adjective, adverbial word, moving guest's phrase or the like.
Step 102: search user's grammer logical record, upgrade the user's grammer logical frequency in described user's grammer logical record, promptly user's grammer logical frequency is improved default value with speech A beginning;
In actual applications, can adopt that to add 1 the described renewal of mode on the part of speech with speech A is user's grammer logical frequency of beginning be user's grammer logical frequency of beginning with the part of speech of speech A, also can adopt other modes, not influence the realization of the embodiment of the invention.Described implementation procedure is applicable to other any embodiment of the present invention.
If do not find user's grammer logical record with the beginning of speech A part of speech, then create user's grammer logical record with the part of speech beginning of speech A, described user's grammer logical record comprises: the part of speech of speech A, be used to identify zone bit and the user grammer logical frequency of the part of speech of speech A for beginning, and user's grammer logical frequency can be used as default (such as, 1), described implementation procedure is applicable to other all embodiment of the present invention.
Step 103: search user's word logical record, upgrade the user's word logical frequency in described user's word logical record with speech A beginning;
If there is not user's word logical record with speech A beginning, then create user's word logical record with speech A beginning, described user's word logical record comprises: speech A, be used to identify zone bit and the user word logical frequency of speech A for beginning, and user's word logical frequency used as default (such as, 1), described implementation procedure is applicable to other all embodiment of the present invention.
In other embodiments of the invention, also can first execution in step 103 execution in step 102 again, perhaps, step 102 is carried out the realization that does not influence the embodiment of the invention simultaneously with step 103.
If the user imports speech B once more behind input speech A, then execution in step 104.
Step 104: the part of speech of identification speech B;
Step 105: the part of speech of searching speech B is followed the user's grammer logical record after the part of speech of speech A, upgrades the user's grammer logical frequency in described user's grammer logical record;
Do not follow user's grammer logical record after the part of speech of speech A if there is the part of speech of speech B, then create described user's grammer logical record, described user's grammer logical record comprises: speech A part of speech speech B part of speech, and user's grammer logical frequency, and user's grammer logical frequency can be used as default (such as, 1), described implementation procedure is applicable to other all embodiment of the present invention.
Step 106: search speech B and follow user's word logical record behind speech A, upgrade the user's word logical frequency in described user's word logical record;
If there is not speech B to follow user's word logical record behind speech A, then create described user's word logical record, described user's word logical record comprises: speech AB, and user's grammer logical frequency, and user's word logical frequency can be used as default (such as, 1), described implementation procedure is applicable to other all embodiment of the present invention.
In other embodiments of the invention, also can first execution in step 105 execution in step 106 again, perhaps, step 105 is carried out the realization that does not influence the embodiment of the invention simultaneously with step 106.
If the user is behind input speech B, continue the input speech, then repeated execution of steps 104 is to the part of speech of the current input speech of step 106 identification, search the part of speech of current input speech and follow user's grammer logical record after the part of speech that last time generates speech, and upgrade user's grammer logical frequency in described user's grammer logical record, and search current input speech and follow user's word logical record after last time generating speech, and upgrade the user's word logical frequency in described user's word logical record.
Illustrate the method that first embodiment of the invention provides.Be empty before the input cursor, the user selects candidate word " knowledge ", and the part of speech of " knowledge " is a noun, then searches the user's grammer logical record with the noun beginning, and adds 1 on the user's grammer logical frequency in described user's grammer logical record; Search user's word logical record, and add 1 on the user's word logical frequency in described user's word logical record with " knowledge " beginning.If the user is in input " knowledge " back input " property right ", the part of speech of " property right " also is " noun ", then search noun and follow user's grammer logical record of behind noun (being the noun noun), and add 1 on the user's grammer logical frequency in described user's grammer logical record; Search " property right " and follow user's word logical record of after " knowledge " (being intellecture property), and add 1 on the user's word logical frequency in described user's word logical record.
See also Fig. 2, be the Chinese character coding input method implementation method that second embodiment of the invention provides, is-symbol a before the input cursor, then after the user selects candidate word A, execution in step 201.
Step 201: the type of symbol a before the identification cursor is a terminating symbol as if described symbol, and such as fullstop, it is preceding for empty then to be considered as importing cursor, is accustomed to according to the method recording user term sentence-making that first embodiment of the invention provides; If described symbol is punctuate symbol (comma, expression such as branch is still unclosed symbol in short), then execution in step 202;
Step 202: search user's grammer logical record, upgrade the user's grammer logical frequency in described user's grammer logical record with symbol a beginning;
Step 203: the part of speech of identification speech A;
Step 204: the part of speech of searching speech A is followed the user's grammer logical record behind symbol a, upgrades the user's grammer logical frequency in described user's grammer logical record;
Step 205: search speech A and follow user's word logical record behind symbol a, upgrade the user's word logical frequency in described user's word logical record;
In other embodiments of the invention, also can first execution in step 205 execution in step 204 again, perhaps, step 204 is carried out the realization that does not influence the embodiment of the invention simultaneously with step 205.
After the user selects candidate word A, if continue the input speech, the step 104 that then repeating first embodiment of the invention provides is discerned the part of speech of current input speech to step 106, search the part of speech of current input speech and follow user's grammer logical record after the part of speech that last time generates speech, upgrade the user's grammer logical frequency in described user's grammer logical record, and search current input speech and follow user's word logical record after last time generating speech, upgrade the user's word logical frequency in the user of the institute word logical record.
In addition, the embodiment of the invention has also defined a kind of loop symbol, and the loop symbol is made of a beginning loop symbol and an end loop symbol, and such as quotation marks " ", punctuation marks used to enclose the title " " etc. all belong to the defined loop of embodiment of the invention symbol.If the symbol a that identifies in the step 201 before the cursor is beginning loop symbol, then the method recording user term sentence-making that provides according to second embodiment of the invention is accustomed to, and import the end loop symbol b of described beginning loop symbol correspondence the user after, further search user's grammer logical record of the part of speech formation of loop symbol ab and speech A, and upgrade the user's grammer logical frequency in described user's grammer logical record; Search user's word logical record that loop symbol ab and speech A constitute, and upgrade the user's word logical frequency in described user's word logical record.If identify symbol a before the cursor in the step 201 for finishing the loop symbol, the term sentence-making custom of the method recording user that provides according to first embodiment of the invention then.
Illustrate the method that second embodiment of the invention provides.Such as, if before the input cursor is comma, then search user's grammer logical record with the comma beginning, and add 1 on the user's grammer logical frequency in described user's grammer logical record, the user selects candidate word " knowledge ", and the part of speech of " knowledge " is a noun, then searches noun and follows behind comma (promptly, noun) user's grammer logical record, and add 1 on the user's grammer logical frequency in described user's grammer logical record; Search knowledge and follow user's word logical record of behind comma (that is, knowledge), and add 1 on the user's word logical frequency in described user's word logical record.If the user is after input " knowledge ", input " property right " once more, the part of speech of " property right " also is " noun ", then searches noun and follows user's grammer logical record behind noun, and add 1 on the user's grammer logical frequency in described user's grammer logical record; Search user's word logical record of intellecture property, and add 1 on the user's word logical frequency in described user's word logical record.If before the input cursor be the beginning loop symbol " " " in the punctuation marks used to enclose the title, and, the speech of described punctuation marks used to enclose the title heel is a Patent Law, the part of speech of Patent Law is a noun, then at user's end of input loop symbol " " " after, search user's grammer logical record that noun and punctuation marks used to enclose the title constitute, and add 1 on the user's grammer logical frequency in described user's grammer logical record; Search user's word logical record of "Patent Law", and add 1 on the user's word logical frequency in described user's word logical record.
Seeing also Fig. 3, be the Chinese character coding input method implementation method that third embodiment of the invention provides, is speech A before the input cursor, then after the user selects candidate word B, and execution in step 301.
Step 301: the part of speech of identification speech B;
Step 302: the part of speech of searching speech B is followed the user's grammer logical record after the part of speech of speech A, upgrades the user's grammer logical frequency in described user's grammer logical record;
Step 303: search speech B and follow user's word logical record behind speech A, upgrade the user's word logical frequency in described user's word logical record.
If the user is behind input speech B, continue the input speech, then repeated execution of steps 301 is to the part of speech of the current input speech of step 303 record, and the part of speech of searching current input speech follows the user's grammer logical record after the part of speech that last time generates speech, upgrades the user's grammer logical frequency in described user's grammer logical record; Search current input speech and follow user's word logical record after last time generating speech, upgrade the user's word logical frequency in user's word logical record.
Illustrate the method that third embodiment of the invention provides.Such as, the input cursor before for speech be " knowledge ", if the candidate word that the user selects once more is " property right ", the part of speech of " property right " is " noun ", then search user's grammer logical record of following behind noun (being the noun noun) at noun, and add 1 on the user's grammer logical frequency in described user's grammer logical record; Search user's word logical record of " intellecture property ", and add 1 on the user's word logical frequency in described user's word logical record.
In the Chinese character coding input method implementation method that above embodiment provides, after the user's grammer logical frequency that has write down the user and user's word logical frequency, further the word frequency of speech imported in record, and the input speech is remembered at last.
More than introduced the process of the recording user term sentence-making custom that the embodiment of the invention provides.The process that in said process, comprises the candidate word part of speech that the identification user selects, in actual applications, the candidate word part of speech that can adopt following method identification user to select:
Set up the part of speech storehouse in advance, preserved the corresponding relation of speech and its part of speech in the part of speech storehouse; If the user has selected candidate word A, the part of speech of in described part of speech storehouse, searching speech A then, if in the part of speech storehouse, can not find out the part of speech of speech A, then discern the preceding information of cursor, if be empty before the cursor, then the part of speech of the predicate A of institute for the acquiescence part of speech (such as, can the pre-defined part of speech that in the part of speech storehouse, can not find out the speech of part of speech be defaulted as noun or verb etc.), if before the input cursor is symbol a, then search the highest user's grammer logical record of user's grammer logical frequency with symbol a beginning, the part of speech of the predicate A of institute be write down in described user's grammer logical record follow part of speech behind symbol a (such as, it is the highest to search the user's grammer logical frequency that obtains symbol a heel noun, and then the part of speech of speech A is a noun); If before the input cursor is speech B, then discern speech B part of speech, and search the highest user's grammer logical record of user's grammer logical frequency with the beginning of the part of speech of speech B, the part of speech of the predicate A of institute be write down in described user's grammer logical record follow part of speech after speech B part of speech (such as, if speech B part of speech is a verb, search and obtain noun and follow the user's grammer logical frequency behind verb the highest, then the part of speech of speech A is a noun).
The process of output candidate word or whole sentence describes in detail in the Chinese character coding input method implementation method that the embodiment of the invention is provided below in conjunction with accompanying drawing.
See also Fig. 4, be the Chinese character coding input method implementation method that fourth embodiment of the invention provides, described method comprises:
Step 401: obtain the preceding character of cursor,, then enter step 402,, then enter step 403 if described character is symbol a or speech A if described character is empty;
In implementation procedure, if user user before carrying out this input behavior is carrying out input operation continuously, then the predicate A of institute is user's last candidate word of selecting before carrying out this input behavior.Such as, user's input Pinyin string " womendoushizhongguoren ", the syllabification result of this pinyin string is " wo ' men ' dou ' shi ' zhong ' guo ' ren ' ", the user selects candidate word " we " subsequently, " all be ", " Chinese " form whole sentence " we are Chinese ", and " we are Chinese " inputed to document, though this moment, cursor moved to " people " word back, but in embodiments of the present invention, the predicate A of institute is meant the last candidate word of selecting " Chinese " of user.If the user moves to "Yes" word back with cursor after input " we are Chinese ", information specifically comprises before the then described identification cursor: read "Yes", because dictionary generally all can have the individual character record, therefore, can give tacit consent to "Yes" is a speech, read " all " again, whether write down " all being " in the inquiry dictionary, whether write down " all being " in the dictionary, next step continues to read " ", and whether inquiry has write down " all be " in the dictionary, if the Query Result of " all being " is that dictionary has record, and the Query Result of " all be " is not have record in the dictionary, and then the predicate A of institute is " being "; If " all being " Query Result is not have record in the dictionary, " all be " Query Result also is not have record in the dictionary, then read " I ", whether write down " we are " in the inquiry dictionary, if write down, then the predicate A of institute is " we are ", if there is not record, then the predicate A of institute is a "Yes"; If " all being " Query Result is that record is arranged in the dictionary, " all be " Query Result also is that record (only should not be construed as restriction to the embodiment of the invention for the explanation embodiment of the invention for example herein) is arranged in the dictionary, then read " I ", whether write down " we are " in the inquiry dictionary, if write down, then the predicate A of institute is " we are ", if there is not record, then the predicate A of institute is " be ".Further, if the user carrying out the input behavior first time, but had input results in the document, then the cursor of having stated according to preamble is determined that by artificial the mode of speech A determines speech A when mobile, repeats no more herein.Such as, the user is carrying out the input behavior first time, but has had the input results of " we are " in the document, after cursor is positioned at the "Yes" word, then according to preamble is described cursor is moved to the mode of determining speech A behind the "Yes" word, determines speech A.
In actual applications, step 401 before identifying cursor for identifying the type of symbol a in the symbol a.Therefore, follow-up when the recording user term is accustomed to the type of distinguished symbol a no longer.
Step 402: in user's grammer logical record, search the highest initial user's grammer logic of frequency and initial user's word logic, enter step 404 again;
Wherein, described initial user's grammer logic and initial user's word logic are meant that preamble stated the user logic record that comprises the beginning flag position.
Step 403: search user's grammer logic, and, enter step 404 again with user's word logic that described symbol a or the predicate A of institute start with the part of speech beginning of described symbol a or the predicate A of institute;
Step 404: the part of speech of from user's grammer logic, searching candidate word;
Step 405: the candidate word of from user's word logic, searching described part of speech correspondence;
Step 406:, described candidate word is carried out sequencing display according to described user's word logical frequency.
Among the present invention first to the 3rd embodiment, the candidate word of selecting for the user is to be shown to the user's according to the method that fourth embodiment of the invention provides, and, after the user has selected candidate word that the candidate word window shows, the term sentence-making custom of the method recording user that further provides according to the present invention first to the 3rd embodiment then.
Illustrate the method that fourth embodiment of the invention provides.
Such as, character before the cursor is empty, if user's grammer logic that frequency is the highest is to start with verb, and user's grammer logic of verb heel noun (being the verb noun), then in user's word logic, search the candidate word that meets the verb noun (such as, have a meal, drink water etc.) and these candidate word can be presented at the candidate word window according to user's word logical frequency order from high to low in actual applications.Character before the cursor is empty, illustrate that the user does not carry out any input behavior in client, but the method that the embodiment of the invention provides can be according to user's grammer logical record and user's word logical record, and the speech that the user is often used is shown to the user, has great convenience for the user and selects speech.
If the character before the cursor is speech A, speech A part of speech is a verb, then search user's grammer logical record with the verb beginning, if the user's grammer logical record that finds comprises: verb noun (first user's grammer logic), verb verb (second user's grammer logic), verb pronoun (the 3rd user's grammer logic), and described record is according to user's grammer logical frequency series arrangement from high to low, then in user's word logical record, search the candidate word that meets described user's grammer logic, and the candidate word that will meet the noun verb earlier is presented at the candidate word window according to user's word logical frequency order from high to low, the candidate word that secondly will meet the verb noun is presented at the candidate word window according to user's word logical frequency order from high to low, the candidate word that then will meet the verb pronoun is presented at the candidate word window according to user's word logical frequency order from high to low, wherein, what write down in user's word logical record all is the used speech of user, because candidate word may be that the user does not have used speech, therefore, at last can also be further that the user is original but meet the candidate word of described user's grammer logic, method according to the used speech of explicit user is presented at the candidate word window, it should be noted that, the user did not use but to meet the candidate word quantity of described user's grammer logic very big, thereby when showing these candidate word, only show meet display condition (such as, shown in display condition can be that word frequency surpasses the word frequency that presets) described candidate word.The method that the embodiment of the invention provides can be according to user's grammer logical record and user's word logical record, and the candidate word related with speech A that the user is often used is shown to the user, improves the precision of output candidate word, has made things convenient for the user to select speech.
If the character is-symbol a before the cursor then searches the user's grammer logical record with symbol a beginning, and is a plurality of if the user's grammer logical record that finds has, such as, symbol a noun, symbol a verb, then the method show candidate speech of having stated according to preamble.And if symbol is beginning loop symbol, then the method that provides of the embodiment of the invention can be shown to the user as candidate word with the speech of often following behind the symbol of beginning loop and the end loop symbol of described beginning loop symbol correspondence.Such as, if the user often imports "Patent Law", then " when " ", the method that the embodiment of the invention provides can be shown to the user as candidate word with " Patent Law " " in user's input.The method that the embodiment of the invention provides can be shown to the user with the candidate word behind described symbol of following that the user often uses, and makes things convenient for the user to select speech, and has improved the precision of output candidate word.
In sum, the method that the embodiment of the invention provides can be the user when client not be imported behavior, and according to the term sentence-making custom that has write down, the candidate word that the user is often used is shown to user's selection, reach convenience, shown the purpose of accurate candidate word efficiently.
The embodiment of the invention also provides a kind of Chinese character coding input method implement device, sees also Fig. 5, and described device comprises:
Character acquiring unit 501 is used to obtain the preceding character of cursor;
Boolean query unit 502 is used to inquire about the user logic of described character correspondence;
Candidate word query unit 503 is used to inquire about the candidate word of described character correspondence;
Display unit 504 is used for the frequency according to described user logic, and the candidate word of described character correspondence is carried out sequencing display.
In actual applications, described Boolean query unit 502 specifically comprises:
First searches the unit, is used for if described character for empty, is then inquired about initial user's grammer logic and initial user's word logic;
Second searches the unit, is used for if described character is symbol a or speech A, then inquires about the user's grammer logic with the part of speech beginning of described symbol a or speech A, reaches the user's word logic with described symbol a or speech A beginning.
And described candidate word query unit 503 specifically comprises:
Part of speech is searched the unit, is used for searching from user's grammer logic the part of speech of candidate word;
The candidate word acquiring unit is used for searching from user's word logic the candidate word of described part of speech correspondence.
For the term sentence-making custom of recording user, said apparatus also needs further to comprise:
The part of speech recognition unit is used for after the user selects candidate word B, the part of speech of identification speech B, wherein, shown in the method identification part of speech that can state according to preamble of part of speech recognition unit, repeat no more herein.
Because the character before the cursor is different can to make the process differences of record term sentence-making custom, therefore, below be sky with the character before the cursor respectively, the preceding character of cursor is introduced the device that the embodiment of the invention provides for symbol a or speech A.
(1) if the character before the cursor is empty, then said apparatus further comprises:
First user's grammer logical renewal unit, be used for when described character be that sky or character are symbol a, and a is when being terminating symbol, and the user's grammer logical frequency with the part of speech beginning of speech B is improved default value;
First user's word logical renewal unit, be used for when described character be that sky or character are symbol a, and a improves default value to the user's word logical frequency with speech B beginning when being terminating symbol.
(2),, below be that example is introduced the device that the embodiment of the invention provides with dissimilar symbols because symbol a can be punctuate symbol, terminating symbol or loop symbol if the character before the cursor is symbol a.
1, if symbol a is the punctuate symbol, then said apparatus further comprises:
Second user's grammer logical renewal unit, be used for when described character be symbol a, and a improves default value to the user's grammer logical frequency with symbol a beginning when being punctuate symbol or beginning loop symbol;
The 3rd user's grammer logical renewal unit is used for following the user's grammer logical frequency behind symbol a to improve default value to the part of speech of speech B;
Second user's word logical renewal unit is used for following the user's word logical frequency behind symbol a to improve default value to speech B.
2, if symbol a is beginning loop symbol, and the unit that provides when comprising above symbol a for the punctuate symbol of said apparatus then also needs further to comprise:
Grammer logical renewal unit, four-function family, being used for working as described character is symbol a, and when a is beginning loop symbol, then after the user imports the end loop symbol b of described beginning loop symbol correspondence, user's grammer logical frequency that the part of speech of described loop symbol ab and speech B is constituted improves default value;
The 3rd user's word logical renewal unit, being used for working as described character is symbol a, and when a is beginning loop symbol, then after the user imports the end loop symbol b of described beginning loop symbol correspondence, to user's word logical frequency raising default value of described loop symbol ab and speech B formation.
(3) if the symbol before the cursor is speech A, then said apparatus further comprises:
The 5th user's grammer logical renewal unit, being used for working as described character is speech A, after the user selects candidate word B, follows the user's grammer logical frequency after the part of speech of speech A to improve default value to the part of speech of speech B;
Four-function family word logical renewal unit, being used for working as described character is speech A, after the user selects candidate word B, follows the user's word logical frequency behind speech A to improve default value to speech B.
The embodiment of the invention also provides a kind of client, described client can be a mobile phone, and computing machine etc. need the input method software equipment is installed, and described client comprises the Chinese character coding input method implement device that preamble has been stated, particular content sees also the preamble relevant portion, does not repeat them here.
Further, the user logic of embodiment of the invention record can also sort to the candidate word of choosing according to pinyin string, specifically comprises the steps:
Receive the pinyin string of user's input; Inquire about the candidate word set of described pinyin string correspondence, comprise a candidate word corresponding at least in the described candidate word set with described pinyin string;
Obtain the preceding character of cursor; Inquire about the user logic corresponding with described character;
According to the frequency of described user logic, described candidate word is carried out sequencing display.
Adopt said method that the candidate word of selecting according to pinyin string is sorted, can be so that the order that candidate word is arranged meet user's term sentence-making custom more, saved the time that the user selects candidate word.
More than method and device that the embodiment of the invention is provided introduce, said method and device recording be user's term sentence-making custom, therefore, technique scheme is applicable to the user carries out individual when linking up, the show candidate speech is to the user.If the user is in the workplace or formal occasion, when then fourth embodiment of the invention is used the user's grammer logic write down and user's word logic, need further carry out reasonable user's grammer logic screening, promptly from the user's grammer logic that has write down, select to meet user's grammer logic of preset universal user grammer logic, show the candidate word of selecting for the user according to the user's grammer logic of selecting that has write down, then, show the candidate word of using preset universal user grammer logic to select as the user, secondly, show the candidate word of selecting for the user according to the user's grammer logic that does not meet preset universal user grammer logic in the user's grammer logic that has write down.Such as, the user's grammer logic that has write down comprises the verb noun, the verb verb, the noun verb, preset universal user's grammer logic comprises the verb noun, the noun noun, the user's grammer logic that then meets common user grammer logic is the verb noun, then show earlier to be the candidate word that the user selects, show then, show at last according to verb verb and noun verb candidate word for user's selection according to the candidate word of noun noun for user's selection according to the verb noun.
Above-mentioned two kinds of situations can realize that can define Input Software has two kinds of duties by the Input Software of same employing technical solution of the present invention, and a kind of duty is when carrying out individual's communication for the user, to provide candidate word; Another kind of work be for the user in the workplace or formal occasion, candidate word is provided.The user can be switched two kinds of duties of input method software according to self-demand.
More than a kind of input method implementation method provided by the present invention and device, client are described in detail, for one of ordinary skill in the art, thought according to the embodiment of the invention, part in specific embodiments and applications all can change, in sum, this description should not be construed as limitation of the present invention.