Method for acquiring user word library, method and device for generating candidate words

By constructing a multilingual user vocabulary in the input method, the problem of frequent switching of keyboard and structure during multilingual input in the prior art is solved, and a more efficient and convenient input experience is achieved.

CN114296561BActive Publication Date: 2025-03-11IFLYTEK CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111667762.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-03-11
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

When handling multilingual user vocabulary, existing input methods require frequent switching of keyboards and structures, resulting in cumbersome operation and performance losses.

Method used

By obtaining the user's first language and second language information, the input characters are stored in the pre-constructed primary data structure and secondary data structure respectively. The structure is the same, and the node information includes characters and pronunciation, thereby building a multilingual user vocabulary.

Benefits of technology

It realizes user vocabulary without switching multiple structures between different languages, reduces performance losses, simplifies user operations, and improves input efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114296561B_ABST
    Figure CN114296561B_ABST
Patent Text Reader

Abstract

The present application provides a method for acquiring a user word library, a method for generating candidate words and a device, the method comprising: acquiring the user's first language information and second language information, the first language information being determined according to the user's current keyboard information; receiving the user's input characters; storing the characters of the first language in the input characters into a pre-constructed main data structure, storing the characters of the second language in the input characters into a pre-constructed secondary data structure, the main data structure and the secondary data structure having the same structure, the node information of each node in the main data structure including at least one character of the first language and one pronunciation of the character of the first language, the node information of each node in the secondary data structure including at least one character of the second language and one pronunciation of the character of the second language; obtaining the user's user word library according to the main data structure and the secondary data structure. Thus, the performance loss is reduced, and the user operation is simple and convenient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method for acquiring a user vocabulary, and a method and device for generating candidate words. Background Art

[0002] In order to make it convenient and quick for users to use input methods, current input methods generally have the function of building a user vocabulary. The user vocabulary refers to a collection of words that users have input using the input method. The user vocabulary includes entries that users frequently use. As the connection between countries becomes closer and closer, more and more people master multiple languages. When users use input methods, user vocabulary in different languages ​​will inevitably be generated. How to build user vocabulary in different languages ​​so that users can input more efficiently and quickly between different languages ​​is particularly important.

[0003] In the existing user vocabulary construction method, a user vocabulary is constructed for each language, and user vocabulary with different structures are constructed for different languages. When storing mixed user words in different languages, the mixed user words of two languages ​​are placed in a user vocabulary with one structure, or the construction of mixed user words is not supported.

[0004] However, in the above method, on the one hand, users are required to frequently switch keyboards to complete input in different languages, which is cumbersome; on the other hand, each time a new language is added, a new structure needs to be adapted. When users switch between different languages, they need to switch back and forth between user vocabularies with multiple structures, resulting in high performance loss. Summary of the invention

[0005] The present application provides a method for acquiring a user vocabulary, a method and a device for generating candidate words, so as to reduce the performance loss when acquiring the user vocabulary and reduce the tediousness of user operations.

[0006] In a first aspect, the present application provides a method for acquiring a user vocabulary, comprising:

[0007] Acquire a user's first language information and a second language information, where the first language information is determined according to the user's current keyboard information;

[0008] Receiving input characters from the user;

[0009] The characters of the first language in the input characters are stored in a pre-constructed primary data structure, and the characters of the second language in the input characters are stored in a pre-constructed secondary data structure, wherein the primary data structure and the secondary data structure have the same structure, the node information of each node in the primary data structure includes at least one character of the first language and the pronunciation of the character of the first language, and the node information of each node in the secondary data structure includes at least one character of the second language and the pronunciation of the character of the second language;

[0010] A user vocabulary is obtained according to the main data structure and the secondary data structure.

[0011] In a second aspect, the present application provides a method for generating candidate words, comprising:

[0012] Receive the string input by the user;

[0013] Determining the keyboard input language used by the user when inputting the character string as the first language of the user;

[0014] Determine a target user vocabulary matching the first language from a pre-stored candidate user vocabulary, wherein the target user vocabulary includes a user vocabulary of the first language and a user vocabulary of a second language;

[0015] Searching for candidate words from the target user vocabulary according to the character string input by the user;

[0016] The candidate user vocabulary is obtained according to the method for obtaining the user vocabulary described in the first aspect.

[0017] In a third aspect, the present application provides a device for acquiring a user vocabulary, comprising:

[0018] An acquisition module, used to acquire a user's first language information and a second language information, wherein the first language information is determined according to the user's current keyboard information;

[0019] A receiving module, used for receiving input characters of the user;

[0020] A construction module, used for storing characters of a first language in the input characters into a pre-constructed primary data structure, and storing characters of a second language in the input characters into a pre-constructed secondary data structure, wherein the primary data structure is identical to the secondary data structure, the node information of each node in the primary data structure includes at least one character of the first language and a pronunciation of the character of the first language, and the node information of each node in the secondary data structure includes at least one character of the second language and a pronunciation of the character of the second language;

[0021] A storage module, used for storing the data in the primary data structure and the data in the secondary data structure in the form of binary text;

[0022] The acquisition module is further used to obtain a user vocabulary according to the primary data structure and the secondary data structure, wherein the user vocabulary includes the first language user vocabulary and the second language user vocabulary.

[0023] In a fourth aspect, the present application provides a candidate word generation device, comprising:

[0024] A receiving module, used for receiving a character string input by a user;

[0025] A first determining module, configured to determine the keyboard input language used when the user inputs the character string as the first language of the user;

[0026] A second determination module, configured to determine a target user vocabulary matching the first language from a pre-stored candidate user vocabulary, wherein the target user vocabulary includes a user vocabulary of the first language and a user vocabulary of a second language;

[0027] A search module, used to search for candidate words from the target user vocabulary according to the character string input by the user;

[0028] The candidate user vocabulary is obtained according to the method for obtaining the user vocabulary described in the first aspect.

[0029] In a fifth aspect, the present application provides a device, comprising: a processor and a memory, the memory being used to store a computer program, the processor being used to call and run the computer program stored in the memory to execute the method of the first aspect or the second aspect.

[0030] In a sixth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program enables a computer to execute the method of the first aspect or the second aspect.

[0031] In a seventh aspect, the present application provides a computer program product, comprising a computer program, wherein the computer program implements the method of the first aspect or the second aspect when executed by a processor.

