Summary of the invention
In order to improve the speed of input method, improve user's experience, method and input method client that the embodiment of the invention provides a kind of classified lexicon to realize.Described technical scheme is as follows:
On the one hand, the method that the embodiment of the invention provides a kind of classified lexicon to realize, described method comprises:
Input method client obtains the classified lexicon file;
According to the described classified lexicon file of described acquisition, generate the combinatorial word library file;
Receive the character string of user's input, in described combinatorial word library file, search candidate word with described string matching; The candidate word that finds is offered described user, and after the selection that receives the user was confirmed, the candidate word that described user is selected was input to computing machine.
Wherein, described input method client obtains before the step of classified lexicon file, and described method also comprises:
The dictionary title of the classified lexicon of selecting according to the user is initiated the request of obtaining classified lexicon, the dictionary sign of carrying described classified lexicon in the described request to the classified lexicon server; Described classified lexicon server receives described request of obtaining classified lexicon, according to described dictionary sign, issues the corresponding classified lexicon file of described dictionary sign to described input method client; Or,
Described input method client is to described classified lexicon server generation update request, carry the classified lexicon sign in the described update request, described classified lexicon server receives described update request, according to described classified lexicon sign, return the corresponding version identifier of described classified lexicon sign to described input method client, when described input method client judges that the version identifier of described reception is higher than the version identifier of the local described classified lexicon of preserving self, to the classified lexicon file of the version identifier correspondence of the described reception of described classified lexicon server requests; Or,
Described classified lexicon server initiatively pushes the classified lexicon file to described input method client; Or,
Described input method client receives the dictionary file of the text formatting that the user adds, and the dictionary file of the text formatting that the user of described reception is added is converted to the classified lexicon file.
Wherein, before the step of described generation combinatorial word library file, described method also comprises:
For described classified lexicon file allocation is enabled flag;
According to the flag of enabling of described classified lexicon file, from the described classified lexicon file of described acquisition, select the classified lexicon file of enabling;
Correspondingly, the step of described generation combinatorial word library file comprises:
According to the described classified lexicon file of selecting of enabling, generate the combinatorial word library file.
Wherein, arbitrary described classified lexicon file carries phonetic, speech and word frequency, described described classified lexicon file according to described acquisition, and the step of generation combinatorial word library file comprises:
In the described described classified lexicon file that obtains,, obtain the relevant information of institute's predicate in described combinatorial word library file according to described phonetic, speech and word frequency;
According to the relevant information of institute's predicate in described combinatorial word library file that obtains, generate the combinatorial word library file.
Wherein, described according to described phonetic, speech and word frequency, obtain the step of the relevant information of institute's predicate in described combinatorial word library file, comprising:
According to described phonetic and speech, judge whether the current speech in the described current classified lexicon exists identical speech in other classified lexicons, if, then the word frequency of described current speech in different classified lexicons superposeed or the word frequency of described current speech in different classified lexicons got greatly, obtain the word frequency of described current speech in described combinatorial word library file; According to the word frequency of the described current speech that obtains in described combinatorial word library file, the phonetic and the described current speech of described current speech, generate the relevant information in the described combinatorial word library file of described current speech;
If not, then with word frequency, phonetic and the described current speech of the current speech in the described current classified lexicon, as the relevant information in the described combinatorial word library file of described current speech.
Wherein, the relevant information of institute's predicate in described combinatorial word library file that described basis obtains, the step of generation combinatorial word library file comprises:
Word frequency, phonetic and the institute's predicate in described combinatorial word library file according to lexicographic order and institute's predicate generates the combinatorial word library file.
Wherein, after the step of described generation combinatorial word library file, described method also comprises:
Combinatorial word library file allocate file title for described generation; Correspondingly, described step of searching in described combinatorial word library file with the candidate word of described string matching comprises:
According to described file name, in the combinatorial word library file of described file name correspondence, search candidate word with described string matching.
Wherein, before the described step of searching in described combinatorial word library file with the candidate word of described string matching, described method also comprises:
Shared drive zone bit according to default judges whether to exist new combinatorial word library file, if then search the candidate word with described string matching in described new combinatorial word library file.
Wherein, describedly judge whether to exist before the step of new combinatorial word library file, described method comprises the combinatorial word library file that generation is new, is that described new combinatorial word library file distributes new file name, and the combinatorial word library file that described generation is new writes described new file name corresponding file; Correspondingly, search the step with the candidate word of described string matching in the described new combinatorial word library file, comprising:
According to described new file name, in the new combinatorial word library file of described new file name correspondence, search candidate word with described string matching.
Wherein, system's dictionary form of described combinatorial word library file form and described input method client is identical.
On the one hand, the embodiment of the invention provides a kind of input method client again, and described input method client comprises:
Obtain module, be used to obtain the classified lexicon file;
Generation module is used for the described classified lexicon file according to described acquisition module acquisition, generates the combinatorial word library file;
Search module, be used to receive the character string of user's input, in the combinatorial word library file that described generation module generates, search candidate word with described string matching;
Load module, be used for described search module searches to candidate word offer described user, after the selection that receives the user was confirmed, the candidate word that described user is selected was input to computing machine.
Wherein, described acquisition module comprises:
First obtains submodule, be used to receive the classified lexicon file that the classified lexicon server issues, wherein, the dictionary title of the classified lexicon of selecting according to the user, to the request that classified lexicon is obtained in the initiation of classified lexicon server, carry the dictionary sign of described classified lexicon in the described request; Described classified lexicon server receives described request of obtaining classified lexicon, according to described dictionary sign, issues the corresponding classified lexicon file of described dictionary sign; Or,
Second obtains submodule, be used for to described classified lexicon server generation update request, carry the classified lexicon sign in the described update request, described classified lexicon server receives described update request, according to described classified lexicon sign, return the corresponding version identifier of described classified lexicon sign, when described input method client judges that the version identifier of described reception is higher than the version identifier of the local described classified lexicon of preserving self, to the classified lexicon of the version identifier correspondence of the described reception of described classified lexicon server requests; Or,
The 3rd obtains submodule, is used to receive the classified lexicon file that described classified lexicon server initiatively pushes to described input method client; Or,
The 4th obtains submodule, is used to receive the dictionary file of the text formatting that the user adds, and the dictionary file of the text formatting that the user of described reception is added carries out format conversion, obtains described classified lexicon file.
Wherein, input method client also comprises: select module, be used to described classified lexicon file allocation to enable flag,, from the described classified lexicon file that described acquisition module obtains, select the classified lexicon file of enabling according to the flag of enabling of described classified lexicon file; Correspondingly, described generation module is used for the classified lexicon file of enabling selected according to described selection module, and generates the combinatorial word library file.
Wherein, arbitrary described classified lexicon file carries phonetic, speech and word frequency, and described generation module comprises:
Obtain submodule, be used for the described classified lexicon file that obtains described,, obtain the relevant information of institute's predicate in described combinatorial word library file according to described phonetic, speech and word frequency,
Generate submodule, be used for generating the combinatorial word library file according to the relevant information of the institute's predicate that obtains at described combinatorial word library file.
Wherein, described generation submodule comprises:
Judging unit is used for according to described phonetic and speech, judges whether the current speech in the described current classified lexicon exists identical speech in other classified lexicons;
First processing unit, be used for working as the result of described judgment unit judges for being, then the word frequency of described current speech in different classified lexicons superposeed or the word frequency of described current speech in different classified lexicons got greatly, obtain the word frequency of described current speech in described combinatorial word library file; According to the word frequency of the described current speech that obtains in described combinatorial word library file, the phonetic and the described current speech of described current speech, generate the relevant information in the described combinatorial word library file of described current speech;
Second processing unit, be used for when the result of described judgment unit judges for not, then with word frequency, phonetic and the described current speech of the current speech in the described current classified lexicon, as the relevant information in the described combinatorial word library file of described current speech.
Wherein, described generation submodule specifically is used for generating the combinatorial word library file according to lexicographic order and institute's predicate word frequency, phonetic and the institute's predicate at described combinatorial word library file.
Wherein, described input method client also comprises: distribution module, the combinatorial word library file allocate file title that is used to described generation module to generate; Described generation module is used for according to described file name, searches the candidate word with described string matching in the combinatorial word library file of described file name correspondence.
Wherein, described input method client also comprises:
Judge module is used for judging whether to exist new combinatorial word library file according to default shared drive zone bit, if then search candidate word with described string matching in the described module of searching in described new combinatorial word library file.
Wherein, system's dictionary form of described combinatorial word library file form and described input method client is identical.
The beneficial effect of the technical scheme that the embodiment of the invention provides is:
By being merged, each classified lexicon file obtains the combinatorial word library file, carry out candidate word when searching, only need search this combinatorial word library file, and the classified lexicon file layout that provides is simple, thereby effectively avoided in the traditional classified word bank system, to the influence of input method efficient, improve the speed of input method when the classified lexicon number is big, improve user's experience.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
In order to improve the speed of input method, improve user's experience, the method that the embodiment of the invention provides a kind of classified lexicon to realize, referring to Fig. 1, this method thes contents are as follows:
101: input method client obtains the classified lexicon file.
102:, generate the combinatorial word library file according to the classified lexicon file that obtains.
Wherein, the form of combinatorial word library file is different with the form of classified lexicon file, has only write down the relevant information (as the phonetic and the word frequency of speech, speech) of speech in the classified lexicon file that the embodiment of the invention provides, and does not need to carry information such as index; And in the combinatorial word library file except the relevant information that includes speech, in order to realize locating function, also carried index etc. and be beneficial to the information of searching.
103: receive the character string of user's input, in the combinatorial word library file, search the candidate word of coupling.
104: the candidate word that finds is offered the user, and after the selection that receives the user was confirmed, the candidate word that the user is selected was input to computing machine.
Alternatively, after computing machine receives the candidate word that the user selects, this candidate word is exported and shown, belong to prior art, repeat no more.
Further, before the related input method client of step 101 obtained the step of classified lexicon file, method also comprised:
1, the dictionary title of the classified lexicon of selecting according to the user is initiated the request of obtaining classified lexicon, the dictionary sign of carrying classified lexicon in the request to the classified lexicon server; The classified lexicon server receives the request of obtaining classified lexicon, according to the dictionary sign, issues the corresponding classified lexicon file of dictionary sign to input method client; Or,
2, input method client is to classified lexicon server generation update request, carry the classified lexicon sign in the update request, the classified lexicon server receives update request, identify according to classified lexicon, return the corresponding version identifier of classified lexicon sign to input method client, when the version identifier that judge to receive when input method client is higher than the version identifier of the local classified lexicon of preserving self, the classified lexicon file of the version identifier correspondence that receives to the classified lexicon server requests; Or,
3, the classified lexicon server initiatively pushes the classified lexicon file to input method client; Or,
4, input method client receives the dictionary file of the text formatting that the user adds, and is converted to the classified lexicon file according to the dictionary file of the text formatting that the user is added.
Further, before the step of the related generation combinatorial word library file of step 102, this method also comprises: for flag is enabled in the setting of classified lexicon file; According to enabling flag, from the classified lexicon file that obtains, select the classified lexicon file that the user enables; Correspondingly, generate the step of combinatorial word library file, comprising:, generate the combinatorial word library file according to the classified lexicon file of selecting of enabling.
Wherein, arbitrary classified lexicon file carries phonetic, speech and word frequency, according to the classified lexicon file that obtains, generates the step of combinatorial word library file, comprising:
In the classified lexicon file that obtains,, obtain the relevant information of speech in the combinatorial word library file according to phonetic, speech and word frequency; According to the relevant information of the speech that obtains in the combinatorial word library file, generate the combinatorial word library file.
Wherein, above-mentioned according to phonetic, speech and word frequency, obtain the step of the relevant information of speech in the combinatorial word library file, comprising:
According to phonetic, speech, judge whether the current speech in the current classified lexicon exists identical speech in other classified lexicons, if, then the word frequency of current speech in different classified lexicons superposeed or the word frequency of current speech in different classified lexicons got greatly, obtain the word frequency of current speech in the combinatorial word library file; According to the word frequency of the current speech that obtains in the combinatorial word library file, the phonetic and the current speech of current speech, generate the relevant information in the current speech combinatorial word library file; If not, then with word frequency, phonetic and the current speech of the current speech in the current classified lexicon, as the relevant information in the current speech combinatorial word library file.
Wherein, the relevant information of the speech that above-mentioned basis obtains in the combinatorial word library file, the step of generation combinatorial word library file comprises:
Word frequency, phonetic and the speech in the combinatorial word library file according to lexicographic order and speech generates the combinatorial word library file.
Further, after the related generation combinatorial word library file of step 102, method comprises:
Be the combinatorial word library file allocate file title that generates; Correspondingly, in the combinatorial word library file, search the step of the candidate word of coupling, comprising:, in the combinatorial word library file of file name correspondence, search the candidate word of coupling according to file name.
Further, before the step of the related candidate word of in the combinatorial word library file, searching coupling of step 103, method also comprises: according to default shared drive zone bit, judge whether to exist new combinatorial word library file, if then in new combinatorial word library file, search the candidate word of coupling.
Further, before judging whether there is new combinatorial word library file, comprising: generate new combinatorial word library file,, write new file name corresponding file generating new combinatorial word library file for new combinatorial word library file distributes new file name; Correspondingly, search the candidate word of coupling in the new combinatorial word library file, comprising:, in the new combinatorial word library file of new file name correspondence, search the candidate word of coupling according to new file name.
Preferably, system's dictionary form of the combinatorial word library file form that provides of the embodiment of the invention and input method client is identical.
In sum, the method that the embodiment of the invention provides, by being merged, each classified lexicon file obtains the combinatorial word library file, carry out candidate word when searching, only need search this combinatorial word library file, and the classified lexicon form is simple, thereby effectively avoided in the traditional classified word bank system, to the influence of input method efficient, improve the speed of input method when the classified lexicon number is big, improved user's experience.
For the method that the invention described above embodiment is provided is elaborated, see also following embodiment:
Embodiment 2
In order to improve the speed of input method, improve user's experience, the method that the embodiment of the invention provides a kind of classified lexicon to realize, referring to Fig. 2, this method thes contents are as follows:
201: input method client obtains the classified lexicon file.
The classified lexicon file is input method required file that reads when generating candidate word, has preserved the information that belongs to the speech under certain range of application in each classified lexicon file.Wherein, each classified lexicon file has:
The dictionary sign is used for classified lexicon file of unique identification;
The dictionary title, be used to identify the relevant information of the speech of this classified lexicon file, be convenient to the user when obtaining classified lexicon, can be according to the demand of oneself, obtain targetedly according to this dictionary title, for example, user A wishes to get access to the speech of chat phrase class, then can remove to search the classified lexicon that the dictionary name is called chat phrase commonly used; For another example, user B wishes to get access to the speech relevant with the political situation of the time, then can go to search the classified lexicon that the dictionary name is called political situation of the time important news, thereby improve the convenience that the user uses;
The dictionary type is used to identify the type of this classified lexicon file, is convenient to the user and knows type attribute under this classified lexicon.
Version identifier is used to identify the version of current classified lexicon file, is convenient to follow-up a certain class classified lexicon is upgraded, expands and compatible forward.Preferably, this version flag is continuous progressive whole number, and wherein, the version of big more this classified lexicon file of expression of numeral is high more.
Further, in the prior art in order to realize mating searching of speech, speech in each classified lexicon that prior art provided need be arranged (as lexicographic order) sequentially, so in this classified lexicon file except the information that includes necessary speech, also need information such as index, cause classified lexicon file layout complexity, the classified lexicon file is bigger; When the user needs that (or other modes) download classified lexicon from network, can cause speed of download slow excessively, reduce user's experience.And the classified lexicon file that the embodiment of the invention provides only need carry the information of speech, and referring to table 1, the embodiment of the invention provides the information signal table of the speech that carries in the classified lexicon file.
Table 1
Phonetic |
Speech |
Word frequency |
??weixiao |
Smile |
100 |
??weixiao |
Small |
60 |
??...... |
...... |
...... |
??keyi |
Can |
200 |
??keyi |
Painstakingly |
80 |
??keyi |
Suspicious |
30 |
??...... |
...... |
...... |
As shown in table 1, only need the relevant information of record speech in the classified lexicon file, comprise phonetic, speech and word frequency, and do not need to write down extra information such as index, so the form of this classified lexicon file is comparatively simple, and file is less, particularly, when the obtain manner of classified lexicon for by network download the time, these characteristics make speed of download improve, user experience improves.
Wherein, the related input method client of this step 201 obtain the mode of classified lexicon file, can be for by the needs of user according to oneself, according to the title of classified lexicon file, initiate request to classified lexicon update service device, thereby realize that the user initiatively carries out the download of classified lexicon file; Also can be for initiatively pushing classified lexicon to input method client by the classified lexicon server, the embodiment of the invention does not limit this, only does the example explanation.For example, when classified lexicon update service device identifies according to the classified lexicon FileVersion, when discovery new version occurred for a certain classified lexicon file, then initiatively issue new version classified lexicon file to input method client, for another example, when classified lexicon during the course of the Olympic Games, can initiatively push an exclusive Olympic Games dictionary file to input method client, thereby make that the user does not need oneself to go to add, for the user provides a kind of use-pattern more easily, improved user's experience, the embodiment of the invention does not limit the mode that input method client obtains the classified lexicon file.
202: input method client is preserved the classified lexicon file that obtains.
Wherein, present embodiment is only done the example explanation, supposes that input method client has obtained 6 classified lexicon files, and is wherein as shown in table 2,
Table 2
The dictionary sign |
The dictionary title |
The dictionary type |
The dictionary version identifier |
...... |
??1 |
Neologisms upgrade |
Language |
??1 |
...... |
??18 |
World of Warcraft |
Network game |
??1 |
...... |
??2 |
Chat phrase commonly used |
Language |
??1 |
...... |
??3 |
The Chinese idiom common saying |
Literature |
??2 |
...... |
??4 |
Poem |
Literature |
??1 |
...... |
??5 |
The fan of Tengxun |
Other |
??5 |
...... |
203: the classified lexicon file of input method client for preserving, flag is enabled in configuration, and whether this enables flag and is used to identify this classified lexicon file and is enabled by the user.
Wherein, still referring to table 2, suppose that the user enables certain classified lexicon file, then it is enabled flag accordingly and is changed to 1; Otherwise for the classified lexicon file of user's not enabled, it is enabled flag accordingly and is changed to 0.
204: input method client is obtained the classified lexicon file that the user enables according to enabling flag.
205: the classified lexicon file that input method client is read in the user successively and enabled generates the combinatorial word library file, and be this combinatorial word library file distribution combinatorial word library name.
Wherein, the classified lexicon file that input method client is read in the user successively and enabled, when generating the combinatorial word library file, concrete with reference to as follows:
Suppose that the user has enabled 2 classified lexicon X, Y, then according to phonetic, speech and the word frequency information of each speech, carry out the generation of combinatorial word library file, example is as follows:
205A: according to classified lexicon X and classified lexicon Y, judge whether the current speech among the classified lexicon X exists identical (being that phonetic is identical, speech is identical) speech in classified lexicon Y, if; Execution in step 205B then; Otherwise, execution in step 205C.
205B: with word frequency and the word frequency among classified lexicon Bs of current speech in classified lexicon A, carry out addition, obtain the relevant information of this speech in the combinatorial word library file, after all speech among classified lexicon X and the classified lexicon Y are merged, execution in step 205D.
For example, smile if current speech is weixiao, its word frequency in classified lexicon A is 200, and the word frequency in classification part of speech B is 20, and then the relevant information of this speech is in merging dictionary: weixiao smiles 220.
This step 205B can also for current speech in classified lexicon A word frequency and the word frequency in classified lexicon B in select maximum word frequency, thereby obtain the relevant information in the combinatorial word library file of this speech, after all speech among classified lexicon X and the classified lexicon Y are merged, execution in step 205D.
For example, smile if current speech is weixiao, its word frequency in classified lexicon A is 200, and the word frequency in classification part of speech B is 20, and then the relevant information of this speech is in merging dictionary: weixiao smiles 200.
Present embodiment does not limit this.
205C: to the relevant information of current speech the relevant information in the combinatorial word library file as this speech; After all speech among classified lexicon X and the classified lexicon Y are merged, execution in step 205D.
For example, if the current speech among the classified lexicon X is weixiao small 50; And in classified lexicon Y, do not have the speech identical, only exist weixiao to defend school 20 with this current speech, then with this weixiao small 50 as the relevant information in this combinatorial word library file.
205D: with the speech relevant information in the combinatorial word library file, according to the word frequency information of lexicographic order and speech, the processing of sorting obtains final combinatorial word library file, and is this classified lexicon file allocation combinatorial word library file title (as mergecell.dict).
Wherein, search for the ease of follow-up, classified lexicon file after the merging has different file layouts with the classified lexicon file that the embodiment of the invention provides, need carry the information such as index that are used to inquire about, smaller and be easy to expansion for the classified lexicon demand file of downloading, therefore form is fairly simple, and the classified lexicon after merging requires the input nucleus core module fast dictionary to be searched, so the form more complicated.Preferably, the combinatorial word library file is generally identical with system's dictionary form that input method carries.
206: input method client receives the character string of user's input, searches the combinatorial word library file of combinatorial word library name correspondence, obtains candidate word; Candidate word with getting access to offers the user, and after the selection that receives the user was confirmed, the speech that the user is selected was input in the computing machine.
Wherein, the related content of this step 206 is a prior art, repeats no more.
Further, when practical application, if current merging dictionary is by other programs (as calculator memory etc.) when taking, and obtained new combinatorial word library file and (and have himself combinatorial word library name owing to certain reason triggers, as mergecell_1.dict), wherein, above-mentioned reason includes but not limited to that the user enables a new classified lexicon file again, then can upgrade the dictionary file of merging; Or, because original a certain classified lexicon file is deleted, then can upgrade dictionary file of merging or the like.In order to realize that the employed merging dictionary of user is upgraded timely, for the user provides up-to-date merging dictionary, improve user's experience, correspondingly, at the related combinatorial word library file of searching combinatorial word library name correspondence of step 206, obtain before the candidate word, the method that the embodiment of the invention provides also comprises:
Input method client is checked the shared drive zone bit, according to this shared drive zone bit, knows whether there is new combinatorial word library file, if, then search this new combinatorial word library file, obtain candidate word.
Wherein, the embodiment of the invention provides the shared drive zone bit, input method client is checked this shared drive zone bit, if the shared drive zone bit is put 1, then represent for current merging dictionary, have up-to-date combinatorial word library file, input method need be searched this up-to-date combinatorial word library file when generating candidate word; Otherwise if the shared drive zone bit is put 0, then input method need be searched current combinatorial word library file when generating candidate word.
Alternatively, in order to save the internal memory of input method client,, thereby discharge resource if up-to-date combinatorial word library file then can delete current combinatorial word library file.
The method that classified lexicon that the embodiment of the invention provides is realized, can adopt when specifically using as shown in Figure 3 realize that based on merging the dictionary framework referring to Fig. 3, this framework comprises:
Input method core processor, classified lexicon manager, classified lexicon renovator and classified lexicon combiner, wherein,
1, input method core processor, the responsible most basic function that realizes input method comprises syllabification is carried out in user's input that candidate word generates, intelligent word etc.Say that simply the input method core processor generates the candidate word tabulation according to user's input.The input method core processor needed before candidate word generates according to the classified lexicon file after the loading of classified lexicon filename merges after the merging of record in the classified lexicon tabulation.
2, classified lexicon manager is responsible for being used for classified lexicon tabulation is managed, and comprises the interpolation dictionary, and dictionary enabled in the deletion dictionary, and the forbidding dictionary upgrades dictionary etc.Wherein upgrading dictionary funcall classified lexicon renovator realizes.Other operations all realize that by the classified lexicon manager these operations all can be carried out read-write operation to the classified lexicon listing file.Wherein, the classified lexicon that the user adds can be downloaded from the Internet, also can be added the dictionary file of a text formatting by user oneself, and the classified lexicon manager can be the file conversion of text formatting the classified lexicon formatted file.
3, classified lexicon renovator is responsible for the classified lexicon of enabling is upgraded, both can manual triggers upgrade, and also can be automatic renewal, upgrade as carrying out a classified lexicon every day.Needing a classified lexicon update service device provides the information and the classified lexicon file of the dictionary that needs renewal, server comprises a relevant information (ID who comprises classified lexicon who deposits classified lexicon, version etc.) database, and the latest edition of storing each classified lexicon.Classified lexicon update service device not only can upgrade the dictionary that the user asks to upgrade, and can also initiatively recommend dictionary to arrive client, and the embodiment of the invention does not limit this renewal process, only does the example explanation.Referring to Fig. 4, when this classified lexicon renovator carried out the classified lexicon renewal, its flow process was as follows:
401: the input method renovator reads the classified lexicon tabulation, and the list information of the classified lexicon identification list that the structure request is upgraded sends to classified lexicon update service device with this list information;
Wherein, this input method renovator is positioned at input method client.
402: classified lexicon update service device, according to the classified lexicon sign of carrying in the list information, the relevant information of the classified lexicon that search request is upgraded in database returns to input method client with the relevant information that finds.
Further, need be when classified lexicon that input method client pushes if this classified lexicon update service device has, then correspondingly, also comprise in step 402: input method client is returned the relevant information that this classified lexicon update service device is wished the classified lexicon that pushes.
403: the relevant information of the classified lexicon that input method renovator reception classified lexicon update service device returns for each classified lexicon, according to version identifier, obtains classified lexicon tabulation to be updated.
Wherein, be specially: the input method renovator identifies according to classified lexicon, the version identifier of version identifier that comparison-of-pair sorting's Word library updating server returns and the local classified lexicon of preserving, if the version identifier that the version identifier that returns is preserved greater than this locality then is added into this classified lexicon sign in the classified lexicon tabulation of pending renewal; According to the classified lexicon sign,, then this classified lexicon sign is added in the classified lexicon tabulation of pending renewal if there is not the classified lexicon that returns of this classified lexicon update service device in this locality.
404: the above-mentioned classified lexicon tabulation to be updated that obtains of input method renovator traversal, initiate request to the update service device successively, download each classified lexicon file to be updated, and cover local classified lexicon file.
405: when all classified lexicons to be updated all download finish after, with shared drive mark position 1.
Wherein, shared drive mark position 1 presentation class Word library updating is finished, need reconsolidate, and input method client is carrying out needing to reload new combinatorial word library file before candidate word generates classified lexicon.
4, classified lexicon combiner is responsible for reading in the classified lexicon file that the user enables successively according to the classified lexicon listing file, generates new combinatorial word library file then.If classified lexicon is taken by other programs after the current merging, then be that this new combinatorial word library file generates a new filename, as mergecell_1.dict, and this filename write in the classified lexicon listing file.Follow-up application program will load this new file.After the dictionary union operation is finished, need notice input method core processor to load new combinatorial word library file.In order to make the input method core processor carry out the candidate word generation, can in time search up-to-date combinatorial word library file, the way that the embodiment of the invention provides is that the shared drive zone bit is set, and this shared drive zone bit is 0 when initial, and expression does not need to reload classified lexicon.Behind the classified lexicon union operation, need be 1 with this mark position.The input method core processor was all checked once this zone bit before each candidate word generates, if zone bit is 1, then tabulates according to classified lexicon earlier and reload classified lexicon, and then carry out normal candidate word generation.Referring to Fig. 5, the flow process that the classified lexicon that the embodiment of the invention provides merges is as follows:
501: the classified lexicon combiner reads the classified lexicon tabulation, according to this classified lexicon tabulation, obtains the classified lexicon list information of record in this classified lexicon tabulation, and the relevant information of the speech of corresponding classified lexicon was read in internal memory during this classified lexicon was tabulated.
502: the relevant information of the whole speech that reads in according to step 501 generates new combinatorial word library file.
503: judge whether current combinatorial word library file is occupied, if then execution in step 504; Otherwise, execution in step 506.
504: the new combinatorial word library file that obtains for step 502 generates new filename, and the new combinatorial word library file of step 502 generation is write in this new filename corresponding file, and execution in step 505 then.
505: new filename is write the classified lexicon listing file, and execution in step 507 then.
506: with new combinatorial word library file current combinatorial word library file is covered, execution in step 507 then.
507: with shared drive mark position 1.
In sum, the method that the embodiment of the invention provides a kind of classified lexicon to realize, because the classified lexicon file layout that the embodiment of the invention provides is simple, therefore speed of download is fast, merge by each classified lexicon file that the embodiment of the invention is provided and to obtain the combinatorial word library file, carry out candidate word when searching, only need search this combinatorial word library file, thereby effectively avoided in the traditional classified word bank system, when the classified lexicon number is big to the influence of input method efficient, improve the speed of input method, improve user's experience.
Embodiment 3
With said method embodiment correspondingly, the embodiment of the invention provides a kind of input method client, referring to Fig. 6, input method client comprises:
Obtain module 601, be used to obtain the classified lexicon file;
Generation module 602 is used for generating the combinatorial word library file according to obtaining the classified lexicon file that module 601 obtains; Wherein, the form of combinatorial word library file is different with the form of classified lexicon file.Only write down the relevant information (as the phonetic and the word frequency of speech, speech) of speech in the classified lexicon file that the embodiment of the invention provides, do not needed to carry information such as index; And in the combinatorial word library file except the relevant information that includes speech, in order to realize locating function, also carried index etc. and be beneficial to the information of searching.
Search module 603, be used to receive the character string of user's input, in the combinatorial word library file that generation module 602 generates, search candidate word with string matching;
Load module 604 is used for offering the user with searching the candidate word that module 603 finds, and after the selection that receives the user was confirmed, the candidate word that the user is selected was input to computing machine.
Wherein, obtaining module 601 comprises:
First obtains submodule, be used to receive the classified lexicon file that the classified lexicon server issues, wherein, after the dictionary title of user according to classified lexicon, the then request of obtaining classified lexicon to the initiation of classified lexicon server according to user-selected dictionary title, the dictionary sign of carrying classified lexicon in the request; The classified lexicon server receives the request of obtaining classified lexicon, according to the dictionary sign, issues the corresponding classified lexicon file of dictionary sign; Or,
Second obtains submodule, be used for to classified lexicon server generation update request, carry the classified lexicon sign in the update request, the classified lexicon server receives update request, identify according to classified lexicon, return the corresponding version identifier of classified lexicon sign, when input method client judges that the version identifier that receives is higher than the version identifier of the local classified lexicon of preserving self, the classified lexicon of the version identifier correspondence that receives to the classified lexicon server requests; Or,
The 3rd obtains submodule, is used to receive the classified lexicon server and initiatively pushes the classified lexicon file to input method client; Or,
The 4th obtains submodule, is used to receive the dictionary file of the text formatting that the user adds, and the dictionary file of the text formatting that the user who receives is added carries out format conversion, obtains the classified lexicon file.
Further, the input method client that the embodiment of the invention provides also comprises: select module, be used to the setting of classified lexicon file to enable flag,, from the classified lexicon file that obtains module 601 acquisitions, select the classified lexicon file of enabling according to enabling flag; Correspondingly, generation module 602 is used for generating the combinatorial word library file according to the classified lexicon file of enabling of selecting module to select.
Wherein, arbitrary classified lexicon file carries phonetic, speech and word frequency, and correspondingly, generation module 602 comprises:
Obtain submodule, be used for,, obtain the relevant information of speech in the combinatorial word library file according to phonetic, speech and word frequency at the classified lexicon file that obtains,
Generate submodule, be used for generating the combinatorial word library file according to the relevant information of the speech that obtains at the combinatorial word library file.
Wherein, generate submodule, comprising:
Judging unit is used for according to phonetic and speech, judges whether the current speech in the current classified lexicon exists identical speech in other classified lexicons;
First processing unit, be used for when the result of judgment unit judges for being, then the word frequency of current speech in different classified lexicons superposeed or the word frequency of current speech in different classified lexicons got greatly, obtain the word frequency of current speech in the combinatorial word library file; According to the word frequency of the current speech that obtains in the combinatorial word library file, the phonetic and the current speech of current speech, generate the relevant information in the current speech combinatorial word library file;
Second processing unit, be used for when the result of judgment unit judges for not, then with word frequency, phonetic and the current speech of the current speech in the current classified lexicon, as the relevant information in the current speech combinatorial word library file.
Wherein, generating submodule specifically is used for according to lexicographic order and speech generating the combinatorial word library file at word frequency, phonetic and the speech of combinatorial word library file.
Further, the input method client that the embodiment of the invention provides also comprises: distribution module, the combinatorial word library file allocate file title that is used to generation module 602 to generate; Generation module 602 is used for according to file name, searches the candidate word of coupling in the combinatorial word library file of file name correspondence.
Further, the input method client that provides of the embodiment of the invention also comprises:
Judge module is used for judging whether to exist new combinatorial word library file according to default shared drive zone bit, if then search the candidate word of coupling searching module 603 in new combinatorial word library file.
Preferably, system's dictionary form of combinatorial word library file form and input method client is identical.
In sum, the embodiment of the invention provides input method client, can be by the form that the embodiment of the invention provides simple classified lexicon file, realization merges each classified lexicon file and obtains the combinatorial word library file, carries out candidate word when searching, and only need search this combinatorial word library file, thereby effectively avoided in the traditional classified word bank system, to the influence of input method efficient, improve the speed of input method when the classified lexicon number is big, improve user's experience.And because the classified lexicon form is simple, therefore when obtaining, convenient and swift, mode is varied.
" reception " speech in the embodiment of the invention can be understood as and initiatively obtains from other modules also can be to receive the information that other modules are sent.
It will be appreciated by those skilled in the art that accompanying drawing is the synoptic diagram of a preferred embodiment, module in the accompanying drawing or flow process might not be that enforcement the present invention is necessary.
It will be appreciated by those skilled in the art that the module in the device among the embodiment can be distributed in the device of embodiment according to the embodiment description, also can carry out respective change and be arranged in the one or more devices that are different from present embodiment.The module of the foregoing description can be merged into a module, also can further split into a plurality of submodules.
The invention described above embodiment sequence number is not represented the quality of embodiment just to description.
Part steps in the embodiment of the invention can utilize software to realize that corresponding software programs can be stored in the storage medium that can read, as CD or hard disk etc.
The above only is preferred embodiment of the present invention, and is in order to restriction the present invention, within the spirit and principles in the present invention not all, any modification of being done, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.