Chinese input method and device, electronic equipment and medium
By customizing the soft keyboard and mapping table, the problem of existing Chinese Pinyin input methods being unable to adapt to different users' input habits has been solved, achieving more efficient Chinese input.
Patent Information
- Application Number
- CN202310975311.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-03
- Publication Date
- 2025-02-14
AI Technical Summary
In existing Chinese Pinyin input methods, the mapping relationship between input strings and syllables is fixed, which makes the keyboard scheme of the input method unable to adapt to the input habits of different users, resulting in low input efficiency.
A Chinese input method is provided, which generates key triggers that conform to a user-predefined soft keyboard, divides the key string into blocks using a first mapping table, determines candidate syllables and words based on a legal syllable table and a user-predefined mapping relationship between key symbols and input units, and allows users to customize the keyboard layout to improve input efficiency.
It enables users to customize their input method according to their needs, improving input efficiency and allowing users to find the words they need more quickly, reducing the number of keystrokes.
Smart Images

Figure CN119440268A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of input methods, and in particular to a Chinese input method, device, electronic device and medium. Background Art
[0002] In the current Chinese Pinyin input method, the mapping relationship between input string and syllable is fixed. The keyboard scheme used for input is also fixed, either using a 26-key keyboard, where each key corresponds to a letter from a to z, or using a 9-key keyboard, where each key corresponds to a number from 1 to 9, and each number corresponds to a fixed number of letters. For those who have other input habits or input needs, the input efficiency of using this input method is low. Summary of the invention
[0003] The embodiments of the present disclosure provide a Chinese input method, device, electronic device and medium, which enable an object to use an input method that meets its own needs to input Chinese, thereby improving input efficiency.
[0004] According to one aspect of the present disclosure, a Chinese input method is provided, comprising:
[0005] In response to triggering a plurality of keys on a soft keyboard predefined for a target object, generating a first key string of the plurality of keys;
[0006] Based on a first mapping table, the first key symbol string is divided into blocks, each of the blocks corresponds to at least one candidate syllable, wherein the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol predefined by the target object and an input unit, and the syllable includes one or more of the input units;
[0007] Based on a combination of at least one candidate syllable corresponding to each of the blocks, a candidate word is determined and displayed for selection by the target object.
[0008] According to one aspect of the present disclosure, there is provided a Chinese input device, comprising:
[0009] A generating unit, configured to generate a first key string of a plurality of keys in response to triggering a plurality of keys on a soft keyboard predefined for a target object;
[0010] A chunking unit, configured to chunk the first key symbol string based on a first mapping table, each chunk corresponding to at least one candidate syllable, wherein the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol predefined by the target object and an input unit, and the syllable includes one or more of the input units;
[0011] A determination unit is used to determine and display candidate words based on a combination of at least one candidate syllable corresponding to each of the blocks for selection by the target object.
[0012] Optionally, the first mapping table is generated in the following manner:
[0013] Acquire a second mapping table, where the second mapping table includes the second mapping relationship;
[0014] Obtaining the legal syllable table;
[0015] The input units of the legal syllables in the legal syllable table are replaced with key symbols corresponding to the input units according to the second mapping relationship, so that the obtained key symbol sequence forms the first mapping relationship with the legal syllables.
[0016] Optionally, replacing each input unit of the legal syllable in the legal syllable table with a key symbol corresponding to the input unit according to the second mapping relationship includes:
[0017] Reversing the second mapping relationship to obtain a third mapping relationship between the input unit and the key symbol;
[0018] For each input unit of a legal syllable in the legal syllable table, refer to the third mapping relationship, obtain the key symbol to which the input unit is mapped, and replace the input unit with the key symbol.
[0019] Optionally, after each input unit of a legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship so that the obtained key symbol sequence forms the first mapping relationship with the legal syllable, the generation process of the first mapping table further includes:
[0020] Obtaining a third mapping table, wherein the third mapping table includes a fourth mapping relationship between initial consonants and legal syllables;
[0021] Each of the initial consonants in the fourth mapping relationship is replaced with a key symbol corresponding to the initial consonant according to the second mapping relationship, so that the obtained key symbol sequence and the legal syllable in the fourth mapping relationship form the first mapping relationship.
[0022] Optionally, obtaining the second mapping table includes:
[0023] Displaying a second mapping relationship input interface;
[0024] receiving the second mapping relationship input in the second mapping relationship input interface;
[0025] The second mapping relationship is stored in the second mapping table.
[0026] Optionally, the generating unit is specifically used for:
[0027] In response to triggering a plurality of trigger positions on the soft keyboard, determining a plurality of keys corresponding to the plurality of trigger positions based on a fourth mapping table, wherein the fourth mapping table includes a fifth mapping relationship between keys and position ranges;
[0028] The key symbols of the plurality of keys are integrated into the first key symbol string.
[0029] Optionally, the position range includes position coordinates of a first anchor point and a second anchor point, the position coordinates include a first coordinate and a second coordinate, the key is a square, and the first anchor point and the second anchor point are located at two opposite corners of the square;
[0030] The generating unit is specifically used for:
[0031] If the first coordinate of the trigger position is between the first coordinate of the first anchor point and the first coordinate of the second anchor point in the fifth mapping relationship, and the second coordinate of the trigger position is between the second coordinate of the first anchor point and the second coordinate of the second anchor point in the fifth mapping relationship, the key in the fifth mapping relationship is determined to be the key corresponding to the trigger position.
[0032] Optionally, the fourth mapping table is generated in the following manner:
[0033] Displaying a second mapping relationship input interface, where the second mapping relationship input interface has a plurality of rows;
[0034] receiving the second mapping relationships input in each of the rows in the second mapping relationship input interface;
[0035] The fourth mapping table is determined based on the second mapping relationships input in each of the rows.
[0036] Optionally, the determining the fourth mapping table based on the second mapping relationship input in each of the rows includes:
[0037] Determining the length and height of the key based on the number of the second mapping relationships input in each of the rows and the number of the rows;
[0038] Based on the length and the height, determine the starting coordinates of each of the rows, the starting coordinates being the first coordinates and the second coordinates of the first anchor point of the first key of the row;
[0039] Determine the position range of each of the keys in the row based on the starting coordinates, the number of the second mapping relationships in the row, the length, and the height;
[0040] The key symbol and the position range in the second mapping relationship are mapped into the fifth mapping relationship to generate the fourth mapping table.
[0041] Optionally, determining the length and height of the key based on the number of the second mapping relationships input in each of the rows and the number of rows of the plurality of rows includes:
[0042] Determining the height of the key based on the number of rows and the total height of the soft keyboard;
[0043] The length of the key is determined based on a maximum value of the number of the second mapping relationships input in each of the rows and a total length of the soft keyboard.
[0044] Optionally, the first coordinate is a horizontal coordinate, the second coordinate is a vertical coordinate, the first anchor point is an upper left corner point of the key, and the second anchor point is a lower right corner point of the key;
[0045] The step of determining the starting coordinates of each of the rows based on the length and the height includes:
[0046] A plane rectangular coordinate system is established with the upper left corner of the soft keyboard as the origin, the extension direction of the row as the positive direction of the horizontal axis, and the direction from small to large row numbers as the positive direction of the vertical axis;
[0047] Determine the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, and the length;
[0048] Based on the height and the row number of the row, the ordinate in the start coordinates of the row is determined.
[0049] Optionally, the determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, the length, and the total length of the soft keyboard includes:
[0050] If the layout is centered, determining the length occupied by the soft keyboard in the row based on the number of the second mapping relationships in the row and the length;
[0051] Determine the remaining length of the soft keyboards in the row based on the total length and the occupied length of the soft keyboards in the row;
[0052] A half of the remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
[0053] Optionally, the determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, the length, and the total length of the soft keyboard includes:
[0054] If the format is right-aligned, determining the length occupied by the soft keyboard in the row based on the number of the second mapping relationships in the row and the length;
[0055] Determine the remaining length of the soft keyboards in the row based on the total length and the occupied length of the soft keyboards in the row;
[0056] The remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
[0057] Optionally, determining the position range of each of the keys in the row based on the starting coordinate, the number of the second mapping relationships in the row, the length, and the height includes:
[0058] Determine the horizontal coordinate of the first anchor point of the key based on the horizontal coordinate in the starting coordinate, the sequence number of the key in the row, and the length;
[0059] Determine the ordinate of each of the keys in the row to be consistent with the ordinate in the starting coordinate;
[0060] Based on the abscissa and the ordinate of the first anchor point of the key, the length and the height, the abscissa and the ordinate of the second anchor point of the key are determined.
[0061] Optionally, the determining the abscissa and the ordinate of the second anchor point of the key based on the abscissa and the ordinate, the length, and the height of the first anchor point of the key includes:
[0062] Determine the sum of the abscissa of the first anchor point of the key and the length as the abscissa of the second anchor point of the key;
[0063] The sum of the ordinate of the first anchor point of the key and the height is determined as the ordinate of the second anchor point of the key.
[0064] Optionally, the determining unit is specifically configured to:
[0065] Selecting a target candidate syllable from at least one candidate syllable corresponding to each of the blocks, and traversing the combinations of the target candidate syllables of each block;
[0066] For each of the combinations, a fifth mapping table is searched to obtain a word corresponding to the combination as the determined candidate word, wherein the fifth mapping table indicates a sixth mapping relationship between syllable combinations and words.
[0067] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the Chinese input method as described above when executing the computer program.
[0068] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the Chinese input method as described above is implemented.
[0069] According to one aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the Chinese input method as described above.
[0070] In the embodiment of the present disclosure, the key to be specifically triggered is determined according to the position of the object's click on the predefined soft keyboard, and the first key string is generated according to the triggering order. The first key string contains at least one block, and each block corresponds to at least one candidate syllable. Based on the combination of the candidate syllables of each block, a candidate word is determined for the object to select. In the above process, the basis for dividing the first key string into blocks is the first mapping table. The first mapping table contains a first mapping relationship between a key sequence and a syllable, and the first mapping relationship is determined based on a legal syllable table and a second mapping relationship between a key in the soft keyboard predefined by the object and an input unit, and is a mapping rule that meets the object's input requirements. Since the first key string is generated using the soft keyboard predefined by the object, the key sequence in the first key string can find the corresponding syllable using the first mapping table. If a key sequence in the first key string has a first mapping relationship with a syllable in the first mapping table, then this key sequence can be used as a block. Therefore, in the embodiment of the present disclosure, the object can use its own predefined soft keyboard that meets its own input requirements for input, and obtain the input result using the mapping rule between the key sequence and the syllable corresponding to the predefined soft keyboard, thereby improving the Chinese input efficiency of the object.
[0071] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.
[0073] Figure 1 is a system architecture diagram of a Chinese input method application system according to an embodiment of the present disclosure;
[0074] Figure 2A-2D is a schematic diagram of an interface in which a Chinese input method according to an embodiment of the present disclosure is applied to a scenario in which an object uses a soft keyboard set by itself to input;
[0075] Figure 3 is an overall flow chart of a Chinese input method according to an embodiment of the present disclosure;
[0076] Figure 4 This is a diagram of a 36-key keyboard predefined by the object;
[0077] Figure 5 yes Figure 3 A specific flow chart of step 310;
[0078] Figure 6 It is a vector diagram for determining whether the position clicked by the target object is within the triangle button;
[0079] Figure 7 This is a schematic diagram of the position range of a 16-key keyboard;
[0080] Figure 8 is a specific flow chart for generating a fourth mapping table;
[0081] Fig. 9 is a schematic diagram of an interface showing multiple rows on a second mapping relationship input interface;
[0082] Fig.10 It is a schematic diagram of an interface in which a target object can autonomously control rows in a second mapping relationship input interface;
[0083] Fig.11 is a schematic diagram of an interface for a target object to input a second mapping relationship according to a row;
[0084] Fig.12 yes Figure 8A specific flow chart of step 830;
[0085] Fig.13 yes Fig.13 A specific flow chart of step 1210 in FIG.
[0086] Fig.14 It is a schematic diagram for determining the length and height of the key;
[0087] Fig.15 yes Fig.12 A specific flow chart of step 1220 in FIG.
[0088] Fig.16 This is a schematic diagram showing that the layout of the soft keyboard is left-aligned;
[0089] Fig.17 yes Fig.15 A specific flow chart of step 1520 in FIG.
[0090] Fig.18 This is a schematic diagram of a soft keyboard layout that is centered;
[0091] Fig.19 yes Fig.15 A specific flow chart of step 1520 in FIG.
[0092] Fig. 20 This is a schematic diagram showing that the layout of the soft keyboard is right-aligned;
[0093] Fig.21 yes Fig.12 A specific flow chart of step 1230 in FIG.
[0094] Fig. 22 yes Fig.21 A specific flow chart of step 2130;
[0095] Fig.23 is a specific flow chart for generating a first mapping table;
[0096] Fig.24 yes Fig.23 A specific flow chart of step 2310 in FIG.
[0097] Fig.25 yes Fig.23 A specific flow chart of step 2330 in FIG.
[0098] Fig.26 is Fig.23 After step 2330, a specific flow chart of the process of determining the first mapping relationship by using the fourth mapping relationship between the initial consonant and the legal syllable is added;
[0099] Fig. 27 This is a schematic diagram of dividing the first key string into blocks;
[0100] Fig.28 yes Figure 3 A specific flow chart of step 320 in FIG.
[0101] Fig.29 yes Fig.28 A flowchart of the specific process of determining the blocks;
[0102] Fig.30 yes Figure 3 A specific flow chart of step 330;
[0103] Fig.31 yes Figure 3 A specific flow chart of step 330;
[0104] Fig.32 yes Figure 3 A specific flow chart of step 330;
[0105] Figure 33A-Figure 33B is an example schematic diagram of displaying candidate words in different display modes;
[0106] Fig.34 yes Fig.32 A specific flow chart of step 3210 in FIG.
[0107] Fig.35 is an overall implementation detail diagram of the Chinese input method of the embodiment of the present disclosure;
[0108] Fig.36 is a block diagram of a Chinese input device according to an embodiment of the present disclosure;
[0109] Fig.37 An embodiment according to the present disclosure is shown. Figure 3 The terminal structure diagram of the Chinese input method shown;
[0110] Fig.38 An embodiment according to the present disclosure is shown. Figure 3 The server structure diagram of the Chinese input method shown. DETAILED DESCRIPTION
[0111] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.
[0112] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:
[0113] Soft keyboard: refers to the keyboard displayed on the terminal screen. The object can generate input through touch or mouse click to achieve the same input effect as a hardware keyboard.
[0114] Syllable: A syllable in Chinese characters refers to a phonetic unit composed of initial consonants and finals. A single final can also constitute a syllable. Both initial consonants and finals are composed of lowercase letters, so a syllable can also be said to be composed of one or more lowercase letters. There are 23 initial consonants, including: b, p, m, f, d, t, n, l, g, k, h, j, q, x, zh, ch, sh, r, z, c, s, y, w. There are 6 single finals and 18 complex finals. The single finals include: a, o, e, i, u, ü; the complex finals include: ai, ei, ui, ao, ou, iu, ie, üe, er, an, en, in, un, ün, anɡ, enɡ, i nɡ, ong.
[0115] Chinese input method: It is a Chinese information processing technology, which refers to the encoding method used to input Chinese characters into electronic devices such as computers or mobile phones. Chinese input method is very important in scenarios where Chinese input is required. Therefore, it is very necessary to continuously explore new technologies to ensure that Chinese input can be carried out more efficiently.
[0116] System architecture and scenario description of the application of the embodiments of the present disclosure
[0117] Figure 1 1 is a system architecture diagram of a Chinese input method according to an embodiment of the present disclosure, which includes a terminal 140, an Internet 130, a gateway 120, a server 110, and the like.
[0118] The terminal 140 is a device for displaying input boxes, input information and candidate words. It includes various forms such as desktop computers, laptop computers, tablet computers, PDAs (personal digital assistants), mobile phones, and vehicle-mounted terminals. In addition, it can be a single device or a combination of multiple devices. For example, multiple devices are connected through a local area network and work together using a common display device, forming a terminal 140. The terminal 140 can also communicate with the Internet 130 in a wired or wireless manner to exchange data.
[0119] The server 110 refers to a computer system that can find candidate words according to the input key string. Compared with the ordinary terminal 140, the server 110 has very high requirements in terms of stability, security, performance, etc. The server 110 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc.
[0120] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the terminal 140 to the server 110 must be sent to the corresponding server 110 through the gateway 120. The message sent by the server 110 to the terminal 140 must also be sent to the corresponding terminal 140 through the gateway 120.
[0121] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A-2D The object shown uses the soft keyboard that it sets to input.
[0122] like Figure 2A As shown, when the subject is ready to use the soft keyboard to input Chinese on terminal 140, the soft keyboards provided to the subject by terminal 140 are only 9-key keyboard and 26-key keyboard. However, when using the 9-key keyboard, the subject thinks that there are too many input units corresponding to each key, resulting in a large number of candidate words generated, and the efficiency of finding the words he needs is too low; when using the 26-key keyboard, he thinks that there are too many keys, it is not easy to find the keys he needs, and the input efficiency is too low. Therefore, the subject wants to set a keyboard that suits his input habits. The subject clicks the "Set Keyboard" option in the interface, and the terminal 140 interface is as shown. Figure 2B shown.
[0123] exist Figure 2B In the , the object needs to enter the mapping relationship between the key symbol and the input unit that it wants, that is, when the object clicks the key symbol, which input unit is inputted. The mapping relationship set by the object in the input box is, 0: {a, b}, 1: {c}, 2: {d, e}, 3: {f, g}, 4: {h, i}, 5: {j, k}, 6: {l, m}, 7: {n}, 8: {o, p}, 9: {q, r}, A: {s}, B: {t, u}, C: {v, w}, D: {x}, E: {y}, F: {z}. After the object sets the mapping relationship, click OK, and the following will be generated. Figure 2C The object shown defines the soft keyboard.
[0124] exist Figure 2CIn this case, according to the mapping relationship set for the object, a 16-key keyboard is generated on the interface of the terminal 140 of the object. There are a total of 16 keys, distributed in 4 rows, with 4 keys in each row. The order of the keys is arranged according to the order of the mapping relationship set for the object. When the object clicks the key with the key symbol '0', according to the mapping relationship, it is equivalent to inputting the letters 'a' and 'b'. The object can also switch between the 26-key keyboard and the 9-key keyboard, and can also reset a keyboard. The object can perform Chinese input on this 16-key keyboard, such as Figure 2D As shown, the object sequentially clicks the '7', '4', '4', '0', '8' keys of the 16-key keyboard, and 4 candidate words are displayed for the object in the interface, namely "你好" (Hello), "您好" (Hello), "你号" (You number), and "拟好" (Intended to be good). The object can select the word it wants to input from these 4 candidate words. Compared with the fixed 26-key keyboard and 9-key keyboard, the object can improve the Chinese input efficiency by using the keyboard set by itself.
[0125] General description of the embodiments of the present disclosure
[0126] According to an embodiment of the present disclosure, a Chinese input method is provided.
[0127] The Chinese input method refers to the process of obtaining the required Chinese characters or words according to the syllables constructed by the object using pinyin letters. For example, if the object wants to input the character "树" (tree), the corresponding pinyin syllable is "shu". Therefore, to obtain this character, the object needs to sequentially click the key symbols corresponding to's', 'h', and 'u' on the soft keyboard. The server 110 responds to the triggering of the key symbols on the soft keyboard by the object, combines the three letters together to generate the pinyin syllable "shu", and then finds the Chinese character "树" according to the pinyin syllable.
[0128] The Chinese input method of the embodiments of the present disclosure can be executed on the server 110, or partially executed on the server 110 and partially executed on the terminal 140.
[0129] Such as Figure 3 As shown, according to an embodiment of the present disclosure, the Chinese input method includes:
[0130] Step 310: In response to the triggering of multiple keys on the predefined soft keyboard of the target object, generate a first key symbol string of the multiple keys;
[0131] Step 320: Based on the first mapping table, divide the first key symbol string into blocks, each block corresponding to at least one candidate syllable, where the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, and the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol predefined by the target object and an input unit, and the syllable includes one or more input units;
[0132] Step 330: Based on the combinations of at least one candidate syllable corresponding to each block, determine and display candidate words for the target object to select.
[0133] The following is a detailed description of Steps 310 - 330.
[0134] Detailed description of Step 310
[0135] In Step 310, the soft keyboard predefined by the target object refers to the soft keyboard set by the target object according to its own input requirements. For example, the target object needs a soft keyboard with a moderate number of keys and fewer input units corresponding to each key. Therefore, the target object predefined a 16 - key keyboard as shown in Figure 2C At this time, if the target object wants to input "你好" (ni hao), it needs to trigger '7', '4', '4', '0', '8' on the soft keyboard in sequence. Another example is that the target object needs a soft keyboard that can map compound vowels to reduce the number of key presses required for each input. Therefore, the target object predefined a 36 - key keyboard as shown in Figure 4 In this 36 - key keyboard, the mapping relationship between key symbols and input units is: 0:{ao,ai}, 1:{an,ang}, 2:{en,eng}, 3:{in,ing}, 4:{ie,ei}, 5:{ong,un}, 6:{ua,uai}, 7:{iu,ui}, 8:{uan,uang}, 9:{ian,iang}, among a - z, c:{c,ch}, s:{s,sh}, z:{z,zh}, and the rest correspond to themselves. At this time, the target object needs to trigger at most two keys to input a character. For example, if the target object wants to input "装修" (zhuang xiu) with the pinyin "zhuangxiu", if using a 9 - key or 26 - key keyboard, it needs to press the keys 9 times, but using the above 36 - key keyboard only needs to trigger 'z', '8', 'x', and '7', greatly reducing the number of key presses and meeting the target object's need to improve input efficiency by reducing the number of key presses.
[0136] In response to the triggering of multiple keys on the predefined soft keyboard by the target object, obtain the input units corresponding to the multiple keys, combine the input units of the multiple keys, and arrange them in the order of triggering the keys to generate the first key string. For example, the target object triggers the keys '9' and '4' in sequence. The input units corresponding to the key '9' are 'q' and 'r', and the input units corresponding to the key '4' are 'h' and 'i'. The first key strings that can be obtained by combining the input units of the key '9' and the key '4' are: "qh", "qi", "rh", "ri".
[0137] When the target object uses the soft keyboard to input, it is necessary to determine which key on the soft keyboard is triggered by the target object based on the click position. Figure 5 As shown, in response to triggering a plurality of keys on a predefined soft keyboard of a target object, a first key string of the plurality of keys is generated, including:
[0138] Step 510: In response to triggering a plurality of trigger positions on the soft keyboard, determine a plurality of keys corresponding to the plurality of trigger positions based on a fourth mapping table;
[0139] Step 520: Integrate the key symbols of multiple keys into a first key symbol string.
[0140] In step 510, the fourth mapping table includes a fifth mapping relationship between keys and position ranges. The position range refers to the position area where the keys are located in the soft keyboard. If the position triggered by the target object falls within a position range, it means that the keys in this position range are triggered.
[0141] The position range can be limited by the vector of each side of the key. For example, if the key is a triangle, determine the vector of each side according to the clockwise direction of the triangle, and then determine the vector from each corner to the target object trigger position point. Use the cross product of the side vector and the corner to trigger position vector to determine whether the target object trigger position point is within the triangle. Figure 6 As shown, the three corners of a triangular key are points A, B, and C, and the position of the target object is point P. Vector AC is cross-multiplied with vector AP, vector CB is cross-multiplied with vector CP, and vector BA is cross-multiplied with vector BP. If the above three cross-multiplication results are all greater than 0, it means that the position of the target trigger is within the key. In the fourth mapping table of the triangular key, the position range corresponding to each key in the fifth mapping relationship is the vector of each edge.
[0142] The position range can also be limited by the coordinates of the key points of the button. For example, if the button is circular, the center of each button can be represented by coordinates, and the position range of the button can be limited by the center and the button radius. For example, the center coordinates of button '0' are (1,1), and the button radius is 1. If the distance between the position triggered by the target object and the center coordinates is less than or equal to 1, it means that the target object clicks button '0'. In the fourth mapping table of circular buttons, the corresponding position range of each button in the fifth mapping relationship is the center coordinates and the radius.
[0143] For another example, if the key is square, in one embodiment, the position range includes the position coordinates of the first anchor point and the second anchor point, and the first anchor point and the second anchor point are located at two diagonal corners of the square. For example, the first anchor point and the second anchor point are the upper left corner and the lower right corner, or the lower left corner and the upper right corner of the square key, respectively. The coordinates of the other two positions in the square key can be inferred from the coordinates of the two diagonal positions, so the position range of the entire key can be clearly defined by the position coordinates of the two diagonal points. The position coordinates include the first coordinate and the second coordinate.
[0144] Therefore, based on the fourth mapping table, determining multiple keys corresponding to multiple trigger positions includes:
[0145] If the first coordinate of the trigger position is between the first coordinate of the first anchor point and the first coordinate of the second anchor point in the fifth mapping relationship, and the second coordinate of the trigger position is between the second coordinate of the first anchor point and the second coordinate of the second anchor point in the fifth mapping relationship, the key in the fifth mapping relationship is determined to be the key corresponding to the trigger position.
[0146] For example, Figure 2D The first anchor point of the 16-key keyboard in is the lower left corner coordinate, the second anchor point is the upper right corner coordinate, the first digit of the position coordinate is the first coordinate, and the second digit is the second coordinate. Figure 7 As shown in the coordinate schematic diagram of the 16-key keyboard, the fourth mapping table corresponding to the soft keyboard is Table 1.
[0147] button Location Range 0 (0,1),(1,0) 1 (1,1),(2,0) …… …… 6 (2,2),(3,1) …… …… E (2,4),(3,3) F (3,4),(4,3),
[0148] Table 1
[0149] The fifth mapping relationship between each square key and its position range can be determined through Table 1. For example, key '1' is limited between the two coordinates (1,1) and (2,0).
[0150] When the target object triggers a point on the soft keyboard, the first coordinate of the trigger position is identified as 2.3, and the second coordinate is 3.5. The first coordinate falls within the position interval of 2 to 3, and the second coordinate falls within the position interval of 3 to 4. Therefore, the position range of the trigger position is (2,4), (3,3). Based on the fifth mapping relationship in the fourth mapping table (Table 1), the key corresponding to the trigger position is key 'E'.
[0151] The advantage of this embodiment is that the key to which the trigger position of the target object belongs can be quickly determined through the position coordinates of two diagonal corners, thereby improving the accuracy and efficiency of determining the key corresponding to the trigger position.
[0152] When the object clicks multiple positions on the soft keyboard continuously, the key corresponding to each position is determined in turn according to the order in which the target object clicks, and the input unit corresponding to each key is determined, and the input units are combined in the order of clicks to obtain the first key string.
[0153] The advantage of this embodiment is that, based on the fourth mapping table, the key is determined according to the position range within which the position clicked by the target object falls, thereby improving the speed of determining the key and further improving the efficiency of obtaining the first key string.
[0154] Since the soft keyboard predefined by the target object is presented in the interface with the keyboard layout required by the target object, the number of keys of the soft keyboards predefined by different target objects may be different, and the position range corresponding to each key may also be different. Therefore, after the target object predefines the soft keyboard, it is necessary to determine the fifth mapping relationship between each key and the position range to generate the fourth mapping table of the soft keyboard. Since there are many shapes of keys that can be implemented and there are many ways to limit the position range, the generation process of the fourth mapping table for keys of different shapes and different position range representation methods will also be slightly different.
[0155] In one embodiment, based on the aforementioned key shape being a square, the position range includes the position coordinates of the first anchor point and the second anchor point, the first anchor point and the second anchor point are located at two objects of the square, and the position coordinates include an embodiment of the first coordinate and the second coordinate, such as Figure 8 As shown, the fourth mapping table is generated in the following manner:
[0156] Step 810: display a second mapping relationship input interface, where the second mapping relationship input interface has multiple rows;
[0157] Step 820: receiving the second mapping relationships input in each row of the second mapping relationship input interface;
[0158] Step 830: Determine a fourth mapping table based on the second mapping relationships input in each row.
[0159] In step 810, the second mapping relationship input interface is an interface for the target object to input the second mapping relationship between the key symbol of the soft keyboard and the input unit when the soft keyboard is predefined. The position range of the key corresponding to the key symbol needs to be determined based on the position of the key in the soft keyboard. When the target object predefines the soft keyboard, not only the second mapping relationship needs to be predefined, but also the position of the key corresponding to the key symbol in the soft keyboard layout needs to be predefined. Since the main layout mode of the keys in the soft keyboard is row and column layout, the target object needs to input the second mapping relationship according to the arrangement of the rows in the second mapping relationship input interface, such as Fig. 9As shown, the input interface of the second mapping relationship displays "the first row" to "the fourth row", requiring the target object to enter the second mapping relationship between the corresponding key symbols and the input units one by one in each row according to the arrangement order of the keys in a row. For example, if the target object wants the keys in the first row to include '0', '1', '2', and '3' and to be arranged in this order, then the corresponding second mapping relationship is entered in sequence after the first row.
[0160] In one embodiment, the rows displayed in the second mapping relationship input interface are determined according to the number of keys predefined by the target object. Before the target object enters the second mapping relationship input interface, the target object will be prompted to enter the number of keys of the predefined soft keyboard, and the reasonable number of rows that the soft keyboard should have is calculated based on the number of keys. After entering the second mapping relationship input interface, each row is directly displayed according to the calculated number of rows. For example, the number of soft keyboard keys that the target object wants is 16. After calculation, a total of 4 rows are arranged, and arranging 4 keys in each row is a more reasonable key layout. Therefore, in the second mapping relationship input interface, 4 rows are displayed, and the target object is prompted to enter 4 second mapping relationships in each row according to the key sequence.
[0161] The advantage of determining the displayed row according to the number of keys predefined in the target object is that the key layout in the soft keyboard is obtained through calculation, thereby improving the rationality of the layout of the soft keyboard.
[0162] In another embodiment, the row displayed in the second mapping relationship input interface is predefined by the target object. Since the soft keyboard predefined by the target object is to meet the input requirements of the target object, the key layout of the soft keyboard can also be determined by the target object. Fig.10 As shown, in the second mapping relationship input interface, the target object retains at least the first row, and the remaining rows can be deleted if they exceed the predefined soft keyboard layout of the target object. The target object can also add rows arbitrarily to ensure that the number of rows meets its own input requirements.
[0163] The advantage of the row displayed predefined by the target object is that not only the second mapping relationship of the predefined soft keyboard can meet the input requirements of the target object, but the key layout is also arranged in the way the target object wants, further improving the input efficiency of the target object using the predefined soft keyboard.
[0164] In step 820, the second mapping relationship inputted by the target object in each row of the second mapping relationship input interface is received. Fig.11As shown, the second mapping relationship of the target object input in the first row includes: 0: {a, b}, 1: {c}, 2: {d, e}, 3: {f, g}, which means that the keys of the first row of the soft keyboard predefined by the target object need to be arranged in the order of '0', '1', '2', '3'. After determining the position of each key on the soft keyboard, in step 830, determine the fifth mapping relationship between the key and the position range, and generate a fourth mapping table.
[0165] In one embodiment, Fig.12 As shown, based on the second mapping relationship input in each row, a fourth mapping table is determined, including:
[0166] Step 1210: determining the length and height of the key based on the number of second mapping relationships input in each row and the number of rows of the plurality of rows;
[0167] Step 1220: Determine the starting coordinates of each row based on the length and height;
[0168] Step 1230: Determine the position range of each key in the row based on the starting coordinates, the number of second mapping relationships in the row, the length, and the height;
[0169] Step 1240: Map the key symbols and position ranges in the second mapping relationship into a fifth mapping relationship to generate a fourth mapping table.
[0170] In step 1210, after receiving the second mapping relationships input by the target object in each row, the number of rows of the predefined soft keyboard and the number of second mapping relationships in each row can be known.
[0171] In one embodiment, Fig.13 As shown, based on the number of second mapping relationships input in each row and the number of rows of the plurality of rows, determining the length and height of the key comprises:
[0172] Step 1310: Determine the height of the key based on the number of rows and the total height of the soft keyboard;
[0173] Step 1320: Determine the length of the key based on the maximum value of the number of second mapping relationships input in each row and the total length of the soft keyboard.
[0174] In this embodiment, the total length and total height of the soft keyboard are determined by the input device used by the target object. If the space reserved for displaying the soft keyboard in the interface of the input device is 7 cm long and 5 cm wide, then the total length of the soft keyboard is 7 cm and the total height is 5 cm.
[0175] Divide the total height of the soft keyboard by the number of rows to get the key height. Fig.14As shown in the 22-key soft keyboard, the total height of the soft keyboard is 5 cm, there are 5 rows, and the key height of each row is 1 cm.
[0176] Since the number of keys in each row of the soft keyboard may be different, in order to accommodate all the keys in the soft keyboard, the length of the keys needs to be determined based on the row with the largest number of keys. The length of the keys is obtained by dividing the total length of the soft keyboard by the maximum number of second mapping relationships entered in each row. For example Fig.14 As shown, the total length of the soft keyboard is 7 centimeters, and the numbers of second mapping relationships of each row input are 5, 5, 5, 5, and 2 respectively. Therefore, the length of the keys in the soft keyboard is 7 / 5=1.4 centimeters.
[0177] The advantage of this embodiment is that the length and height of the keys are obtained according to the total length and height of the soft keyboard, so that the soft keyboard displayed in the input device of the target object can fully adapt to the interface layout, thereby improving the adaptability of the predefined soft keyboard.
[0178] In step 1220, the starting coordinates of each row are determined based on the length and height of the key. The starting coordinates are the first coordinates and the second coordinates of the first anchor point of the first key in the row. The purpose of determining the starting coordinates of a row is to determine the position range of the keys after the first key in the row.
[0179] Before determining the starting coordinates, it is necessary to establish a coordinate system and clarify which point in the square button the first anchor point refers to. In one embodiment, the first coordinate is the horizontal coordinate, the second coordinate is the vertical coordinate, the first anchor point is the upper left corner of the button, and the second anchor point is the lower right corner of the button. Fig.15 As shown, based on the length and height, the starting coordinates of each row are determined, including:
[0180] Step 1510, establish a plane rectangular coordinate system with the upper left corner of the soft keyboard as the origin, the extension direction of the row as the positive direction of the horizontal axis, and the direction from small to large row numbers as the positive direction of the vertical axis;
[0181] Step 1520: Determine the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row, and the total length of the soft keyboard;
[0182] Step 1530: Determine the vertical coordinate in the starting coordinates of the row based on the height and the row number.
[0183] In step 1510, a plane rectangular coordinate system is established, such as Fig.16 As shown, the upper left corner of the soft keyboard is taken as the origin, the extension direction of the row (from key '0' to key '4') is the positive direction of the horizontal axis, and the direction from small to large row numbers (from the first row to the fifth row) is the positive direction of the vertical axis.
[0184] In step 1520, the layout of the soft keyboard can be the alignment of the keys in the soft keyboard, for example, left alignment, center alignment, and right alignment. Due to different alignments, the starting position of each row may be different, but no matter how the alignment is performed, the keys move horizontally in a row. Therefore, the alignment will affect the horizontal coordinate of the key, but will not affect the vertical coordinate of the key.
[0185] In one embodiment, if the layout is left-aligned, 0 is used as the horizontal coordinate in the starting coordinate. Fig.16 As shown, the keys of each row are arranged from the leftmost side of the soft keyboard. Therefore, the horizontal coordinate of the starting coordinate of each row (the coordinate of the upper left corner of the first key) is 0.
[0186] In another embodiment, Fig.17 As shown, based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row, and the total length of the soft keyboard, determining the horizontal coordinate in the starting coordinate of the row includes:
[0187] Step 1710: If the layout is centered, determine the length of the soft keyboard in the row based on the number and length of the second mapping relationships in the row;
[0188] Step 1720: Determine the remaining length of the soft keyboard in the row based on the total length and the occupied length of the soft keyboard in the row;
[0189] Step 1730: determine half of the remaining length of the soft keyboard as the horizontal coordinate in the starting coordinates.
[0190] In this embodiment, the layout of the soft keyboard is centered, and the keys in each row are arranged horizontally toward the center of the entire soft keyboard. Fig.18 As shown in the figure, the maximum number of second mapping relationships in each row is 5. There are 5 second mapping relationships in the first to fourth rows. Therefore, after the first to fourth rows are centered, the left side of the first key is still attached to the left side of the soft keyboard, and the right side of the last key is still attached to the right side of the soft keyboard. However, the fifth row has only 2 keys. After the center alignment, the right side of the first key is attached to the center line of the soft keyboard, and the left side of the second key is attached to the center line of the soft keyboard.
[0191] Steps 1720-1730 are the calculation process of the horizontal coordinates of the starting coordinates of each row after the keys are arranged in the center, which can be expressed as Formula 1:
[0192] X i =(tn×w) / 2 (Formula 1).
[0193] In formula 1, X irepresents the horizontal coordinate of the starting coordinate of the i-th row, t represents the total length of the soft keyboard, n represents the number of second mapping relationships in the i-th row, w represents the length of a key, and n×w represents the length occupied by the soft keyboard in the i-th row. The remaining length of the soft keyboard in the row is obtained by subtracting the length occupied by the soft keyboard in the row from the total length of the soft keyboard; since the remaining length of the soft keyboard is the sum of the remaining lengths on both sides of the i-th row after the key is centered, and the lengths of both sides are equal, the horizontal coordinate of the starting coordinate of the i-th row is obtained by dividing the remaining length of the soft keyboard by 2.
[0194] If the number of second mapping relationships in a row is the maximum number of second mapping relationships in each row, then the horizontal coordinate of the starting coordinate of this row is 0. This can also be verified by formula 1. In step 1320, the length of the key is obtained by dividing the total length of the soft keyboard by the maximum number of second mapping relationships input in each row. Therefore, if the number of second mapping relationships in a row is the maximum number of second mapping relationships in each row, then n×w=t, that is, the remaining length of the soft keyboard is 0, and the horizontal coordinate of the starting coordinate of this row is also 0.
[0195] If the number of second mapping relationships in a row is less than the maximum number of second mapping relationships in each row, then the starting coordinates of the row are determined by calculation using Formula 2. For example, Fig.18 For the fifth row of the 22-key soft keyboard, the total length of the soft keyboard is 7, and the length of a key is 1.4. Then the horizontal coordinate of the starting coordinate of this row is (7-2×1.4) / 2=2.1.
[0196] The advantage of this embodiment is that the efficiency of determining the horizontal coordinate of the starting coordinate of each row after centering is high, and the calculation using the remaining length is more accurate.
[0197] In another embodiment, Fig.19 As shown, based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row, and the total length of the soft keyboard, determining the horizontal coordinate in the starting coordinate of the row includes:
[0198] Step 1910: If the layout is right-aligned, determine the length occupied by the soft keyboard in the row based on the number and length of the second mapping relationships in the row;
[0199] Step 1920: Determine the remaining length of the soft keyboard in the row based on the total length and the occupied length of the soft keyboard in the row;
[0200] Step 1930: determine the remaining length of the soft keyboard as the horizontal coordinate in the starting coordinate.
[0201] In this embodiment, the layout of the soft keyboard is right-aligned, that is, the right side of the last key in each row is attached to the right side of the soft keyboard, for example Fig. 20 shown.
[0202] Steps 1920-1930 are the calculation process of the horizontal coordinates of the starting coordinates of each row after the keys are right-aligned, which can be expressed as Formula 2:
[0203] X i =tn×w(Formula 2).
[0204] The difference between Formula 2 and Formula 1 is that Formula 2 does not need to divide the remaining length of the soft keyboard by 2. This is because, after right alignment, there is no remaining space on the right side of the last key, and all the remaining space is on the left side of the first key. Since the remaining space starts from 0, the remaining length of the soft keyboard is the horizontal coordinate of the starting coordinate of a row.
[0205] If the number of second mapping relationships in a row is the maximum number of second mapping relationships in all rows, then the horizontal coordinate of the starting coordinate of this row is 0. This can be verified by formula 2, and the specific verification process is the same as the above embodiment, which will not be repeated here.
[0206] If the number of second mapping relationships in a row is less than the maximum number of second mapping relationships in each row, then the abscissa of the starting coordinate of this row is calculated using Formula 2. Fig. 20 In the fifth row, there are 2 second mapping relationships, the total length of the soft keyboard is 7, and the length of the key is 1.4, so the horizontal coordinate of the starting coordinate of the fifth row is 7-2×1.4=4.2.
[0207] The advantage of this embodiment is that the efficiency of determining the horizontal coordinate of the starting coordinate of each row after right alignment is high, and the calculated horizontal coordinate is relatively accurate.
[0208] In step 1530, the ordinate in the starting coordinates of the row is determined based on the height and the row number. Since the first anchor point is the upper left corner of the key, the calculation process of the ordinate of the starting coordinates of the row can be expressed as Formula 3:
[0209] Y i =(i-1)×h (Formula 3).
[0210] In formula 3, Y i represents the ordinate of the starting coordinate of the i-th row, and h represents the key height. Fig. 20 In the 22-key soft keyboard, the key height is 1, the ordinate of the starting coordinate of the first row is 0, the ordinate of the starting coordinate of the second row is (2-1)×1=1, the ordinate of the starting coordinate of the third row is (3-1)×1=2, the ordinate of the starting coordinate of the fourth row is (4-1)×1=3, and the ordinate of the starting coordinate of the fifth row is (5-1)×1=4.
[0211] The advantage of the embodiment of steps 1510-1530 is that the efficiency of determining the starting coordinates of each row is improved by using a relatively simple calculation method, and the accuracy of determining the starting coordinates is improved.
[0212] In 1230, based on the starting coordinates, the number of second mapping relationships in the row, the length, and the height, the position range of each key in the row is determined.
[0213] Since the starting coordinates are the first coordinates and the second coordinates of the first anchor point of the first key in the row, based on the arrangement order of the keys in a row, the first coordinates and the second coordinates of the first anchor point of each key can be determined in sequence.
[0214] In one embodiment, the first coordinate is the horizontal coordinate and the second coordinate is the vertical coordinate. Fig.21 As shown, based on the starting coordinates, the number, length and height of the second mapping relationships in the row, the position range of each key in the row is determined, including:
[0215] Step 2110: determine the horizontal coordinate of the first anchor point of the key based on the horizontal coordinate in the starting coordinate, the serial number of the key in the row, and the length;
[0216] Step 2120: determine the ordinate of the first anchor point of each key in the row to be consistent with the ordinate in the starting coordinate;
[0217] Step 2130: Determine the horizontal coordinate and vertical coordinate of the second anchor point of the key based on the horizontal coordinate and vertical coordinate, length and height of the first anchor point of the key.
[0218] The keys in a row have the same ordinates but different abscissas. Therefore, the ordinate of the first anchor point of each key in the row is determined to be consistent with the ordinate of the starting coordinate.
[0219] The horizontal coordinate of the first anchor point of the first key in the row is the horizontal coordinate of the starting coordinate. The horizontal coordinate calculation process of the first anchor point of each key is shown in Formula 4:
[0220] X i j1=X i +(j-1)×w (Formula 4).
[0221] In Formula 4, X i j1 represents the horizontal coordinate of the first anchor point of the jth key in the i-th row, X i represents the horizontal coordinate of the starting coordinate of the i-th row, and w represents the key length. For example, the starting horizontal coordinate of the first row is 0, that is, the horizontal coordinate of the first anchor point of the first key is 0, the key length is 1.4, the horizontal coordinate of the first anchor point of the second key is 0+(2-1)*1.4=1.4, the horizontal coordinate of the first anchor point of the third key is 0+(3-1)*1.4=2.8, and so on.
[0222] After determining the first anchor point coordinates of each key in the row based on the starting coordinates of a row, it is also necessary to determine the second anchor point coordinates based on the first anchor point coordinates of the key. Since the second anchor point is the diagonal point of the first anchor point, the first coordinates and the second coordinates of the second anchor point of the first key can be obtained based on the key length and height.
[0223] In one embodiment, Fig. 22 As shown, based on the horizontal coordinate and vertical coordinate, length and height of the first anchor point of the key, determining the horizontal coordinate and vertical coordinate of the second anchor point of the key includes:
[0224] Step 2210: Determine the sum of the abscissa of the first anchor point of the key and the length as the abscissa of the second anchor point of the key;
[0225] Step 2220: Determine the sum of the ordinate of the first anchor point of the key and the height as the ordinate of the second anchor point of the key.
[0226] In this embodiment, the coordinates of the second anchor point of each key are determined based on the coordinates of the first anchor point of the key. If the horizontal coordinate of the first anchor point is 0 and the key length is 1.4, then the horizontal coordinate of the second anchor point of the key is 0+1.4=1.4. If the vertical coordinate of the first anchor point is 2 and the key length is 1, then the vertical coordinate of the second anchor point of the key is 2+1=3.
[0227] The advantage of this embodiment is that the efficiency of determining the coordinates of the second anchor point is improved.
[0228] The advantage of the embodiment of steps 2110-2130 is that the first anchor point coordinates and the second anchor point coordinates of each key in the row are determined based on the starting coordinates, thereby improving the accuracy of determining the position range.
[0229] In step 1240, generating the fifth mapping relationship between keys and position ranges is actually mapping the key symbols and position ranges in the second mapping relationship to the fifth mapping relationship. All the fifth mapping relationships between key symbols and position ranges in the second mapping relationship are combined to form a fourth mapping table.
[0230] The position range includes the first anchor point and the second anchor point of the key. The coordinates of the first anchor point of the jth key in the i-th row of the predefined soft keyboard can be expressed as (X i j1,Y i j1), the coordinates of the second anchor point can be expressed as (X i j2,Y i j2). Fig. 20 Taking the 22-key soft keyboard as an example, the fourth mapping table is shown in Table 2.
[0231] Key / Keysym Location Range 0 <![CDATA[(X111,Y111),(X112,Y112)]]> 1 <![CDATA[(X121,Y121),(X122,Y122)]]> 2 <![CDATA[(X131,Y131),(X132,Y132)]]> …… …… D <![CDATA[(X341,Y341),(X342,Y342)]]> …… …… L <![CDATA[(X521,Y521),(X522,Y522)]]>
[0232] Table 2
[0233] When the target object clicks Fig. 20 After the 22-key keyboard is used, the clicked position will be determined according to the clicked position coordinates to determine which position range the clicked position belongs to, and the corresponding key symbol will be determined according to Table 2.
[0234] In the embodiment of steps 1210-1240, the layout of the soft keyboard is determined according to the number of second mapping relationships input by the target object in each row and the number of rows, and the position range of each key is determined based on the layout of the soft keyboard to generate a fourth mapping table, thereby improving the accuracy of generating the fourth mapping table.
[0235] In the embodiment of steps 810-830, the target object can input the second mapping relationship one by one in the second mapping relationship input interface in rows. That is to say, not only the second mapping relationship can be determined by the target object, but also the key arrangement in the soft keyboard can be determined by the target object to obtain a soft keyboard key arrangement that can meet the input requirements of the target object, which improves the flexibility of generating a predefined soft keyboard and further improves the input efficiency of the target object using the predefined soft keyboard.
[0236] Detailed description of step 320
[0237] In step 320, the first key string is divided into blocks based on a first mapping table. The first mapping table includes a first mapping relationship between a key sequence and a syllable, and a syllable includes one or more input units. For example, Table 3 is an example of a first mapping table.
[0238]
[0239]
[0240] Table 3
[0241] Based on Table 3, if the key sequence is '04', the corresponding syllable is 'ai'.
[0242] The first mapping relationship is determined based on the legal syllable table and the second mapping relationship between the key symbol and the input unit predefined by the target object. Fig.23 As shown, the first mapping table is generated in the following manner:
[0243] Step 2310: Obtain a second mapping table;
[0244] Step 2320, obtaining a legal syllable table;
[0245] Step 2330: Replace each input unit of the legal syllable in the legal syllable table with the key symbol corresponding to the input unit according to the second mapping relationship, so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable.
[0246] The second mapping table contains a second mapping relationship between the key symbols predefined by the target object and the input unit. Fig.24 As shown, obtaining the second mapping table includes:
[0247] Step 2410: display a second mapping relationship input interface;
[0248] Step 2420: receiving a second mapping relationship input in a second mapping relationship input interface;
[0249] Step 2430: Store the second mapping relationship in the second mapping table.
[0250] When the target object predefines a soft keyboard, the second mapping relationship input interface will be displayed, for example Figure 2B As shown, the target object needs to input the second mapping relationship between the key symbol and the input unit that he needs in the second mapping relationship input interface.
[0251] After receiving the second mapping relationship input by the target object, the second mapping relationships are stored one by one in the second mapping table. Figure 2B The second mapping relationship of the target object input is stored in the second mapping table according to the input order, and the result is shown in Table 4.
[0252] Keysym Input unit 0 a,b 1 c 2 d,e …… …… E y F z
[0253] Table 4
[0254] The advantage of this embodiment is that the second mapping relationship input by the target object is directly stored in the second mapping table, thereby improving the efficiency of obtaining the second mapping table.
[0255] The legal syllable table in step 2320 is fixedly stored in the system memory or cloud storage space so that it can be called at any time when needed. Since syllables are composed of fixed rules, including: composed of initials and finals, a single final can also constitute a syllable alone, there are fixed 23 initials, and 24 finals. Therefore, the legal syllable table is obtained based on the legal rules of syllable composition and cannot be modified. Table 5 shows a part of the legal syllable table.
[0256]
[0257] Table 5
[0258] According to each legal syllable in the legal syllable table of Table 5, a corresponding Chinese character can be obtained.
[0259] A legal syllable is composed of multiple input units. Therefore, in step 2330, each input unit of each legal syllable in the legal syllable table is replaced with the key symbol corresponding to the input unit according to the second mapping relationship stored in the second mapping table. For example, the second mapping table is Table 4, and the legal syllable "a" has only one input unit 'a'. Based on Table 4, the input unit is replaced with the corresponding key symbol '0'; the legal syllable "ai" is composed of input units 'a' and 'i', which are replaced with corresponding key symbols respectively, and the key symbol sequence "04" is obtained; ...; the legal syllable "zuo" is composed of input units 'z', 'u', and 'o', which are replaced with corresponding key symbols respectively, and the key symbol sequence "FB8" is obtained. The result obtained after replacing the input unit with the key symbol is that the key symbol sequence corresponding to the legal syllable can be obtained, and the key symbol sequence and the legal syllable constitute a first mapping relationship.
[0260] Since a key symbol may correspond to multiple input units. When determining the corresponding key symbol according to the target input unit in the legal syllable, it is necessary to traverse the second mapping relationship in the second mapping table one by one, and for each second mapping relationship, it is necessary to traverse the input units one by one until the target input unit is found. For example, if the target input unit is 'd', when determining the key symbol corresponding to 'd', first traverse the input unit corresponding to key symbol '0' to see if there is 'd', then traverse the input unit corresponding to key symbol '1' to see if there is 'd', and then traverse the input unit corresponding to key symbol '2' to see if there is 'd'. After finding 'd', replace it with key symbol '2'.
[0261] In one embodiment, Fig.25 As shown, each input unit of the legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship, including:
[0262] Step 2510: invert the second mapping relationship to obtain a third mapping relationship between the input unit and the key symbol;
[0263] Step 2520: For each input unit of the legal syllable in the legal syllable table, refer to the third mapping relationship, obtain the key symbol mapped to the input unit, and replace the input unit with the key symbol.
[0264] Since the second mapping relationship is mapped from key symbols to input units, reversing the second mapping relationship will result in a third mapping relationship from input units to key symbols. In the second mapping relationship, a key symbol may be mapped to multiple input units. After reversing the mapping relationship, an input unit only corresponds to one key symbol. For example, the second mapping relationship 0:{a,b} is reversed to obtain a:{0},b:{0}. Reversing the second mapping relationship in Table 4 will result in the third mapping relationship in Table 6.
[0265]
[0266]
[0267] Table 6
[0268] Based on the third mapping relationship from input unit to key symbol, determine the key symbol corresponding to each input unit in each legal syllable, and replace the input unit with the corresponding key symbol. For example, if the legal syllable is "bao", through the third mapping relationship, it can be directly found that the key symbol corresponding to the input unit 'b' is '0', the key symbol corresponding to 'a' is '0', and the key symbol corresponding to 'o' is '8'. Replace the input unit with the corresponding key symbol to obtain the key symbol sequence "008", and "008" and "bao" constitute a set of first mapping relationships.
[0269] After the second mapping relationship is reversed into the third mapping relationship, one input unit corresponds to one key symbol. There is no need to traverse all the third mapping relationships. You only need to directly lock the third mapping relationship of the input unit to obtain the corresponding key symbol, which improves the efficiency of generating the first mapping relationship between the key symbol sequence and the legal syllable.
[0270] In the embodiment of steps 2310-2330, the first mapping relationship between the key sequence and the syllable is obtained based on the legal syllable table to ensure that the candidate syllables obtained based on the key sequence are legal, thereby improving the accuracy of generating the first mapping relationship and also improving the accuracy of inputting Chinese characters.
[0271] The legal syllables in the legal syllable table are all complete syllables, but in actual applications, the subject may only use abbreviations for input to improve input efficiency. For example, the subject can obtain the Chinese characters corresponding to the syllables such as "ba", "bai", and "bao" through an input unit 'b'. Therefore, in one embodiment, Fig.26 As shown, after each input unit of the legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable, the generation process of the first mapping table further includes:
[0272] Step 2610: Obtain a third mapping table, where the third mapping table includes a fourth mapping relationship between initial consonants and legal syllables;
[0273] Step 2620: Replace each initial consonant in the fourth mapping relationship with the key symbol corresponding to the initial consonant according to the second mapping relationship, so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable in the fourth mapping relationship.
[0274] The third mapping table contains a fourth mapping relationship from initial consonants to legal syllables. Similar to the legal syllable table, the third mapping table is also generated based on syllable composition rules and is a fixed mapping relationship that cannot be changed. The third mapping table is also stored in the local system memory or cloud storage space for easy access at any time. Table 7 shows a portion of the third mapping table.
[0275] Initials Legal syllables b ba,bai,bao,ban,bang,bei,ben,beng,bi,bin,…… c ca,cai,cao,can,cang,ceng,ci,…… d da,dai,dao,dan,dang,de,dei,deng,di,ding,…… …… …… z za,zai,zao,zan,zang,ze,zei,zeng,zi,……
[0276] Table 7
[0277] Based on Table 7, when the subject inputs an initial consonant, the corresponding legal syllable can be obtained as a candidate syllable.
[0278] In order to enable the target object to obtain multiple candidate syllables when triggering a key symbol corresponding to an initial consonant, the initial consonant is replaced with the key symbol corresponding to the initial consonant according to the second mapping relationship, forming a first mapping relationship between the key symbol sequence and the legal syllable. For example, the second mapping relationship is shown in Table 4. The initial consonant "b" is replaced with the key symbol "0", and then the first mapping relationship from "0" to legal syllables such as "ba", "bai", and "bao" is formed. Based on the second mapping relationship in Table 4, the first mapping relationship obtained by replacing each initial consonant in the third mapping table with the corresponding key symbol sequence is shown in Table 8.
[0279] key sequence Legal syllables 0 ba,bai,bao,ban,bang,bei,ben,beng,bi,bin,…… 1 ca,cai,cao,can,cang,ceng,ci,…… 2 da,dai,dao,dan,dang,de,dei,deng,di,ding,…… …… …… F za,zai,zao,zan,zang,ze,zei,zeng,zi,……
[0280] Table 8
[0281] Based on Table 8, when the target object triggers the key symbol "1", "ca", "cai", "cao", etc. are obtained as candidate syllables.
[0282] The first mapping relationship obtained by using the third mapping table is combined with the first mapping relationship obtained by using the legal syllable table to obtain a first mapping table. Table 9 shows the first mapping table obtained based on the second mapping relationship in Table 4.
[0283] key sequence Legal syllables 0 a,ba,bai,bao,ban,bang,bei,ben,beng,bi,bin,…… 00 ba 04 ai,bi 004 bai …… …… 1 ca,cai,cao,can,cang,ceng,ci,…… 10 ca 14 ci …… …… F za,zai,zao,zan,zang,ze,zei,zeng,zi,…… F0 za F2 ze …… ……
[0284] Table 9
[0285] Based on the first mapping table, candidate syllables can be obtained according to the key sequence input by the target object.
[0286] The advantage of using the fourth mapping relationship from initial consonants to legal syllables to obtain the first mapping relationship is that the target object can obtain multiple candidate legal syllables based on one input key symbol, thereby improving the input efficiency of the target object using a predefined soft keyboard.
[0287] After receiving the first key string input by the target object using the predefined soft keyboard, the first key string is divided into blocks based on the first mapping table, and each block needs to correspond to at least one candidate syllable. Fig. 27 As shown, the first key string is "0041". Based on the first mapping table, no legal syllable can be found according to this key sequence, so it is divided into two blocks, "1" corresponds to candidate syllables such as "ca", "ca i", "cao", and "004" corresponds to a candidate syllable "bai".
[0288] In one embodiment, Fig.28 As shown, based on the first mapping table, the first key string is divided into blocks, including:
[0289] Step 2810: Set a sliding window and a substring to be compared, initialize the sliding window to the first key string, and initialize the substring to be compared to the first key string;
[0290] Step 2820, execute the first process until the substring to be compared becomes an empty set, the first process includes: determining whether the sliding window corresponds to a key symbol sequence in the first mapping table; if so, taking the sliding window as a block, and deleting part of the key symbol sequence of the sliding window in the substring to be compared, updating the sliding window to the deleted substring to be compared, and repeating the first process; if not, deleting the last key symbol of the sliding window, and repeating the first process.
[0291] In this embodiment, the sliding window is the key sequence that needs to be searched in the first mapping table, and the substring to be compared is the sequence that has not been searched in the first key string. Fig.29 As shown, firstly, a loop initial value is set for the first process, the sliding window is initialized to the first key string, and the substring to be compared is initialized to the first key string. After the initialization is completed, the first process is performed, which includes: searching the first mapping table with a sliding window to determine whether the key symbol sequence of the sliding window is included in the first mapping table; if not, it means that the key symbol sequence in the current sliding window does not have any corresponding legal syllables and cannot be used as a block, delete the last digit of the sliding window, and use a new sliding window to re-search the first mapping table; if it exists, it means that the key symbol sequence in the current sliding window has corresponding legal syllables and can be used as a block, save the sliding window as a block, and store the syllables corresponding to the block as candidate syllables; at this time, part of the key symbol sequence of the sliding window in the substring to be compared has been stored as a block, so this part of the key symbol sequence is deleted, and the remaining part is used as a new substring to be compared, and then the sliding window is updated to the new substring to be compared; if the substring to be compared is not empty, it means that there are still key symbol sequences that need to be retrieved, and the first mapping table is re-searched using a new sliding window; if the substring to be compared is empty, it means that all key symbols have been retrieved, the first process ends, and one or more blocks corresponding to the first key symbol string are obtained.
[0292] For example, the first key string is "0041", and the first mapping table is Table 9. First, initialize the sliding window to "0041", and initialize the substring to be compared to "0041"; enter the first process, search the current sliding window in the first mapping table; if the key sequence "0041" does not exist in the first mapping table, delete the last key in the sliding window, and the new sliding window after deletion is "004"; search the new sliding window in the first mapping table, and the key sequence "004" exists in the first mapping table, and the corresponding syllable is "bai", so "004" is stored as a block, and the corresponding syllable is recorded as the candidate syllable of the block; delete the sliding window in the substring to be compared. The window part, after deletion, the substring to be compared is "1"; the sliding window is updated to the current substring to be compared, and the current new sliding window is "1"; at this time, the substring to be compared is not empty, and the current new sliding window is retrieved using the first mapping table; there is a key symbol sequence of "1" in the first mapping table, and the corresponding syllables include: "ca", "cai", "can", etc., so "1" is saved as a block, and the corresponding syllable is recorded as a candidate syllable of the block; the sliding window part in the substring to be compared is deleted, and the sliding window is updated to the current substring to be compared. It is determined that the substring to be compared is empty, and the first process ends. Therefore, based on the first mapping relationship in Table 9, the first key symbol string "0041" is divided into two blocks of "004" and "1".
[0293] The advantage of using the first process of this embodiment to divide the first key string into blocks is that it ensures that no key symbol in the first key string is missed, thereby improving the accuracy of the block division.
[0294] Detailed description of step 330
[0295] In step 330, the candidate syllables corresponding to the blocks in a key string are combined in the block order, and the candidate words are determined according to the candidate syllable combination. For example, the candidate syllable corresponding to "004" is "bai", and the candidate syllable corresponding to "1" is "ca", "cai", "can", etc. The candidate syllables are combined in the block order to obtain candidate syllable combinations such as "bai ca", "bai cai", and "baican". Based on the candidate syllable combination, candidate words such as "bai cai", "bai cai", and "bai ca" may be obtained.
[0296] In one embodiment, Fig.30 As shown, based on the combination of at least one candidate syllable corresponding to each block, the candidate word is determined and displayed, including:
[0297] Step 3010: Select a target candidate syllable from at least one candidate syllable corresponding to each block, and traverse the combination of target candidate syllables in each block;
[0298] Step 3020: For each combination, search the fifth mapping table to obtain the word corresponding to the combination as the determined candidate word.
[0299] Each block corresponds to one or more candidate syllables. All candidate syllables corresponding to a block are traversed, and the candidate syllables are taken as the target candidate syllables of the block in turn. The target candidate syllables of all blocks in the first key string are arranged and combined in the order of the blocks to form a candidate syllable combination. Multiple candidate syllable combinations can be obtained by combining the candidate syllables of the blocks, and each combination is traversed.
[0300] Each syllable represents one or more Chinese characters, and Chinese characters represented by different syllables are combined together to form a word. However, in the Chinese input method, not all characters can become words after any combination, so a fifth mapping table is needed to determine the words that can be successfully combined. The fifth mapping table indicates the sixth mapping relationship between syllable combinations and words, and each syllable combination corresponds to one or more candidate words. The fifth mapping table is generated based on the Chinese vocabulary, and the sixth mapping relationship will be added as the vocabulary expands. Similar to the legal syllable table, the fifth mapping table is stored in the local system memory or cloud storage space for easy access at any time. Table 10 shows a portion of the fifth mapping table.
[0301] Syllable combination Candidate word a'ba Aba, Aba, Aba,... ba'ba Dad, Baba, Baba,... Bai'cai Cabbage, Baicai Bai'can White meal, white silkworm bai'cao Grass, white grass, barnyard grass Bai'ceng Hundred Layers bai'ci Hundred Times, White Porcelain, White Thorn, Farewell Bai'cha White tea, white stubble, white tea ...... ...... Xin'ling Heart, heart, signal, Xinling, Xinling,... Zong'zong Zongzong, Zongzong, Zongzong, Zongzong, Zongzong,...
[0302] Table 10
[0303] Based on Table 10, if the candidate syllable combination is "bai'cai", the candidate words "baicai" and "baicai" can be obtained.
[0304] Traverse each candidate syllable combination in turn, and search for the candidate syllable combination in Table 10. If there is no search result, it means that the characters corresponding to the syllables in the candidate syllable combination cannot form a word, and this syllable combination is invalid; if it can be retrieved, obtain the candidate word corresponding to the candidate syllable combination.
[0305] For example, the candidate syllable corresponding to block "004" is "bai", and the candidate syllables corresponding to block "1" are "ca", "cai", "cao", "can", "cang", "ceng", and "ci". Since there is only one candidate syllable corresponding to block "004", "bai" is combined with the candidate syllables corresponding to block "1" in sequence, and the resulting candidate syllable combinations are: "bai'ca", "bai'cai", "bai'cao", "bai'can", "bai'cang", "bai'ceng", and "bai'ci". The candidate syllable combinations are traversed in sequence, among which "bai'ca" and "bai'cang" have no search results in Table 10, which means that the syllable combination is invalid. The candidate words obtained by "bai'cai" in Table 10 are: "baicai" and "baicai"; the candidate words obtained by "bai'cao" in Table 10 are: "baicao", "baicao", "baicao"; the candidate words obtained by "bai'can" in Table 10 are: "baican" and "baican"; the candidate words obtained by "bai'ceng" in Table 10 are: "bai ceng"; the candidate words obtained by "bai'ci" in Table 10 are: "bai ci", "bai ci", "bai ci", and "bai ci". The candidate words corresponding to all candidate syllable combinations are combined together to form a candidate word set obtained based on the first key string "0041", including: "baicai", "baicai", "baicao", "baicao", "baicao", "baican", "baican", "bai ceng", "bai ci", "bai ci", "bai ci", and "bai ci".
[0306] The advantage of this embodiment is that it ensures that the obtained candidate words are correct words that comply with Chinese word formation rules, thereby improving the accuracy of determining the candidate words.
[0307] After the candidate words are determined, the candidate words need to be displayed to the target object for selection. If there are a large number of candidate words, the target object may need to spend a lot of time to find the desired candidate word among the many candidate words if the candidate words are displayed to the target object in any order. Fig.31 As shown, candidate words are determined and displayed for selection by the target object, including:
[0308] Step 3110: Determine the number of times the candidate word appears in the predetermined document library as the first count;
[0309] Step 3120: Based on the work log of the current device, determine the number of times the candidate word has been selected on the current device as a second number;
[0310] Step 3130: Sort and display the candidate words based on the first number and the second number.
[0311] The first number counted in step 3110 is the number of times the candidate word appears in a predetermined document library. The predetermined document library can be a collection of documents created by the target object itself in the past or a part of a collection of documents, or a collection of several documents crawled from the Internet.
[0312] When the predetermined document library is a collection of documents created by the target object itself in the past or a part of a collection of documents, the first count can reflect the number of times the target object has entered the selected word in the past. The more times the target object has entered a word in the past, the more likely it is that the target object will use the word frequently. For such candidate words, they can be placed in the front when sorting, thereby improving the efficiency of the target object in finding the candidate word.
[0313] When the predetermined document library is a collection of several documents crawled from the Internet, the first count can reflect whether the candidate word is likely to appear in the document. For words that are likely to appear in the document, the target object has a higher probability of selecting it. For such candidate words, they can also be ranked in the front when sorting, improving the efficiency of the object in selecting candidate words.
[0314] In addition, the predetermined document library may also be a collection of some documents created by the target object itself in the past and some documents crawled from the Internet, so as to comprehensively reflect the frequency of candidate words used by the object itself and the frequency of occurrence in general articles.
[0315] For example, after step 3110, the number of times each candidate word appears in the predetermined document library is obtained as follows: {"cabbage": 985, "hundred wealth": 101, "hundred grass": 687, "white grass": 532, "white silkworm": 336, "hundred layers": 111, "hundred times": 654, "farewell": 595}. At this time, the first number of candidate word "cabbage" is 985, the first number of candidate word "hundred wealth" is 101, the first number of candidate word "hundred grass" is 687, the first number of candidate word "white grass" is 532, the first number of candidate word "white silkworm" is 336, the first number of candidate word "hundred layers" is 111, the first number of candidate word "hundred times" is 654, and the first number of candidate word "farewell" is 595.
[0316] The second number of times counted in step 3120 is the number of times the target object has selected the candidate word when it was displayed in history. The work log of the current device records all events on the terminal, wherein an information entry is recorded for each event of displaying a candidate word to the target object. The information entry includes the displayed candidate word, the candidate word selected by the target object, the display event, the selection time, etc. The information entries of the candidate words selected by the target object to be displayed are filtered out from these information entries. The total number of filtered information entries is counted to obtain the number of times the candidate word has been selected by the target object in the current device in history. The function of this step is: the first number of times counted in step 3110 can only represent the number of times the candidate word has been used by the target object himself or the number of times it has been used by all corresponding populations, but the use does not mean that the object will select it when multiple candidate words are displayed. Some words may not be input through the Chinese input method, for example, they are input by the object through copying and pasting, or generated in the process of translating foreign languages into Chinese through translation software. Therefore, when sorting the candidate words, it is necessary to consider the number of times the target object has selected it in history when the candidate word is displayed.
[0317] In one embodiment, the second number can be the total number of times the candidate word is selected by the target object when it is displayed at all times in history. If the number of historical selections of a word is high, it means that the word is often used and the probability of being selected again is also high. For example, the total number of selections recorded in the work log for each candidate word is {"cabbage": 525, "hundred wealth": 85, "hundred grass": 410, "white grass": 352, "white silkworm": 185, "hundred layers": 56, "hundred times": 557, "farewell": 425}. At this time, the second number of candidate word "cabbage" is 525, the second number of candidate word "hundred wealth" is 85, the second number of candidate word "hundred grass" is 410, the second number of candidate word "hundred grass" is 352, the second number of candidate word "white silkworm" is 185, the second number of candidate word "hundred layers" is 56, the second number of candidate word "hundred times" is 557, and the second number of candidate word "farewell" is 425.
[0318] In another embodiment, the second number can be the number of times the candidate word is selected by the target object when it is displayed in the most recent cycle. The cycle can be days, weeks, months, etc. As described above, the information entries in the work log include the displayed candidate words, the candidate words selected by the target object, the display time, the selection time, etc. The information entries in the work log can be filtered out, and the displayed candidate words include the candidate words, the candidate words selected by the target object also include the candidate words, and the selection time falls in the most recent cycle. By counting the number of filtered information entries, the number of times the candidate word is selected by the target object when it is displayed in the most recent cycle can be obtained. For example, the current time is 15:20:00 on July 25, the cycle is days, and the candidate word is "cabbage". From the information entries in the work log, the displayed candidate words include "cabbage", the candidate words selected by the target object also include "cabbage", and the selection time falls between 0:00-24:00 on July 24 are filtered out, and there are 198 information entries, and the second number is determined to be 198. The advantage of this embodiment is that the total number of historical selections of a certain word may not be high, but it has been frequently used by the target object for some reason recently (for example, the target object has recently spent a few days writing a novel, and the name of the protagonist has been frequently selected by the target object in recent days). The words frequently selected by the target object recently represent the target object's recent status. By determining the second number in this way, the candidate word ranking can be made closer to the actual status of the target object, thereby improving the efficiency of selecting candidate words.
[0319] In another embodiment, the second number may be a weighted sum of the total number of times the candidate word was selected by the target object when it was displayed at all times in history, and the number of times the candidate word was selected by the target object when it was displayed in the most recent cycle. The advantage of this embodiment is that the second number can reflect both the long-term input habits of the target object and the recent input habits of the target object, and can flexibly assign weights to the above two factors, thereby improving the flexibility of determining the second number.
[0320] In step 2530, the average of the first and second times of the candidate word can be calculated as the final score of the candidate word, and the candidate words are sorted in descending order according to the final scores. The advantage of using the average to calculate the final score is that the influence of the first and second times on the candidate word results is comprehensively considered, and the first and second times are both important for the selection of the candidate word, which more equally reflects the different influences of the possibility of the candidate word being input and the possibility of being selected.
[0321] In another embodiment, the weighted sum of the first and second times of the candidate word can be calculated as the final score of the candidate word, and the candidate words are sorted in descending order according to the final scores. The advantage of this embodiment is that different weights can be flexibly set for the possibility of the candidate word being input and the possibility of being selected, thereby improving the flexibility of determining the display order of the candidate words.
[0322] The advantage of steps 2510-2530 is that the order of displaying candidate words is determined comprehensively by examining two dimensions: the possibility of the candidate words being input by the target object and the possibility of being selected by the target object. The former reflects the commonness of the candidate words, and the latter reflects whether the candidate words are easy to be selected by the object when displaying the candidate words in the Chinese input method. The comprehensive use of the two dimensions makes the determined order of displaying candidate words closer to the habits of the target object and the input efficiency is higher.
[0323] In another embodiment, when displaying candidate words, it is also necessary to consider the display mode of the candidate words. The display mode includes: the word size, font, form (bold, italic, underline, etc.), color, etc. The advantage of considering the display mode of the candidate words is that different candidate words are displayed separately, and a special display mode is adopted for the candidate words that need to attract the attention of the target object, thereby improving the efficiency of input.
[0324] In one embodiment, Fig.32 As shown, candidate words are determined and displayed for selection by the target object, including:
[0325] Step 3210: Determine the display mode of the candidate words based on the work log of the current device;
[0326] Step 3220: Display the candidate words in a determined display manner.
[0327] When displaying candidate words, different words can be displayed in different ways. Fig.33A As shown in the figure, "baicai" is displayed in bold, and the other candidate words are displayed in normal font. Fig.33B As shown, each candidate word is displayed in a different font size, and the font size of the displayed candidate words gradually decreases from the front to the back. The following will introduce how to determine the display mode of different candidate words.
[0328] In one embodiment, Fig.34 As shown, based on the work log of the current device, the display mode of the candidate words is determined, including:
[0329] Step 3410: Based on the work log of the current device, determine the number of times the candidate word has been selected on the current device as the second number;
[0330] Step 3420: Determine, based on the work log of the current device, the number of times the candidate word has been selected on the current device for the first key string input using the predefined soft keyboard, as the third number;
[0331] Step 3430: Determine how to display the candidate words based on the second digit and the third digit.
[0332] The second number is the number of times the candidate word has been selected on the current device, which has been described in detail in the above embodiment and will not be repeated here.
[0333] The third number is the number of times the target object selects the candidate word for the first key string input using a predefined soft keyboard. In the aforementioned embodiment, the work log includes multiple information entries of events for displaying candidate words to the target object. The information entry includes the displayed candidate word, the candidate word selected by the target object, the display time, the selection time, and the key string input by the target object. Filter out the information entries in the work log, in which the displayed candidate word includes the candidate word, the candidate word selected by the target object is the candidate word, and the key string input by the target object is the first key string, and count the number of filtered information entries as the third number.
[0334] The reason for determining the display mode of candidate words based on the second number and the third number is that the second number represents the possibility that the target object will choose a specific candidate word for any first key string as long as the specific candidate word appears in the displayed candidate words. But sometimes, although the target object has historically chosen a certain specific candidate word more often, they are all selected for key strings that are completely unrelated to the currently input first key string. In fact, when facing the currently input first key string, the probability that the target object chooses a specific candidate word among many candidate words is not high. Therefore, the embodiment of the present disclosure introduces the third number, which represents the probability that the target object will choose a specific candidate word among many displayed candidate words for the currently input first key string. The second number represents the possibility of target object selection in a generalized scenario, and the third number represents the possibility of target object selection in a specific scenario.
[0335] In one embodiment, determining the display mode of the candidate word based on the second number and the third number includes: determining a total score based on the second number and the third number; and determining the display mode of the candidate word based on the total score.
[0336] When determining the total score based on the second number and the third number, in different embodiments, the sum, average or weighted sum of the second number and the third number can be used as the total score. The advantage of using the sum or average is that the influence of the selection possibility of the generalized scene target object and the selection possibility of the specific scene target object on the display mode is balanced, so that the determined display mode is not biased towards any aspect, thereby improving the fairness of the determination result. The advantage of using the weighted sum is that different weights can be flexibly set for the selection possibility of the generalized scene target object and the selection possibility of the specific scene target object according to actual needs, thereby improving the flexibility of determining the display mode.
[0337] In one embodiment, when determining the display mode of candidate words based on the total score, a first threshold can be set. Once the total score is greater than the first threshold, the display mode of the corresponding candidate word is set to a display mode different from that of other candidate words. That is to say, there are two display modes for candidate words. For those with a total score greater than the first threshold, it indicates that the probability of the candidate word being selected by the target object is relatively high in terms of the overall possibility of the target object being selected in the generalization scenario and the specific scenario, and the candidate word should be displayed in a more prominent and attention-catching display mode. For those with a total score less than or equal to the first threshold, it indicates that the probability of the candidate word being selected by the target object is not so high in terms of the overall possibility of the target object being selected in the generalization scenario and the specific scenario, and the candidate word can be displayed in a less prominent display mode. For example, the final scores of all candidate words are: {"Chinese cabbage": 645, "hundred kinds of herbs": 325, "white grass": 269, "hundred times": 495, "take leave": 408}, and the set first threshold is 500. As Fig.33A shown, the total score of "Chinese cabbage" exceeds 500, so "Chinese cabbage" is displayed in bold, and the total scores of other words are less than or equal to 500, so they are displayed in normal font. The advantage of this embodiment is that candidate words that are generally more dominant in terms of the possibility of the target object being selected in the generalization scenario and the specific scenario can be displayed in a special way to attract the attention of the target object, thereby improving the object input efficiency.
[0338] In another embodiment, when determining the display mode of candidate words based on the total score, different display parameters can be set according to different total scores. The display parameters are the parameters for displaying candidate words, such as font size, height, etc. The total score represents the comprehensive evaluation result of the candidate word in terms of the possibility of the target object being selected in the generalization scenario and the specific scenario. The larger the total score, the more dominant the candidate word is generally in terms of the possibility of the target object being selected in the generalization scenario and the specific scenario, and the larger the font, height, etc. can be used for display. The smaller the total score, the less dominant the candidate word is generally in terms of the possibility of the target object being selected in the generalization scenario and the specific scenario, and the smaller the font, height, etc. can be used for display. For example, the total scores of each candidate word are: {"Chinese cabbage": 645, "hundred times": 495, "take leave": 408, "hundred kinds of herbs": 325, "white grass": 269}. At this time, as Fig.33B shown, the fonts of "Chinese cabbage", "hundred times", "take leave", "hundred kinds of herbs", and "white grass" can be displayed smaller and smaller. The advantage of this embodiment is that the object can clearly see the probability of each candidate word being selected from the display parameters (such as font size), thereby improving the input efficiency.
[0339] The advantage of the implementation scheme of steps 3410-3430 is that it comprehensively evaluates the possibility of the target object selecting the candidate word based on the possibility of the target object selecting the candidate word in a generalized scenario and the possibility of the target object selecting the candidate word in a specific scenario, and determines the display method of the candidate word according to the possibility of the candidate word being selected, reminding the target object to pay attention to the candidate word with a higher possibility of being selected, thereby improving input efficiency.
[0340] The advantage of the embodiment of steps 3210-3220 is that the display mode is determined for different candidate words, so that the words that the target object has a high probability of selecting are displayed to the target object at a glance, thereby improving input efficiency.
[0341] Implementation details of the Chinese input method of the disclosed embodiment
[0342] Refer to the following Fig.35 , which illustrates in detail the implementation details of the Chinese input method of the embodiment of the present disclosure.
[0343] In step 3521, a second mapping relationship input interface is displayed to the target object, the second mapping relationship input interface having a plurality of rows; and a second mapping relationship inputted by the target object in each row of the second mapping relationship input interface is received.
[0344] In step 3522, a fourth mapping table of keys to position ranges is generated based on the second mapping relationship customized by the target object.
[0345] by Figure 4 Taking the 36-key keyboard defined by the target object shown as an example, the second mapping relationship between the key symbol and the input unit is: 0: {ao, ai}, 1: {an, ang}, 2: {en, eng}, 3: {in, i ng}, 4: {ie, ei}, 5: {ong, un}, 6: {ua, uai}, 7: {iu, ui}, 8: {uan, uang}, 9: {ian, iang}, az, c: {c, ch}, s: {s, sh}, z: {z, zh}, and the rest correspond to themselves. The fourth mapping table for generating keys to position ranges based on the second mapping relationship is shown in Table 11.
[0346] button Location Range 0 <![CDATA[(X111,Y111),(X112,Y112)]]> 1 <![CDATA[(X121,Y121),(X122,Y122)]]> …… …… z <![CDATA[(X491,Y491),(X492,Y492)]]>
[0347] Table 11
[0348] In step 3523, the second mapping relationship is reversed to obtain a third mapping relationship between the input unit and the key symbol. Still taking the above 36-key keyboard as an example, after the second mapping relationship is reversed, the third mapping relationship obtained is: ao:0, ai:0, an:1, ang:1, en:2, eng:2, ..., z:z, zh:z.
[0349] In step 3524, a third mapping table of a legal syllable table and initials and legal syllables is obtained; each input unit of the legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the third mapping relationship, so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable; each initial consonant in the third mapping table is replaced with a corresponding key symbol according to the third mapping relationship, and a first mapping relationship between the key symbol sequence and the legal syllable is obtained; the first mapping relationship constitutes a first mapping table. Taking the above 36-key keyboard as an example, the obtained first mapping table is shown in Table 12.
[0350] key sequence syllable 0 ao,ai 1 an,ang …… …… a a b ba,bao,bai,ban,bang…… b0 bao,bai …… …… z8 zuan,zuang
[0351] Table 12
[0352] In step 3511, in response to triggering multiple positions of the soft keyboard, multiple keys corresponding to the multiple trigger positions are determined based on the fourth mapping table. The fourth mapping table comes from step 3522. For example, by identifying the trigger position of the target object, it is determined that the trigger position of the target object falls on the key symbols 'b', '0', "s", and "i" in sequence.
[0353] In step 3512, the key symbols of the plurality of keys are integrated into a first key string. For example, the first key string is "b0si".
[0354] In step 3513, the first key string is divided into blocks based on the first mapping table. The first mapping table comes from step 3524. By searching the first mapping table, the first key string can be divided into two blocks, "b0" and "si". The candidate syllables corresponding to "b0" are "bao" and "bai", and the candidate syllables corresponding to "si" are "si" and "shi".
[0355] In step 3514, candidate words are determined based on the combination of at least one candidate syllable corresponding to each block. The candidate syllables of the blocks "b0" and "si" are combined to obtain multiple candidate syllable combinations, namely: "bao's i", "bao'shi", "bai's i", and "bai'sh i". The candidate words obtained based on the candidate syllable combinations include: "Baosi", "Bao Si", "Sudden death", "Gems", "Moisturizing", "Timekeeping", "Bail", "Bai Si", "Bai Shi", "Baisi", etc.
[0356] In step 3515, the display mode of the candidate words is determined, and the candidate words are displayed in the display mode for the target object to select. For example, "moisturizing" is displayed in bold, and the other words are displayed normally.
[0357] Description of the apparatus and device of the present disclosure
[0358] In each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to object characteristics such as object attribute information or attribute information sets, the permission or consent of the object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain object attribute information, the object's separate permission or separate consent will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the object's separate permission or separate consent, the necessary object-related data for the normal operation of the embodiment of the present application will be obtained.
[0359] Reference Fig.36 , Fig.36 The structure diagram of the Chinese input device 3600 provided in the embodiment of the present disclosure includes:
[0360] A generating unit 3610, configured to generate a first key string of the plurality of keys in response to triggering the plurality of keys on the soft keyboard predefined for the target object;
[0361] The block division unit 3620 is used to divide the first key symbol string into blocks based on the first mapping table, each block corresponds to at least one candidate syllable, wherein the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol and an input unit predefined by a target object, and the syllable includes one or more input units;
[0362] The determination unit 3630 is used to determine and display candidate words based on a combination of at least one candidate syllable corresponding to each block for selection by the target object.
[0363] Optionally, the first mapping table is generated in the following manner:
[0364] Obtain a second mapping table, where the second mapping table includes a second mapping relationship;
[0365] Get a table of legal syllables;
[0366] Each input unit of a legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship, so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable.
[0367] Optionally, each input unit of a legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship, including:
[0368] Reversing the second mapping relationship to obtain a third mapping relationship between the input unit and the key symbol;
[0369] For each input unit of a legal syllable in the legal syllable table, refer to the third mapping relationship, obtain the key symbol mapped to the input unit, and replace the input unit with the key symbol.
[0370] Optionally, after each input unit of a legal syllable in the legal syllable table is replaced with a key symbol corresponding to the input unit according to the second mapping relationship so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable, the generation process of the first mapping table further includes:
[0371] Obtaining a third mapping table, the third mapping table including a fourth mapping relationship between initial consonants and legal syllables;
[0372] Each initial consonant in the fourth mapping relationship is replaced with a key symbol corresponding to the initial consonant according to the second mapping relationship, so that the obtained key symbol sequence forms a first mapping relationship with the legal syllable in the fourth mapping relationship.
[0373] Optionally, obtaining the second mapping table includes:
[0374] Displaying a second mapping relationship input interface;
[0375] Receiving a second mapping relationship input in a second mapping relationship input interface;
[0376] The second mapping relationship is stored in the second mapping table.
[0377] Optionally, the generating unit 3610 is specifically configured to:
[0378] In response to triggering a plurality of trigger positions on the soft keyboard, determining a plurality of keys corresponding to the plurality of trigger positions based on a fourth mapping table, wherein the fourth mapping table includes a fifth mapping relationship between keys and position ranges;
[0379] The key symbols of multiple keys are integrated into a first key symbol string.
[0380] Optionally, the position range includes position coordinates of a first anchor point and a second anchor point, the position coordinates include a first coordinate and a second coordinate, the key is a square, and the first anchor point and the second anchor point are located at two opposite corners of the square;
[0381] The generating unit 3610 is specifically used for:
[0382] If the first coordinate of the trigger position is between the first coordinate of the first anchor point and the first coordinate of the second anchor point in the fifth mapping relationship, and the second coordinate of the trigger position is between the second coordinate of the first anchor point and the second coordinate of the second anchor point in the fifth mapping relationship, the key in the fifth mapping relationship is determined to be the key corresponding to the trigger position.
[0383] Optionally, the fourth mapping table is generated in the following manner:
[0384] Displaying a second mapping relationship input interface, where the second mapping relationship input interface has a plurality of rows;
[0385] Receiving second mapping relationships input in each row of the second mapping relationship input interface;
[0386] Based on the second mapping relationships input in each row, a fourth mapping table is determined.
[0387] Optionally, determining a fourth mapping table based on the second mapping relationship input in each row includes:
[0388] Determine the length and height of the key based on the number of second mapping relationships input in each row and the number of rows of the plurality of rows;
[0389] Based on the length and the height, determine the starting coordinates of each row, where the starting coordinates are the first coordinates and the second coordinates of the first anchor point of the first key of the row;
[0390] Determine the position range of each key of the row based on the starting coordinates, the number of second mapping relationships in the row, the length and the height;
[0391] The key symbols and position ranges in the second mapping relationship are mapped into a fifth mapping relationship to generate a fourth mapping table.
[0392] Optionally, determining the length and height of the key based on the number of second mapping relationships input in each row and the number of rows of the plurality of rows includes:
[0393] Determine the height of the keys based on the number of rows and the total height of the soft keyboard;
[0394] The length of the key is determined based on the maximum value of the number of second mapping relationships input in each row and the total length of the soft keyboard.
[0395] Optionally, the first coordinate is the horizontal coordinate, the second coordinate is the vertical coordinate, the first anchor point is the upper left corner point of the key, and the second anchor point is the lower right corner point of the key;
[0396] Based on the length and height, determine the starting coordinates of each row, including:
[0397] Take the upper left corner of the soft keyboard as the origin, the extension direction of the row as the positive direction of the horizontal axis, and the direction from small to large row numbers as the positive direction of the vertical axis to establish a plane rectangular coordinate system;
[0398] Determine the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row;
[0399] Based on the height and the row number of the row, determine the ordinate in the starting coordinates of the row.
[0400] Optionally, determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row, and the total length of the soft keyboard includes:
[0401] If the layout is centered, determine the length of the soft keyboard in the row based on the number and length of the second mapping relationships in the row;
[0402] Determine the remaining length of the soft keyboard in the row based on the total length and the occupied length of the soft keyboard in the row;
[0403] A half of the remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
[0404] Optionally, determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number and length of the second mapping relationships in the row, and the total length of the soft keyboard includes:
[0405] If the layout is right-aligned, determine the length of the soft keyboard in the row based on the number and length of the second mapping relationships in the row;
[0406] Determine the remaining length of the soft keyboard in the row based on the total length and the occupied length of the soft keyboard in the row;
[0407] The remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
[0408] Optionally, determining the position range of each key of the row based on the starting coordinates, the number, length, and height of the second mapping relationships in the row includes:
[0409] Determine the horizontal coordinate of the first anchor point of the key based on the horizontal coordinate in the starting coordinate, the serial number of the key in the row, and the length;
[0410] Determine the ordinate of each key of the row to be consistent with the ordinate in the starting coordinate;
[0411] Based on the abscissa and ordinate, length and height of the first anchor point of the key, the abscissa and ordinate of the second anchor point of the key are determined.
[0412] Optionally, determining the abscissa and ordinate of the second anchor point of the key based on the abscissa and ordinate, length, and height of the first anchor point of the key includes:
[0413] The sum of the abscissa of the first anchor point of the key and the length is determined as the abscissa of the second anchor point of the key;
[0414] The sum of the ordinate of the first anchor point of the key and the height is determined as the ordinate of the second anchor point of the key.
[0415] Optionally, the determining unit 3630 is specifically configured to:
[0416] Selecting a target candidate syllable from at least one candidate syllable corresponding to each block, and traversing the combination of target candidate syllables of each block;
[0417] For each combination, the fifth mapping table is searched to obtain the word corresponding to the combination as the determined candidate word, and the fifth mapping table indicates the sixth mapping relationship between the syllable combination and the word.
[0418] Reference Fig.37 , Fig.37 The structural block diagram of the terminal 140 for implementing the Chinese input method of the embodiment of the present disclosure includes: a radio frequency (RF) circuit 3710, a memory 3715, an input unit 3730, a display unit 3740, a sensor 3750, an audio circuit 3760, a wireless fidelity (WiFi) module 3770, a processor 3780, and a power supply 3790. Those skilled in the art can understand that Fig.37 The structure of the terminal 140 shown in the figure does not constitute a limitation on a mobile phone or a computer, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.
[0419] The RF circuit 3710 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 3780 for processing; in addition, the designed uplink data is sent to the base station.
[0420] The memory 3715 may be used to store software programs and modules. The processor 3780 executes various functional applications and data processing of the terminal by running the software programs and modules stored in the memory 3715 .
[0421] The input unit 3730 may be used to receive input digital or character information and generate key signal input related to the terminal's settings and function control. Specifically, the input unit 3730 may include a touch panel 3731 and other input devices 3732 .
[0422] The display unit 3740 may be used to display input information or provided information and various menus of the terminal. The display unit 3740 may include a display panel 3741.
[0423] The audio circuit 3760, the speaker 3761, and the microphone 3762 may provide an audio interface.
[0424] In this embodiment, the processor 3780 included in the terminal 140 can execute the Chinese input method of the previous embodiment.
[0425] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to input methods, intelligent input products, human-computer interaction processing, etc.
[0426] Fig.38 A block diagram of the structure of a portion of the server 110 for implementing the Chinese input method of the embodiment of the present disclosure. The server 110 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 3382 (for example, one or more processors) and memories 3832, and one or more storage media 3830 (for example, one or more mass storage devices) storing application programs 3842 or data 3844. Among them, the memories 3832 and the storage media 3830 may be temporary storage or permanent storage. The program stored in the storage medium 3830 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the server 3800. Furthermore, the central processing unit 3822 may be configured to communicate with the storage medium 3830 and execute a series of instruction operations in the storage medium 3830 on the server 3800.
[0427] The server 3800 may also include one or more power supplies 3826, one or more wired or wireless network interfaces 3850, one or more input and output interfaces 3858, and / or one or more operating systems 3841, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0428] The processor in the server 3800 can be used to execute the Chinese input method of the embodiment of the present disclosure.
[0429] The embodiments of the present disclosure further provide a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the Chinese input methods of the aforementioned embodiments.
[0430] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the above-mentioned Chinese input method.
[0431] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0432] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: 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.
[0433] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.
[0434] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0435] 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.
[0436] In addition, each functional unit in each embodiment of the present disclosure 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0437] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable 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 various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0438] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.
[0439] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.
Claims
1. A Chinese input method, characterized in that: include: In response to triggering a plurality of keys on a soft keyboard predefined for a target object, generating a first key string of the plurality of keys; Based on a first mapping table, the first key symbol string is divided into blocks, each of the blocks corresponds to at least one candidate syllable, wherein the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol predefined by the target object and an input unit, and the syllable includes one or more of the input units; Based on a combination of at least one candidate syllable corresponding to each of the blocks, a candidate word is determined and displayed for selection by the target object.
2. The Chinese input method according to claim 1, characterized in that: The first mapping table is generated in the following manner: Acquire a second mapping table, where the second mapping table includes the second mapping relationship; Obtaining the legal syllable table; The input units of the legal syllables in the legal syllable table are replaced with key symbols corresponding to the input units according to the second mapping relationship, so that the obtained key symbol sequence forms the first mapping relationship with the legal syllables.
3. The Chinese input method according to claim 2, characterized in that: The step of replacing each input unit of a legal syllable in the legal syllable table with a key symbol corresponding to the input unit according to the second mapping relationship includes: Reversing the second mapping relationship to obtain a third mapping relationship between the input unit and the key symbol; For each input unit of a legal syllable in the legal syllable table, refer to the third mapping relationship, obtain the key symbol to which the input unit is mapped, and replace the input unit with the key symbol.
4. The Chinese input method according to claim 2, characterized in that: After replacing each input unit of the legal syllable in the legal syllable table with a key symbol corresponding to the input unit according to the second mapping relationship so that the obtained key symbol sequence forms the first mapping relationship with the legal syllable, the generation process of the first mapping table further includes: Obtaining a third mapping table, wherein the third mapping table includes a fourth mapping relationship between initial consonants and legal syllables; Each of the initial consonants in the fourth mapping relationship is replaced with a key symbol corresponding to the initial consonant according to the second mapping relationship, so that the obtained key symbol sequence and the legal syllable in the fourth mapping relationship form the first mapping relationship.
5. The Chinese input method according to claim 2, characterized in that: The obtaining of the second mapping table comprises: Displaying a second mapping relationship input interface; receiving the second mapping relationship input in the second mapping relationship input interface; The second mapping relationship is stored in the second mapping table.
6. The Chinese input method according to claim 1, characterized in that: The step of generating a first key string of a plurality of keys in response to triggering a plurality of keys on a predefined soft keyboard of the target object comprises: In response to triggering a plurality of trigger positions on the soft keyboard, determining a plurality of keys corresponding to the plurality of trigger positions based on a fourth mapping table, wherein the fourth mapping table includes a fifth mapping relationship between keys and position ranges; The key symbols of the plurality of keys are integrated into the first key symbol string.
7. The Chinese input method according to claim 6, characterized in that: The position range includes position coordinates of a first anchor point and a second anchor point, the position coordinates include a first coordinate and a second coordinate, the key is a square, and the first anchor point and the second anchor point are located at two opposite corners of the square; The step of determining the plurality of buttons corresponding to the plurality of trigger positions based on the fourth mapping table includes: If the first coordinate of the trigger position is between the first coordinate of the first anchor point and the first coordinate of the second anchor point in the fifth mapping relationship, and the second coordinate of the trigger position is between the second coordinate of the first anchor point and the second coordinate of the second anchor point in the fifth mapping relationship, the key in the fifth mapping relationship is determined to be the key corresponding to the trigger position.
8. The Chinese input method according to claim 7, characterized in that: The fourth mapping table is generated in the following manner: Displaying a second mapping relationship input interface, where the second mapping relationship input interface has a plurality of rows; receiving the second mapping relationships input in each of the rows in the second mapping relationship input interface; The fourth mapping table is determined based on the second mapping relationships input in each of the rows.
9. The Chinese input method according to claim 8, characterized in that: The determining the fourth mapping table based on the second mapping relationships input in each of the rows includes: Determining the length and height of the key based on the number of the second mapping relationships input in each of the rows and the number of the rows; Based on the length and the height, determine the starting coordinates of each of the rows, the starting coordinates being the first coordinates and the second coordinates of the first anchor point of the first key of the row; Determine the position range of each of the keys in the row based on the starting coordinates, the number of the second mapping relationships in the row, the length, and the height; The key symbol and the position range in the second mapping relationship are mapped into the fifth mapping relationship to generate the fourth mapping table.
10. The Chinese input method according to claim 9, characterized in that: The determining the length and height of the key based on the number of the second mapping relationships input in each of the rows and the number of the rows comprises: Determining the height of the key based on the number of rows and the total height of the soft keyboard; The length of the key is determined based on a maximum value of the number of the second mapping relationships input in each of the rows and a total length of the soft keyboard.
11. The Chinese input method according to claim 9, characterized in that: The first coordinate is a horizontal coordinate, the second coordinate is a vertical coordinate, the first anchor point is an upper left corner point of the key, and the second anchor point is a lower right corner point of the key; The step of determining the starting coordinates of each of the rows based on the length and the height includes: A plane rectangular coordinate system is established with the upper left corner of the soft keyboard as the origin, the extension direction of the row as the positive direction of the horizontal axis, and the direction from small to large row numbers as the positive direction of the vertical axis; Determine the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, the length, and the total length of the soft keyboard; Based on the height and the row number of the row, the ordinate in the start coordinates of the row is determined.
12. The Chinese input method according to claim 11, characterized in that: The determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, the length, and the total length of the soft keyboard includes: If the layout is centered, determining the length occupied by the soft keyboard in the row based on the number of the second mapping relationships in the row and the length; Determine the remaining length of the soft keyboards in the row based on the total length and the occupied length of the soft keyboards in the row; A half of the remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
13. The Chinese input method according to claim 11, characterized in that: The determining the horizontal coordinate in the starting coordinate of the row based on the layout of the soft keyboard, the number of the second mapping relationships in the row, the length, and the total length of the soft keyboard includes: If the format is right-aligned, determining the length occupied by the soft keyboard in the row based on the number of the second mapping relationships in the row and the length; Determine the remaining length of the soft keyboards in the row based on the total length and the occupied length of the soft keyboards in the row; The remaining length of the soft keyboard is determined as the horizontal coordinate in the starting coordinate.
14. The Chinese input method according to claim 9, characterized in that: The first coordinate is a horizontal coordinate, and the second coordinate is a vertical coordinate; The determining the position range of each of the keys in the row based on the starting coordinate, the number of the second mapping relationships in the row, the length, and the height includes: Determine the horizontal coordinate of the first anchor point of the key based on the horizontal coordinate in the starting coordinate, the sequence number of the key in the row, and the length; Determine the ordinate of the first anchor point of each of the keys in the row to be consistent with the ordinate in the starting coordinate; Based on the abscissa and the ordinate of the first anchor point of the key, the length and the height, the abscissa and the ordinate of the second anchor point of the key are determined.
15. The Chinese input method according to claim 14, characterized in that: The determining the abscissa and the ordinate of the second anchor point of the key based on the abscissa and the ordinate, the length, and the height of the first anchor point of the key comprises: Determine the sum of the abscissa of the first anchor point of the key and the length as the abscissa of the second anchor point of the key; The sum of the ordinate of the first anchor point of the key and the height is determined as the ordinate of the second anchor point of the key.
16. The Chinese input method according to claim 1, characterized in that: The determining and displaying the candidate word based on the combination of at least one candidate syllable corresponding to each of the blocks comprises: Selecting a target candidate syllable from at least one candidate syllable corresponding to each of the blocks, and traversing the combinations of the target candidate syllables of each block; For each of the combinations, a fifth mapping table is searched to obtain a word corresponding to the combination as the determined candidate word, wherein the fifth mapping table indicates a sixth mapping relationship between syllable combinations and words.
17. A Chinese input device, characterized in that: include: A generating unit, configured to generate a first key string of a plurality of keys in response to triggering a plurality of keys on a soft keyboard predefined for a target object; A chunking unit, configured to chunk the first key symbol string based on a first mapping table, each chunk corresponding to at least one candidate syllable, wherein the first mapping table includes a first mapping relationship between a key symbol sequence and a syllable, the first mapping relationship between the key symbol sequence and the syllable is determined based on a legal syllable table and a second mapping relationship between a key symbol predefined by the target object and an input unit, and the syllable includes one or more of the input units; A determination unit is used to determine and display candidate words based on a combination of at least one candidate syllable corresponding to each of the blocks for selection by the target object.
18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the Chinese input method according to any one of claims 1 to 16 is implemented.
19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the Chinese input method according to any one of claims 1 to 16 is implemented.
20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the Chinese input method according to any one of claims 1 to 16.