Thesaurus retrieval methods and related devices

By using an incremental retrieval method to search for each character in the input string, and by utilizing caching and bitmap data structures, the poor dictionary retrieval performance caused by long and short string concatenation is solved, thereby improving the input method's response performance and user experience.

CN117131164BActive Publication Date: 2025-12-02TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210552416.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-20
Publication Date
2025-12-02
Estimated Expiration
2042-05-20

AI Technical Summary

Technical Problem

When the input string to be searched is a long simplified string, the existing technology requires the construction of multiple combinations of full strings for retrieval, resulting in poor dictionary retrieval performance and affecting the response performance of the input method and the user input experience.

Method used

An incremental retrieval method is adopted, which searches for each character in the input string. By using caching and bitmap data structures, the search range is gradually narrowed, avoiding the construction of multiple combinations of full-character strings and improving retrieval efficiency.

Benefits of technology

It improves the retrieval performance of the dictionary and the response performance of the input method, reduces the possibility of lag during the user's input process, and enhances the input experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117131164B_ABST
    Figure CN117131164B_ABST
Patent Text Reader

Abstract

This application discloses a method and related apparatus for searching a dictionary. The method involves obtaining the first character of the input string to be searched, determining the search range from the dictionary based on the first character, and recording it in a cache. Within the search range, the remaining characters of the input string are searched sequentially to obtain target terms that satisfy the input string. When searching for the i-th character of the input string, the cache corresponding to the (i-1)-th character retrieves the first term data containing the full spelling string prefixed with the previous i characters, and caches this first term data until the search for the last character of the input string is completed and the target term is obtained. The cache corresponding to the (i-1)-th character includes the second term data containing the full spelling string prefixed with the previous (i-1)-th characters. This application implements incremental retrieval, improves the dictionary retrieval performance, enhances the overall response performance of the input method, reduces the possibility of lag during input, and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, and in particular to a thesaurus retrieval method and related apparatus. Background Technology

[0002] With the development of computer technology, electronic devices such as mobile phones and tablets have become increasingly popular, bringing great convenience to people's lives, studies, and work. These electronic devices usually have input method applications installed, allowing users to input information using those methods.

[0003] Input methods typically provide a dictionary, which is used to search for and provide candidate words to the user. Generally, searching the dictionary involves matching the full pinyin string to the correct word or phrase. However, for input strings that include abbreviations, the full pinyin string must first be constructed based on the abbreviation-included string. Then, the dictionary is searched using the method described above to find the corresponding word or phrase and provide it to the user.

[0004] However, for input strings that include abbreviations, it is necessary to search for all corresponding full-spelling strings. The longer the input string, the more possible combinations of full-spelling strings there are. Therefore, in scenarios where the input string is a long abbreviation string, the retrieval performance of the dictionary is very poor, which will affect the response performance of the entire input method, causing users to experience lag and a poor input experience. Summary of the Invention

[0005] To address the aforementioned technical issues, this application provides a dictionary retrieval method and related apparatus. This eliminates the need to construct multiple combinations of full-character strings and to perform separate searches for each combination, thereby improving the dictionary retrieval efficiency. Furthermore, by implementing incremental retrieval, it further enhances the dictionary retrieval performance, improves the overall response performance of the input method, reduces the possibility of lag during user input, and enhances the user's input experience.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On the one hand, embodiments of this application provide a thesaurus retrieval method, the method comprising:

[0008] Obtain the first character in the input string to be searched, wherein the input string includes abbreviations;

[0009] Based on the first character, the search range is determined from the dictionary and recorded in the cache. The search range includes the word data of the full pinyin string starting with the first character.

[0010] Within the search range, the remaining characters of the input string to be searched are searched sequentially to obtain target terms that satisfy the input string to be searched;

[0011] In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, when searching for the i-th character in the input string, the first term data is retrieved from the cache corresponding to the (i-1)-th character. The first term data includes the term data of the full spelling string with the first i characters as prefixes. The first term data is cached until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)-th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as prefixes. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

[0012] On one hand, embodiments of this application provide a thesaurus retrieval device, the device comprising an acquisition unit, a determination unit, a caching unit, and a retrieval unit:

[0013] The acquisition unit is used to acquire the first character in the input string to be searched, and the input string to be searched includes abbreviated spelling;

[0014] The determining unit is used to determine the search range from the thesaurus based on the first character;

[0015] The caching unit is used to record the search range in the cache, and the search range includes the word data of the full pinyin string starting with the first character;

[0016] The retrieval unit is used to sequentially search the remaining characters of the input string to be searched within the retrieval range to obtain target terms that satisfy the input string to be searched.

[0017] In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, the search unit is specifically used to retrieve the first term data from the cache corresponding to the (i-1)th character when searching for the i-th character in the input string. The first term data includes the term data of the full spelling string with the first i characters as prefixes. The cache unit is specifically used to cache the first term data until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as prefixes. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

[0018] On one hand, embodiments of this application provide a computer device, the computer device including a processor and a memory:

[0019] The memory is used to store program code and transmit the program code to the processor;

[0020] The processor is configured to execute the method described in any of the foregoing aspects according to the instructions in the program code.

[0021] In one aspect, embodiments of this application provide a computer-readable storage medium for storing program code, which, when executed by a processor, causes the processor to perform the method described in any of the foregoing aspects.

[0022] On one hand, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the foregoing aspects.

