Chinese character input method, equipment and system
Technical field
The present invention relates to the computer input method technical field, particularly a kind of Chinese character input method, equipment and system.
Background technology
Input method refers to the coding method of employing for various symbols being imported computing machines or other equipment (as mobile phone).The coding method of Chinese character input all is to adopt sound, shape, justice and specific key are interrelated basically, makes up to finish the input of Chinese character again according to different Chinese character.
Common input method of Chinese character type comprises spelling input method, five-stroke input method etc. in the prior art at present, the Chinese character that uses these input methods to obtain exporting, the technological means that these input methods adopt generally all is to import font or word sound according to the user, obtain Chinese character by the font of input or the mapping relations between word sound and the Chinese dictionary afterwards, and the output result.Also have some input methods to have the function of intelligent association, can produce matching result preferably for common input, such as input xinxilan, input method is according to the font of input or the association of the word sound matching results such as New Zealand or Information that come out.
In realizing process of the present invention, the inventor finds that there is following problem at least in prior art:
Input method of the prior art can only be carried out association to font and the word sound of input, can not produce the synonym association to the output result, therefore, only know the synonym of certain word the user, and when not knowing this definite word, just can not obtain the word that the user with the synonym coupling truly want from input method.
Summary of the invention
In order to make input method carry out the synonym association according to input results, match the word that the user really wants, the embodiment of the invention provides a kind of input method, Apparatus and system of exporting the synonym matching result.Described technical scheme is as follows:
On the one hand, a kind of Chinese character input method comprises:
The candidate word tabulation that the coding of importing according to the user obtains comprises at least one candidate word in the described candidate word tabulation;
From described candidate word tabulation, choose at least one candidate word, and send the synonym services request to the synonym server, comprise selected candidate word in the described synonym services request;
Receive the synonym of described synonym server candidate word coupling that return and selected, and export described candidate word tabulation and described synonym.
Wherein, described to synonym server transmission synonym services request, comprising:
Analyze selected candidate word, judge whether comprise function word in the selected candidate word;
If comprise function word in the selected candidate word, then delete the function word in the selected candidate word, and send the synonym services request to the synonym server, carry the described candidate word behind the deletion function word in the described synonym services request.
Wherein, the described candidate word tabulation of described output and described synonym comprise:
In described candidate word tabulation, add described synonym;
The candidate word tabulation behind the described synonym has been added in output.
Wherein, from the tabulation of described candidate word, choose and be positioned at the first candidate word, then describedly in described candidate word tabulation, add described synonym and specifically comprise: described synonym is added into the second place in the described candidate word tabulation.
Wherein, export after described candidate word and the described synonym, also comprise:
When receiving the user to the synon error correction request of described output, the synonym of described output is carried out correction process.
Wherein, obtain also comprising after the tabulation of described candidate word according to described coding:
Judge whether the synonym service function opens;
If then carry out from described candidate word tabulation and choose at least one candidate word, and send the step of synonym services request to the synonym server;
Otherwise, export described candidate word tabulation.
On the other hand, a kind of Chinese character input method comprises:
Receive the synonym services request that client sends, comprise candidate word to be matched in the described synonym services request;
Search the synonym with described candidate word coupling;
The synonym of described coupling is returned to described client, make described client export described synonym.
Wherein, before the synonym services request that described reception client sends, also comprise: according to RBTree data structure storage database of synonyms;
The described synonym that mates with described candidate word of searching comprises: search the synonym with described candidate word coupling from described database of synonyms.
Another aspect, a kind of client comprises:
Choose module, be used for the candidate word tabulation according to the coding acquisition of user's input, from described candidate word tabulation, choose at least one candidate word, comprise at least one candidate word in the described candidate word tabulation;
Sending module is used for sending the synonym services request to the synonym server, comprises selected candidate word in the described synonym services request;
Receiver module, be used for to receive described synonym server that return with synonym described candidate word coupling;
Output module is used for the described candidate word tabulation of output and described synonym.
Wherein, described client also comprises:
Optimize module, be used for analyzing selected candidate word, judge whether comprise function word in the selected candidate word, if comprise function word in the selected candidate word, then delete the function word in the selected candidate word;
Described sending module specifically is used for sending the synonym services request to the synonym server, carries the candidate word after described optimization module is deleted function word in the described synonym services request.
Wherein, described output module comprises:
Adding device is used for adding described synonym in described candidate word tabulation;
Output unit is used for the candidate word tabulation after described synonym has been added in output.
Wherein, the described module of choosing specifically is used for choosing the candidate word that is positioned at the first place from described candidate word tabulation;
Described adding device specifically is used for described synonym is added into the second place of described candidate word tabulation.
Wherein, described client also comprises:
Correction module is used for after described output module is exported described candidate word and described synonym, if receive the user to the synon error correction request of described output, then the synonym to described output carries out correction process.
Wherein, described client also comprises:
Judge module is used for judging whether the synonym service function opens described client obtains described candidate word tabulation according to described coding after;
Correspondingly, described sending module specifically is used for the result that judges when described judge module when being, transmission comprises that the synonym services request of the described candidate word of choosing arrives the synonym server;
Described output module also is used for the result that judges when described judge module for not the time, exports described candidate word and tabulates.
Another aspect, a kind of synonym server comprises:
Receiver module is used for receiving the synonym services request that client sends, and comprises candidate word to be matched in the described synonym services request;
Search module, be used for searching the synonym that mates with described candidate word;
Sending module is used for searching the described synonym that module finds and returning to described client described, makes described client export described synonym.
Wherein, described server also comprises:
Memory module is used for before described receiver module receives the synonym services request of client transmission, according to RBTree data structure storage database of synonyms;
Correspondingly, the described module of searching specifically is used for searching the synonym that mates with described candidate word from described database of synonyms.
On the one hand, a kind of Chinese character input system comprises: at least two synonym servers and aforesaid client again; Described synonym server is aforesaid synonym server.
Wherein, in described at least two synonym servers, one of them synonym server is main synonym server, and other synonym servers are from the synonym server; When described main synonym server occurs when unusual, described from the synonym server generation for described main synonym server work.
The beneficial effect that the technical scheme that the embodiment of the invention provides is brought is:
The candidate word tabulation that the coding of importing according to the user obtains, therefrom choose at least one candidate word, and transmission comprises that the synonym services request of this candidate word is to the synonym server, obtain that server returns and synonym this candidate word coupling, export this candidate word tabulation and synonym then, can allow the user have more output result to select, obtain the output result that the user really wants.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use is done to introduce simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is a kind of Chinese character input method process flow diagram that the embodiment of the invention 1 provides;
Fig. 2 is the another kind of Chinese character input method process flow diagram that the embodiment of the invention 1 provides;
Fig. 3 is a kind of Chinese character input method process flow diagram that the embodiment of the invention 2 provides;
Fig. 4 is the synon synoptic diagram of output that the embodiment of the invention 2 provides;
Fig. 5 be the embodiment of the invention 2 provide another export synon synoptic diagram;
Fig. 6 is a kind of client terminal structure figure that the embodiment of the invention 3 provides;
Fig. 7 is the another kind of client terminal structure figure that the embodiment of the invention 3 provides;
Fig. 8 is a kind of synonym server architecture figure that the embodiment of the invention 4 provides;
Fig. 9 is a kind of Chinese character input system structural drawing that the embodiment of the invention 5 provides;
Figure 10 is the synonym server disposition synoptic diagram that the embodiment of the invention 5 provides.
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
Referring to Fig. 1, the embodiment of the invention provides a kind of input method of exporting the synonym matching result, and described method comprises:
101: the candidate word tabulation that the coding of importing according to the user obtains, from described candidate word tabulation, choose at least one candidate word, comprise at least one candidate word in the described candidate word tabulation;
102: send the synonym services request to the synonym server, comprise selected candidate word in the described synonym services request;
103: the synonym that receives described synonym server candidate word coupling that return and selected;
104: export described candidate word tabulation and described synonym.
The said method that the embodiment of the invention provides, the candidate word tabulation that the coding of importing according to the user obtains, therefrom choose at least one candidate word, and transmission comprises that the synonym services request of this candidate word is to the synonym server, obtain that server returns and synonym this candidate word coupling, export this candidate word tabulation and synonym then, can allow the user have more output result to select, obtain the output result that the user really wants.
Referring to Fig. 2, the embodiment of the invention also provides a kind of Chinese character input method, and described method comprises:
201: receive the synonym services request that client sends, comprise candidate word to be matched in the described synonym services request;
202: search the synonym with described candidate word coupling;
203: the synonym of described coupling is returned to described client, make described client export described synonym.
The said method that the embodiment of the invention provides, according to the candidate word in the synonym services request of client transmission, search the synonym of coupling, and this synonym sent to client, make client can export this synonym, can allow the user have more output result to select, obtain the output result that the user really wants.
Embodiment 2
Referring to Fig. 3, the embodiment of the invention provides a kind of Chinese character input method, said method comprising the steps of:
301: client receives the coding of user's input, according to the candidate word tabulation that this coding obtains mating, comprises at least one candidate word in this candidate word tabulation;
This step can adopt conventional input method, the coding of user's input can comprise font or phonetic, coding and the mapping relations between the Chinese character according to input obtain tabulating with the candidate word of input coding coupling, import " xinxilanshoudu " such as the user with spelling input method, then first candidate word that obtains according to the mapping relations between phonetic and the Chinese character is " New Zealand capital ", second candidate word is " New Zealand ", and the 3rd candidate word is " Information ".
302: client is chosen at least one candidate word from the candidate word tabulation, the candidate word that analysis is chosen, judge wherein whether comprise function word, if comprise function word in the candidate word of choosing, then delete the function word in the described candidate word, and send the synonym services request to the synonym server, comprise the candidate word behind the described deletion function word in this synonym services request;
This step before sending synonym coupling services request, can be deleted the function word in the candidate word that obtains in order to improve the efficient that obtains the synonym service.Described function word refers to there is not complete lexical meaning, but the word of grammatical meaning or functional meaning is arranged, and generally, function word depends on notional word or statement, is used for representing grammatical meaning.Described function word includes but not limited to: adverbial word, preposition, conjunction, auxiliary word, modal particle, onomatopoeia etc. do not have the word of practical significance, for example, when the coding according to the user obtains candidate word when " wife of Chen Yixun ", then can be before the service of request synonym this candidate word be changed into " the fast wife of Chen Yi ".
303: after the synonym server is received the synonym services request that client sends, search with described synonym services request in the synonym of candidate word coupling, and this synonym sent to client;
Wherein, the synonym server can be searched corresponding synonym in database of synonyms.Particularly, described database of synonyms is SQL (Structured Query Language, Structured Query Language (SQL)) database, more than totally 150 ten thousand of synonyms in the database of synonyms that input method is used, the words that need renewal, only need to upgrade that relative recording gets final product in the SQL database, database of synonyms can be stored on the synonym server, perhaps provides service as an independent database of synonyms server.After the synonym server received the synonym services request, the database of synonyms that visit is local perhaps connected the database of synonyms server, therefrom searched the synonym with the input results coupling.
The deployment of the synonym server of synonym service is provided, can adopt HA high availability HA (High Availability, high available) model, and employing principal and subordinate working method, when master (master) server occurs unusual the time, input method can be dynamically connected certainly slave (from) server, the slave server promoted and was the master server this moment, guaranteeing in time provides the synonym service, and the master server is downgraded to the slave server simultaneously.
In the present embodiment, further, search synon efficient in order to improve, the synonym server can also be in advance according to RBTree data structure storage database of synonyms; Correspondingly, the synonym of the candidate word coupling in synonym whois lookup and the described synonym services request, can specifically comprise: from described database of synonyms, search the synonym that mates with described candidate word, thereby can guarantee that the synon speed of synonym whois lookup is faster.
304: client receive the synonym server that return with synonym described candidate word coupling;
305: the synonym that client is exported described candidate word tabulation and received.
This step can specifically comprise:
Add described synonym in described candidate word tabulation, the candidate word tabulation behind the described synonym has been added in output.
Client is behind the output synonym, and the user just can select as required, thereby more convenient user uses.For example, referring to Fig. 4, after user's input " xinxilanshoudu ", first candidate word " New Zealand capital " is sent to the service of synonym server request synonym, the synonym whois lookup to synonym be " Wellington " and issue client, then the result of client output has just comprised " Wellington ", and the user can select the result of needs as required, as is " New Zealand capital " or " Wellington ".
In order to improve the efficient that obtains synonym service, further, client can be chosen in this candidate word tabulation and be positioned at the first candidate word in the step 302, then correspondingly, describedly adds described synonym can specifically comprise in described candidate word tabulation:
Add described synonym in the tabulation of described candidate word the second place.
From the candidate word tabulation, choose and be positioned at the first candidate word, can guarantee the highest synonym of the degree of correlation of the each demonstration at most of the synonym service that obtains, obtain the efficient of synonym service with raising, the synonym service is after input method is obtained conventional candidate word, and just first candidate word with the input method coupling transmit a request to the synonym service.
For example, with spelling input method input " xinxilan ", obtain the candidate word tabulation, wherein, first candidate word is " New Zealand ", and second candidate word is " Information ", then chooses first candidate word " New Zealand " and sends to the synonym server.
Further, said method can also comprise the steps: behind client output candidate word tabulation and synonym
306: when receiving the user to the synon error correction request of described output, the synonym of output is carried out correction process.
This step has offered the user and has more selected, when the user is unsatisfied to the synonym result of coupling, can carry out error correction to the synonym of output, again described candidate word is sent to the synonym server and search the coupling synonym, so that the synonym that other is provided is to the user.
In addition, in the present embodiment, client can also provide synonym service function option to the user, selects whether open the synonym service function for the user, and particularly, described method also comprises:
Client obtains candidate word tabulation according to coding after, judge whether the synonym service function opens earlier, if then client executing step 302 and subsequent step are according to above-mentioned flow performing; Otherwise client is directly exported this candidate word tabulation, according to the flow performing of routine.
Referring to Fig. 5, by " Wellington " word of output, provided a small icon, if the user clicks this small icon, can obtain error correction and close intelligence getting the word function, the user can carry out error correction or close the synonym service the synonym that obtains as required.
The said method that the embodiment of the invention provides, the candidate word tabulation that the coding that client is imported according to the user obtains mating, therefrom choose at least one candidate word, transmission is carried the synonym services request of this candidate word to the synonym server, the synonym of synonym whois lookup coupling also sends to client, client is exported this candidate word tabulation and synonym, can allow the user that more selection is arranged, and obtains the result that the user really wants.Further, by before sending the synonym services request, exporting the function word that does not have practical significance, improved the efficient of synonym service.By employing RBTree data structure storage database of synonyms, and in this database of synonyms, search synonym, can further improve the efficient of searching, thereby improved the efficient of synonym service.
Embodiment 3
Referring to Fig. 6, the embodiment of the invention provides a kind of client, and described client comprises:
Choose module 601, be used for the candidate word tabulation according to the coding acquisition of user's input, from described candidate word tabulation, choose at least one candidate word, comprise at least one candidate word in the described candidate word tabulation;
Sending module 602 is used for sending the synonym services request to the synonym server, comprises selected candidate word in this synonym services request;
Receiver module 603, be used for to receive the synonym server that return with synonym described candidate word coupling;
Output module 604 is used for the described candidate word tabulation of output and synonym.
Referring to Fig. 7, in the present embodiment, described client also comprises:
Optimize module 605, be used for analyzing selected candidate word, judge whether comprise function word in the selected candidate word, if comprise function word in the selected candidate word, then delete the function word in the selected candidate word;
Correspondingly, sending module 602 specifically is used for sending the synonym services request to the synonym server, carries the candidate word of optimizing after module 605 is deleted function words in the described synonym services request.
In the present embodiment, output module 604 comprises:
Adding device is used for adding described synonym in described candidate word tabulation;
Output unit is used for the candidate word tabulation after described synonym has been added in output.
Further, choosing module 601 specifically is used for choosing the candidate word that is positioned at the first place from described candidate word tabulation; Correspondingly, described adding device specifically is used for described synonym is added into the second place of described candidate word tabulation.
Present embodiment, described client also comprises:
Correction module is used for after described output module is exported described candidate word and described synonym, if receive the user to the synon error correction request of described output, then the synonym to described output carries out correction process.
In the present embodiment, described client also comprises:
Judge module is used for judging whether the synonym service function opens described client obtains described candidate word tabulation according to described coding after;
Correspondingly, described sending module specifically is used for the result that judges when described judge module when being, transmission comprises that the synonym services request of the described candidate word of choosing arrives the synonym server;
Described output module also is used for the result that judges when described judge module for not the time, exports described candidate word and tabulates.
The above-mentioned client that the embodiment of the invention provides, the candidate word tabulation that the coding of importing according to the user obtains, therefrom choose at least one candidate word, and transmission comprises that the synonym services request of this candidate word is to the synonym server, obtain that server returns and synonym this candidate word coupling, export this candidate word tabulation and synonym then, can allow the user have more output result to select, obtain the output result that the user really wants.
Embodiment 4
Referring to Fig. 8, the embodiment of the invention provides a kind of synonym server, comprising:
Receiver module 801 is used for receiving the synonym services request that client is sent, and comprises candidate word to be matched in the described synonym services request;
Search module 802, be used for searching the synonym that mates with described candidate word;
Sending module 803 is used for searching the described synonym that module finds and returning to described client described, makes described client export described synonym.
In the present embodiment, described server also comprises:
Memory module is used for before receiver module 801 receives the synonym services request of client transmission, according to RBTree data structure storage database of synonyms;
Correspondingly, the described module of searching specifically is used for searching the synonym that mates with described candidate word from described database of synonyms.
The above-mentioned synonym server that the embodiment of the invention provides, according to the candidate word in the synonym services request of client transmission, search the synonym of coupling, and this synonym sent to client, make client can export this synonym, can allow the user have more output result to select, obtain the output result that the user really wants.
Embodiment 5
Referring to Fig. 9, the embodiment of the invention provides a kind of Chinese character input system, and described system comprises: client 901 and at least two synonym servers 902.
Wherein, client 901 is specially the described client that embodiment 3 provides, and has identical functions, and synonym server 902 is specially the synonym server that embodiment 4 provides, and has identical functions, does not give unnecessary details herein.
In the present embodiment, in described at least two synonym servers 902, one of them synonym server can be specially main synonym server, and other synonym servers are from the synonym server; When main synonym server occurs when unusual, from the synonym server generation for main synonym server work.
For example, referring to Figure 10, synonym server 1001 is main synonym server, described system also comprises from synonym server 1002, be used for when main synonym server 1001 appearance are unusual from synonym server 1002, receive the synonym services request, from database of synonyms, search the synonym with the candidate word coupling.
The said system that the embodiment of the invention provides, the candidate word tabulation that the coding that client is imported according to the user obtains mating, therefrom choose at least one candidate word, transmission is carried the synonym services request of this candidate word to the synonym server, the synonym of synonym whois lookup coupling also sends to client, client is exported this candidate word tabulation and synonym, can allow the user that more selection is arranged, and obtains the result that the user really wants.Further, by before sending the synonym services request, deleting the function word that does not have practical significance, improved the efficient of synonym service.By employing RBTree data structure storage database of synonyms, and in this database of synonyms, search synonym, can further improve the efficient of searching, thereby improved the efficient of synonym service.
Need to prove: the equipment that above-described embodiment provides and system are when exporting Chinese character, only the division with above-mentioned each functional module is illustrated, in the practical application, can as required the above-mentioned functions distribution be finished by different functional modules, the inner structure that is about to device is divided into different functional modules, to finish all or part of function described above.In addition, the equipment that above-described embodiment provides, System and method for embodiment belong to same design, and its specific implementation process sees method embodiment for details, repeats no more here.
The all or part of step that one of ordinary skill in the art will appreciate that realization above-described embodiment can be finished by hardware, also can instruct relevant hardware to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.