[0038] Example two
[0039] As a progress description of the first embodiment, the embodiment of the present invention also provides a text input method, such as figure 2 As shown, the method includes the following steps:
[0040] Step 201: The electronic device obtains text input information.
[0041] The electronic device receives the input instruction, and then obtains the input information corresponding to the input instruction, and stores the candidate text table corresponding to the input information. Wherein, the input instruction is used to instruct to input text.
[0042] After the user inputs the input information, the electronic device displays the alternative text table according to the input information. The user can select the text in the alternative text list, that is, click the function keys such as "OK" and "Enter" (Enter) to select the text. After the function button is clicked, an input instruction is issued to instruct the electronic device to display the text selected by the user. After receiving the input instruction, the electronic device stores the candidate text table corresponding to the input information. During specific operations, the electronic device can store the candidate text table corresponding to the input information by allocating an independent storage space in the memory.
[0043] The input information acquired by the electronic device is the final input information in the process of the user inputting text. The input information is pinyin or strokes. As in the background art, when the user inputs pinyin "pai" as input information, the input information obtained by the electronic device is "p", "pa" and "pai" in order, and the final input information is "pai". For different input methods, the input information corresponding to the same text can be different content. For example, in the background art, it is desired to input "Pai". For the Pinyin input method, the input information corresponding to "Pai" is "pai". For the stroke input method, the input information corresponding to "Pai" is ",, -丿". The input information acquired by the electronic device is input information corresponding to the inputted text corresponding to the modification instruction. Because the text just input by the user is modified, the electronic device can directly obtain input information from the storage space occupied by the input method program.
[0044] Further, in order to provide a method for modifying a certain character among many characters that have been input, after the input information is obtained in step 201, the input information and the candidate text table corresponding to the input information may be stored together. During specific implementation, the input information and the candidate text table corresponding to the input information can be stored sequentially or indexed. Among them, the storage content stored sequentially is the input information input each time and the candidate text table corresponding to the input information. The storage content of the indexed storage is a position sub-relation table used to describe the corresponding relationship between the input information input each time and the position of the row and column, and the corresponding sub-relation table of the candidate text table corresponding to the input information and the input information. Further, if indexed storage is adopted in step 201, the electronic device uses the position information obtained in step 202 to determine the input information corresponding to the entered text in the position sub-relation table. If sequential storage is used in step 201, the electronic device judges the input information corresponding to the current position of the cursor in the sequential storage based on the distance between the cursor and the last character.
[0045] Step 202: The electronic device receives a modification instruction.
[0046] Wherein, the modification instruction is used to instruct to delete the entered text.
[0047] If the user finds that the entered text has been entered and needs to be modified, he can send a modification instruction to the electronic device by operating the function keys such as "modify" and "delete" to modify the entered text.
[0048] Furthermore, in order to provide a method for modifying a certain character among the inputted characters, step 202 further includes: when the electronic device receives the modification instruction, it also obtains the inputted character corresponding to the modification instruction. location information.
[0049] Optionally, in order to further improve the embodiment of the present invention, a table of candidate texts corresponding to the input information may be displayed according to the cursor position, so that the user can directly modify the input text without clicking the function buttons such as "modify". Specifically, the electronic device receives the position modification instruction generated by the user moving the cursor. When the electronic device receives the position modification instruction, it also obtains the position information of the cursor.
[0050] Step 203: The electronic device retrieves the stored candidate text table according to the text input information.
[0051] According to the modification instruction obtained in step 202, the electronic device retrieves the candidate text table corresponding to the input information stored in step 201 through the input information obtained in step 201, so that the user can check the text in the candidate text table. Make a selection. For the example of inputting "pie" in the background art, the candidate word list is the candidate word list corresponding to pinyin "pai", such as image 3 As shown, it includes nine candidate characters corresponding to the pinyin "pai" from "beat" with the original sound of one tone to "pie" with the original sound of four tones.
[0052] Further, in order to provide a method for modifying a certain character among the inputted characters, the embodiment of the present invention further includes the following steps. If the sequential storage method is used for storage in step 201, the electronic device converts the left and right movement of the cursor position into addition and subtraction of the storage position in sequential storage according to the position information obtained in step 202 and the input information obtained in step 201, thereby determining the cursor The input information corresponding to the corresponding entered text and the candidate text table corresponding to the input information. If indexed storage is used in step 201, the electronic device determines the device corresponding to the input information in the corresponding subrelation table in the indexed storage in step 201 based on the location information obtained in step 202 and the input information obtained in step 201. Select the text table.
[0053] Further, the corresponding sub-relation table may also include the following information: a phrase containing the input text (that is, the text deleted by the user), the number of words of the phrase is not limited to two, and the input text is not Limit the position in the phrase. The user can select the candidate word table containing the input information of a certain keyword by searching the candidate word table. The keywords can be single characters or phrases.
[0054] Specifically, when the deletion instruction instructs to delete the word "派", the electronic device retrieves the candidate text table corresponding to the input information "pai" according to the input information "pai" of the keyword "派". Select the keyword "派" in the text table, and you can also select phrases containing the keyword "派" such as "dispatch" or "appointment". In addition, when selecting a phrase containing a keyword, you can delete the entered text before or after the entered keyword according to the position of the keyword in the phrase. For example, after selecting "Dispatch", the keyword "派" in "Dispatch" is at the first place and there is a word "dispatch" after it. Therefore, in addition to deleting the entered keyword "派" when deleting, the word "送" after "派" is also deleted. At this time, the "dispatch" before modification is changed to "dispatch".
[0055] Optionally, in order to further improve the embodiment of the present invention, a candidate text table corresponding to the input information may be displayed according to the cursor position, so that the user can directly modify the input text without clicking a function button. Specifically, the electronic device receives a position modification instruction for the user's operation to move the cursor position, and retrieves the candidate text table corresponding to the entered text stored in step 201 according to the cursor position. If the position information of the cursor in step 202 is the first row and the second column, then the candidate word table called at this time is the candidate word table corresponding to the second word in the first row, that is, the spare word table corresponding to the word before the cursor. Select the text table. If sequential storage is used in step 201, the electronic device converts the left and right movement of the cursor position into the addition and subtraction of the storage position in sequential storage according to the position modification instruction in step 202, the position information of the cursor, and the input information obtained in step 201 , And further determine the input information corresponding to the input text corresponding to the cursor and the candidate text table corresponding to the input information. If indexed storage is adopted in step 201, the electronic device determines that the input information corresponds to the corresponding sub-relationship table in the indexed storage in step 201 based on the cursor position information obtained in step 202 and the input information obtained in step 201 Alternative text table.
[0056] Step 204: The electronic device displays the text selected by the user in the candidate text list.
[0057] The electronic device deletes the entered text; the electronic device displays the candidate text table corresponding to the input information corresponding to the text, and receives an input instruction from the user; and displays the text that the input instruction indicates to be input.
[0058] According to the modification instruction received in step 202, the electronic device deletes the entered text corresponding to the modification instruction on the display device, and displays the candidate text table retrieved in step 203 to the user through the display device. When the user re-selects the displayed alternative text table, that is, the user clicks "OK", "Enter" and other function keys to select the text, and the function key is clicked to issue an input command. After receiving the input instruction, the electronic device displays the input text indicated by the input instruction. The display device is but not limited to a computer monitor or a mobile phone screen.
[0059] Optionally, in order to further improve the embodiment of the present invention, a candidate text table corresponding to the input information may be displayed according to the cursor position, so that the user can directly modify the input text without clicking a function button. Specifically, the electronic device displays the candidate text table corresponding to the entered text corresponding to the cursor position in real time according to the cursor position information. After the user selects the text in the candidate text table, the electronic device deletes the input text and displays the text that the user instructs to input through the input instruction. Then display the alternative text table corresponding to the input text corresponding to the current cursor position.
[0060] In order to further improve the foregoing embodiment, the method further includes:
[0061] 205. The electronic device deletes the stored candidate text table according to a preset rule.
[0062] Specifically include the following methods:
[0063] (1) After receiving the next input instruction, the electronic device deletes the stored candidate text table.
[0064] Wherein, the input instruction is an instruction issued by a function key such as "OK" to indicate the text specifically selected by the user. For example, the user clicks the "OK" function button after inputting "dispatch" or clicks the "OK" function button after inputting "dispatch". The deletion of the stored candidate text table is to clear the content in the independent storage space in the memory mentioned in step 201 above. The next input instruction refers to an input instruction issued by a function button such as "confirm" that the user presses when the user re-selects after the electronic device retrieves the alternative text table. This method is only aimed at one-time input modification, thereby reducing the size of the independent storage space in the memory and providing more storage space for other applications of the electronic device.
[0065] (2) When the memory is full, the electronic device deletes at least one candidate word table from the earliest stored candidate word table.
[0066] The electronic device detects the capacity of the storage space allocated in the memory, and when the storage space is saturated, releases one or at least two candidate word lists stored in the storage space first from the storage space. For the above technical solution using indexed storage, since the same text may appear in multiple locations, the position sub-relationship table can be released first and then the corresponding sub-relationship table. For the sequential storage technical solution, the input information stored for the first time and the candidate text table corresponding to the input information can be released in sequence according to the storage order. This method guarantees the modification range of the input text to the maximum extent, and reduces the repetitive memory space release and the operation of obtaining input information.
[0067] (3) The electronic device periodically deletes the stored candidate text table according to the preset duration.
[0068] In addition to the above-mentioned capacity detection of the memory space, the electronic device can also release the storage space through a preset duration. In this way, the real-time detection required for the capacity detection of the memory in the above manner is omitted, and the content in the storage space only needs to be periodically released by a preset time period (for example, three minutes).
[0069] (4) The electronic device may receive a deletion instruction sent by the user through a preset button, and delete the stored candidate text table according to the deletion instruction.
[0070] Among them, the preset button refers to function buttons such as "clear the cache", and the delete instruction is used to release the content in the storage space. In addition to the aforementioned electronic device-controlled release of the storage space according to the storage space capacity and the preset duration, the user can also control the release of the content in the storage space through preset buttons such as "clear cache" and other functional buttons. If the user finds that there are no typos in the entered text after inspection, he can release the content in the storage space through function buttons such as "Clear Cache".
[0071] The above four methods can avoid the phenomenon of memory overflow caused by failure to release the storage space in time, thereby avoiding the situation that the data in the memory of the software in the electronic device interferes with each other and the electronic device cannot be used normally.
[0072] It should be noted that the embodiment of the present invention uses pinyin and strokes as input information. In practical applications, input methods based on characters other than Chinese can also be used as input information. Refer to the above using pinyin or strokes as input The information realization method is combined with the characteristics of its own input method, and the foregoing method embodiments are implemented without creative work, and the details are not repeated here.
[0073] In the prior art, when the user modifies the inputted text, the user can only delete the inputted text by clicking a function button such as "Delete". However, in the text input method provided in this embodiment, you can click on the function buttons such as "modify" to further display the alternative text corresponding to the input information of the input text to be modified on the basis of deleting the input text table. The embodiment of the present invention can not only modify the most recent input, but also modify the entered text in the previous text, which expands the scope of modification. Furthermore, it can also display the corresponding text before the cursor in real time according to the cursor position. The alternative text table allows the user to directly modify the text corresponding to the cursor without clicking on the function buttons such as "modify". In addition, by releasing the storage space, the safety and stability of the text input method are ensured. The alternative text table can save users the operation of re-entering information, thereby reducing the repetition of user operations.
[0074] The text described in the embodiment of the present invention includes a single text and a phrase containing at least two single texts. In the embodiment of the present invention, the text is used as a high-level expression of a single text and a word group. In actual application, the text should not constitute a reference to the embodiment of the present invention Restrictions on processing objects.