[0023] As can be seen from the above technical solution, this application can perform incremental retrieval for each character in the input string, including abbreviated spellings. Specifically, the first character of the input string can be obtained, and then the retrieval range can be determined from the dictionary based on the first character and recorded in the cache. This allows the retrieval of subsequent characters to be traversed only within this retrieval range, thereby improving retrieval efficiency. The retrieval range includes the word data of the full spelling string starting with the first character. Then, the remaining characters of the input string are retrieved sequentially within the retrieval range to obtain the target word that satisfies the input string. Specifically, when retrieving the i-th character in the input string, the first word data is retrieved from the cache corresponding to the (i-1)-th character. The first word data includes the word data of the full spelling string prefixed with the i-th characters, and the first word data is cached until the retrieval of the last character in the input string is completed, thus obtaining the target word. The cache corresponding to the (i-1)th character includes the second term data, which in turn includes the term data containing the full pinyin string prefixed by the (i-1)th character. The value of i is 2, 3, ..., N, where N is the number of characters in the input string. This allows each search to be performed within the cache obtained from the previous search, gradually narrowing the search scope and achieving incremental retrieval, thus improving the retrieval performance of the dictionary. Therefore, even with long and abbreviated pinyin input, this application eliminates the need to construct multiple combinations of full pinyin strings or perform separate searches for each combination, improving the retrieval efficiency of the dictionary. Furthermore, the implementation of incremental retrieval further enhances the retrieval performance of the dictionary, improves the overall response performance of the input method, reduces the possibility of lag during user input, and enhances the user's input experience. Attached Figure Description

[0024] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0025] Figure 1 An example diagram of a thesaurus provided in an embodiment of this application;

[0026] Figure 2 An application scenario architecture diagram of a thesaurus retrieval method provided in this application embodiment;

[0027] Figure 3 A flowchart illustrating a thesaurus retrieval method provided in this application embodiment;

[0028] Figure 4 An example diagram illustrating the determination of a search range from a thesaurus, provided as an embodiment of this application;

[0029] Figure 5 An example diagram provided for an embodiment of this application shows how to record word data corresponding to a full-character string with the first two characters "bs" as a prefix using a bitmap.

[0030] Figure 6 An example diagram provided in this application illustrates how a bitmap can be used to record word data corresponding to a full-character Pinyin string prefixed with the first four characters "bsd".

[0031] Figure 7 An example diagram provided for embodiments of this application shows how to record word data corresponding to a full-character string prefixed with the first two characters "bsdb" using a bitmap.

[0032] Figure 8 A flowchart illustrating another thesaurus retrieval method provided in this application embodiment;

[0033] Figure 9 A structural diagram of a thesaurus retrieval device provided in an embodiment of this application;

[0034] Figure 10 A structural diagram of a terminal provided in an embodiment of this application;

[0035] Figure 11 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation

[0036] The embodiments of this application will now be described with reference to the accompanying drawings.

[0037] In an input method, a word library is usually provided. By retrieving the word library, candidate items are provided to the user. The word library can also be a user word library. The user word library can be used to record the content input by the user and provide the ability to retrieve entries based on the input string, so as to optimize the sorting of candidate items under homophony and make the provided candidate items more accurate.

[0038] The format of the user word library generally includes two parts: an index area + a data area. The index area generally stores the offsets pointing to the data and is sorted in alphabetical order of pinyin, so that binary search can be performed. The data area stores the specific entry data. The entry data is the relevant data of the entry corresponding to the input string. For example, it can include the full pinyin string, the entry, and the attached information of the entry. The attached information can be, for example, the frequency of the entry being selected by the user. See Figure 1 , Figure 1 is a schematic diagram of a user word library. It can be seen that 10 entry data are stored in this user word library. The offset values of its index area are offset 1, offset 2, offset 3, offset 4, offset �, offset 6, offset 7, offset 8, offset 9 in sequence. The full pinyin strings in the data area include, for example, "a", "bushi", "bushiba",..., the entries are "啊", "不是", "不是吧",..., and the frequencies of being selected are "1", "8", "5",... in sequence. In addition, there are two free spaces. Among them, the index area marked as free 1 and the data areas marked as free 11, free 12, free 13 form a free space, and the index area marked as free 2 and the data areas marked as free 21, free 22, free 23 form another free space.

[0039] Because the user word library needs to support fast operations of addition, deletion, and modification, and other indexing methods (such as Trie trees) cannot achieve fast operations of adding entry data, the user word library usually adopts the relatively simple indexing structure described above. When inserting a new entry data, only need to append the entry data to be inserted to the end of the data area, and then insert the offset value of the entry data stored in the data area into the appropriate position in the index area to ensure alphabetical order. Generally, the user word library will reserve a large amount of free space. In the case of having free space, entry data can be directly added according to the above method. If there is not enough free space, the capacity of the word library needs to be expanded first, and then the entry data is added according to the above method.

[0040] When retrieving the word library, generally, the same full pinyin string is matched in the word library through the full pinyin string (for example, generally, binary search is performed in the index area through the full pinyin string), and then the corresponding entry is found as a candidate item to be provided to the user. However, for a query input string including abbreviated pinyin, the full pinyin string needs to be constructed first based on the query input string including abbreviated pinyin, and then the word library is retrieved through the above method to find the corresponding entry as a candidate item to be provided to the user.

[0041] However, for input strings that include abbreviations, it is necessary to search for all corresponding full-spelling strings. The longer the input string, the more possible combinations of full-spelling strings there are. Therefore, in scenarios where the input string is a long abbreviation string, the retrieval performance of the dictionary is very poor, which will affect the response performance of the entire input method, causing users to experience lag and a poor input experience.

[0042] Among them, a full-spell string refers to an input string composed entirely of pinyin, meaning it consists of one or more complete syllables, such as "ni'hao". A syllable is a phonetic unit composed of an initial consonant and a final vowel; a single final vowel can also be a syllable, such as "ni" or "a". A simplified-spell string refers to an input string composed entirely of pinyin, meaning it is not a full-spell string, i.e., it may not form a complete syllable, such as "n'h".