[0032] In summary, in the present application, by first obtaining the user's first language information and second language information, the first language information is the main language information, and after receiving the user's input characters, the characters of the first language in the input characters are stored in a pre-constructed main data structure, and the characters of the second language in the input characters are stored in a pre-constructed secondary data structure, wherein the main data structure is the same as the structure of the secondary data structure, and a user vocabulary is obtained according to the main data structure and the secondary data structure, and the user vocabulary includes a first language user vocabulary and a second language user vocabulary, wherein each node in the main data structure and the secondary data structure stores a character and the pronunciation of the character. Thus, a data structure can be used to construct user vocabulary of multiple different languages, and there is no need to use different structures according to different languages. When the user switches between different languages, there is no need to switch back and forth between user vocabulary of multiple structures, which reduces performance loss. Moreover, when generating candidate words based on the user input character string and the user vocabulary constructed through the multilingual user vocabulary constructed through the embodiment of the present application, only the main language keyboard can be used for input according to the main language and the second language set by the user, and separate main language user words, second language user words or mixed words of the main language and the second language can be decoded. The user does not need to frequently switch keyboards to complete the input of different languages. The user operation is simple and convenient, which improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 A flowchart of a method for acquiring a user vocabulary provided in an embodiment of the present application;

[0035] Figure 2 A schematic diagram of node information of a node provided in an embodiment of the present application;

[0036] Figure 3 A schematic diagram of a main structure tree constructed when the first language is Chinese provided in an embodiment of the present application;

[0037] Figure 4 A schematic diagram of a flow chart of a method for generating candidate words provided in an embodiment of the present application;

[0038] Figure 5 A schematic diagram of a main structure tree constructed when the first language is Chinese provided in an embodiment of the present application;

[0039] Figure 6A schematic diagram of a substructure tree constructed when the second language is English provided in an embodiment of the present application;

[0040] Figure 7 A schematic diagram of displaying candidate words provided in an embodiment of the present application;

[0041] Figure 8 Another schematic diagram of displaying candidate words provided in an embodiment of the present application;

[0042] Fig. 9 Another schematic diagram of displaying candidate words provided in an embodiment of the present application;

[0043] Fig.10 A schematic diagram of the structure of a device for acquiring a user vocabulary provided in an embodiment of the present application;

[0044] Fig.11 A schematic diagram of the structure of a candidate word generation device provided in an embodiment of the present application;

[0045] Fig.12 It is a schematic block diagram of the device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention 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 invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.

[0048] In the user vocabulary construction method of the related art, a user vocabulary is constructed for each language, and user vocabulary with different structures are constructed for different languages. When storing mixed user words in different languages, the mixed user words in two languages ​​(for example, a mixture of Chinese and English) are placed in a user vocabulary with one structure. On the one hand, the user needs to frequently switch the keyboard to complete the input of different languages, which is cumbersome; on the other hand, each time a new language is added, a new structure needs to be adapted. When the user switches between different languages, it is necessary to switch back and forth between user vocabulary with multiple structures, resulting in a high performance loss. In order to solve this technical problem, the present application first obtains the user's first language and second language, with the first language being the main language. After receiving the user's input characters, the characters of the first language in the input characters are stored in a pre-constructed main data structure, and the characters of the second language in the input characters are stored in a pre-constructed secondary data structure, wherein the main data structure is the same as the structure of the secondary data structure. According to the main data structure and the secondary data structure, a user vocabulary is obtained, and the user vocabulary includes a user vocabulary of the first language and a user vocabulary of the second language, wherein each node in the main data structure and the secondary data structure stores a character and the pronunciation of the character. Thus, a data structure can be used to construct user vocabulary of multiple different languages, without the need to use different structures for different languages. When the user switches between different languages, there is no need to switch back and forth between user vocabulary of multiple structures, which reduces performance loss. Moreover, when generating candidate words based on the user input character string and the user vocabulary constructed through the multilingual user vocabulary constructed through the embodiment of the present application, only the main language keyboard can be used for input according to the main language and the second language set by the user, and separate main language user words, second language user words or mixed words of the main language and the second language can be decoded. The user does not need to frequently switch keyboards to complete the input of different languages. The user operation is simple and convenient, which improves the user experience.

[0049] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0050] The method for acquiring a user vocabulary and the method for generating candidate words provided in the embodiments of the present application can be applied to input software, such as keyboard input software, voice input software, handwriting input software, etc., and can also be applied to devices related to input methods, but the embodiments of the present application are not limited thereto.

[0051] Figure 1 The flowchart of a method for acquiring a user vocabulary provided in an embodiment of the present application, the method can be executed by a user vocabulary acquisition device, and the user vocabulary acquisition device can be implemented in software and / or hardware. Figure 2As shown, the method may include the following steps:

[0052] S101. Obtain the first language information and the second language information of the user, where the first language information is determined according to the user's current keyboard information.

[0053] Specifically, when using an input method, the user can switch between different languages by switching the keyboard. For example, the user can switch between Chinese and English. When switched to Chinese, it is for Chinese input, and when switched to English, it is for English input. The user's current keyboard information is the language information input by the user on the current keyboard. For example, if the language input by the user on the current keyboard is Chinese, the first language information can be determined as Chinese information. According to the first language information, the first language can be determined, and according to the second language information, the second language can be determined. The first language is the user's main language, and the second language can be the language selected by the user. For example, when the user selects to enable the multi-language user vocabulary building function, the user is prompted to select the second language. It can be understood that the second language can be one or more. In this embodiment, the construction of a user vocabulary for two languages is taken as an example. When it is necessary to obtain user vocabularies for multiple languages, the obtaining process is similar.

[0054] S102. Receive the input characters of the user.

[0055] Specifically, the input characters of the user are the characters input by the user through input software, which can be input through the keyboard, voice input, handwriting input, etc.

[0056] S103. Store the characters in the first language in the input characters into a pre-constructed main data structure, and store the characters in the second language in the input characters into a pre-constructed secondary data structure. The main data structure and the secondary data structure have the same structure. The node information of each node in the main data structure includes at least one character in the first language and the pronunciation of a character in the first language. The node information of each node in the secondary data structure includes at least one character in the second language and the pronunciation of a character in the second language.

