[background technology]
Computer user will be input to computer by Chinese character, needs to use input in Chinese software.At present, input in Chinese software can be divided into keyboard input and non-keyboard input, and what wherein comparative maturity and use were the widest is the input in Chinese software based on keyboard.Input in Chinese software is the tool software running in operating system, and its media data by the coding of keyboard input or the input of other non-keyboard converts Chinese character input to.
Keyboard input in Chinese is to utilize keyboard, inputs a kind of method of Chinese character according to certain coding rule.English alphabet only has 26, and their correspondences 26 letters on keyboard, therefore, for English, does not have what Input Software, directly inputting English letter.And the number of words of Chinese character has several ten thousand, they and keyboard are without any corresponding relation, to in computer, input Chinese character, must encode to Chinese character, and these codings and the key on keyboard are connected, just can make us by keyboard, input the coding of certain Chinese character, then according to code conversion, become Chinese character.At present, Hanzi coding scheme is existing hundreds of, and that has wherein moved on computers just has tens kinds, and as a kind of pictograph, Chinese character is to carry out co expression by the sound of word, shape, justice.The coding method of Chinese character input, be substantially all to adopt sound, shape, justice to be associated with specific key, then according to different Chinese character, combined the input of Chinese character.
Non-keyboard input in Chinese software comprises handwriting input software, phonetic entry software, optical character identification (OCR) Input Software etc.Wherein, handwriting input software is handwritten Chinese under a kind of pen type environment identification Input Software, meets Chinese's custom of word that writes with a pen, as long as write by usual custom on handwriting pad, computer just can be identified Graphics Processing; Phonetic entry software is by using a kind of Input Software that converts word to after microphone sound import; And OCR Input Software is the manuscript of input to be converted into figure by scanner could identify.
Most people adopts five or spelling input method input Chinese character in computer.And using in five-stroke input method, often can encounter not can five fractionations word or word, need to input these Chinese characters by phonetic.Under phonetic and five mixed defeated patterns, user is in five of inputs, input string also may be regarded as pinyin string, and when user wants input Pinyin string, if the pinyin string of user's input is also imperfect, in dictionary, also search less than corresponding pinyin word, when being input to the 4th character, can be according to directly upper screen of five inputs, five words that output is corresponding, thus cause interference to user's Pinyin Input.
[summary of the invention]
Based on this, be necessary to provide a kind of character input method, can carry out phonetic expansion to input string, thereby can reduce the interference between five strings and pinyin string.
A kind of character input method, said method comprising the steps of: obtain input string, judge that can input string carry out phonetic expansion, if, input string is carried out to phonetic expansion, specifically: obtain the ultima of input string, search the expansion syllable obtaining take described ultima as phonetic prefix; From dictionary, search pinyin word corresponding to input string after expansion; Show that pinyin word and five words corresponding to input string are as candidate word.
The method also can comprise: when input string can not carry out phonetic when expansion, show that five words that described input string is corresponding or pinyin word are as candidate word.
The method also can comprise: when searching less than pinyin word corresponding to input string after expansion from dictionary, show that five words that input string is corresponding are as candidate word.
In addition, described in, obtaining input string step afterwards also can comprise: when input string is input to the 4th character, judge that can input string carry out phonetic expansion, if so, carries out phonetic expansion to input string; From dictionary, search pinyin word corresponding to input string after expansion; Show that five words that described pinyin word and/or described input string are corresponding are as candidate word.
In addition, be also necessary to provide a kind of character input system, can carry out phonetic expansion to input string, thereby can reduce the interference between five strings and pinyin string.
A kind of character input system, described system comprises: expansion judge module, for obtaining input string, judges that can input string carry out phonetic expansion; Phonetic expansion module, can carry out phonetic when expansion when expansion judge module determines input string, and input string is carried out to phonetic expansion; Described phonetic expansion module comprises: syllable acquisition module, obtains the ultima of described input string; Module searched in syllable, searches the expansion syllable take described ultima as phonetic prefix; Search module, for search the pinyin word corresponding with input string described expansion from dictionary; Candidate word output module, shows that pinyin word and five words corresponding to input string are as candidate word.
This candidate word output module can be further used for can not carrying out phonetic when expansion when expansion judge module determines input string, shows that five words that input string is corresponding or pinyin word are as candidate word.
This candidate word load module can be further used for when search module while searching less than pinyin word corresponding to input string after expansion from dictionary, shows that five words that input string is corresponding are as candidate word.
This phonetic expansion module also comprises: expansion syllable memory module, the expansion syllable that storage sets in advance.
In addition, this expansion judge module can be further used for when input string is input to the 4th character, obtain input string and judge that can input string carry out phonetic expansion, described candidate word output module is further used for when described input string can carry out phonetic expansion and can find pinyin word corresponding to input string after expansion from dictionary, searches five words that the pinyin word that obtains and/or input string are corresponding described in demonstration as candidate word.
Above-mentioned character input method and system, by obtaining input string and judging that can input string carry out phonetic expansion, when input string can carry out phonetic expansion, input string is carried out to phonetic expansion, and from dictionary, search pinyin word corresponding to input string after expansion, and show that this pinyin word is as candidate word.So can guarantee not input when complete in pinyin string, correct the identifying of pinyin string energy, avoided when input string direct situation of upper screen to should have four yards of unique five words time, reduced as much as possible the interference between pinyin string and five strings, when can not splitting with five, input string can with phonetic, be up to immediately, in the time of splitting with five, can not be considered to pinyin string, thereby improve the fluency of word input.
[embodiment]
Fig. 1 shows the flow process of an embodiment Chinese word input method, and the method flow process detailed process is as follows:
In step S10, obtain input string.
In step S20, judge that can input string carry out phonetic expansion, if so, enter step S40, otherwise enter step S30.In one embodiment, input string is carried out to syllabification, input string is carried out to syllabification and can realize according to existing syllabification method, after syllabification, obtain ultima, according to ultima, judge that can input string carry out phonetic expansion.When the ultima of input string may be the phonetic prefix of certain expansion syllable, judge that input string can carry out phonetic expansion.For example, get ultima for " on " after syllabification, it may be the phonetic prefix of " ong ", can carry out phonetic expansion; Again for example, get ultima for " h " after syllabification, it may be the phonetic prefix of " he ", " hong " etc., judges that it can carry out phonetic expansion.
In step S30, show that five words that input string is corresponding or pinyin word are as candidate word.In one embodiment, when input string can not carry out phonetic when expansion, according to the mixed defeated mode of normal five phonetics, process, show that five words that input string is corresponding or pinyin word are as candidate word.
In step S40, input string is carried out to phonetic expansion.Conventionally, the character string of user's input is not inputted completely, for example user's input " wozho ", that it may think input is " wozhong ", " wozhou " etc., but now in dictionary, can not find the pinyin word corresponding with input string, and when user is input to the 4th yard, at five phonetics, mix under defeated pattern, due to five four yards unique, can directly will on five corresponding input string words, shield, and cannot export user want input pinyin word.Therefore need input string to carry out phonetic expansion.Fig. 2 shows the method flow that in an embodiment, input string is carried out to phonetic expansion, and detailed process is:
In step S402, obtain the ultima of input string.Because syllable user above only inputs simplicity or input spelling conventionally, input string is carried out after syllabification, only need expand the ultima of input string.
In step S404, search the expansion syllable obtaining take ultima as phonetic prefix.In one embodiment, set in advance and stored the syllable list after all expansions and expanded the phonetic prefix list of syllable.For example, take syllable " a " as prefix, the syllable after corresponding expansion has " ao ", " ai ", " an ", " ang " etc.Getting after the ultima of input string, in the syllable list from the expansion of prior storage, searching the expansion syllable take ultima as phonetic prefix.For example, input string is " wzho ", and the expansion syllable finding take ultima " zho " as phonetic prefix is " zhong ", " zhou " etc.
In step S50, from dictionary, search pinyin word corresponding to input string after expansion, judge in dictionary whether have pinyin word corresponding to input string after expansion, if so, enter step 70, otherwise, enter step S60.In one embodiment, after the ultima of input string is expanded, the input string after being expanded.For example, in upper example, the input string after expansion is " wzhong ", " wzhou ".Search the pinyin word that input string after expansion is corresponding from dictionary before, need carry out syllabification to the input string after expansion, for example " wzhong " is divided into " w ' zhong ", and " wzhou " is divided into " w ' zhou ".Input string is carried out to syllabification can be realized according to existing syllabification method, at this, repeats no more.And to the simplicity in input string, can search all simple or compound vowel of a Chinese syllable of its correspondence, for example " w " finds " wo ", " wai ", " wa " etc.Afterwards, from dictionary, search obtain with expand after pinyin word corresponding to input string.
In step S60, show that five words corresponding to input string are as candidate word.In one embodiment, when searching in dictionary when with pinyin word corresponding to input string after expansion, illustrate that input string cannot phonetic identification, according to normal five-stroke input method processing, five words corresponding to demonstration input string are as candidate word.
In step S70, show that five words that described pinyin word and described input string are corresponding are as candidate word.In one embodiment, when in dictionary, can find with expand after pinyin word corresponding to input string time, show that the pinyin word finding is as candidate word, under the mixed defeated pattern of five phonetics, show that five words that described input string is corresponding are as candidate word simultaneously.
Demonstrate after candidate word, can be by corresponding Chinese character output according to user's selection.
Fig. 3 shows the flow process of another embodiment Chinese word input method, and the method flow process detailed process is as follows:
In step S100, obtain input string.
In step S200, judge that whether input string is input to the 4th character, if so, enters step S400, otherwise enters step S300.
In step S300, show that five words that input string is corresponding or pinyin word are as candidate word.Due to according to five-stroke input method, being input in the 4th yard, if four yards are unique, can directly above shield (being about to candidate word output), when being input to the 5th yard, automatically will in the acquiescence candidate word of four yards, shield.Therefore, input string outputed to before the 4th, all can process according to the mixed defeated mode of normal five phonetics, thereby show that five words that input string is corresponding or pinyin word are as candidate word.
In step S400, judge that can input string carry out phonetic expansion, if so, enter step S500, otherwise return to step S300.When input string can not carry out phonetic expansion, also according to the mixed defeated mode processing of normal five phonetics.
In step S500, input string is carried out to phonetic expansion.About the method for input string being carried out to phonetic expansion, can, with reference to as mentioned above, at this, repeat no more.
In step S600, from dictionary, search pinyin word corresponding to input string after phonetic expansion, judge in dictionary whether have pinyin word corresponding to input string after expansion, if so, enter step S800, otherwise enter step S700.
In step S700, show that five words corresponding to input string are as candidate word.
In step S800, show and search the pinyin word that obtains and/or five words corresponding to described input string as candidate word.Because input string has been input to four yards, four yards have five words of unique correspondence, show that five words that input string is corresponding are as candidate word, meanwhile, show that pinyin word that the input string searched after the phonetic expansion obtaining is corresponding is as candidate word.Like this, avoided owing to being input to four yards, pinyin string is not inputted complete and be there is no corresponding pinyin word, but five four yards unique upper screens, thereby can not get user and want the situation of the pinyin word of input.
Fig. 4 shows a character input system in embodiment, and this system comprises expansion judge module 10, phonetic expansion module 20, searches module 30, dictionary 40 and candidate word output module 50, wherein:
Expansion judge module 10, for obtaining input string, judges that can input string carry out phonetic expansion; When phonetic expansion module 20 can carry out phonetic expansion for determining input string when expansion judge module 10, input string is carried out to phonetic expansion; Search module 30 for from dictionary, search with expand pinyin word corresponding to input string; Dictionary 40 is for storing five words and pinyin word, and candidate word output module 50 is for showing that five words that the pinyin word that finds and input string are corresponding are as candidate word.
In one embodiment, expansion judge module 10 judges that can input string carry out phonetic expansion, if can, notify phonetic expansion module 20 to carry out phonetic expansion to input string, otherwise, according to the mixed defeated mode of normal five phonetics, process, by candidate word output module 50, export five words that input string is corresponding or pinyin word as candidate word.
Fig. 5 shows a phonetic expansion module 20 in embodiment, and this phonetic expansion module 20 comprises that syllable acquisition module 200, syllable search module 202 and expansion syllable memory module 204, wherein:
Syllable acquisition module 200 is for obtaining the ultima of input string; Syllable is searched module 202 for searching the expansion syllable obtaining take ultima as phonetic prefix; Expansion syllable memory module 204 has been stored the expansion syllable setting in advance.In one embodiment, set in advance the syllable list after all expansions and expanded all phonetic prefix lists of syllable, and be stored in expansion syllable memory module 204.Getting after the ultima of input string, in the syllable list from the expansion of prior storage, searching the expansion syllable take ultima as phonetic prefix.
In one embodiment, search module 30 and from dictionary 40, search pinyin word corresponding to input string after expansion, and judge in dictionary 40, whether there be pinyin word corresponding to input string after expansion, if exist, 50 of candidate word output modules show that corresponding pinyin word is as candidate word, under the mixed defeated pattern of five phonetics, show that five words that input string is corresponding are as candidate word simultaneously; Otherwise, illustrate input string cannot phonetic identification, according to normal five-stroke input method processing, candidate word output module 50 shows that five corresponding words are as candidate word.Afterwards, the candidate word output that user can be selected.
In one embodiment, expansion judge module 10 is further used for when input string is input to the 4th character, obtains input string and judges that can described input string carry out phonetic expansion.Due to according to five-stroke input method, being input in the 4th yard, if four yards unique, can directly above shield (being about to candidate word output), when being input to the 5th yard, automatically will in the acquiescence candidate word of four yards, shield, therefore, input string outputed to before the 4th, all can process according to the mixed defeated mode of normal five phonetics, thereby show that five words that input string is corresponding or pinyin word are as candidate word.When the 4th character of input string input, the pinyin string of user's input may be imperfect, 10 of judge modules of expansion judge that can described input string carry out phonetic expansion, according to judged result notice phonetic expansion module 20, carry out phonetic expansion, described candidate word output module 50 is further used for when described input string can carry out phonetic expansion and can find pinyin word corresponding to input string after expansion from dictionary, searches five words that the pinyin word that obtains and/or input string are corresponding described in demonstration as candidate word.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.It should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.