[0043] To address the aforementioned technical problems, this application provides a dictionary retrieval method. This method performs incremental retrieval on each character in the input string, including abbreviated spellings. This eliminates the need to construct multiple combinations of full spellings and to perform separate searches for each combination, thus improving dictionary retrieval efficiency. Furthermore, the incremental retrieval further enhances dictionary retrieval performance, improves the overall response performance of the input method, reduces the possibility of lag during user input, and improves the user's input experience. Characters can include letters, numbers, symbols, etc. Letters refer to the smallest written unit of phonetic characters or phonetic symbols, such as b, s, d, b, a, sh, etc. For ease of explanation, this application primarily uses letters as an example.

[0044] It should be noted that the embodiments of this application can be applied to various input method products. The method provided in the embodiments of this application can be executed by a computer device, which can be a terminal or a server. The terminal can have an input method product installed, and the server is used to provide the input method service corresponding to the input method product. When the computer device is a server, after receiving the user's current input information, the terminal needs to send the user's current input information to the server. The user's current input information can be, for example, the input string to be searched or any character in the input string to be searched.

[0045] like Figure 2 As shown, Figure 2This paper illustrates an application scenario architecture diagram for a thesaurus retrieval method, using the example of a terminal executing the thesaurus retrieval method provided in this application embodiment. This application scenario may include a terminal 100, on which an input method product may be installed. The terminal 100 includes, but is not limited to, mobile phones, computers, intelligent voice interaction devices, smart home appliances, in-vehicle terminals, and aircraft. The method provided in this application embodiment can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, and assisted driving.

[0046] Users can input the search string using the input method product on terminal 100, which in turn allows terminal 100 to provide candidate options for text input. The search string is the string the user intends to input, from which candidate options are provided by searching a dictionary.

[0047] When terminal 100 provides candidate words to users through an input method product, it can search the dictionary and then provide candidate words to users based on the search results. Specifically, terminal 100 can include the first character of the abbreviated input string to be searched, and then determine the search range from the dictionary based on the first character and record it in the cache. This allows subsequent character searches to be traversed only within this search range, thereby improving search efficiency. The search range includes the word data of the full pinyin string starting with the first character.

[0048] Then, terminal 100 can sequentially search the remaining characters of the input string within the search range to obtain target terms that satisfy the input string. During the process of sequentially searching the remaining characters of the input string within the search range to obtain target terms that satisfy the input string, when searching for the i-th character in the input string, terminal 100 can retrieve the first term data from the cache corresponding to the (i-1)-th character. The first term data includes term data containing the full-word string prefixed with the first i characters, and the first term data is cached until the search for the last character in the input string is completed, thus obtaining the target term.

[0049] The cache corresponding to the (i-1)th character includes the second term data, which includes the term data of the full spelling string with the (i-1)th character as a prefix. The value of i is 2, 3, ..., N, where N is the number of characters in the input string to be searched. This allows each search to be performed in the cache obtained from the previous search. The search range is gradually narrowed down each time, realizing incremental search and improving the search performance of the dictionary.

[0050] For example, if a user inputs the string "jttqzh", searching the dictionary using relevant technologies would first require generating the full pinyin string of "jttqzh". Generally, the longer the abbreviated pinyin string, the larger the generated full pinyin string becomes. In this case, the full pinyin string is approximately in the millions. Searching the dictionary sequentially would then result in very poor performance. However, the method provided in this application allows for incremental searching. When searching for the first character "j", the dictionary caches the entries containing the full pinyin string starting with "j" as the search range. Subsequent searches can then be performed directly within this search range. When searching for the second character "t" (i=2), the search can be performed in the cache. At the same time, the data of entries with the prefix "jt" will be updated in the cache. Similarly, when "jttqz" is entered, the data of entries with the prefix "jttqz" will be updated in the cache. When the last character "jttqzh" is entered, the target entry can be obtained directly from the cache corresponding to the previous character.

[0051] As can be seen, even in the case of long and abbreviated Pinyin input, this application does not require the construction of multiple combinations of full Pinyin strings, nor does it require separate retrieval for multiple combinations of full Pinyin strings, thus improving the retrieval efficiency of the dictionary. Furthermore, due to the implementation of incremental retrieval, the retrieval performance of the dictionary is further improved, the response performance of the entire input method is enhanced, the possibility of lag during user input is reduced, and the user's input experience is improved.

[0052] Next, taking the method provided in the embodiments of this application as an example, and in conjunction with the accompanying drawings, we will provide a detailed description of the thesaurus retrieval method provided in the embodiments of this application. See also Figure 3 , Figure 3 A flowchart of a thesaurus retrieval method is shown, the method comprising:

[0053] S301. Obtain the first character in the input string to be searched, wherein the input string to be searched includes abbreviations.

[0054] When a user hopes to input text through an input method product installed on a terminal, the user can input a corresponding input string as a searchable input string through the input method on the terminal, so that the terminal can provide candidate items for the user based on the searchable input string to help the user complete text input. Among them, the searchable input string includes simple pinyin, that is, the searchable input string can be completely a simple pinyin string. For example, "bsdb", as long as each pinyin in its corresponding full pinyin string starts with "b", "s", "d", "b", so based on the possible full pinyin strings corresponding to the searchable input string, the candidate items can be "不是的吧" (No, right?), "不舍得吧" (Reluctant, right?), "巴适得板" (Perfect), "北师大版" (Beijing Normal University Edition), etc.; the searchable input string can also be a mixture of simple pinyin and full pinyin. For example, "busdb", at this time, its corresponding full pinyin string needs to include the pinyin "bu", and the other three pinyins starting with "s", "d", "b", so based on the possible full pinyin strings corresponding to the searchable input string, the candidate items can be "不是的吧" (No, right?), "不舍得吧" (Reluctant, right?), it can be seen that the candidate items corresponding to "bsdb" are different, and there are fewer possible candidate items.