[0057] Specifically, the input characters of the user may include at least one of the characters in the first language and the characters in the second language. Taking the input characters of the user including the characters in the first language and the characters in the second language as an example, when the input characters of the user are, for example, the Chinese-English mixed word "T恤" (T-shirt), the first language is Chinese and the second language is English. When the input characters of the user are, for example, the Japanese-English mixed word "元気girl" (energetic girl), the first language is Japanese and the second language is English.

[0058] In the embodiments of the present application, a character of a language is defined as the smallest unit of formal writing of that language. For example, the Chinese character "俩", the Japanese character "な", the English character "n", and the Korean character All of the above are single characters. At the same time, in the embodiments of the present application, through a pronunciation, a character can definitely be determined, but through a character, its pronunciation cannot be determined because a character may have multiple pronunciations. For example, the Chinese character "俩" corresponds to two pinyin pronunciations "liǎ" and "liǎng". It should be noted here that Chinese characters can also correspond to stroke pronunciations, that is, Chinese characters are obtained through stroke input, so the way to determine a character is not unique.

[0059] According to the above definition of characters, all languages can be divided into two categories. The first category of languages is that one character corresponds to one pronunciation, such as English, Korean, Hindi, etc. The second category of languages is that one character corresponds to multiple pronunciations, such as Chinese and Japanese, etc. In the embodiments of the present application, the determination of the correspondence relationship between pronunciation and character is the basis for constructing user word libraries of different languages using a data structure in this embodiment.

[0060] In the embodiments of the present application, the pronunciation can be directly input through input settings. For example, for the Chinese character "你", it can be input by pinyin "ni", or by Wubi input "wqiy". Both pinyin input and Wubi input can be regarded as the pronunciation of the Chinese character "你" macroscopically. Another example is the Korean character which can be input through the keyboard At this time it can be regarded as the pronunciation of the Korean character macroscopically.

[0061] In the embodiments of the present application, optionally, both the main data structure and the secondary data structure can be a combined structure of a structure tree and an array structure or a combined structure of a finite state transducer and an array structure.

[0062] In the embodiments of the present application, if the main data structure is a combined structure of a main structure tree and an array structure, and the secondary data structure is a combined structure of a secondary structure tree and an array structure, the main structure tree and the secondary structure tree can be, for example, prefix trees, or other types of structure trees. The node information of each node can also include at least one of node attributes, the child nodes of the node, and the sibling nodes of the node. The node attributes include indication information for indicating whether the node is a leaf node. The sibling nodes of the node are nodes with the same pronunciation as the node but different node attributes. The character corresponding to the leaf node is the ending character of a lemma, and the node information of the leaf node also includes the identifier of the lemma, and this lemma ends with the character corresponding to the leaf node.

[0063] Exemplarily, Figure 2 is a schematic diagram of the node information of a node provided by the embodiments of the present application, as Figure 2As shown, the node information of a node may include the pronunciation of the character corresponding to the node, node attributes, child nodes, and sibling nodes. For pronunciation, the Chinese character "好" corresponds to the pinyin pronunciation "hao", and the English letter "g" corresponds to the pronunciation "g". Node attributes include indication information for indicating whether the node is a leaf node, and may also include indication information for indicating whether the character is a polyphonic character. The sibling node of a node is a node with the same pronunciation as the node but different node attributes. The character corresponding to the leaf node is the ending character of a lemma, and the node information of the leaf node further includes the identifier of the lemma, and the lemma ends with the character corresponding to the leaf node.

[0064] In an implementable manner, the main structure tree includes a root node and multiple nodes under the root node. Storing the characters in the first language in the input characters into the pre-constructed main data structure in S103 may specifically include:

[0065] S1031. For each first target character in the characters in the first language, if it is determined that the first target character does not exist in the main data structure, a node corresponding to the first target character is added under the root node, and the node information of the node corresponding to the first target character is stored.

[0066] The input characters may be characters input by the user through the keyboard, or may be characters imported through the import module of the terminal device. The input characters may be one character or multiple characters.

[0067] S1032. If it is determined that the first target character already exists in the main data structure and the node where the first target character is located is not a leaf node, the first second target character after the first target character in the characters in the first language is obtained.

[0068] S1033. If it is determined that the second target character does not exist in the main data structure, a node corresponding to the second target character is added under the node where the first target character is located. If the first target character and the second target character form a lemma, an identifier is assigned to the lemma, and the node information corresponding to the first target character is updated and the node information corresponding to the second target character is stored, and the identifier of the lemma and the attribute information of the lemma are stored in the array structure.

[0069] S1034. If it is determined that the first target character already exists in the main data structure and the node where the first target character is located is a leaf node, the attribute information of the lemma ending with the first target character is updated in the array structure.

[0070] Among them, the attribute information of the lemma may include at least one of the input time, input times, and input method of the lemma.

[0071] The input method can be pinyin input (including full pinyin input and abbreviated pinyin input), voice input, handwriting input, etc.

[0072] Figure 3 The figure is a schematic diagram of a main structure tree constructed when the first language is Chinese provided by an embodiment of the present application. As Figure 3 shown, in the array structure of the main structure tree, the attribute information of 3 entries is stored, and the entry identifiers are 0, 1, and 2 respectively. The node where "hao" in the entry "ni hao" is located is a leaf node, and the node where "zhe" in the entry "wo zai zhe" is located is a leaf node.

[0073] S104. Obtain a user word library according to the main data structure and the secondary data structure.

[0074] Optionally, when the main data structure is the main structure tree and the secondary data structure is the secondary structure tree, in S104, obtaining the user word library according to the main data structure and the secondary data structure may specifically include:

[0075] S1041. According to the main data structure, obtain the node composition information of each first entry included in the main structure tree of the main data structure. The node composition information includes all nodes that make up the first entry and the characters and pronunciations of each node among all nodes.

[0076] Specifically, taking the Figure 3 main structure tree shown as an example, for example, the node composition information of the entry "ni hao" includes the characters and pronunciations of each node among all nodes that make up this entry (that is, the two nodes corresponding to "ni" and the node corresponding to "hao"), that is, it includes: "ni" (ni) and "hao" (hao).

[0077] S1042. According to the array structure of the main data structure and the node composition information of each first entry included in the main structure tree, obtain the user word library of the first language.

