Candidate word recommendation method and electronic equipment
By identifying the symbols or pinyin input by the user and comparing them with the words in the preset vocabulary, candidate words are solved, and the problem of insufficient candidate words recommendations caused by electronic devices being unable to recognize symbols or pinyin, improving user experience.
Patent Information
- Application Number
- CN202311341469.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-13
- Publication Date
- 2025-04-15
AI Technical Summary
When a user uses an electronic device to input handwriting, the electronic device cannot recognize the symbols or pinyin entered by the user, resulting in the inability to recommend matching candidate words for the user, affecting the user's experience.
By identifying the symbols or pinyins input by the user, the first word input by the user is compared as a whole with the words in the preset vocabulary, a candidate word that matches the first word is determined, and displayed in the candidate word column.
It effectively improves the user's experience of using the handwriting input function and avoids the problem of insufficient recommendation of candidate words caused by the electronic device's inability to recognize symbols or pinyin.
Smart Images

Figure CN119828899A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of terminals, and in particular, to a method for recommending candidate words and an electronic device. Background Art
[0002] When a user uses an electronic device for handwritten input, there is a situation of forgetting a character when picking up the pen. For example, when the user writes "一生一世" (a lifetime), they forget how to write "生" (life). The user may use some symbols or the corresponding pinyin to occupy the position for the forgotten Chinese character to indicate the Chinese character that cannot be written.
[0003] However, currently, the electronic device cannot recognize the symbols or pinyin input by the user and recommend corresponding candidate words, resulting in a poor experience for the user's handwritten input. Summary of the Invention
[0004] This application provides a method for recommending candidate words and an electronic device to improve the experience of the user using the handwritten input function.
[0005] In a first aspect, this application provides a method for recommending candidate words. This method can be executed by an electronic device, or can also be executed by components (such as chips, chip systems, etc.) configured in the electronic device, or can also be implemented by a logic module or software that can implement all or part of the functions of the electronic device. This application does not make any limitations in this regard.
[0006] Exemplarily, the method includes: in the handwritten input mode, in response to a first operation of the user, display a first word in the input box, where the first word includes at least one known character and at least one character, and the at least one character is used to replace the character that the user cannot write; recognize the first word to determine that the first word includes the at least one character; based on the first word, determine at least one candidate word from a preset word library, where each candidate word in the at least one candidate word has the same number of characters as the first word, each candidate word includes the at least one known character, and the position of the at least one known character in the first word is the same as its position in each candidate word, and each candidate word is composed of known characters; display the at least one candidate word in the candidate word column.
[0007] Optionally, the at least one character includes a preset symbol and / or a pinyin letter.
[0008] Among them, the preset symbol can be preset on the electronic device by the developer or user-defined. For example, it can be a question mark, a space, a comma, an underscore, or other symbols, etc. The pinyin letters include the letters that make up the pinyin, fuzzy pinyin, dialect pinyin, etc. of the characters that the user cannot write. For example, the character "生" can be replaced by "sheng", "shen", "seng", or "sen", etc. "sheng", "shen", "seng", or "sen" are called pinyin letters.
[0009] It can be understood that the number of characters included in the first word refers to the number of characters included in the first word recognized by the electronic device, rather than the number of characters actually input by the user. The number of characters actually input by the user refers to the number of characters included in the target word that the user wants to input. For example, if the target word that the user wants to input is "一生一世", but because the user cannot write "生", the first word actually input by the user may be "一sheng一世".
[0010] In this application, in the handwriting input mode, the user usually uses symbols or pinyin to replace the characters that cannot be written. When the electronic device recognizes a symbol or pinyin, it can compare the first word input by the user as a whole with the words in the preset word library to determine the candidate words that are more matched with the first word. The difference between each candidate word and the first word is that the unknown characters in the input text are replaced by known characters in the candidate word, and the positions of the known characters in the first word are the same as those in the candidate word, so as to recommend the candidate word to the user for selection. In this way, when the user uses the handwriting input mode to input words, it will no longer be because the electronic device cannot recognize symbols or pinyin, resulting in the inability to recommend matching candidate words to the user, effectively improving the user experience of using the handwriting input function.
[0011] Combined with the first aspect, in some implementation manners of the first aspect, the method further includes: determining the number of characters corresponding to the at least one character in the first word; and determining the number of characters included in the first word based on the number of characters corresponding to the at least one character.
[0012] It can be understood that when the user inputs the first word, for each character that cannot be written, it is replaced by a symbol, or one or more pinyin letters. Based on the at least one character, the number of corresponding characters is determined, and then combined with the number of known characters, the number of characters included in the first word can be obtained. If the characters that the user cannot write are called unknown characters, then a symbol used to replace the characters that the user cannot write, or one or more pinyin letters, can correspond to one unknown character. Therefore, the number of characters included in the first word is the sum of the number of at least one known character and the number of at least one unknown character.
[0013] In combination with the first aspect, in certain implementations of the first aspect, the first word includes multiple characters, and determining at least one candidate word from a preset word library based on the first word includes: determining positions of the multiple characters in the first word; and determining the at least one candidate word from the preset word library based on the at least one known character and the position of each known character in the at least one known character in the first word.
[0014] It is understood that the positions of the multiple characters in the first word can be determined by numbering the multiple characters in a certain order. Similarly, the positions of the characters contained in each candidate word in each candidate word can be determined by numbering the multiple characters in the first word.
[0015] Exemplarily, based on at least one known character and the order of each known character in the at least one known character in the first word, at least one candidate word is determined from a preset word library, including: based on the number of characters included in the first word, a first word set is determined from the target word library, the number of characters included in each word in the first word set is the same as the number of characters included in the first word; based on the known characters included in the first word, a second word set is determined from the first word set determined in step 1, the characters included in each word in the second word set include all the known characters included in the first word; based on the position of at least one known character in the first word, the position of the characters in the second word set that are the same as the known characters in the first word in each word, and the words that are the same as the position of the known characters in the first word, are determined as at least one candidate word.
[0016] In combination with the first aspect, in certain implementations of the first aspect, displaying the at least one candidate word in the candidate word column includes: determining the degree of match between each candidate word and the first word; and displaying the at least one candidate word in the candidate word column in order of match from high to low.
[0017] The matching degree between each candidate word and the first word is related to the number of unknown characters included in the first word.
[0018] Exemplarily, the first word includes an unknown character, and the unknown character is located at the first position in the first word, then the matching degree of each candidate word with the first word is: the matching degree of the unknown character in the first word with the character located at the first position in each candidate word.
[0019] Exemplarily, the first word includes two unknown characters, and the two unknown characters are respectively located at the first position and the second position of the first word. Then the matching degree of each candidate word with the first word is determined based on the matching degree of the first unknown character with the character located at the first position of each candidate word, and the matching degree of the second unknown character with the character located at the second position of each candidate word.
[0020] That is, when the first word includes multiple unknown characters, the matching degree of each candidate word with the first word is determined based on multiple matching degrees of the multiple unknown characters with characters at multiple positions in each candidate word. For example, it can be the sum of multiple matching degrees, or the average of multiple matching degrees, or the weighted average of multiple matching degrees, etc., which is not limited in this application.
[0021] In combination with the first aspect, in certain implementations of the first aspect, there are multiple at least one candidate word, including at least two candidate words, and the at least two candidate words have the same matching degrees; displaying the at least one candidate word in the candidate word column in order of matching degrees from high to low includes: displaying the at least one candidate word in the candidate word column in order of matching degrees from high to low, and in order of word frequency from high to low when the matching degrees are the same.
[0022] That is, when multiple candidate words are displayed in the candidate word column, the matching degree corresponding to the candidate word displayed first is greater than or equal to the matching degree corresponding to the candidate word displayed later.
[0023] The candidate words displayed based on this method can help users quickly select a target candidate word from multiple candidate words, thereby improving user experience.
[0024] In combination with the first aspect, in certain implementations of the first aspect, the at least one unknown character is the preset symbol, and the displaying of the at least one candidate word in the candidate word column includes: displaying the at least one candidate word in the candidate word column in order from high to low frequency.
[0025] Since when at least one unknown character is a preset symbol, the matching degree between the first word and each candidate word in at least one candidate word is 0, when at least one unknown character is a preset symbol, the electronic device can directly display at least one candidate word in the candidate word column in order from high to low frequency.
[0026] In combination with the first aspect, in some implementations of the first aspect, the method further includes: in response to a second operation of the user, bringing a second word to the screen, the second word being one of the at least one candidate word.
[0027] It can be understood that the second operation of the user may be an operation of selecting the second word displayed in the candidate word column.
[0028] The upper screen refers to inserting the text to be input out of the input method window into the insertion point of the target program. The present application refers to displaying the second word in the area to be displayed.
[0029] In combination with the first aspect, in some implementations of the first aspect, the method further includes: updating the first word into the preset vocabulary.
[0030] Optionally, after receiving the user's selection operation of the second word, the electronic device can memorize the first word, that is, include the first word in the user's input habit memory, or upload it to the cloud at the same time, so that the next time the user enters the first word, the electronic device can preferentially display the second word in the candidate word column.
[0031] In a second aspect, the present application provides an electronic device, including a processor coupled to a memory, the memory being used to store code instructions; the processor being used to execute the code instructions so that the electronic device executes the method described in the first aspect or any one of the implementations of the first aspect.
[0032] Optionally, the electronic device further comprises a memory for storing a computer program and / or a configuration file of the logic circuit.
[0033] Optionally, the electronic device further includes a communication interface, and the processor is coupled to the communication interface for inputting and / or outputting signals.
[0034] In a third aspect, the present application provides a processor, comprising: an input circuit, an output circuit, and a processing circuit. The processing circuit is used to receive a signal through the input circuit and transmit a signal through the output circuit, so that the processor executes the method in any possible implementation of the first aspect.
[0035] In the specific implementation process, the above-mentioned processor can be a chip, the input circuit can be an input pin, the output circuit can be an output pin, and the processing circuit can be a transistor, a gate circuit, a trigger, and various logic circuits. The input signal received by the input circuit can be, for example, but not limited to, received and input by a receiver, and the signal output by the output circuit can be, for example, but not limited to, output to a transmitter and transmitted by the transmitter, and the input circuit and the output circuit can be the same circuit, which is used as an input circuit and an output circuit at different times. This application does not limit the specific implementation of the processor and various circuits.
[0036] In a fourth aspect, the present application provides a computer-readable storage medium, which stores instructions. When the instructions are executed, the computer executes the method described in the first aspect or any implementation of the first aspect.
[0037] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed, enables a computer to execute the method described in the first aspect or any one of the implementations of the first aspect.
[0038] It should be understood that the second to fifth aspects of the present application correspond to the technical solution of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0040] Figure 2 and Figure 3 It is a schematic diagram of a scenario applicable to the method provided in the embodiment of the present application;
[0041] Figure 4 is a schematic flow chart of a candidate word recommendation method provided in an embodiment of the present application;
[0042] Figure 5 and Figure 6 is a schematic diagram of a candidate word display interface provided in an embodiment of the present application;
[0043] Figure 7 and Figure 8 is a schematic diagram of the process of putting a second word on the screen provided by an embodiment of the present application;
[0044] Fig. 9 This is another schematic diagram of a candidate word display interface provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The technical solution in this application will be described below in conjunction with the accompanying drawings.
[0046] To facilitate understanding of the embodiments of the present application, the following points are first explained:
[0047] First, in the embodiments of the present application, the use of prefixes such as "first" and "second" is only to facilitate the distinction and description of different things belonging to the same name category, and does not restrict the order, size or quantity of the things. For example, "first unknown word" and "second unknown word" are just different unknown words, and do not limit the number or priority of unknown words.
[0048] Second, in the embodiments shown below, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a specific way.
[0049] Third, in the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship, but it does not exclude the situation where the previous and next associated objects are in an "and" relationship. The specific meaning can be understood in conjunction with the context. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c; a and b; a and c; b and c; or a and b and c. Where a, b, c can be single or multiple.
[0050] The electronic device of the embodiment of the present application may also be referred to as terminal equipment, user equipment (UE), mobile station (MS), mobile terminal (MT), etc.
[0051] Exemplarily, the electronic device is a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a virtual reality (VR) device, an augmented reality (AR) device, an artificial intelligence (AI) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, or other processing devices capable of installing an operating system, vehicle-mounted equipment, wearable devices, terminal devices in a 5G network, or terminal devices in a future evolved public land mobile communication network (PLMN), etc., and the embodiments of the present application are not limited to this.
[0052] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0053] Figure 1 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a sensor module 180, a button 190, an indicator 192, a camera 193, and a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0054] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. It should be understood that the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0055] The processor 110 may include one or more processing units. Different processing units may be independent devices or integrated into one or more processors. The processor 110 may also be provided with a memory for storing instructions and data.
[0056] The universal serial bus (USB) interface 130 is an interface that complies with the USB standard specification. The USB interface 130 can be used to connect a charger to charge the terminal device, and can also be used to transmit data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices.
[0057] The charging management module 140 is used to receive charging input from a charger, which may be a wireless charger or a wired charger. The power management module 141 is used to connect the charging management module 140 to the processor 110 .
[0058] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0059] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. The antenna in the terminal device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna.
[0060] The mobile communication module 150 can provide wireless communication solutions including second generation (2th-generation, 2G) wireless technology communication / third generation (3th-generation, 3G) mobile communication technology / fourth generation (4th-generation, 4G) mobile communication technology / fifth generation (5th-generation, 5G) mobile communication technology applied to the terminal device. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
[0061] The wireless communication module 160 can provide wireless communication solutions applied to terminal devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), etc.
[0062] The terminal device implements the display function through a graphics processing unit (GPU), a display screen 194, and an application processor. The GPU connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
[0063] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0064] The electronic device can realize the shooting function through image signal processing (ISP), camera 193, video codec, GPU, display screen 194 and application processor.
[0065] The camera 193 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0066] The external memory interface 120 can be used to connect an external memory card to expand the storage capacity of the terminal device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0067] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The internal memory 121 can include a program storage area and a data storage area.
[0068] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, and the application processor.
[0069] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The terminal device can listen to music or listen to hands-free calls through the speaker 170A. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. When the terminal device answers a call or voice message, the voice can be answered by placing the receiver 170B close to the human ear. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals.
[0070] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. The gyroscope sensor 180B can be used to determine the motion posture of the terminal device. The air pressure sensor 180C is used to measure the air pressure. The magnetic sensor 180D includes a Hall sensor. The acceleration sensor 180E can detect the magnitude of the acceleration of the terminal device in all directions (generally three axes). The distance sensor 180F is used to measure the distance. The proximity light sensor 180G can include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The ambient light sensor 180L is used to sense the brightness of the ambient light. The fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K, also known as a "touch device". The bone conduction sensor 180M can obtain a vibration signal.
[0071] The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, or a "touch screen". In the embodiment of the present application, a capacitive sensing node grid (hereinafter referred to as a capacitive sensor) may be disposed in the touch screen. When the terminal device determines that the value of the capacitance in at least one grid received by the capacitive sensor exceeds the capacitance threshold, it may be determined that a touch operation has occurred; further, the terminal device may determine the touch area corresponding to the touch operation based on the area occupied by at least one grid exceeding the capacitance threshold.
[0072] The button 190 includes a power button, a volume button, etc. The button 190 may be a mechanical button. It may also be a touch button. The terminal device may receive the button input and generate a key signal input related to the user settings and function control of the terminal device. The indicator 192 may be an indicator light, which may be used to indicate the charging status, power change, message, missed call, notification, etc.
[0073] The SIM card interface 195 is used to connect to a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact with and separation from the electronic device 100. The electronic device 100 can support one or more SIM card interfaces. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The types of multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communication. In some embodiments, the electronic device 100 uses an eSIM, that is, a pre-set embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0074] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In this embodiment of the application, the Android system with a layered architecture is taken as an example to combinatorially Figure 2 exemplarily illustrate the software structure of the electronic device 100. The layered architecture means dividing the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces, which are used to manage the chip downward and provide application programming interface (API) services upward.
[0075] To facilitate the understanding of the candidate word recommendation method provided in this embodiment of the application, the application scenarios of the method provided in this embodiment of the application will be described below. It can be understood that the application scenarios described in this embodiment of the application are for more clearly explaining the technical solutions of this embodiment of the application and do not constitute a limitation on the technical solutions provided in this embodiment of the application.
[0076] Figure 2 and Figure 3 are schematic diagrams of scenarios applicable to the method provided in this embodiment of the application. As Figure 2 shown in (a) of Figure 3 and (a) of
[0077] The interface includes a handwriting area, a candidate word bar, and an input box for the user to handwrite text. The candidate word bar is used to display candidate words, and the input box is used to display the text handwritten by the user. Figure 2 When the user writes "一生一世" (forever) and forgets how to write the character "生" (life), the user may use some placeholders or pinyin to replace the unwritten character "生". For example, the user enters "一?一世" in the Figure 2the interface shown in (b) in. Figure 2 In the input box shown in (b) in, display "一只一世" and the input cursor. Figure 2 In the candidate word bar shown in (b) in, display candidate words such as "一只一世", "一只世", "一?一世", etc. If the user selects "一?一世" in the candidate word bar, the electronic device displays the interface shown in Figure 2 (c) in. Figure 2 In the input box shown in (c) in, display "一?一世", and the input cursor and the underline disappear. Figure 2 In the candidate word bar shown in (c) in, no longer display the candidate words determined for "一?一世".
[0078] For another example, when the user inputs "一sheng一世" in the Figure 3 handwriting area of (a), the electronic device displays the interface shown in Figure 3 (b) in response to the user's input operation. Figure 3 In the input box shown in (b) in, display "一sheng一世". Figure 3 In the candidate word bar shown in (b) in, display candidate words such as "一sheng一世", "一shemg一世", etc. If the user selects "一sheng一世" in the candidate word bar, the electronic device displays the interface shown in Figure 3 (c) in. Figure 3 In the input box shown in (c) in, display "一sheng一世", and the input cursor and the underline disappear. Figure 3 In the candidate word bar shown in (c) in, no longer display the candidate words determined for "一sheng一世".
[0079] Since in the current handwriting input method, the electronic device recommends candidate words by recognizing the handwriting (or called glyph) input by the user, when the user uses symbols or pinyin to replace the words that he forgets or cannot write in the input words, the electronic device may not be able to recommend candidate words with a higher matching degree to the target word (the target word can be understood as the word that the user wants to input) for the user to select, resulting in the user being unable to determine the word that the user wants to input through the candidate words recommended by the electronic device. For example, the user wants to input "一生一世" (an example of the target word), but because he cannot write the character "生", he actually inputs "一sheng一世", but in the candidate words recommended by the electronic device, the position corresponding to "sheng" may still be pinyin, and "一生一世" is not recommended, resulting in the user being unable to select the target input word through the candidate words recommended by the electronic device, and the user experience is poor.
[0080] In view of this, the present application provides a candidate word recommendation method and electronic device. In this method, after recognizing the symbols or pinyin in the words input by handwriting of the user, the input word is taken as a whole, and words with the same number of characters as the input word are determined from a preset vocabulary, and the positions of the characters in the determined words that are identical to the known characters in the input word are the same as the positions of the known words in the input word, and the determined words are recommended to the user as candidate words, instead of recommending candidate words to the user by recognizing the glyphs in the words input by the user. This method is conducive to improving the user experience of using the handwriting input function.
[0081] The candidate word recommendation method provided by the present application will be described in detail below in conjunction with specific embodiments.
[0082] It should be understood that the embodiments shown below describe the method from the perspective of an electronic device, but should not constitute any limitation on the subject that executes the method. As long as the computer program that records the method provided by the embodiment of the present application can be run, the method provided by the embodiment of the present application can be executed. For example, the electronic device can be Figure 1 The electronic device shown can also be replaced by components configured in the electronic device (such as chips, chip systems, etc.), or other functional modules that can call and execute programs, which is not limited to the embodiments of the present application.
[0083] Figure 4 4 is a schematic flow chart of a candidate word recommendation method 400 provided in an embodiment of the present application. Figure 4 As shown, the method 400 may include S401 to S404. The various steps shown in the method 400 are described in detail below.
[0084] S401, in handwriting input mode, in response to a first operation of a user, displaying a first word in an input box, the first word including at least one known word and at least one character.
[0085] The handwriting input method in the present application may be an input method in which the electronic device calls a handwriting input method in a preinstalled input method in response to a user's operation.
[0086] The first operation may be an operation in which the user writes the first word by hand, or an operation in which the user writes the first word by using a stylus.
[0087] Optionally, the at least one character includes a preset symbol and / or a phonetic letter. In other words, each character in the at least one character may be a symbol or one or more phonetic letters.
[0088] It can be understood that at least one known character in the first word refers to a character that the user can write correctly; at least one character in the first word is used to replace the character that the user cannot write, and for each character that the user cannot write, it is replaced by a symbol or one or more pinyin letters. In other words, if the character that the user cannot write is called an unknown character, then each unknown character corresponds to a symbol, or each unknown character corresponds to one or more pinyin letters. At least one character and at least one character in this application may appear alternately.
[0089] Among them, the preset symbol can be preset on the electronic device by the developer or can be user-defined. For example, it can be other symbols such as a question mark, a space, a comma, or an underscore; the pinyin includes fuzzy pinyin, dialects, etc. For example, the character "生" can be replaced by "sheng", "shen", "seng", or "sen", etc.
[0090] It can also be understood that the preset symbol can also include a single letter, and the pinyin can also include a single letter. Therefore, the electronic device can recognize a single letter as a symbol and can also recognize a single letter as pinyin. For example, when the preset symbol includes the letter "L", the "L" in the "金L殿" input by the user can be recognized as a symbol or can be recognized as pinyin. For example, it is first recognized as a symbol and then as pinyin; or, it is first recognized as pinyin and then as a symbol. This application does not make a limit on this.
[0091] Taking the word that the user wants to input as "金銮殿" as an example, the known characters and unknown characters above are introduced. When the user is inputting "金銮殿", since the user cannot write the character "銮", the user may use the preset symbol to replace the character "銮", such as "?", "_", or "。", etc. to replace "銮". At this time, "金?殿", "金_殿", "金。殿" are displayed in the input box; or the user may use pinyin to replace the character "銮", such as "luan", "L", "lan", or "nuan", etc. to replace "銮". At this time, "金luan殿", "金L殿", "金lan殿", "金nuan殿" are displayed in the input box. Among them, "金" and "殿" are called known characters in this application; "?", "_", "。", "luan", "L", "lan", "nuan" are called unknown characters in this application; "金luan殿", "金L殿", "金lan殿", "金nuan殿" are called the first word in this application.
[0092] S402. Identify the first word to determine that the first word includes at least one character.
[0093] Or rather, identify the first word to determine that there are preset symbols and / or pinyin letters in the first word.
[0094] S403. Determine at least one candidate word from a preset word library based on the first word.
[0095] Among them, each candidate word in the at least one candidate word has the same number of characters as the first word. Each candidate word in the at least one candidate word includes at least one known character, and the position of at least one known character in the first word is the same as its position in each candidate word. Each candidate word is composed of known characters.
[0096] The number of characters included in the above-mentioned first word refers to the number of characters recognized by the electronic device for the first word, rather than the number of characters actually input by the user. The number of characters actually input by the user refers to the number of characters included in the target word that the user wants to input. For example, if the target word that the user wants to input is "一生一世" (yī shēng yī shì), but since the user cannot write the character "生" (shēng), the first word actually input by the user may be "一sheng一世".
[0097] Since at least one character in the first word can be a pinyin letter, and for a pinyin composed of multiple pinyin letters, the electronic device may recognize it as one character or multiple characters. Therefore, the number of characters included in the first word may be the same as or different from the number of characters included in the target word. For example, when the target word is "金銮殿" (jīn luán diàn), the first word can be "金luan殿" (jīn luán diàn). When the electronic device processes "luan" as one character, the number of characters included in the first word is 3; when the electronic device processes "luan" as two characters (for example, lu and an), the number of characters included in the first word is 4.
[0098] It can be understood that since the number of characters in the first word will change when the unknown character is pinyin, when there are multiple candidate words determined by the electronic device, the number of characters included in the first candidate word among the multiple candidate words may be different from the number of characters included in the second candidate word among the multiple candidate words.
[0099] Combining the above example of "金銮殿" (jīn luán diàn), when the first word is "金?殿" (jīn? diàn), the at least one candidate word determined by the electronic device can be: "金色殿" (jīn sè diàn), "金銮殿" (jīn luán diàn), "金光殿" (jīn guāng diàn), etc. When the first word is "金luan殿" (jīn luán diàn), the at least one candidate word determined by the electronic device can include: "金銮殿" (jīn luán diàn), "金鸾殿" (jīn luán diàn), "金栏殿" (jīn lán diàn), "金鹿殿" (jīn lù diàn), "金路岸殿" (jīn lù àn diàn), etc.
[0100] S404. Display at least one candidate word in the candidate word column.
[0101] Taking the target word as "金銮殿" (jīn luán diàn) and the user being unable to write "銮" (luán) as an example, combined with Figure 5 and Figure 6Describe the process of recommending candidate words for an electronic device. Regarding Figure 5 the (a) in Figure 6 and the description of (a) in Figure 2 can refer to the above description of (a) in
[0102] Exemplarily, the user inputs "Golden? Hall" in the handwriting area of (a) in Figure 5 . In response to the user's input operation, the electronic device displays an interface as shown in (b) in Figure 5 . The input box shown in (b) in Figure 5 displays "Golden? Hall", and the candidate word column shown in (b) in Figure 5 displays candidate words such as "Golden Hall", "Hall of Supreme Harmony", "Golden Light Hall", etc.
[0103] Exemplarily, the user inputs "Golden Luan Hall" in the handwriting area of (a) in Figure 6 . In response to the user's input operation, the electronic device displays an interface as shown in (b) in Figure 6 . The input box shown in (b) in Figure 6 displays "Golden Luan Hall", and the candidate word column shown in (a) in Figure 6 displays candidate words such as "Hall of Supreme Harmony", "Golden Phoenix Hall", "Golden Rail Hall", "Golden Deer Hall", "Golden Road Bank Hall", etc.
[0104] In the embodiment of the present application, in the handwriting input mode, users usually use symbols or pinyin to replace the words they cannot write. When the electronic device recognizes a symbol or pinyin, it can compare the first word input by the user as a whole with the words in the preset word library to determine candidate words that are relatively matched with the first word. The difference between each candidate word and the first word is that the unknown word in the input text is replaced by a known word in the candidate word, and the position of the known word in the first word is the same as its position in the candidate word, so as to recommend the candidate word to the user for selection. In this way, when the user uses the handwriting input mode to input words, the electronic device will no longer be unable to recognize symbols or pinyin, resulting in the inability to recommend matching candidate words for the user, effectively improving the user experience of using the handwriting input function.
[0105] Optionally, before S403, the method 400 further includes: determining the number of characters corresponding to at least one character in the first word; determining the number of characters included in the first word based on the number of characters corresponding to at least one character.
[0106] Among them, the characters corresponding to at least one character can also be understood as the unknown characters corresponding to at least one character.
[0107] As previously mentioned, each character is used to replace a non-writable character. Therefore, the number of characters included in the first term is the sum of the number of at least one character and the number of at least one known character.
[0108] Example 1: When the unknown characters in the first term are symbols, each symbol can be determined as a character. For example, in the above example of "Golden Throne Hall", when the user inputs "Jin? Hall", "Jin_Hall", "Jin. Hall", the electronic device can determine that the first term includes 3 characters, one unknown character and two known characters.
[0109] Example 2: When the unknown characters in the first term include pinyin, since pinyin can be a combination of initials + finals or a combination of single finals, such as an, ou, ai, etc. Therefore, in one implementation, the electronic device can process consecutive input letters as one pinyin, that is, recognize them as one character; in another possible implementation, the electronic device can split consecutive input letters into multiple pinyins for processing, that is, recognize them as multiple characters.
[0110] Combined with the above example of "Golden Throne Hall", when the user inputs "Jinluan Hall", the electronic device can process "luan" as one pinyin, then the first term includes 3 characters, one unknown character and two known characters. The electronic device can also split "luan" into "lu" and "an" for processing as two characters, then the first term includes 4 characters, two unknown characters and two known characters.
[0111] Optionally, determining at least one candidate word from the preset word library based on the first term includes: determining the positions of the multiple characters included in the first term in the first term; and determining at least one candidate word from the preset word library based on at least one known character and the position of each known character in the first term among the at least one known characters.
[0112] The positions of the multiple characters in the first term can be achieved by numbering the multiple characters in the first term. For example, for "Jin? Hall", it can be numbered in the order from left to right. Number 1 is "Jin", number 2 is "?", and number 3 is "Hall". Then "Jin" is located at position 1 in the first term, "?" is located at position 2 in the first term, and "Hall" is located at position 3 in the first term.
[0113] Exemplarily, the process of determining at least one candidate word from the preset word library based on at least one known character and the order of each known character in the first term among the at least one known characters may include the following steps 1 to 3.
[0114] Step 1: The electronic device determines a first word set from a target word library based on the number of characters contained in a first word, wherein the number of characters contained in each word in the first word set is the same as the number of characters contained in the first word.
[0115] Step 2: The electronic device determines a second word set from the first word set determined in step 1 based on the known characters included in the first word, wherein the characters contained in each word in the second word set include all the known characters included in the first word.
[0116] Step 3: The electronic device determines at least one candidate word from the second word set based on the position of at least one known character in the first word.
[0117] Among them, the words included in the third vocabulary are at least one candidate word of the present application.
[0118] Optionally, displaying at least one candidate word in the candidate word column includes: determining a matching degree between each candidate word and the first word; and displaying at least one candidate word in the candidate word column in order of matching degree from high to low.
[0119] It can be understood that each candidate word can determine a matching degree with the first word, and then at least one candidate word can determine at least one matching degree, that is, each matching degree corresponds to a candidate word. Therefore, the electronic device can sort at least one matching degree in descending order of matching degrees, thereby determining the display order of at least one candidate word in the candidate word column.
[0120] The following takes the at least one unknown character as one and multiple as examples, and describes in detail the process of determining the matching degree between the candidate word and the first word in combination with Example 1 and Example 2.
[0121] Example 1: The first word includes an unknown character, and the unknown character is located at the first position in the first word.
[0122] The above-mentioned determination of the matching degree between each candidate word and the first word includes: determining the matching degree between the unknown characters in the first word and the characters located at the first position in each candidate word.
[0123] Combined with the above example of the "Hall of Supreme Harmony", the process of determining the matching degree is introduced as follows: When the user represents the character "銮" that they cannot write through a symbol, the preset symbol at the second position of the first word has a matching degree of 0 with the characters "色", "銮", and "光" at the second position of each candidate word (for example, "金色殿", "金銮殿", "金銮殿"); when the user represents the character "銮" that they cannot write through "luan", the "luan" at the second position of the first word has matching degrees of 100%, 75%, 50%, and 0 with the characters "銮", "栏", "鹿", and "色" at the second position of each candidate word (for example, "金銮殿", "金栏殿", "金鹿殿", "金色殿") respectively.
[0124] Among them, the pinyin of "銮" at the second position of the candidate word is exactly the same as that of "luan" at the second position of the candidate word, so the matching degree is 100%; there are three identical letters between the pinyin of "栏" at the second position of the candidate word and that of "luan" at the second position of the candidate word, so the matching degree is 75%; there are two identical letters between the pinyin of "鹿" at the second position of the candidate word and that of "luan" at the second position of the candidate word, so the matching degree is 50%; the pinyin of "色" at the second position of the candidate word does not match that of "luan" at all, so the matching degree is 0.
[0125] Example 2: The first word includes multiple (assumed to be n, where n is an integer greater than 1) unknown characters, and these n unknown characters are located at positions 1, 2,..., n in the first word respectively.
[0126] The above determination of the matching degree between each candidate word and the first word includes: determining the first matching degree between the first unknown character (located at position 1 in the first word) in the first word and the character at position 1 in each candidate word; determining the second matching degree between the second unknown character (located at position 2 in the first word) among the multiple unknown characters in the first word and the character at position 2 in each candidate word; and so on, determining the nth matching degree between the nth unknown character (located at position n in the first word) in the first word and the character at position n in each candidate word; based on the obtained n matching degrees, determining the matching degree between each candidate word and the first word.
[0127] Among them, the matching degree between each candidate word and the first word can be the sum of the n matching degrees, or the average of the n matching degrees, or the weighted average of the n matching degrees, etc. This application does not make any restrictions on this.
[0128] Optionally, when the first word includes n unknown characters, the matching degree between each candidate word and the first word can be the matching degree between the unknown character at the ith (i takes any integer greater than 0 and less than or equal to n) position in the first word and the character at the ith position in each candidate word.
[0129] Optionally, when the first word includes n unknown characters, the matching degree between each candidate word and the first word can be determined based on the obtained m (m is an integer greater than 0 and less than n) matching degrees. The m matching degrees can be partial matching degrees among the above n matching degrees; the matching degree between each candidate word and the first word can be the sum of the m matching degrees, or the average of the m matching degrees, or the weighted average of the m matching degrees, etc.
[0130] Optionally, at least one candidate word is multiple, and the multiple candidate words include at least two candidate words, and the matching degrees corresponding to the at least two candidate words are the same.
[0131] When the matching degrees are the same, the above-mentioned displaying at least one candidate word in the candidate word column in order of matching degrees from high to low includes: displaying at least one candidate word in the candidate word column in order of matching degrees from high to low, and when the matching degrees are the same, displaying at least one candidate word in the candidate word column in order of word frequency from high to low.
[0132] That is, among at least one candidate word displayed in the candidate word column, the matching degree corresponding to the candidate word displayed first is greater than or equal to the matching degree corresponding to the candidate word displayed later.
[0133] The word frequency refers to the frequency of use of each candidate word. The word frequency can be preset by the developer, or learned by the electronic device based on the user's input habits, or obtained through statistics of big data. This application does not limit this.
[0134] In summary, when there are multiple at least one candidate words and the matching degrees corresponding to the multiple candidate words are different, the electronic device can display the multiple candidate words in the candidate word column in the descending order of the matching degrees corresponding to the multiple candidate words.
[0135] When there are multiple at least one candidate words, and the multiple matching degrees corresponding to the multiple candidate words include the same matching degree, the electronic device can first sort the at least one candidate word in order of matching degree from high to low, and for the candidate words with the same matching degree, sort the candidate words with the same matching degree in order of word frequency from high to low, and then display at least one candidate word in the candidate word column in sequence.
[0136] Optionally, the at least one unknown character is a preset symbol, and the displaying of at least one candidate word in the candidate word column includes: displaying at least one candidate word in the candidate word column in order of frequency from high to low.
[0137] It can be understood that when at least one unknown character is a preset symbol, the matching degree between the first word and each of the at least one candidate word is 0, that is, the at least one matching degree corresponding to the at least one candidate word is equal. Therefore, the electronic device can directly display the at least one candidate word in the candidate word column in descending order of word frequency.
[0138] Optionally, after S404, the method 400 further includes: in response to a second operation of the user, inputting the second word onto the screen, where the second word is one of the at least one candidate word.
[0139] It can be understood that the second operation of the user can be a selection operation of the second word displayed in the candidate word column by the user.
[0140] It can also be understood that the second word can be the target word mentioned above, that is, the word that the user wants to input.
[0141] Based on the above Figure 5 and Figure 6 shown example, combined with Figure 7 and Figure 8 introduce the process of inputting the second word onto the screen.
[0142] Exemplarily, the user selects "Golden Luan Hall" (the second word) in the candidate word column shown in (a) of Figure 7 . The electronic device responds to the user's selection operation and displays the interface shown in (b) of Figure 7 . "Golden Luan Hall" is displayed in the input box shown in (b) of Figure 7 , and the input cursor and underline are not displayed. In the candidate word column shown in (b) of Figure 7 , the candidate words determined for "Jin? Hall" are no longer displayed.
[0143] Exemplarily, the user selects "Golden Luan Hall" (the second word) in the candidate word column shown in (a) of Figure 8 . The electronic device responds to the user's selection operation and displays the interface shown in (b) of Figure 8 . "Golden Luan Hall" is displayed in the input box shown in (b) of Figure 8 , and the input cursor and underline are not displayed. In the candidate word column shown in (b) of Figure 8 , the candidate words determined for "Jinluan Hall" are no longer displayed.
[0144] Among them, for the description of the interface shown in (a) of Figure 7 and the interface shown in (a) of Figure 8 , reference can be made to the description in Figure 5 and Figure 6 , and details are not elaborated here.
[0145] Optionally, the method 400 further includes: updating the first word to a preset word library, or adding the first word to the preset word library, and associating the first word with the second word. In this way, when the user inputs the first word again, the electronic device can quickly recommend the second word to the user.
[0146] Optionally, after the electronic device receives the user's selection operation on the second word, it can memorize the first word, that is, incorporate the first word into the user's input habit memory or upload it to the cloud at the same time. So that when the user inputs the first word next time, the electronic device can preferentially display the second word in the candidate word column.
[0147] Similarly, in some other scenarios where handwriting input or stylus input is performed in a handwriting area not provided by the input method of the electronic device, for example, in the annotation mode of the electronic device, the scenario where the user uses a stylus to annotate the first text, or the scenario where the user writes text using the drawing board provided by the electronic device, if the user uses a preset symbol or pinyin to replace the word that cannot be written, the electronic device can also recommend candidate words for the user near the position where the pen tip ejects ink based on the method provided in this application.
[0148] It can be understood that in such scenarios, the function of the electronic device to recommend candidate words can be triggered by some preset triggering methods (for example, long pressing the screen after writing is completed, etc.), or the electronic device automatically recommends candidate words for the user after recognizing the pinyin or preset symbol.
[0149] Fig. 9 Shows another candidate word display interface diagram provided by an embodiment of the present application. As Fig. 9 shown in the interface of (a) in, document 1 is displayed, and the first text is included in document 1. When the user wants to annotate the text in the first area of the first text and the content to be annotated is "examination point", if the user cannot write "examination", they may use a preset symbol or pinyin to replace it. As Fig. 9 shown in the interface of (a) in, when the electronic device responds to the annotation operation of the user on the text in the first area, it displays the interface shown in Fig. 9 shown in (b) in. In Fig. 9 the interface shown in (b) in, the underline of the user's annotation of the text in the first area is displayed, through the input "? point", and the candidate words recommended for "? point": "difficult point", "examination point", "key point", etc. When the electronic device responds to the user's click on the "examination point" operation, it displays the interface shown in Fig. 9 shown in (c) in. In Fig. 9 the interface shown in (c) in, the underline of the user's annotation of the text in the first area and the annotated "examination point" are displayed.
[0150] The above describes in detail the method for recommending candidate words when the words that the user wants to input are text. The following describes the method for recommending candidate words when the user inputs other languages (eg, English) or multilingual phrases (eg, Chinese and English mixed phrases).
[0151] Example 1: When a user inputs an English phrase, for an English word that the user does not know how to write, only some letters may be written. The following takes the case where the user inputs a first phrase, and the first phrase includes at least one English word that the user does not know how to spell correctly as an example to introduce a method for recommending candidate words.
[0152] 1. The electronic device displays a first phrase in an input box in response to a user operation.
[0153] 2. The electronic device recognizes the first phrase and compares the single English word in the first phrase with the single English word in the preset phrase to determine the similarity between the two.
[0154] If the similarity reaches a preset threshold, the electronic device displays the English words whose similarity reaches the preset threshold in the candidate word column; or,
[0155] If the similarity does not reach the preset threshold, the electronic device compares the first phrase with the English phrases in the preset phrases to determine the degree of similarity between the two, and displays the English phrases whose similarity meets the preset conditions in the candidate word column in descending order of similarity.
[0156] Example 2: When a user inputs a mixed Chinese-English phrase, for an English word that the user does not know how to write, only some letters may be written. The following takes the case where the user inputs a second phrase, and the second phrase includes at least one known character and at least one English word that the user does not know how to spell correctly as an example to introduce a method for recommending candidate words.
[0157] 1. The electronic device displays the second phrase in the input box in response to the user's operation.
[0158] 2. The electronic device recognizes the first phrase. If the letters in the second phrase satisfy the pinyin form, the electronic device can recommend candidate words according to the above method 400. If the second phrase includes text and the letters in the second phrase do not satisfy the pinyin form, the electronic device can recommend candidate words for the second phrase according to the method of recommending candidate words for the first phrase input in the above example 1.
[0159] The present application also provides an electronic device, which may include: a processor coupled to a memory, wherein the memory may be used to store a computer program; and the processor may be used to call the computer program in the memory so that the electronic device executes each step shown in the above method embodiment.
[0160] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor can be combined to perform. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0161] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0162] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which enables an electronic device to execute each step in the method embodiment when the computer program is executed.
[0163] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the electronic device executes each step in the method embodiment.
[0164] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0165] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, terminal devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0166] In the several embodiments provided in the present application, it should be understood that the disclosed systems, terminal devices and methods can be implemented in other ways. For example, the terminal device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the terminal device or unit can be electrical, mechanical or other forms.
[0167] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0168] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0169] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memories (ROM), random access memories (RAM), magnetic disks or optical disks.
[0170] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A candidate word recommendation method, characterized in that: Applied to electronic equipment, the method comprises: In the handwriting input mode, in response to a first operation of the user, a first word is displayed in the input box, wherein the first word includes at least one known word and at least one character, and the at least one character is used to replace the word that the user cannot write; Recognize the first word and determine that the first word includes the at least one character; Based on the first word, at least one candidate word is determined from a preset word library, each of the at least one candidate word has the same number of characters as the first word, each of the candidate words includes the at least one known character, and the position of the at least one known character in the first word is the same as that in each of the candidate words, and each of the candidate words is composed of known characters; The at least one candidate word is displayed in the candidate word column.
2. The method according to claim 1, characterized in that The method further comprises: Determining the number of characters corresponding to the at least one character in the first word; Based on the number of characters corresponding to the at least one character, the number of characters included in the first word is determined.
3. The method according to claim 1 or 2, characterized in that: The first word includes a plurality of characters, and determining at least one candidate word from a preset word library based on the first word includes: Determining positions of the plurality of characters in the first word; Based on the at least one known character and the position of each of the at least one known character in the first word, the at least one candidate word is determined from the preset word library.
4. The method according to any one of claims 1 to 3, characterized in that The displaying of the at least one candidate word in the candidate word column comprises: Determining a degree of match between each candidate word and the first word; The at least one candidate word is displayed in sequence in the candidate word column in the order of high to low matching degree.
5. The method according to claim 4, characterized in that The at least one candidate word is multiple, the multiple candidate words include at least two candidate words, and the matching degrees corresponding to the at least two candidate words are the same; The displaying of the at least one candidate word in the candidate word column in order of the matching degree from high to low includes: The at least one candidate word is displayed in sequence in the candidate word column in the order of high to low matching degree, and in the order of high to low word frequency when the matching degrees are the same.
6. The method according to any one of claims 1 to 3, characterized in that The at least one character is the preset symbol, and the displaying of the at least one candidate word in the candidate word column includes: The at least one candidate word is displayed in sequence in the candidate word column in the order of word frequency from high to low.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: In response to a second operation of the user, a second word is brought to the screen, where the second word is one of the at least one candidate word.
8. The method according to claim 7, characterized in that The method further comprises: The first word is updated into the preset word library.
9. An electronic device, characterized in that: include: A processor, wherein the processor is coupled to a memory, wherein the memory is used to store a computer program, and when the processor calls the computer program, the electronic device executes the method as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, the computer program comprising instructions for implementing the method according to any one of claims 1 to 8.