[0055] When performing a lexical database search, in order to avoid constructing multiple full pinyin strings based on a searchable input string including simple pinyin, and thus avoid reducing the search performance of the lexical database due to separate searches based on multiple full pinyin strings, the embodiments of the present application can perform a search for each character in the searchable input string without constructing a full pinyin string. For example, a search can be first performed on the first character of the searchable input string, so the first character can be obtained first.

[0056] It can be understood that when the terminal provides candidate items for the user, it can provide candidate items by searching the lexical database. And the timing of searching the lexical database can include various types. One can be after the user completes the input of the entire searchable input string, and then perform a lexical database search. At this time, the method of obtaining the first character in the searchable input string can be, after completing the input of the searchable input string, obtain the searchable input string, then perform character division on the searchable input string to get a division result, and then obtain the first character based on the division result. The method of obtaining the remaining characters is similar to that of the first character, and is also obtained based on the division result.

[0057] For example, if the searchable input string is "bsdb", perform character division on "bsdb" to obtain a division result. The division result includes 4 characters, which are "b", "s", "d", "b" in the input order, so the first character is "b".

[0058] In this case, the condition for determining that the user has completed the input of the entire searchable input string can be that after the user completes the input operation for the target character, if no character input operation is detected after exceeding a preset duration, then obtain the target character and other characters input before the target character as the searchable input string, and the target character is the last character of the searchable input string.

[0059] Another approach is to perform a dictionary search for each character entered by the user, continuing until the last character is searched. In this case, the first character of the input string can be retrieved in response to the input of the first character. For example, if the user wants to input "bsdb", the user can enter each character sequentially. When the user enters the first character "b", the terminal can respond to the input of "b" by retrieving the first character "b" and then search the dictionary for that first character "b".

[0060] S302. Based on the first character, determine the search range from the dictionary and record it in the cache. The search range includes the word data of the full pinyin string starting with the first character.

[0061] When the terminal searches for the first character of the input string, it can determine the upper and lower boundaries of the word data in the dictionary that contains the full spelling string starting with the first character. Based on these upper and lower boundaries, it determines the search range and then traverses within the search range to find the target word that satisfies the input string, which is the search target.

[0062] by Figure 1 Taking the dictionary shown as an example, if the input string to be searched is "bsdb", the terminal can obtain the first character "b", perform a dictionary search on "b", determine the upper and lower boundaries of the full spelling string corresponding to the word data starting with "b", that is, the 2nd word data and the 7th word data. The word data between the 2nd and 7th word data is determined as the search range. See [link to relevant documentation]. Figure 4 As shown, the search range is indicated by black fill.

[0063] It should be noted that in this embodiment, binary search can be used when performing dictionary retrieval for each character. Binary search, also known as half-interval search, has the advantages of fewer comparisons, faster retrieval speed, and better average performance, making it suitable for ordered lists that are not frequently changed but are frequently retrieved. Since a dictionary is, to a certain extent, an ordered list that is not frequently changed but is frequently retrieved, binary search can be used to achieve dictionary retrieval.

[0064] If we use a binary search method to search for the first character "b", we can determine that by performing two binary searches, we can obtain the term data between the 2nd and 7th terms as the search range.

[0065] S303. Search the remaining characters of the input string in the search range in turn to obtain the target terms that satisfy the input string.

[0066] Then, the terminal traverses within the search range, sequentially retrieves the remaining characters of the input string to be searched, and obtains the target entry that satisfies the input string to be searched, which is the search target. Still taking the input string to be searched as "bsdb" as an example, if the search range is determined for the first character "b" as Figure 4 shown, that is, from the 2nd entry data to the 7th entry data, and then from the 2nd entry data to the 7th entry data, only 1 entry data that satisfies "bsdb" is found, that is, the entry data including the entry "not really". Thus, the retrieval of the thesaurus is completed.

[0067] S304. During the process of sequentially retrieving the remaining characters of the input string to be searched in the search range and obtaining the target entry that satisfies the input string to be searched, when retrieving for the i-th character in the input string to be searched, the first entry data is retrieved from the cache corresponding to the (i - 1)-th character. The first entry data includes the entry data where the full spelling string with the first i characters as the prefix is located, and the first entry data is cached until the target entry is obtained after completing the retrieval for the last character in the input string to be searched.

[0068] Among them, the cache corresponding to the (i - 1)-th character includes the second entry data. The second entry data includes the entry data where the full spelling string with the first (i - 1) characters as the prefix is located, and the value of i is 2, 3,..., N, and N is the number of characters in the input string to be searched. That is to say, when retrieving for the (i - 1)-th character and obtaining the second entry data where the full spelling string with the first (i - 1) characters as the prefix is located, the second entry data can be cached. Thus, when retrieving the thesaurus for the i-th character, the first entry data can be directly retrieved from the cache corresponding to the (i - 1)-th character (i.e., the second entry data). The first entry data includes the entry data where the full spelling string with the first i characters as the prefix is located, and the first entry data is cached, and so on.

[0069] Taking the input string to be searched as "bsdb" as an example, if the search range is determined for the first character "b" as Figure 4 shown, when retrieving the thesaurus for the second character "s", the entry data where the full spelling string with "bs" as the prefix is located can be obtained. For example, Figure 4 the 3rd entry data to the 6th entry data in it are cached. When retrieving the thesaurus for the third character "d", the entry data where the full spelling string with "bsd" as the prefix is located can be obtained. For example, Figure 4 the 5th entry data in it is cached. When retrieving the thesaurus for the fourth character "b", the target entry that satisfies "bsdb" is obtained, that is, the entry "not really" in the 5th entry data.