[0078] Among them, the array structure of the main data structure stores the first entry identifier and the attribute information of the first entry. The user word library of the first language may include the array structure of the main data structure and the node composition information of each first entry. The tree structure of the main structure tree does not need to be stored in the user word library of the first language, which can save storage space.

[0079] S1043. According to the secondary data structure, obtain the node composition information of each second entry included in the secondary structure tree of the secondary structure tree.

[0080] S1044. According to the array structure of the secondary data structure and the node composition information of each second entry included in the secondary structure tree, obtain the user word library of the second language.

[0081] Similarly, the array structure of the secondary data structure stores the second term identifier and the attribute information of the second term. The user vocabulary of the second language may include the array structure of the secondary data structure and the node composition information of each second term. The user vocabulary of the second language does not need to store the tree structure of the secondary structure tree, which can save storage space.

[0082] When storing user lexicons, user lexicons in different languages ​​can be stored in different files.

[0083] The method for obtaining a user vocabulary provided in this embodiment first obtains the user's first language information and second language information, wherein the first language information is the main language information, and after receiving the user's input characters, the characters of the first language in the input characters are stored in a pre-constructed main data structure, and the characters of the second language in the input characters are stored in a pre-constructed secondary data structure, wherein the main data structure is the same as the structure of the secondary data structure, and a user vocabulary is obtained according to the main data structure and the secondary data structure, wherein the user vocabulary includes a first language user vocabulary and a second language user vocabulary, wherein each node in the main data structure and the secondary data structure stores a character and the pronunciation of the character. Thus, a data structure can be used to construct user vocabulary of multiple different languages, without the need to use different structures for construction according to different languages. When a user switches between different languages, there is no need to switch back and forth between user vocabulary of multiple structures, thereby reducing performance loss. Moreover, when generating candidate words based on the user input character string and the user vocabulary constructed through the multilingual user vocabulary constructed through the embodiment of the present application, only the main language keyboard can be used for input according to the main language and the second language set by the user, and separate main language user words, second language user words or mixed words of the main language and the second language can be decoded. The user does not need to frequently switch keyboards to complete the input of different languages. The user operation is simple and convenient, which improves the user experience.

[0084] Figure 1-Figure 3 The embodiment shown in the figure illustrates the acquisition of a multilingual user vocabulary. Figure 4 The use of the multilingual user word library is explained in detail. When a user uses the input method to input characters, candidate words can be generated according to the constructed multilingual user word library, so that the user can input characters efficiently and quickly.

[0085] Figure 4 The present invention provides a flowchart of a method for generating candidate words, which can be performed by a device for generating candidate words. The device for generating candidate words can be implemented in software and / or hardware. Figure 4 As shown, the method may include the following steps:

[0086] S201: Receive a character string input by a user.

[0087] Specifically, the character string input by the user may include one or more characters, and the method in which the user inputs the character string is not limited, such as pinyin input or Wubi input, etc.

[0088] S202: Determine the keyboard input language used by the user to input a character string as the user's first language.

[0089] Specifically, for example, if the user switches to Chinese input and inputs a character string, and the keyboard input language used by the user when inputting the character string is Chinese, then Chinese is the user's first language.

[0090] S203: Determine a target user vocabulary matching the first language from the pre-stored candidate user vocabulary, where the target user vocabulary includes a first language user vocabulary and a second language user vocabulary.

[0091] Among them, the candidate user vocabulary is based on Figure 1 The method for acquiring the user vocabulary shown is obtained.

[0092] The candidate user vocabulary includes user vocabulary of different first and second languages. For example, there are 3 candidate user vocabulary. The first language of the first candidate user vocabulary is Chinese and the second language is English. The first language of the second candidate user vocabulary is Chinese and the second language is Japanese. The first language of the third candidate user vocabulary is English and the second language is Chinese. When constructing the user vocabulary, the second language corresponding to the first language is selected by the user. After the first language is determined, the target user vocabulary can be matched from multiple candidate user vocabulary.

[0093] S204: Search for candidate words from the target user vocabulary according to the character string input by the user.

[0094] Specifically, in an implementable manner, S204 may include:

[0095] S2041: If the character string input by the user includes characters in the first language, search for candidate words from the first language user word library in the target user word library according to the character string input by the user.

[0096] Optionally, searching for candidate words from the first language user vocabulary in the target user vocabulary according to the character string input by the user may specifically include:

[0097] A main data structure is determined according to a user vocabulary of a first language, all nodes under a root node in a main structure tree of the main data structure are obtained, character pronunciations of all nodes under the root node in the main structure tree are matched with the pronunciation of a first character in a string, a first candidate node set matching the pronunciation of the first character in the string is determined, character pronunciations of all first candidate nodes in the first candidate node set are matched with the pronunciation of a second character in the string, a second candidate node set matching the pronunciation of the second character in the string is determined, character pronunciations of all child nodes of each second candidate node in the second candidate node set are matched with the pronunciation of a third character in the string, a third candidate node set matching the pronunciation of the third character in the string is determined, character pronunciation matching is continued according to the third candidate node set and characters after the third character in the string until a node matching the pronunciation of the last character in the string is determined, and candidate words are obtained according to the node characters matching the pronunciation of each character in the string.

[0098] by Figure 3 Take the main structure tree shown in the figure as an example to explain the generation process of candidate words in detail. Figure 3 , assuming that the user inputs "nihao" step by step, when the user inputs "n" in the first step, first obtain all nodes under the root node in the main structure tree (that is, the child nodes of the root node), obtain the pronunciation of all child nodes of the root node, and compare them with the user input. Figure 3 As shown, the user's word tree includes three entries of "hello", "scratch", and "I'm here", and the pronunciation of the first word is "ni", "nao", and "wo", and "n" partially matches "ni" and "nao", and the "you" and "scratch" nodes are put into the stack (any structure is all right, and stack storage is used in the present embodiment) cache. When the user inputs "i" in the second step, the node in the cache stack last time is expanded, and the matching node "you" is found, and because the "scratch" node does not match, the "scratch" node is deleted from the stack. When the user inputs "h" in the third step, the node according to the cache of the previous step is expanded, because the node "you" has been expanded, all the child nodes of the "you" node are found to match, because the pronunciation "hao" of the child node "good" matches the input "h" in the third step, so the node "good" is put into the stack cache. When the user inputs "a" in the fourth step, the node expansion by the cache of the previous step, namely, the "you" node continues to be expanded. When the user enters "o" in the fifth step, the expansion of the "good" node is completed by expanding the cached node in the previous step. At this time, it has expanded to the end node of the user's word, indicating that there is a term that completely matches the user input, and this term is the candidate word.

[0099] S2042: If the character string input by the user includes characters in the second language, search for candidate words from the second language user word library in the target user word library according to the character string input by the user.

[0100] Specifically, the process of searching for candidate words from the second language user vocabulary in the target user vocabulary according to the character string input by the user is similar to the process of searching for candidate words from the first language user vocabulary in the target user vocabulary, and will not be repeated here.

[0101] S2043: If the character string input by the user includes characters in the first language and characters in the second language, search for candidate words from the first language user word library and the second language user word library according to the character string input by the user.

[0102] Optionally, searching for candidate words from the first language user vocabulary and the second language user vocabulary according to the character string input by the user may specifically include:

[0103] A primary data structure is determined according to the first language user vocabulary, and a secondary data structure is determined according to the second language user vocabulary, all nodes under the root node in the primary structure tree of the primary data structure are obtained, and the character pronunciations of all nodes under the root node in the primary structure tree are matched with the pronunciation of the first character in the string to determine a first candidate node set that matches the pronunciation of the first character in the string, all nodes under the root node in the secondary structure tree of the secondary data structure are obtained, and the character pronunciations of all nodes under the root node in the secondary structure tree are matched with the pronunciation of the first character in the string to determine a second candidate node set that matches the pronunciation of the first character in the string, and if the second candidate node set is empty, the first candidate node set is replaced by the secondary structure tree. The character pronunciations of all first candidate nodes in the point set are matched with the pronunciation of the second character in the string to match a third candidate node set. If the third candidate node set includes nodes whose node attributes are mixed words, the character pronunciations of all child nodes of the root node in the secondary structure tree are matched with the pronunciation of the third character in the string to determine a fourth candidate node set that matches the pronunciation of the third character in the string. Character pronunciation matching continues based on the fourth candidate node set and the characters after the third character in the string until a node that matches the pronunciation of the last character in the string is determined. Candidate words are obtained based on the node characters that match the pronunciation of each character in the string.

[0104] by Figure 5 The main structure tree shown and Figure 6 Taking the substructure tree shown in the figure as an example, the generation process of candidate words for Chinese-English mixed words is described in detail. Figure 5 A schematic diagram of a main structure tree constructed when the first language is Chinese provided in an embodiment of the present application, Figure 6Schematic diagram of a sub-structure tree constructed when the second language is English provided by an embodiment of the present application. As Figure 5 and Figure 6 shown, the entries are "da call" and "T恤" (it seems there is an error here as "T恤" is in Chinese and not relevant to the English description context. Assuming the correct entry is something else). Suppose the user inputs "dacall" step by step. When the user inputs "d" in the first step, all the nodes under the root node of the main structure tree (i.e., the children nodes of the root node) are obtained first, and the pronunciations of all the children nodes are retrieved and matched with the user input. Since "d" matches part of the pronunciation "da" of the node "打" (it should be noted that "打" is in Chinese and might need to be adjusted according to the correct English context), the node "打" is put into the stack for temporary storage. Then, all the children nodes of the root node of the sub-structure tree are obtained, and their pronunciations are retrieved and matched with the user input. There is no matching character, so the matching fails. When the user inputs "a" in the second step, the node temporarily stored in the stack from the previous step is expanded and fully matches the "打" node. Since the "打" node is extracted from the entry "da call", it has the attribute of a mixed-word node. When the user inputs "c" in the third step, the node temporarily stored in the stack from the previous step is expanded. Because the "打" node has the mixed-word attribute, an expansion is made from the main structure tree to the sub-structure tree, and the matching node "c" is obtained and the "c" node is stored in the stack. When the user inputs "a" in the fourth step, the node temporarily stored from the previous step is expanded, and the "a" node is obtained and put into the stack. The fifth and sixth steps are the same, and finally, the entry "da call" is obtained.

[0105] Furthermore, the method of this embodiment may further include: displaying candidate words sorted according to a preset sorting rule on the current interface.

[0106] Taking the user's input of a Chinese-English mixed word as an example, Figure 7 Schematic diagram of candidate word display provided by an embodiment of the present application. As Figure 7 shown, when the user inputs the string "da’call" under the Chinese keyboard, the candidate words generated according to the above method are sorted according to the preset sorting rule as shown in Figure 7 "1. da call 2. 打 3. 大 4. 答 5. 达".

[0107] Taking the user's input of a Chinese-Korean mixed word as an example, Figure 8 Another schematic diagram of candidate word display provided by an embodiment of the present application. As Figure 8 shown, when the user inputs the string "renzhen’dlf" under the Chinese keyboard, the candidate words generated according to the above method are sorted according to the preset sorting rule as shown in Figure 8 "1. 认真 2. 认真 3. 任真 4. 人 5. 认".

[0108] Taking the user's input of a Chinese-Japanese mixed word as an example, Fig. 9 Another schematic diagram of candidate word display provided by an embodiment of the present application. As Fig. 9As shown, the user enters the string "nizhen'kawaii" on the Chinese keyboard, and the candidate words generated according to the above method are sorted according to the preset sorting rules as follows: Fig. 9 shown.

[0109] The method for generating candidate words provided in this embodiment receives a character string input by a user, determines the keyboard input language when the user inputs the character string as the user's first language, determines a target user word library that matches the first language from a pre-stored candidate user word library, and the target user word library includes a first language user word library and a second language user word library. According to the character string input by the user, the candidate word is searched from the target user word library. Since the target user word library includes a multi-language user word library, when generating candidate words according to the user input character string and the user word library, according to the main language and the second language set by the user, only the main language keyboard input can be used to decode a separate main language user word, a second language user word, or a mixed word of the main language and the second language, without the user having to frequently switch keyboards to complete the input of different languages. The user operation is simple and convenient, and the user experience is improved.

[0110] The following is an embodiment of the device of the present application, which can be used to execute the above method embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, reference can be made to the above method embodiment of the present application.