[0070] As the user inputs, the search scope is gradually reduced, which is very suitable for the daily input scenario of the input method, improving the search performance and thus enhancing the user's input experience.

[0071] It should be noted that when the opportunity to search the word library is to perform a word library search every time the user inputs a character, the way to search for the i-th character in the input string to be searched can be to obtain the i-th character in response to the input operation for the i-th character and search for the i-th character. When the word library search for the last character is completed, the target entry is obtained.

[0072] Correspondingly, the judgment condition for the last character is that after obtaining the target character, if no character input operation is detected beyond the preset time, the target character is used as the last character of the input string to be searched.

[0073] When the opportunity to search the word library is to perform a word library search every time the user inputs a character, in order to enable the user to quickly obtain the text they hope to input, in the embodiments of the present application, after the user inputs each character, possible entries can be provided to the user as candidates based on all the characters currently input for the user to select. In this case, the way to retrieve the first entry data from the cache corresponding to the (i - 1)-th character can be to retrieve from the cache corresponding to the (i - 1)-th character to obtain the first entry data and the target full spelling string that matches the first i characters, and then display the entries in the entry data where the target full spelling string is located as candidates. [[ID=​​​​​​​from the 3rd entry data to the 6th entry data) and the target full spelling string "bushi" that matches the first i characters (e.g., "bs"), and then display the entry (e.g., "不是") in the entry data where the target full spelling string is located as a candidate. When performing a thesaurus search for the third character (i = 3) "d", it can be retrieved from the cache corresponding to the 1st (i - 1 = 2) character, and the first entry data (e.g., Figure 4 the 5th entry data) and the target full spelling string "bushide" that matches the first i characters (e.g., "bsd"), and then display the entry (e.g., "不是的") in the entry data where the target full spelling string is located as a candidate. When performing a thesaurus search for the fourth character (i = 4) "b", it can be retrieved from the cache corresponding to the 3rd (i - 1 = 3) character. At this time, the target entry that satisfies "bsdb" is directly obtained, that is, the entry "不是的吧" in the 5th entry data, and the search stops.

[0076] By inputting characters one by one and providing candidates simultaneously, it is possible to promptly and quickly provide the entries that the user may input, thereby improving the input efficiency and the user's input experience.

[0077] It should be noted that when displaying the entries in the entry data where the target full spelling string is located as candidates, since there may be multiple determined target full spelling strings and there may also be multiple entries in the entry data where the target full spelling string is located, this results in a sequence for displaying multiple entries to the user. Therefore, it is necessary to determine the sequence for displaying different entries to the user. In one possible implementation, the terminal can determine the display priority of the entries in the entry data where the target full spelling string is located according to the on-screen frequency of the entry data where the target full spelling string is located. Generally, the higher the on-screen frequency, the higher the probability that the user inputs the entry in the entry data, and thus it can be displayed preferentially, that is, the higher the on-screen frequency, the higher the display priority. Then, display the entries in the entry data where the target full spelling string is located as candidates in descending order of priority.

[0078] Through this method, the entries that the user is more likely to select for on-screen display can be preferentially shown, facilitating the user to quickly obtain the entries they hope to be on-screen and improving the input efficiency.

[0079] It should be noted that in the embodiments of the present application, the acquisition or processing of user-related data (such as on-screen frequency data, etc.) is all authorized and permitted by the user.

[0080] As can be seen from the above technical solution, this application can perform incremental retrieval for each character in the input string, including abbreviated spellings. Specifically, the first character of the input string can be obtained, and then the retrieval range can be determined from the dictionary based on the first character and recorded in the cache. This allows the retrieval of subsequent characters to be traversed only within this retrieval range, thereby improving retrieval efficiency. The retrieval range includes the word data of the full spelling string starting with the first character. Then, the remaining characters of the input string are retrieved sequentially within the retrieval range to obtain the target word that satisfies the input string. Specifically, when retrieving the i-th character in the input string, the first word data is retrieved from the cache corresponding to the (i-1)-th character. The first word data includes the word data of the full spelling string prefixed with the i-th characters, and the first word data is cached until the retrieval of the last character in the input string is completed, thus obtaining the target word. The cache corresponding to the (i-1)th character includes the second term data, which in turn includes the term data containing the full pinyin string prefixed by the (i-1)th character. The value of i is 2, 3, ..., N, where N is the number of characters in the input string. This allows each search to be performed within the cache obtained from the previous search, gradually narrowing the search scope and achieving incremental retrieval, thus improving the retrieval performance of the dictionary. Therefore, even with long and abbreviated pinyin input, this application eliminates the need to construct multiple combinations of full pinyin strings or perform separate searches for each combination, improving the retrieval efficiency of the dictionary. Furthermore, the implementation of incremental retrieval further enhances the retrieval performance of the dictionary, improves the overall response performance of the input method, reduces the possibility of lag during user input, and enhances the user's input experience.

[0081] The dictionary retrieval method provided in this application embodiment only requires a dozen or so queries to complete the retrieval of the input string "bsdb". In contrast, the query provided by related technologies would require hundreds of thousands of queries. Therefore, the dictionary retrieval method provided in this application embodiment can greatly improve retrieval performance and enhance the overall response performance of the input method.

[0082] It is understood that the dictionary retrieval for the current character (e.g., the i-th character) in this embodiment is performed in the cache corresponding to the previous character (e.g., the (i-1)-th character). This cache includes word data containing the full spelling of the i-th character as a prefix. Thus, as the user inputs, the search range gradually narrows, achieving incremental retrieval and improving search efficiency. However, since the word data obtained from each retrieval needs to be cached, if the dictionary is large, for example, contains 300,000 word entries, the memory required for caching increases accordingly. Therefore, to reduce memory usage, a bitmap data structure can be introduced in one possible implementation. The dictionary can be simply described using a bitmap, with each word entry corresponding to 1 bit in the bitmap. Therefore, caching the first word entry can be done by using a bitmap to record the first word entry.

[0083] In this context, a bitmap is a contiguous block of storage that uses bits as the unit to represent numbers. Different identifiers on a bit can represent different meanings. Typically, identifiers can be represented by numbers, such as 0 or 1. 0 indicates "not" (i.e., not the first term data, and the term data does not meet the query conditions), while 1 indicates "yes" (i.e., the first term data, and the term data meets the query conditions).

[0084] Based on this, the method of using a bitmap to record the first term data can be to set the bit corresponding to the first term data in the bitmap as an indicator that the query conditions are met, and set the bits corresponding to the other term data in the bitmap as an indicator that the query conditions are not met, according to the position of the first term data in the dictionary.

[0085] When using a bitmap data structure, the dictionary retrieval method is as follows: When retrieving the first character, the dictionary index area can be searched twice using binary search to determine the upper and lower boundaries of the word data corresponding to the full spelling of the first character. This allows for determining the search range based on these boundaries. Within this range, word data that satisfies the first two characters is retrieved, and these word data prefixed with the first two characters are cached. The caching method uses a bitmap to record this information; that is, the bit position of the word data in the dictionary corresponds to which bit in the bitmap. For example, if the word data is the Nth word in the dictionary, then the Nth bit in the bitmap is set to indicate that it meets the query conditions, for example, set to 1, indicating that the word data meets the conditions for the next query. Retrieving the first three characters involves traversing the bitmap, only querying the word data in the dictionary corresponding to the bit set to 1, and updating the bitmap again for word data that satisfies the first three characters as prefixes. This process is repeated to gradually narrow the search range. The next input only needs to query the word data with the bit set to 1 in the bitmap.

[0086] Continue with the input string to be searched as "bsdb". When the user enters 'b', the upper and lower bounds of the entry data corresponding to the full - spelling string starting with 'b' are determined through two binary searches, that is, the second entry data and the seventh entry data. The entry data between the second entry data and the seventh entry data is determined as the search range, as shown in Figure 4 the black filling shown. When the user then enters's', traverse again within the just - determined search range, and record the entry data corresponding to the full - spelling string with 'bs' as the prefix into the bitmap, that is, set the flag '1' at the corresponding bit, as shown in Figure 5 . When the user then enters 'd', traverse the entry data with bit 1 in the bitmap, and at the same time record the entry data corresponding to the full - spelling string with 'bsd' as the prefix into a new bitmap, as shown in Figure 6 . When the user enters 'b', similarly traverse the entry data with bit 1 in the new bitmap. The entries in the entry data that satisfy "bsdb" are the target entries to be searched, and the bitmap will be updated at the same time. Since there is no entry data corresponding to the full - spelling string with 'bsdb' as the prefix in the thesaurus, the bitmap is all 0, as shown in Figure 7 . The entry "No way" in the entry data shown in gray in Figure 7 is the target entry.

[0087] This solution introduces the data structure of the bitmap, enabling the thesaurus search to support incremental search, greatly improving the search performance of the thesaurus. At the same time, due to the very small memory occupancy of the bitmap data structure, it is completely acceptable for the input method product. For example, assuming the scale of the thesaurus is 320,000 entry data, corresponding to the bitmap, a bitmap of 320,000 bits is required, that is, 320,000 / 8 = 40KB. It can be seen that the new memory occupancy is very small. That is to say, through the use of the bitmap data structure, not only can the performance of searching the thesaurus be improved, but also the incremental search of the thesaurus can be supported. In the case of implementing incremental search, the memory occupancy is greatly reduced, thereby maximizing the search performance of the large - capacity thesaurus in the case of long - short spelling input, avoiding the situation of jamming during the user input process, and improving the user input experience.

[0088] This application embodiment greatly improves the performance of searching the thesaurus, especially the performance of the thesaurus including simple spelling. Through the evaluation of simple - spelling search, the kernel conversion performance of the input method product is improved by 80%.

[0089] Based on the above introduction, this application embodiment also provides a method for searching a thesaurus. This method introduces the data structure of the bitmap, and based on this, the method for searching the thesaurus can be seen in Figure 8 shown. The method includes:

[0090] S801. The terminal responds to the input operation for the first character and starts to search the thesaurus.

[0091] S802. Determine the search scope by the first character.

[0092] Specifically, the first character can be used to determine the upper and lower boundaries of the word data corresponding to the full pinyin string starting with that first character, and then the search range can be determined based on these boundaries. This search range includes the word data corresponding to the full pinyin string starting with that first character.

[0093] S803. Retrieve term data that satisfy the first two characters within the retrieval scope.

[0094] S804. Record the term data that subsequently meets the query conditions using a bitmap.

[0095] When searching for the i-th character, the subsequent entries that meet the query criteria are usually the entries containing the full pinyin string prefixed with the i-th character.

[0096] S805. Determine whether the last character of the input string to be searched has been found. If yes, the search of the dictionary ends. If no, proceed to S806.

[0097] S806. Quickly retrieve term data that satisfies the first i characters using bitmap.

[0098] It should be noted that, based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods.

[0099] based on Figure 3 Corresponding to the thesaurus retrieval method provided in the embodiments, this application also provides a thesaurus retrieval device 900. See also Figure 9 The retrieval device 900 of the thesaurus includes an acquisition unit 901, a determination unit 902, a caching unit 903, and a retrieval unit 904.

[0100] The acquisition unit 901 is used to acquire the first character in the input string to be searched, the input string to be searched including abbreviations;

[0101] The determining unit 902 is used to determine the search range from the dictionary based on the first character;

[0102] The caching unit 903 is used to record the search range in the cache, and the search range includes the word data of the full pinyin string starting with the first character;

[0103] The retrieval unit 904 is used to sequentially retrieve the remaining characters of the input string to be searched within the retrieval range to obtain target terms that satisfy the input string to be searched.

[0104] In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, the search unit 904 is specifically used to retrieve first term data from the cache corresponding to the (i-1)th character when searching for the i-th character in the input string. The first term data includes term data containing the full spelling string prefixed with the first i characters. The cache unit 903 is specifically used to cache the first term data until the search for the last character in the input string is completed, thus obtaining the target term. The cache corresponding to the (i-1)th character includes second term data, which includes term data containing the full spelling string prefixed with the first i-1 characters. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

[0105] In one possible implementation, the cache unit 903 is specifically used for:

[0106] The first term data is recorded using a bitmap.

[0107] In one possible implementation, the cache unit 903 is specifically used for:

[0108] Based on the position of the first term data in the thesaurus, the bit corresponding to the first term data in the bitmap is set as an identifier that satisfies the query conditions;

[0109] Set the bits corresponding to the remaining terms in the bitmap to indicate that the query conditions are not met.

[0110] In one possible implementation, the acquisition unit 901 is specifically used for:

[0111] After the input string to be searched is completed, the input string to be searched is obtained;

[0112] The input string to be searched is divided into characters to obtain the division result;

[0113] The first character is obtained based on the segmentation result.

[0114] In one possible implementation, the acquisition unit 901 is specifically used for:

[0115] In response to an input operation for the first character, the first character is acquired;

[0116] The retrieval unit 904 is specifically used for:

[0117] In response to an input operation for the i-th character, the i-th character is obtained and a search is performed on the i-th character.

[0118] In one possible implementation, the condition for determining the last character includes:

[0119] If no character input operation is detected after the target character is obtained, the target character will be used as the last character of the input string to be searched.

[0120] In one possible implementation, the device further includes a display unit:

[0121] The retrieval unit 904 is specifically used to retrieve data from the cache corresponding to the (i-1)th character to obtain the first term data and the target full string matching the first i characters.

[0122] The display unit is used to display the words in the word data containing the target full spelling as candidate options.

[0123] In one possible implementation, the display unit is specifically used for:

[0124] Based on the frequency of appearance in the term data where the target full pinyin string is located, the display priority of the term in the term data where the target full pinyin string is located is determined;

[0125] According to the order of display priority from high to low, the words in the word data containing the target full spelling are displayed as candidates.

[0126] This application also provides a computer device capable of executing a thesaurus retrieval method. This computer device can be, for example, a terminal, such as a smartphone.

[0127] Figure 10 The diagram shown is a block diagram of a portion of the structure of a smartphone provided in an embodiment of this application. (Reference) Figure 10 The smartphone includes components such as: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a Wi-Fi module 1070, a processor 1080, and a power supply 1090. The input unit 1030 may include a touch panel 1031 and other input devices 1032; the display unit 1040 may include a display panel 1041; and the audio circuit 1060 may include a speaker 1061 and a microphone 1062. It is understood that... Figure 10 The smartphone structure shown does not constitute a limitation on smartphones and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0128] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various functions and data processing of the smartphone by running the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the smartphone (such as audio data, phonebook, etc.). In addition, the memory 1020 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0129] The processor 1080 is the control center of the smartphone, connecting various parts of the smartphone via various interfaces and lines. It performs various functions and processes data by running or executing software programs and / or modules stored in the memory 1020 and by accessing data stored in the memory 1020. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 1080.