[0111] Fig.10 A schematic diagram of a device for acquiring a user vocabulary library provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the device of this embodiment may include: an acquisition module 11, a receiving module 12, a construction module 13 and a storage module 14, wherein:

[0112] The acquisition module 11 is used to acquire the first language and the second language of the user, where the first language is determined according to the current keyboard information of the user;

[0113] The receiving module 12 is used to receive input characters from the user;

[0114] The storage module 13 is used to store the characters of the first language in the input characters into a pre-constructed main data structure, and store the characters of the second language in the input characters into a pre-constructed secondary data structure, the main data structure and the secondary data structure have the same structure, the node information of each node in the main data structure includes at least one character of the first language and a pronunciation of the character of the first language, and the node information of each node in the secondary data structure includes at least one character of the second language and a pronunciation of the character of the second language;

[0115] The storage module 14 is used to store the data in the primary data structure and the data in the secondary data structure in the form of binary text;

[0116] The acquisition module 11 is further used to obtain a user vocabulary according to the primary data structure and the secondary data structure, wherein the user vocabulary includes a first language user vocabulary and a second language user vocabulary.

[0117] Optionally, both the primary data structure and the secondary data structure are a combination structure of a structure tree and an array structure or a combination structure of a finite state converter and an array structure.

[0118] Optionally, the main data structure is a combination structure of a main structure tree and an array structure, the secondary data structure is a combination structure of a secondary structure tree and an array structure, the node information of each node also includes node attributes, at least one of the node's child nodes and the node's sibling nodes, the node attributes include indication information for indicating whether the node is a leaf node, the node's sibling nodes are nodes with the same pronunciation as the node but different node attributes, the character corresponding to the leaf node is the end character of an entry, the node information of the leaf node also includes an entry identifier, and the entry ends with the character corresponding to the leaf node.

[0119] Optionally, the main structure tree includes a root node and multiple nodes under the root node, and the storage module 13 is used to:

[0120] For each first target character in the characters of the first language, if it is determined that the first target character does not exist in the main data structure, adding a node corresponding to the first target character under the root node, and storing node information of the node corresponding to the first target character;

[0121] If it is determined that the first target character already exists in the main data structure, and the node where the first target character is located is not a leaf node, then obtaining the first second target character after the first target character in the characters of the first language;

[0122] If it is determined that the second target character does not exist in the main data structure, a node corresponding to the second target character is added under the node where the first target character is located. If the first target character and the second target character constitute a term, an identifier is assigned to the term, and the node information of the node corresponding to the first target character is updated and the node information of the node corresponding to the second target character is stored, and the identifier of the term and the attribute information of the term are stored in the array structure;

[0123] If it is determined that the first target character already exists in the main data structure, and the node where the first target character is located is a leaf node, the attribute information of the entry with the first target character as the end character is updated in the array structure.

[0124] Optionally, the attribute information of the entry includes at least one of input time, input times and input method.

[0125] Optionally, the acquisition module 11 is used to acquire, according to the main data structure, node composition information of each first entry in all first entries contained in the main structure tree of the main data structure, wherein the node composition information includes all nodes constituting the first entry and characters and pronunciations of each node in all the nodes;

[0126] Obtaining a user vocabulary of the first language according to the array structure of the main data structure and the node composition information of each first word item contained in the main structure tree;

[0127] According to the secondary data structure, obtaining the node composition information of each second term in all second terms contained in the secondary structure tree of the secondary structure tree;

[0128] The user vocabulary of the second language is obtained according to the array structure of the secondary data structure and the node composition information of each second word item contained in the secondary structure tree.

[0129] The device provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.

[0130] Fig.11 A schematic diagram of a candidate word generation device provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, the device of this embodiment may include: a receiving module 21, a first determining module 22, a second determining module 23 and a searching module 24, wherein:

[0131] The receiving module 21 is used to receive a character string input by a user;

[0132] The first determination module 22 is used to determine the keyboard input language when the user inputs the character string as the user's first language;

[0133] The second determination module 23 is used to determine a target user vocabulary matching the first language from the pre-stored candidate user vocabulary, the target user vocabulary including the first language user vocabulary and the second language user vocabulary;

[0134] The search module 24 is used to search for candidate words from the target user vocabulary according to the character string input by the user;

[0135] Among them, the candidate user vocabulary is based on Figure 1 The method for acquiring the user vocabulary shown is obtained.

[0136] Optionally, the search module 24 is used to search for candidate words from the first language user vocabulary in the target user vocabulary according to the character string input by the user if the character string input by the user includes characters in the first language;

[0137] If the character string input by the user includes characters in the second language, searching for candidate words from the second language user word library in the target user word library according to the character string input by the user;

[0138] If the character string input by the user includes characters in the first language and characters in the second language, a candidate word is searched from the first language user word library and the second language user word library according to the character string input by the user.

[0139] Optionally, the search module 24 is used to determine the data structure according to the first language user vocabulary;

[0140] Acquire all nodes under the root node in the main structure tree of the main data structure, match the character pronunciations of all nodes under the root node in the main structure tree with the pronunciation of the first character in the string, and determine a first candidate node set that matches the pronunciation of the first character in the string;

[0141] Matching the pronunciation of the characters of all the first candidate nodes in the first candidate node set with the pronunciation of the second character in the character string, and determining a second candidate node set that matches the pronunciation of the second character in the character string;

[0142] Matching the pronunciation of characters of all child nodes of each second candidate node in the second candidate node set with the pronunciation of the third character in the string, and determining a third candidate node set that matches the pronunciation of the third character in the string;

[0143] According to the third candidate node set and the characters after the third character in the string, continue to match the character pronunciations until a node matching the pronunciation of the last character in the string is determined;

[0144] The candidate words are obtained based on the node characters that match the pronunciation of each character in the string.

[0145] Optionally, the search module 24 is used to determine a primary data structure according to the first language user vocabulary, and to determine a secondary data structure according to the second language user vocabulary;

[0146] Acquire all nodes under the root node in the main structure tree of the main data structure, match the character pronunciations of all nodes under the root node in the main structure tree with the pronunciation of the first character in the string, and determine a first candidate node set that matches the pronunciation of the first character in the string;

[0147] Acquire all nodes under the root node in the secondary structure tree of the secondary data structure, match the character pronunciations of all nodes under the root node in the secondary structure tree with the pronunciation of the first character in the string, and determine a second candidate node set that matches the pronunciation of the first character in the string;

[0148] If the second candidate node set is empty, match the character pronunciations of all first candidate nodes in the first candidate node set with the pronunciation of the second character in the string to match a third candidate node set;

[0149] If the third candidate node set includes a node whose node attribute is a mixed word, matching the character pronunciations of all child nodes of the root node in the secondary structure tree with the pronunciation of the third character in the string, and determining a fourth candidate node set that matches the pronunciation of the third character in the string;

[0150] Continue to match character pronunciations based on the fourth candidate node set and characters after the third character in the string until a node matching the pronunciation of the last character in the string is determined;

[0151] The candidate words are obtained based on the node characters that match the pronunciation of each character in the string.

[0152] Optionally, the device of this embodiment may further include a display module, and the display module is used to display the candidate words sorted according to a preset sorting rule on the current interface.

[0153] The device provided in the embodiment of the present application can execute the above method embodiment. Its specific implementation principle and technical effects can be found in the above method embodiment, and this embodiment will not be repeated here.

[0154] It should be understood that the device embodiment and the method embodiment may correspond to each other, and similar descriptions may refer to the method embodiment. To avoid repetition, they will not be described here.

[0155] The above describes the generation device of the candidate words of the embodiment of the present application from the perspective of the functional module in conjunction with the accompanying drawings. It should be understood that the functional module can be implemented in hardware form, can be implemented by instructions in software form, and can also be implemented by a combination of hardware and software modules. Specifically, the steps of the method embodiment in the embodiment of the present application can be completed by the hardware integrated logic circuit and / or software form instructions in the processor, and the steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or a combination of hardware and software modules in the decoding processor to perform. Optionally, the software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. The storage medium is located in a memory, and the processor reads the information in the memory, and completes the steps in the above method embodiment in conjunction with its hardware.

[0156] Fig.12 It is a schematic block diagram of the device provided in the embodiment of the present application.

[0157] like Fig.12 As shown, the device may include:

[0158] The memory 210 and the processor 220, the memory 210 is used to store the computer program and transmit the program code to the processor 220. In other words, the processor 220 can call and run the computer program from the memory 210 to implement the method in the embodiment of the present application.

[0159] For example, the processor 220 may be configured to execute the above method embodiments according to instructions in the computer program.

[0160] In some embodiments of the present application, the processor 220 may include but is not limited to:

[0161] General-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.

[0162] In some embodiments of the present application, the memory 210 includes but is not limited to:

[0163] Volatile memory and / or non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM) or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus random access memory (DR RAM).

[0164] In some embodiments of the present application, the computer program may be divided into one or more modules, which are stored in the memory 210 and executed by the processor 220 to complete the method provided by the present application. The one or more modules may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the candidate word generation device.

[0165] like Fig.12 As shown, the device may also include:

[0166] The transceiver 230 may be connected to the processor 220 or the memory 210 .

[0167] The processor 220 may control the transceiver 230 to communicate with other devices, specifically, to send information or data to other devices, or to receive information or data sent by other devices. The transceiver 230 may include a transmitter and a receiver. The transceiver 230 may further include an antenna, and the number of antennas may be one or more.

[0168] It should be understood that the various components in the candidate word generation device are connected via a bus system, wherein the bus system includes not only a data bus but also a power bus, a control bus and a status signal bus.

[0169] The present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a computer, the computer can perform the method of the above method embodiment. In other words, the present application embodiment also provides a computer program product containing instructions, and when the instructions are executed by a computer, the computer can perform the method of the above method embodiment.

[0170] When software is used for implementation, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a digital video disc (digital video disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.

[0171] Those of ordinary skill in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0172] In the several embodiments provided in the present application, 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 the module is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0173] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. For example, each functional module in each embodiment of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0174] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for acquiring a user vocabulary, characterized in that: include: Acquire a user's first language information and a second language information, where the first language information is determined according to the user's current keyboard information; Receiving input characters from the user; The characters of the first language in the input characters are stored in a pre-constructed main data structure, and the characters of the second language in the input characters are stored in a pre-constructed secondary data structure, wherein the main data structure is identical to the secondary data structure, the node information of each node in the main data structure includes at least one character of the first language and the pronunciation of the character of the first language, and the node information of each node in the secondary data structure includes at least one character of the second language and the pronunciation of the character of the second language, wherein the main data structure is a combination structure of a main structure tree and an array structure, and the secondary data structure is a secondary structure tree and an array structure, the node information of each node further includes at least one of a node attribute, a child node of the node, and a brother node of the node, the node attribute includes indication information for indicating whether the node is a leaf node, the brother node of the node is a node with the same pronunciation as the node but different node attributes, the character corresponding to the leaf node is the end character of an entry, the node information of the leaf node further includes an entry identifier, the entry ends with the character corresponding to the leaf node, wherein the array structure stores the entry identifier and the attribute information of the entry; A user vocabulary is obtained according to the main data structure and the secondary data structure, wherein the user vocabulary includes a first language user vocabulary and a second language user vocabulary.

2. The method according to claim 1, characterized in that The main structure tree includes a root node and multiple nodes under the root node, and storing the characters of the first language in the input characters into the pre-built main data structure includes: For each first target character in the characters of the first language, if it is determined that the first target character does not exist in the main data structure, adding a node corresponding to the first target character under the root node, and storing node information of the node corresponding to the first target character; If it is determined that the first target character already exists in the main data structure, and the node where the first target character is located is not a leaf node, obtaining a first second target character after the first target character in the characters of the first language; If it is determined that the second target character does not exist in the main data structure, then a node corresponding to the second target character is added under the node where the first target character is located, if the first target character and the second target character constitute a term, then an identifier is assigned to the term, and node information of the node corresponding to the first target character is updated and node information of the node corresponding to the second target character is stored, and the identifier of the term and the attribute information of the term are stored in the array structure; If it is determined that the first target character already exists in the main data structure, and the node where the first target character is located is a leaf node, the attribute information of the entry with the first target character as the end character is updated in the array structure.

3. The method according to claim 2, characterized in that The attribute information of the entry includes at least one of input time, input times and input method.