[0130] In this embodiment, the processor 1080 in the smartphone can perform the following steps:

[0131] Obtain the first character in the input string to be searched, wherein the input string includes abbreviations;

[0132] Based on the first character, the search range is determined from the dictionary and recorded in the cache. The search range includes the word data of the full pinyin string starting with the first character.

[0133] Within the search range, the remaining characters of the input string to be searched are searched sequentially to obtain target terms that satisfy the input string to be searched;

[0134] In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, when searching for the i-th character in the input string, the first term data is retrieved from the cache corresponding to the (i-1)-th character. The first term data includes the term data of the full spelling string with the first i characters as prefixes. The first term data is cached until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)-th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as prefixes. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

[0135] The computer device provided in this application embodiment can also be a server. Please refer to [link / reference]. Figure 11 As shown, Figure 11 The diagram illustrates the structure of a server 1100 provided in this embodiment. The server 1100 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and a memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing application programs 1142 or data 1144. The memory 1132 and storage media 1130 may be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations stored in the storage media 1130 on the server 1100.

[0136] Server 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server. TM Mac OS X TM Unix TM Linux TM FreeBSD TM etc.

[0137] In this embodiment, the central processing unit 1122 in server 1100 can perform the following steps:

[0138] Obtain the first character in the input string to be searched, wherein the input string includes abbreviations;