4. The method according to claim 2, characterized in that: The step of obtaining a user vocabulary according to the primary data structure and the secondary data structure includes: According to the main data structure, obtaining node composition information of each first term in all first terms contained in the main structure tree of the main data structure, wherein the node composition information includes all nodes constituting the first term and characters and pronunciations of each node in all the nodes; Obtaining a user vocabulary of the first language according to the array structure of the main data structure and the node composition information of each first word item contained in the main structure tree; According to the secondary data structure, obtaining the node composition information of each second term in all second terms contained in the secondary structure tree; The user vocabulary of the second language is obtained according to the array structure of the secondary data structure and the node composition information of each second word item contained in the secondary structure tree.

5. A method for generating candidate words, characterized in that: include: Receive the string input by the user; Determining the keyboard input language used by the user when inputting the character string as the first language of the user; Determine a target user vocabulary matching the first language from a pre-stored candidate user vocabulary, wherein the target user vocabulary includes a user vocabulary of the first language and a user vocabulary of a second language; Searching for candidate words from the target user vocabulary according to the character string input by the user; The candidate user vocabulary is obtained according to the method for obtaining the user vocabulary according to any one of claims 1 to 4.

6. The method according to claim 5, characterized in that The searching for candidate words from the target user vocabulary according to the character string input by the user includes: If the character string input by the user includes characters in the first language, searching for candidate words from the user word library of the first language in the target user word library according to the character string input by the user; If the character string input by the user includes characters in the second language, searching for candidate words from the user word library of the second language in the target user word library according to the character string input by the user; If the character string input by the user includes characters in the first language and characters in the second language, candidate words are searched from the first language user word library and the second language user word library according to the character string input by the user.

7. The method according to claim 6, characterized in that The searching for a candidate word from the first language user word library in the target user word library according to the character string input by the user includes: Determine a main data structure according to the user vocabulary of the first language; Acquire all nodes under the root node in the main structure tree of the main data structure, match the character pronunciations of all nodes under the root node in the main structure tree with the pronunciation of the first character in the string, and determine a first candidate node set that matches the pronunciation of the first character in the string; Matching the pronunciation of characters of all first candidate nodes in the first candidate node set with the pronunciation of the second character in the character string, and determining a second candidate node set that matches the pronunciation of the second character in the character string; Matching the pronunciation of characters of all child nodes of each second candidate node in the second candidate node set with the pronunciation of the third character in the string, and determining a third candidate node set that matches the pronunciation of the third character in the string; Continue to match character pronunciations according to the third candidate node set and characters after the third character in the character string until a node matching the pronunciation of the last character in the character string is determined; A candidate word is obtained according to the node characters that match the pronunciation of each character in the character string.

8. The method according to claim 6, characterized in that Searching for candidate words from the first language user word library and the second language user word library according to the character string input by the user includes: Determine a primary data structure according to the first language user vocabulary, and determine a secondary data structure according to the second language user vocabulary; Acquire all nodes under the root node in the main structure tree of the main data structure, match the character pronunciations of all nodes under the root node in the main structure tree with the pronunciation of the first character in the string, and determine a first candidate node set that matches the pronunciation of the first character in the string; Acquire all nodes under the root node in the secondary structure tree of the secondary data structure, match the character pronunciations of all nodes under the root node in the secondary structure tree with the pronunciation of the first character in the string, and determine a second candidate node set that matches the pronunciation of the first character in the string; If the second candidate node set is empty, match the character pronunciations of all first candidate nodes in the first candidate node set with the pronunciation of the second character in the character string to obtain a third candidate node set; If the third candidate node set includes a node whose node attribute is a mixed word, matching the character pronunciations of all child nodes of the root node in the secondary structure tree with the pronunciation of the third character in the string, and determining a fourth candidate node set that matches the pronunciation of the third character in the string; Continue to perform character pronunciation matching based on the fourth candidate node set and characters after the third character in the character string until a node matching the pronunciation of the last character in the character string is determined; A candidate word is obtained according to the node characters that match the pronunciation of each character in the character string.

9. A device for acquiring a user vocabulary, characterized in that: include: An acquisition module, used to acquire a user's first language information and a second language information, wherein the first language information is determined according to the user's current keyboard information; A receiving module, used for receiving input characters of the user; A construction module is used to store the characters of the first language in the input characters into a pre-constructed main data structure, and store the characters of the second language in the input characters into a pre-constructed secondary data structure, wherein the main data structure has the same structure as the secondary data structure, the node information of each node in the main data structure includes at least one character of the first language and the pronunciation of the character of the first language, and the node information of each node in the secondary data structure includes at least one character of the second language and the pronunciation of the character of the second language, wherein the main data structure is a combination structure of a main structure tree and an array structure, and the secondary data structure The structure is a combination of a substructure tree and an array structure, the node information of each node further includes at least one of a node attribute, a child node of the node and a brother node of the node, the node attribute includes indication information for indicating whether the node is a leaf node, the brother node of the node is a node with the same pronunciation as the node but different node attributes, the character corresponding to the leaf node is the end character of an entry, the node information of the leaf node further includes an entry identifier, the entry ends with the character corresponding to the leaf node, wherein the array structure stores the entry identifier and the attribute information of the entry; The acquisition module is further used to obtain a user vocabulary according to the primary data structure and the secondary data structure, wherein the user vocabulary includes a first language user vocabulary and a second language user vocabulary.

10. A device for generating candidate words, characterized in that: include: A receiving module, used for receiving a character string input by a user; A first determining module, configured to determine the keyboard input language used when the user inputs the character string as the first language of the user; A second determination module, configured to determine a target user vocabulary matching the first language from a pre-stored candidate user vocabulary, wherein the target user vocabulary includes a user vocabulary of the first language and a user vocabulary of a second language; A search module, used to search for candidate words from the target user vocabulary according to the character string input by the user; The candidate user vocabulary is obtained according to the method for obtaining the user vocabulary according to any one of claims 1 to 4.

11. An electronic device, characterized in that: include: A processor and a memory, the memory being used to store a computer program, and the processor being used to call and run the computer program stored in the memory to execute the method according to any one of claims 1 to 4 or 5 to 8.

12. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein the computer program causes a computer to execute the method according to any one of claims 1 to 4 or 5 to 8.

Citation Information

Patent Citations

  • Mixed input method of at least two languages and input method system

    CN101943952A