[0139] Based on the first character, the search range is determined from the dictionary and recorded in the cache. The search range includes the word data of the full pinyin string starting with the first character.

[0140] Within the search range, the remaining characters of the input string to be searched are searched sequentially to obtain target terms that satisfy the input string to be searched;

[0141] In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, when searching for the i-th character in the input string, the first term data is retrieved from the cache corresponding to the (i-1)-th character. The first term data includes the term data of the full spelling string with the first i characters as prefixes. The first term data is cached until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)-th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as prefixes. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

[0142] According to one aspect of this application, a computer-readable storage medium is provided for storing program code for executing the thesaurus retrieval method described in the foregoing embodiments.

[0143] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.

[0144] The descriptions of the processes or structures corresponding to the above figures each have their own emphasis. For parts of a process or structure that are not described in detail, please refer to the relevant descriptions of other processes or structures.

[0145] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0146] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0147] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0148] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0149] If the integrated unit is implemented as 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 this application, in essence, 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. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0150] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for retrieving a thesaurus, characterized in that, The method includes: Obtain the first character in the input string to be searched, wherein the input string to be searched includes a simplified string or a combination of a simplified string and a full string; Based on the first character, the search range is determined from the dictionary and recorded in the cache. The search range includes the word data of the full pinyin string starting with the first character. Within the search range, the remaining characters of the input string to be searched are searched sequentially to obtain target terms that satisfy the input string to be searched; In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, when searching for the i-th character in the input string, the first term data is retrieved from the cache corresponding to the (i-1)-th character. The first term data includes the term data of the full spelling string with the first i characters as prefixes. Based on the position of the first term data in the dictionary, the bit corresponding to the first term data in the bitmap is set as an identifier that satisfies the query condition, and the bit corresponding to the remaining term data in the bitmap is set as an identifier that does not satisfy the query condition, until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)-th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as prefixes. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

2. The method according to claim 1, characterized in that, The step of obtaining the first character in the input string to be searched includes: After the input string to be searched is completed, the input string to be searched is obtained; The input string to be searched is divided into characters to obtain the division result; The first character is obtained based on the segmentation result.

3. The method according to claim 1, characterized in that, The step of obtaining the first character in the input string to be searched includes: In response to an input operation for the first character, the first character is acquired; The search is performed on the i-th character in the input string to be searched, including: In response to an input operation for the i-th character, the i-th character is obtained and a search is performed on the i-th character.

4. The method according to claim 3, characterized in that, The conditions for determining the last character include: If no character input operation is detected after the target character is obtained, the target character will be used as the last character of the input string to be searched.

5. The method according to claim 3, characterized in that, The step of retrieving the first term data from the cache corresponding to the (i-1)th character includes: Retrieve from the cache corresponding to the (i-1)th character to obtain the first term data and the target full string matching the first i characters; The method further includes: The terms in the terminology data containing the target full spelling are displayed as candidate terms.

6. The method according to claim 5, characterized in that, The step of displaying the terms in the terminology data containing the target full-spell string as candidate terms includes: Based on the frequency of appearance in the term data where the target full pinyin string is located, the display priority of the term in the term data where the target full pinyin string is located is determined; According to the order of display priority from high to low, the words in the word data containing the target full spelling are displayed as candidates.

7. A thesaurus retrieval device, characterized in that, The device includes an acquisition unit, a determination unit, a caching unit, and a retrieval unit: The acquisition unit is used to acquire the first character in the input string to be searched, wherein the input string to be searched includes a simplified string or a combination of a simplified string and a full string; The determining unit is used to determine the search range from the thesaurus based on the first character; The caching unit is used to record the search range in the cache, and the search range includes the word data of the full pinyin string starting with the first character; The retrieval unit is used to sequentially search the remaining characters of the input string to be searched within the retrieval range to obtain target terms that satisfy the input string to be searched. In the process of sequentially searching the remaining characters of the input string within the search range to obtain the target term that satisfies the input string, the search unit is specifically used to retrieve the first term data from the cache corresponding to the (i-1)th character when searching for the i-th character in the input string. The first term data includes the term data of the full spelling string with the first i characters as a prefix. The cache unit is specifically used to set the bit corresponding to the first term data in the bitmap as an identifier that satisfies the query condition, and set the bit corresponding to the remaining term data in the bitmap as an identifier that does not satisfy the query condition, according to the position of the first term data in the dictionary, until the search for the last character in the input string is completed, and the target term is obtained. The cache corresponding to the (i-1)th character includes the second term data, which includes the term data of the full spelling string with the first i-1 characters as a prefix. The value of i is 2, 3, ..., N, where N is the number of characters in the input string.

8. The apparatus according to claim 7, characterized in that, The acquisition unit is specifically used for: After the input string to be searched is completed, the input string to be searched is obtained; The input string to be searched is divided into characters to obtain the division result; The first character is obtained based on the segmentation result.

9. The apparatus according to claim 7, characterized in that, The acquisition unit is specifically used for: In response to an input operation for the first character, the first character is acquired; The retrieval unit is specifically used for: In response to an input operation for the i-th character, the i-th character is obtained and a search is performed on the i-th character.

10. The apparatus according to claim 9, characterized in that, The conditions for determining the last character include: If no character input operation is detected after the target character is obtained, the target character will be used as the last character of the input string to be searched.

11. The apparatus according to claim 9, characterized in that, The device also includes a display unit: The retrieval unit is specifically used to retrieve data from the cache corresponding to the (i-1)th character to obtain the first term data and the target full string that matches the first i characters. The display unit is used to display the words in the word data containing the target full spelling as candidate options.

12. The apparatus according to claim 11, characterized in that, The display unit is specifically used for: Based on the frequency of appearance in the term data where the target full pinyin string is located, the display priority of the term in the term data where the target full pinyin string is located is determined; According to the order of display priority from high to low, the words in the word data containing the target full spelling are displayed as candidates.

13. A computer device, characterized in that, The computer device includes a processor and memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the method according to any one of claims 1-6 according to the instructions in the program code.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program code that, when executed by a processor, causes the processor to perform the method according to any one of claims 1-6.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Fast vocabulary entry prompting realization method

    CN101576929A