WO2016107611A1 - 一种用于移动终端的文本查找方法和装置 - Google Patents

一种用于移动终端的文本查找方法和装置 Download PDF

Info

Publication number
WO2016107611A1
WO2016107611A1 PCT/CN2016/070053 CN2016070053W WO2016107611A1 WO 2016107611 A1 WO2016107611 A1 WO 2016107611A1 CN 2016070053 W CN2016070053 W CN 2016070053W WO 2016107611 A1 WO2016107611 A1 WO 2016107611A1
Authority
WO
WIPO (PCT)
Prior art keywords
group
letter
query result
query
result
Prior art date
Application number
PCT/CN2016/070053
Other languages
English (en)
French (fr)
Inventor
聂琳
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2016107611A1 publication Critical patent/WO2016107611A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing

Definitions

  • the present invention relates to the field of mobile terminals, and more particularly to a text search method and apparatus for a mobile terminal.
  • obtaining the matching information by inputting the keyword is a common means for the user to store the query information on the terminal.
  • the amount of data corresponding to the database of these information is often small, but it needs to be able to find out the information required by the user relatively quickly and accurately, such as finding the contact information in the mobile phone, such as the name, and, for example, by installing the input method font in the terminal. Type the required text, etc.
  • the pre-current query method can convert the Chinese character input by the user into the corresponding pinyin, so that even if the Chinese character input by the user is wrong, as long as it is the homophone of the correct Chinese character to be searched, the search can be obtained from the database.
  • the user queries the original Chinese character string; or only performs a fuzzy search by the partial keyword of the character string to be queried by the user, and lists the string that satisfies the query condition including these partial keywords, and can be used in the listed results. Select the desired string and further obtain the information corresponding to the string.
  • the existing query method requires that the keyword input by the user is a part of the character string to be queried or a corresponding part of the pinyin, so that the target information to be queried by the user can be obtained according to the input character, and the input error cannot be tolerated. Due to dialects or language habits, many users have the problem of not being able to spell words or mistake the pinyin corresponding to certain Chinese characters.
  • an embodiment of the present invention provides a text search method and apparatus for a mobile terminal, so as to improve tolerance for keyword input errors, thereby improving query efficiency and accuracy of target text.
  • an embodiment of the present invention provides a text search method for a mobile terminal, where the method includes:
  • the i-th group query result includes the entry Is a non-empty subset of the entries of the text library in the terminal, and the i-th group query result is the same as the i-th group query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • the method further includes:
  • the i-th 2 sets of query results include The entry is a non-empty subset of the terms in the text library in the terminal.
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the method further includes:
  • a search is performed in the text library according to the first letter in the letter string to obtain a first group of query results, and the first pinyin letter or the text library is not included in the text library.
  • the entry included in the first set of query results is the same as the entry included in the text library;
  • the first group of query results is the first pinyin letter or the first in the text library.
  • the method further includes:
  • the set of query results are displayed after each set of query results is obtained in the text library or in the previous set of query results according to a letter in the letter string.
  • an embodiment of the present invention provides a text search method for a mobile terminal, where the search method includes:
  • the search is performed in the i-1th group query result to obtain the i-th group query result, and the i-th group query result includes the entry Is the end a non-empty subset of the entries of the text library in the end, the ith group query result is the same as the i-th group query result,
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • the method further includes:
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the method further includes:
  • a search is performed in the text library according to the first letter in the Pinyin string to obtain a first group query result.
  • the term included in the first group of query results is the same as the term included in the text library.
  • the first group of query results is the first pinyin letter and the first letter in the text library.
  • a collection of matching terms is the first pinyin letter and the first letter in the text library.
  • the method further includes:
  • an embodiment of the present invention provides a text search device, where the search device includes:
  • a receiving unit configured to receive a letter string input by a user
  • a searching unit configured to perform a search in the i-1th group query result according to the i-th letter in the alphabet string, where i is greater than 1, to obtain an i-th group query result, where the i-th group query
  • the result includes a term that is a non-empty subset of the entries of the text library in the terminal, and the i-th group query result is the same as the i-th group query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the result of the i+1th group query is the same as the result of the i-th group.
  • the searching unit is further configured to: in the case that i is greater than 2, according to the i-1th letter in the alphabet string, in the i-2th group query The result is queried to obtain the ith i-1 group query result, and the ith i-2 group query result includes an entry that is a non-empty subset of the entry in the text library in the terminal.
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the searching unit is further configured to: when i is equal to 2, according to the first letter in the alphabet string, Performing a search in the text library to obtain a first group of query results, where the first phonetic alphabet or the first English alphabet matches the first alphabet in the text library, The term included in the first set of query results is the same as the term included in the text library; the first text pinyin or the first English letter matching the first letter is included in the text library.
  • the first group of query results is a set of the first phonetic alphabet or the first English alphabet in the text library that matches the first letter.
  • the apparatus further includes:
  • a display unit configured to display the set of query results after obtaining a set of query results in the text library or in the previous set of query results according to one letter in the alphabet string.
  • an embodiment of the present invention provides a text search apparatus for a mobile terminal, where the search apparatus includes:
  • a receiving unit configured to receive a Chinese character string input by a user
  • a converting unit configured to obtain a Pinyin string corresponding to the Chinese character string according to the Chinese character string
  • a searching unit configured to perform a search in the i-1th group query result according to the i-th letter in the Pinyin string, where i is greater than 1, to obtain an i-th group query result, where the i-th group query
  • the result includes a term that is a non-empty subset of the entries of the text library in the terminal, and the i-th group query result is the same as the i-th group query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • the query unit is further configured to:
  • the i-th In the case where i is greater than 2, querying in the i-2th group query result according to the i-1th letter in the letter string to obtain the i-1th group query result, the i-th The entries included in the two sets of query results are non-empty subsets of the terms in the text library in the terminal.
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the query unit is further configured to:
  • a search is performed in the text library according to the first letter in the letter string to obtain a first group query result.
  • the term included in the first group of query results is the same as the term included in the text library.
  • the first group of query results is the first pinyin letter and the first letter in the text library.
  • a collection of matching terms is the first pinyin letter and the first letter in the text library.
  • the apparatus further includes:
  • a display unit configured to display the set of query results after obtaining a set of query results in the last set of query results according to the last pinyin in the Pinyin string corresponding to a Chinese character in the Chinese character string.
  • the embodiment of the invention has the following beneficial effects:
  • a text search method and apparatus for a mobile terminal are provided, and if the input keyword is incorrect or inaccurate, the target text that the user wants to query may still be queried, and the method is improved.
  • the tolerance of the text search method to the keyword input error simplifying the query process under the keyword input error, can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.
  • FIG. 1a and 1b are schematic flowcharts of a text search method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of a text search method in a specific scenario according to an embodiment of the present invention
  • FIG. 3 is a structural diagram of a text search apparatus according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of another text search apparatus according to an embodiment of the present invention.
  • FIG. 5 is a structural diagram of a device according to an embodiment of the present invention.
  • FIG. 6 is a structural diagram of another apparatus of a terminal according to an embodiment of the present invention.
  • the embodiment of the present invention provides a text search method and apparatus for a mobile terminal.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are merely a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1a and FIG. 1b are schematic flowcharts of a text search method according to an embodiment of the present invention, for convenience of description.
  • the embodiment corresponding to FIG. 1a and FIG. 1b is described by taking a search process as an example.
  • a search process is a process of displaying a matching result that meets the user's requirements according to a keyword input by the user.
  • the keyword can be a Chinese character or a string.
  • the text search method is used for the terminal device, and the terminal device may be a mobile phone, a notebook computer, a desktop computer, or the like, which is not limited in the embodiment of the present invention.
  • the text search method can be used for searching Chinese or English information of a contact in the address book of the terminal, obtaining a corresponding file by searching for a file name in the terminal database, or adopting an input method.
  • the embodiment of the present invention is not limited in the scenario of inputting the correct text according to the keyword input by the user.
  • the search method described in FIG. 1a, the user inputs letters, including the following steps:
  • S101a Receive a string of letters input by the user.
  • the length of the letter string depends on the user's input.
  • the letters in the letter string can be uppercase or lowercase or a mixture of uppercase and lowercase.
  • matching one letter with another letter can be understood as the two letters being identical or only different in case, such as A and a, m and M.
  • S102a According to the i-th letter in the alphabet string, where i is greater than 1, perform a search in the i-1th group query result to obtain an i-th group query result, where the i-th group query result is included
  • the entry is a non-empty subset of the entry of the text library in the terminal, and the result of the i-th query is the same as the result of the i-1th query.
  • the i-th group query result is the same as the i-th group query result, in other words, it means that the i-th group query result does not include the term matching the i-th letter.
  • the entry included in the i-th query result is the same as the entry included in the text library, in other words, the entry in the text library that does not include the i-th letter is not included.
  • the i-th letter can be the first letter
  • the first pinyin letter or the first is not included in the text library.
  • the English alphabet matches the i-th letter, or the i-th alphabet can be a letter in the middle of the alphabetic string.
  • the i-1th query result there is no entry matching the i-th alphabet.
  • the user does not need to delete the incorrect input letter or the user re-enters the alphabet string to search from the beginning, but still obtains the i-th group query result, the i-th group query result and the i-th group query result or
  • the text library is the same. This process of S102a is equivalent to ignoring the i-th letter, or querying the i-th letter as an arbitrary letter.
  • the entry included in the i-2th query result is a non-empty subset of the terms in the text library in the terminal.
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • searching is performed in the text library according to the first letter in the alphabet string to obtain a first group query result, and the first one is not included in the text library.
  • the term included in the first group of query results is the same as the term included in the text library;
  • the first group of query results is the first pinyin letter or the first in the text library.
  • the result of the i-th query is displayed.
  • non-empty subset includes the corpus.
  • the text library in the terminal may be a text library preset in the terminal, or may be a text library that is dynamically loaded or loaded by the user in the terminal, which is not limited in the embodiment of the present invention.
  • the result of the i+1th group query is a set of terms matching the i+1th letter in the i-th group query result;
  • the i+1th group query result is the same as the i-th group result.
  • the result of the (i+1)th group is displayed.
  • the set of query results is displayed.
  • S104a Display the last set of query results corresponding to the letter string.
  • a query process refers to a process of searching through a text library according to a letter string input by a user until a final set of query results is obtained. For example, if the user inputs n letters, the obtained n-th query result is the last set of query results. In this process: to obtain the i-group query results, you need to obtain the first set of query results, and then get the second set of query results from the first set of query results, and then obtain the third set of queries from the second set of query results. The result... until the i-th query result is obtained from the i-1th group query result.
  • the i-th letter is actually converted into an arbitrary letter for query.
  • the i-th query The result of matching the i+1th letter in the letter string means that the i+1th pinyin letter or the English letter of the entry is identical to the i+1th letter in the letter string or only the case is different. .
  • the i+1th pinyin letters or English letters of these terms are exactly the same or only the case is different, and the i+1th pinyin letters or English letters and letter strings of these terms are If the i+1th letter is identical or only the case is different, then the result of the i+1th query result is the same as the i-th query result. However, in this case, the i+1th query result is The entry matches the i+1th letter.
  • the i-th letter is ignored to perform the query, and after the i-th query result is obtained, the i-th letter is corresponding. The query process is ignored.
  • the pinyin spelling of the entry or the first m letters of the English spelling is the same; then the entry of the i+1th letter in the matching letter string in the i-th query result satisfies: the pinyin spelling or English of these terms
  • the m+1th letter of the spelling is identical to the i+1th letter in the letter string or only the case.
  • the i+1 query result matches the i+1-letter entry in the letter string, and the pinyin spelling of the entry Or the first letter of the English spelling is exactly the same as the i+1th letter in the letter string or only the case.
  • S102a and subsequent steps may also receive the i-th letter, obtain the i+1th query result according to the i-th query result or the text library, and then receive the i+1th letter, and obtain the i+1th query result according to the i+1th group
  • the result of the i+2 group query that is, the letter in the received letter string and the query result are alternately performed, which is not limited by the embodiment of the present invention.
  • the preset text library of the terminal is a pre-stored address book in the terminal, which is composed of the following terms: “Cao Fang”, “Fang Jing”, “Li Liang”, “Lin Xi”, “Lu Ming”, “Lu Qi”, “Lu Yiyang”, “Lu Qing”, “Lu Huaishan”, “Lu Yue”, “Lucy “And” Linda.
  • the entry that the user is looking for is "Lu Qing", and the letter string entered by the user is mlfuq.
  • the first letter of the letter string is m, and the first letter in the text library or the first word with the pinyin is m. If the first letter is wrong, the letter m is ignored, and the first letter corresponds to the first one.
  • the results of the group query include the same terms as those included in the address book.
  • the first group of query results are specifically "Cao Fang”, “Fang Jing”, “Li Liang”, “Lin Xi”, “Lu Ming”, “Lu Qi”, “Lu Yiyang”, “Lu Qing”, “Lu Huaishan”, “Lu Yue”, “Lucy” and “Linda”.
  • the first set of query results are displayed, which is more convenient for the user to view.
  • the second letter of the letter string is l, and the second group of query results are found from the first group of query results. Since the first letter m is wrong, the query process corresponding to the first letter is ignored, that is, the first group of queries is found.
  • the first letter in the entry or the first pinyin matches the entry of l
  • the first letter or the first pinyin of all the terms included in the second set of query results matches l
  • the second set of query results is specifically "Li Liang” "Lin Xi”, “Lu Ming”, “Lu Qi”, “Lu Yiyang”, “Lu Qing", “Lu Huaishan”, “Lu Yue”, “Lucy” and "Linda”.
  • the second set of query results is displayed, which is more convenient for the user to view.
  • the third letter of the letter string is f
  • the third group of query results are found from the second group of query results, that is, the second letter or the second pinyin of the second set of query results is matched with f. Entry.
  • the third set of query results is the same as the second set of query results, specifically "Li Liang”, “Lin Xi” , “Lu Ming”, “Lu Qi”, “Lu Yiyang”, “Lu Qing”, “Lu Huaishan”, “Lu Yue”, “Lucy” and "Linda”.
  • the third set of query results is displayed, which is more convenient for the user to view.
  • the fourth letter of the letter string is u, and the fourth group of query results are found from the third group of query results. Because the third letter f is wrong, the query process corresponding to the third letter is ignored, that is, the third group of queries is found.
  • the second letter of the entry in the result or the second pinyin and u match the entry, the fourth set of query results are: "Lu Ming", “Lu Qi”, “Lu Yiyang”, “Lu Qing” , “Lu Huaishan”, “Lu Yue” and "Lucy”.
  • the fourth set of query results is displayed, which is more convenient for the user to view.
  • the fifth letter of the letter string is q, and the fifth group of query results are found from the fourth group of query results. Since the fourth letter u corresponds to the matched fourth group of query results, the fourth group of query results are found.
  • the third letter of the entry or the third pinyin and u match the entry, the fifth set of query results are specifically: "Lu Qi" and "Lu Qing".
  • the query process ends, and the fifth group query result is the last group of query results, and the fifth group query result is displayed.
  • the user's next step is to perform operations on the contact corresponding to the term “Lu Qing”, such as selecting, deleting, modifying, viewing, and the like.
  • the entry that the user is looking for is “Li Liang” and the input letter string is “nil”.
  • the first letter of the letter string is n, and the first set of query results are found from the text library based on the first letter.
  • the first letter or the first pinyin is not found in the text library. If the first letter is wrong, the letter n is converted into any letter to find.
  • the first set of query results includes the entry and the address book. The included terms are the same.
  • the first group of query results are specifically "Cao Fang”, “Fang Jing”, “Li Liang”, “Lin Xi”, “Lu Ming”, “Lu Qi”, “Lu Yiyang”, “Lu Qing” "Lu Huaishan”, “Lu Yue”, “Lucy” and “Linda”.
  • the first set of query results are displayed, which is more convenient for the user to view.
  • the second letter of the letter string is i, and the second set of query results is found from the first set of query results according to the second letter. Because the first letter is wrong, the actual result is the first set of query results obtained by converting the letter n into any letter, so the second set of query results are found from the first set of query results, that is, the first set of query results are found.
  • the second letter in the entry or the second pinyin match the i, the second letter or the second pinyin of all the terms included in the second set of queries matches i, the second set of queries
  • the results are specifically "Li Liang", “Lin Xi" and "Linda".
  • the second set of query results is displayed, which is more convenient for the user to view.
  • the third letter of the letter string is l
  • the third group of query results are found from the second group of query results according to the third letter, that is, the third letter or the third of the entries in the second group of query results is found.
  • the third group of query results is specifically "Li Liang".
  • the query process ends, and the third group of query results is the last group of query results, showing the third group of query results.
  • the user's next step is to perform operations on the contact corresponding to the entry “Li Liang”, such as selecting, deleting, modifying, viewing, and the like.
  • the search method shown in FIG. 1b is also applied to the terminal. Unlike FIG. 1a, the user inputs a Chinese character string. This method includes the following steps:
  • Step S101b Receive a Chinese character string input by the user.
  • Step S102b Obtain a Pinyin string corresponding to the Chinese character string according to the Chinese character string.
  • a conversion code of a Chinese character and its corresponding pinyin is obtained to obtain a Pinyin string corresponding to the Chinese character string.
  • Step S103b According to the i-th letter in the Pinyin string, where i is greater than 1, perform a search in the i-1th group query result to obtain an i-th group query result, where the i-th group query result includes The entry is a non-empty subset of the entry of the text library in the terminal, and the i-th query result is the same as the i-th group query result.
  • the result of the i-th query is the same as the result of the i-th group query, in other words, it means that the query result of the i-th group does not include the term matching the i-th pinyin letter.
  • the entry included in the i-th query result is the same as the entry included in the text library, in other words, the entry in the text library that does not include the i-th pinyin letter is not included.
  • the entry included in the i-2th query result is a non-empty subset of the terms in the text library in the terminal.
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • a search is performed in the text library according to the first letter in the Pinyin string to obtain a first group query result
  • the term included in the first group of query results is the same as the term included in the text library.
  • the first group of query results is the first pinyin letter and the first letter in the text library.
  • a collection of matching terms is the first pinyin letter and the first letter in the text library.
  • non-empty subset includes the corpus.
  • Step S104b searching for the i+1th query result according to the i+1th letter in the Pinyin string to obtain the i+1th query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • a query process refers to a process of searching through a text library according to a pinyin string converted by a user input string until the last set of query results is obtained. For example, if the Chinese character string input by the user is converted into a pinyin string including n letters, the obtained nth group query result is the last group of query results.
  • this process to obtain the i-group query results, you need to obtain the first set of query results, and then get the second set of query results from the first set of query results, and then obtain the third set of queries from the second set of query results. The result... until the i-th query result is obtained from the i-1th group query result.
  • a set of query results is obtained in the last set of query results according to the last pinyin letter in the Pinyin string corresponding to a Chinese character in the Chinese character string.
  • a set of query results is displayed, so that the user can view the queryed terms and help the user decide whether to increase the Chinese characters included in the Chinese character string.
  • the search according to the m+1th letter is stopped.
  • the m group query result is displayed.
  • the i-th letter is actually converted into an arbitrary letter for querying.
  • the entry in the i-th query result that matches the i+1th letter in the letter string indicates: the i+1th pinyin letter of the entry and the i+1th in the letter string
  • the letters are identical or only different in capitalization. It should be understood that if the i+1th pinyin letters of these terms are exactly the same or only the case is different, and the i+1th pinyin letters and the i+1th of the letter strings of the terms are If the letters are identical or only the case is different, then the result of the i+1th query result is the same as the i-th query result. However, in this case, the entry of the i+1th query result matches the first i+1 letters.
  • the i-th letter is ignored to perform the query, and the i-th letter is corresponding after obtaining the i-th query result. The query process is ignored.
  • the m group matching query result has been successfully found according to m letters before the i-th letter, where m is smaller than i, then in the i-th group In the query result, the first m letters of the pinyin spelling of the entry are the same; then the entry of the i+1th letter in the matching letter string in the i-th query result satisfies: the m+1th of the pinyin spelling of these terms
  • the letter is identical to the i+1th letter in the letter string or only in case.
  • the i+1 query result matches the i+1-letter entry in the letter string, and the pinyin spelling of the entry
  • the first letter is identical to the i+1th letter in the letter string or only the case.
  • the Chinese character input by the user can be received.
  • the steps of S102b and later are started; a part of the Chinese character string can also be received, and the steps S102b and subsequent steps are started to obtain the last set of query results of the Chinese character string, and are received in the process or later.
  • the second part of the Chinese character string after obtaining the last set of query results of the last part of the Chinese character string, starts the S102b and subsequent steps about the second partial Chinese character string, and so on until the last set of query results of the entire Chinese character string is obtained.
  • the process of receiving the Chinese character string, the converted Chinese character string, and the query process are alternately performed, which is not limited by the embodiment of the present invention.
  • the user may input all the search keywords at once, or may input the searched keywords in different times, such as entering the contact's name when searching for contacts in the address book, etc.
  • a technical solution flow can be summarized by a person skilled in the art through the disclosure of the embodiments of the present invention, and details are not repeatedly described in the embodiments of the present invention.
  • Step S105b Display the last set of query results corresponding to the Pinyin string.
  • n+1th query result i needs to take 1 to n in order, that is, sequentially obtain the second group query result, the third group query result... the nth group query result.
  • the i+1th matching sub-string corresponding to the terms is the pinyin string of the terms or the English spelling, and the order is the same as the letter from the first letter. Long continuous substring.
  • the text library is a pre-stored address book in the terminal, and the entries are “Li Dong” and “Linhua”. , “Lin Nei”, “Lin Mi”, “Lin Xiang”, “Lin Yan Jin” and “Lu Qian”.
  • the terminal receives the Chinese character string input by the user, that is, "Lingyan”; according to the Chinese character string “Lingyan”, the Chinese character is converted into the code of the pinyin, and the corresponding Pinyin string "lingyan” is obtained.
  • the first set of query results are obtained from the text library, by the terms “Li Dong”, “Linhua”, “Linne”, “Linmi”, “Lin Xiang” , “Lin Yanjin” and “Lu Qian”.
  • the first pinyin of each entry in the first set of query results matches the first query letter, and because the first pinyin letter of the entry in the text library is the same, the words included in the first set of query results The bar is the same as the one included in the text library.
  • the second set of query results are obtained from the first set of query results, and the second set of query results are obtained by "Li Dong", “Linhua”, “Lin”, “Lin Mi”, “Lin Xiang” and “Lin Yanjin” are composed.
  • the second pinyin of each entry in the second set of query results matches the second query letter.
  • the third group of query results are obtained from the second set of query results, and the third set of query results are made by the words “forest”, “linne”, “linmi”, “Lin think” and “Lin Yanjin” are composed.
  • the third pinyin letter of each entry in the third set of query results matches the third query letter, and since the third pinyin letter of the entry in the text library is the same, the third set of query results and the second set The query results are the same.
  • the fourth query letter "g" of the Pinyin string it is searched from the third group of query results to obtain the fourth group of query results.
  • the fourth query letter is the wrong letter due to the user's input error.
  • the third query result does not include the entry matching the fourth query letter.
  • the fourth query letter ignores the process query and the obtained fourth group.
  • the results of the query are the same as those of the third group.
  • the results of the fourth group of queries are composed of the terms "forestation", “inside Lin", “linmi”, "lin think” and "lin Yanjin".
  • the fourth set of query results is displayed, which is more convenient for the user to view.
  • the fifth query letter "y" of the Pinyin string it is searched from the fourth group of query results to obtain the fifth group of query results.
  • the fourth query letter is the wrong letter due to user input errors, ignored
  • the fourth letter of the query process, from the fourth set of query results to find the corresponding letter of the Pinyin string is the word "y", then the fifth set of query results consist of "Lin Yanjin.”
  • the fifth group of query results are searched to obtain the sixth group of query results, and it is obvious that the fifth group of query results is the same as the sixth group of query results, the sixth group
  • the result of the query consists of “Lin Yanjin”; according to the seventh query letter “n” of the Pinyin string, it is searched from the sixth group of query results to obtain the seventh group of query results, obviously the seventh group of query results and the sixth group The query results are the same.
  • the seventh group of query results consists of “Lin Yanjin”. Since the user has not entered other Chinese characters, the query process ends.
  • the seventh group of query results is the last set of query results, and the seventh group of query results is displayed.
  • the user's next step is to perform operations on the contact corresponding to the entry “Lin Yanjin”, such as selecting, deleting, modifying, viewing, and the like.
  • the searching according to the sixth query letter and the searching according to the seventh query letter are stopped, and the query process ends, and the fifth group query result is displayed.
  • the entry that the user wants to find is “Lin Yanjin”. Due to the pronunciation error, the input Chinese character string is “Your Word” and the corresponding Pinyin string is “ninyan”.
  • the first letter of the Pinyin string is n
  • the first set of query results are searched from the text library according to the first pinyin letter, and the first letter or the first pinyin is the entry of n in the text library, then the first one If the letter is wrong, the letter n is converted into any letter to find.
  • the first group of query results includes the same entry as the entry included in the address book.
  • the first group of query results are specifically named by the words "Li Dong” and " Linhua, Linne, Linmi, Linxiang, Lin Yanjin and Lu Qian.
  • the second letter of the Pinyin string is i, and the second set of query results is found from the first set of query results according to the second letter. Because the first letter is wrong, the actual result is the first set of query results obtained by converting the letter n into any letter, so the second set of query results are found from the first set of query results, that is, the first set of query results are found.
  • the second pinyin and i match the entry in the entry, the second letter or the second pinyin of all the terms included in the second set of query results match i, and the second set of query results specifically East, Linhua, Linne, Linmi, Lin Xiang and Lin Yanjin.
  • the third letter of the Pinyin string is n, and the third group of query results are found from the second set of query results according to the third letter, that is, the third pinyin of the entry in the second set of query results is matched with n.
  • the third group of query results are specifically "forestation”, “forest”, “linmi”, “lin think” and “lin Yanjin”.
  • the third group of query results are displayed for the convenience of the user.
  • the fourth letter of the Pinyin string is y, and the fourth group of query results are found from the third group of query results according to the fourth letter, that is, the fourth pinyin letter and y of the entries in the third group of query results are found.
  • the fourth group of query results is specifically “Lin Yanjin”.
  • the fourth group of query results are searched to obtain the fifth group of query results, and obviously the fifth group query result is the same as the fourth group query result, the fifth group
  • the result of the query consists of "Lin Yanjin”; according to the sixth query letter "n" of the Pinyin string, it is searched from the fifth group of query results to obtain the sixth group of query results, obviously the sixth group of query results and the fifth group The query results are the same.
  • the sixth group of query results consists of “Lin Yanjin”. Since the user has not entered other Chinese characters, the query process ends.
  • the sixth group of query results is the last set of query results and the last one of the Chinese characters in the Chinese character string.
  • the result of the query corresponding to the pinyin letters shows the results of the sixth group of queries.
  • the user's next step is to perform operations on the contact corresponding to the entry “Lin Yanjin”, such as selecting, deleting, modifying, viewing, and the like.
  • the searching according to the fifth query letter and the searching according to the sixth query letter are stopped, and the query process ends, and the fourth group of query results is displayed.
  • the text search method for the terminal corresponding to FIG. 1a and FIG. 1b can still query the target text that the user wants to query if the input keyword is incorrect or inaccurate, and the method improves the key of the text search method.
  • the tolerance of word input error simplifying the query process under the keyword input error, can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.
  • FIG. 2 is another schematic flow chart of the text search method in the embodiment of the present invention, which is another representation of the method shown in FIG. 1a and FIG. 1b. Again, this text lookup method is applied to the terminal.
  • the method shown in Figure 2 includes the following steps:
  • S201 Receive a letter or a Chinese character input by a user.
  • the conversion code is called to convert the Chinese characters input by the user into pinyin, so as to be used for homophone matching and error character processing.
  • S202 Perform multiple rounds of searching in the text library according to the alphabet input by the user or the alphabet converted by the user, and use one letter as a key in each round until all the letters are traversed to obtain the final search result.
  • a round of searching is taken as an example for explanation:
  • the contacts included in the search range are searched to obtain the matching result of the current search letters, wherein the search range of the search is the result of the previous round search;
  • the search character is a wrong character in the current round
  • the special character is specially made. After processing, the search is performed again, so that the result of the current round search is the same as the result of the previous round search; or, after the special processing of the wrong character, the result of the current round search remains unchanged.
  • the special processing performed on the erroneous characters may be ignoring, arbitrarily character, or the like, and the specific manner is not limited in the embodiment of the present invention.
  • the current round of search results is displayed.
  • the text search method shown in FIG. 2 is equally applicable to various scenarios.
  • an example of finding a contact in an address book is described by a specific example.
  • a set of queries corresponding to the letter is obtained. After the result, the results of this set of queries are ignored.
  • the name of the contact that the user wants to find is “Lin Fujin”, and the input is a pinyin letter. Since there are many names in the address book that match the pronunciation of “lin”, it is still impossible to quickly and accurately locate the contact when inputting “lin”.
  • the user inputs the first letter “l”, and the results found in the address book are "Li Yuan”, “Li Ming”, “Lin Hua”, “Lin Nei”, “Lin Zi”, “Lin Ji” “Lin Xiang”, “Lin Dong” and “Lin Fujin”, preferably, display the first round of results; the user enters the second letter “i”, and the result found in the address book is "Li Yuan”, “Li Ming”, “Lin Hua”, “Lin Nei”, “Lin Zi”, “Lin Ji”, “Lin Xiang”, “Lin Dong” and “Lin Fu Jin” are preferred, showing the second round of results; users Enter the third letter “n” and find the results from the address book as “Linhua”, “Linner”, “Lin Zi”, “Lin Ji”, “Lin Xiang”, “Lin Dong” and “Lin In the preferred way, the third round of results is displayed; the user enters the fourth letter "g”, and the results found in the
  • the result is “Lin Attached”, the search is completed, and the fifth round result is displayed.
  • the user inputs "lingf”, and in the fourth round of the search with g as the keyword, the matching contact is not found, and the fourth round of the keyword is specially processed, for example, the key of the fourth round The word is ignored or used as any character, so that the fifth round of searching is continued in the address book, and the search result "Lin Fujin” is obtained, the search is completed, and the fifth round result is displayed.
  • the user inputs the pinyin corresponding to the first Chinese character, the input is "Ling”, and in the fourth round of the search with g as the keyword, the matching contact is not found, and the fourth round is found.
  • the results found in the address book are "Lin Hua”, “Lin Nei”, “Lin Zi”, “Lin Ji”, “Lin Xiang”, “Lin Dong” and “Lin Fu Jin” show the fourth round of results; due to the large number of results, the user continues to input “f”, so that the fifth round of search in the address book is continued, and the search result is obtained. Lin attached to”, the search is completed, showing the fifth round of results.
  • Figure 2 corresponds to the terminal.
  • the text search method can still query the target text that the user wants to query if the input keyword is wrong or inaccurate. This method improves the tolerance of the text search method on keyword input errors and simplifies keyword input.
  • the query process under error conditions can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.
  • Figure 3 shows a device 300 for text search, the device being used for a terminal, comprising:
  • the receiving unit 301 is configured to receive a letter string input by the user
  • the searching unit 302 is configured to perform a search in the i-1th group query result according to the i-th letter in the alphabet string, where i is greater than 1, to obtain an i-th group query result, where the i-th group
  • the query result includes an entry that is a non-empty subset of the entry of the text library in the terminal, and the i-th group query result is the same as the i-th group query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • the searching unit 302 is further configured to query, in the i-th group query result, according to the i-1th letter in the alphabet string, to obtain the i-1th level, if i is greater than 2.
  • the result of the group query, wherein the entry included in the i-2th query result is a non-empty subset of the terms in the text library in the terminal,
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the searching unit 302 is further configured to perform a search in the text library according to the first letter in the alphabet string to obtain the first group query result, where the text is equal to 2
  • the term included in the first group of query results and the term included in the text library In the case where the text library includes the first pinyin letter or the first English letter matching the first letter, the first group of query results is the first pinyin letter in the text library. Or a collection of terms whose first English letter matches the first letter.
  • the device 300 further includes a display unit 303 for each of the alphabet strings A set of query results is displayed after a letter of a letter obtains a set of query results in the text library or in the previous set of query results.
  • the display unit 303 is further configured to display a string of letters input by the user.
  • Figure 4 shows a device 400 for text search, the device being used for a terminal, comprising:
  • the receiving unit 401 is configured to receive a Chinese character string input by the user;
  • the converting unit 402 is configured to obtain a Pinyin string corresponding to the Chinese character string according to the Chinese character string;
  • the searching unit 403 is configured to perform a search in the i-1th group query result according to the i-th letter in the Pinyin string, where i is greater than 1, to obtain an i-th group query result, where the i-th group
  • the query result includes an entry that is a non-empty subset of the entry of the text library in the terminal, and the i-th group query result is the same as the i-th group query result.
  • the i+1th group query result is that the i-th group query result matches the i-th+ a collection of one-letter entries
  • the i+1th group query result is the same as the i-th group result.
  • the query unit 403 is further configured to query, in the i-th group query result, according to the i-1th letter in the alphabet string, to obtain the ith - a set of query results, the entry included in the i-2th query result is a non-empty subset of the terms in the text library in the terminal,
  • the query result of the i-th group is not included in the query result of the i-th group, the query result of the i-th group is the same as the query result of the i-th group;
  • the i-th group query result is a match in the i-th group query result.
  • the query unit 403 is further configured to perform a search in the text library according to the first letter in the alphabet string to obtain the first group query result, where i is equal to 2 Where the text library does not include the first pinyin alphabet matching the first letter, the term included in the first group of query results is the same as the term included in the text library; Where the text library includes a first pinyin alphabet matching the first letter, the first group of query results is that the first pinyin letter in the text library matches the first letter Collection of entries.
  • the query unit 403 is further configured to stop according to the m-th group query result that is searched from the m-th group search result or the text library according to the m-th letter, including only one entry. The search for the m+1th letter.
  • the device further includes a display unit 404, configured to display the set of query results after obtaining a set of query results in the last set of query results according to the last pinyin in the Pinyin string corresponding to a Chinese character in the Chinese character string. search result.
  • the display unit 404 is further configured to display the mth group query result.
  • the display unit 404 is further configured to display a Chinese character string input by the user.
  • the method improves the text search method for keyword input.
  • the tolerance of the error simplifying the query process under the keyword input error, can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.
  • FIG. 5 illustrates a structure of a terminal device 500 according to an embodiment of the present invention, which is an embodiment of the present invention.
  • the data transmission method is applicable to the terminal device 500.
  • the terminal device 500 includes at least one processor 501, a user interface 503, a network interface 504, a memory 505, and at least one communication bus 502.
  • Communication bus 502 is used to implement connection communication between these components.
  • the terminal device 500 optionally includes a user interface 503, including a display (eg, a touch screen, LCD, CRT, Holographic or Projector, etc.), a keyboard or a pointing device (eg, a mouse, a trackball)
  • the user interface 503 can be used to receive a string of letters input by the user.
  • Memory 505 can include read only memory and random access memory and provides instructions and data to processor 501. A portion of the memory 505 may also include non-volatile random access memory (NVRAM).
  • NVRAM non-volatile random access memory
  • the memory 505 stores the following elements, executable modules or data structures, or a subset thereof, or their extended set: the operating system 5051, including various system programs, such as a framework layer, a core library layer. , driver layer, etc., for implementing various basic services and processing hardware-based tasks; application module 5052, including various applications, such as a desktop, a media player, a browser, etc. Used to implement various application services.
  • the operating system 5051 including various system programs, such as a framework layer, a core library layer. , driver layer, etc., for implementing various basic services and processing hardware-based tasks
  • application module 5052 including various applications, such as a desktop, a media player, a browser, etc. Used to implement various application services.
  • the processor 501 is configured to: according to the i-th letter in the alphabet string input by the user, where i is greater than 1, in the result of the i-1th group query Performing a search to obtain an i-th group query result, where the i-th group query result includes an entry that is a non-empty subset of the entry of the text library in the terminal, the i-th group query result and the The i-1th group query result is the same, or, according to the i-th letter in the letter string, where i is equal to 1, a search is performed in the text library to obtain an i-th group query result, the i-th group
  • the term included in the query result is the same as the term included in the text library; searching for the i+1th query result according to the i+1th letter in the alphabet string to obtain the i+1th a result of the group query, in the case that the ith group query result includes a term that matches the
  • the processor 501 is further configured to: in the case that i is greater than 2, query the result of the i-2 group query according to the i-1th letter in the alphabet string to obtain the first
  • the result of the i-1 group query the term included in the query result of the i-2th group is a non-empty subset of the terms in the text library in the terminal, and the matching result is not included in the query result of the i-2th group
  • the query result of the i-1th group is the same as the query result of the i-2th group; and the matching result is included in the query result of the i-2th group
  • the result of the i-1th group query is a set of terms matching the i-1th letter among the i-2th group of query results.
  • the processor 501 is further configured to perform a search in the text library according to the first letter in the alphabet string to obtain the first group query result, where i is equal to 2
  • the term included in the first group of query results is included in the text library.
  • the terms are the same; in the case where the text library includes the first pinyin letter or the first English letter matching the first letter, the first group of query results is the first in the text library A collection of pinyin letters or terms whose first English letter matches the first letter.
  • the processor 501 is further configured to: control the user interface 503 to display the A set of query results.
  • the processor 501 is further configured to control the user interface 503 to display a string of letters input by the user.
  • the processor 501 is configured to: obtain a Pinyin string corresponding to the Chinese character string according to a Chinese character string input by a user by calling a program or an instruction stored in the memory 505; according to the i-th in the Pinyin string
  • the letters, wherein i is greater than 1, are searched in the i-1th group query result to obtain the i-th group query result, and the i-th group query result includes the entry term is the text in the terminal a non-empty subset of the entry of the library, the result of the i-th query being the same as the result of the query of the i-th group, or, according to the i-th letter in the pinyin string, where i is equal to 1,
  • the processor 501 is further configured to query, in the i-th group query result, according to the i-1th letter in the Pinyin string, in the case that i is greater than 2, to obtain the first
  • the result of the i-1 group query the term included in the query result of the i-2th group is a non-empty subset of the terms in the text library in the terminal, and the matching result is not included in the query result of the i-2th group
  • the query result of the i-1th group is the same as the query result of the i-2th group; and the matching result is included in the query result of the i-2th group
  • the result of the i-1th group query is a set of terms matching the i-1th letter among the i-2th group of query results.
  • the processor 501 is further configured to perform a search in the text library according to the first letter in the Pinyin string to obtain the first group query result, where i is equal to 2 Where the text library does not include the first pinyin alphabet matching the first letter, the term included in the first group of query results is the same as the term included in the text library; Where the text library includes a first pinyin alphabet matching the first letter, the first group of query results is that the first pinyin letter in the text library matches the first letter Collection of entries.
  • the processor 501 is further configured to control the user after obtaining a set of query results in the last set of query results according to the last pinyin in the Pinyin string corresponding to a Chinese character in the Chinese character string.
  • Port 503 displays the set of query results.
  • the processor 501 is further configured to stop according to the first group if the m-th group query result found in the m-th group search result or the text library according to the m-th letter includes only one entry. A lookup of m+1 letters; the control user interface 503 displays the mth group of query results.
  • the processor 501 is further configured to control the user interface 503 to display a string of letters input by the user.
  • the terminal device 500 can also perform the method and the embodiment of FIG. 1a, FIG. 1b, and FIG. 2, and details are not described herein again.
  • the method improves the text search method to input the keyword incorrectly. Tolerance, simplifying the query process under keyword input errors, can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.
  • a person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware (for example, a processor), and the program can be stored in a computer readable storage.
  • the program when executed, may include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
  • the embodiment of the invention relates to a terminal 600 and a text search method.
  • the terminal 600 can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), or an on-board computer.
  • PDA Personal Digital Assistant
  • POS Point of Sales
  • FIG. 6 is a block diagram showing a partial structure of a terminal 600 provided by an embodiment of the present invention.
  • the terminal 600 includes an RF (Radio Frequency) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a WiFi (Wireless Fidelity) module 670, and a processor 680. And power supply 690 And other components.
  • RF Radio Frequency
  • the terminal structure shown in FIG. 6 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements.
  • a terminal 600 of the embodiment of the present invention includes a memory 620, a processor 660, an input unit 630, and the like.
  • the memory 620 stores a text library preset by the terminal;
  • the input unit 630 is configured to receive a letter string input by the user;
  • the 660 is configured to perform a search in the i-1th group query result according to the i-th letter in the alphabet string, where i is greater than 1, to obtain an i-th group query result, and the i-th group query result
  • the included term is a non-empty subset of the entry of the text library in the terminal, the i-th query result is the same as the i-th group query result, or according to the i-th in the alphabet string a letter, where i is equal to 1, performing a lookup in the text library to obtain an i-th query result, the entry included in the i-th query result being the same as the entry included in the text library;
  • the processor 660 is configured to query the i-th group query result according to the i-1th letter in the alphabet string to obtain the i-th-1 in the case that i is greater than 2.
  • a result of the group query wherein the entry included in the query result of the i-2th group is a non-empty subset of the entry in the text library in the terminal, and the matching result is not included in the query result of the i-2th group
  • the i-th group query result is the same as the i-th group query result; and the i-th group query result includes matching the i-th
  • the result of the i-1th group query is the first A set of entries in the i-2 group query result that match the i-1th letter.
  • the processor 660 is configured to perform a search in the text library according to the first letter in the alphabet string to obtain the first group query result, where the text is equal to 2
  • the term included in the first group of query results and the term included in the text library In the case where the text library includes the first pinyin letter or the first English letter matching the first letter, the first group of query results is the first pinyin letter in the text library. Or a collection of terms whose first English letter matches the first letter.
  • the terminal 600 shown in FIG. 6 has another operation mode of the processor 660.
  • the processor 660 is configured to obtain the Chinese character string according to the Chinese character string. Corresponding Pinyin string; according to the i-th letter in the Pinyin string, where i is greater than 1, performing a search in the i-1th group query result to obtain an i-th group query result, the i-th group query The result includes a term that is a non-empty subset of the entry of the text library in the terminal, the i-th group query result is the same as the i-th group query result, or according to the first in the pinyin string i letters, where i is equal to 1, performing a lookup in the text library to obtain an i-th group query result, the entries included in the i-th group query result being the same as the terms included in the text library; Searching in the i-th query result according to the i+1th letter in the Pinyin string to obtain an i+1th group query result,
  • the processor 660 is configured to query, in the i-2th group query result, according to the i-1th letter in the Pinyin string, if i is greater than 2, Obtaining the result of the (i-1)th query, wherein the entry included in the i-2th query result is in a text library in the terminal a non-empty subset of the entry, in the case where the i-th group query result does not include the entry matching the i-th letter, the i-th group query result and the i-th
  • the result of the -2 group query is the same; in the case that the query result of the i-th group includes the entry of the i-1th letter, the result of the i-1th group query is the i-th A set of entries in the two sets of query results that match the i-1th letter.
  • the processor 660 is configured to perform a search in the text library according to the first letter in the Pinyin string to obtain the first group in the case that i is equal to 2.
  • a result of the query in the case that the first phonetic alphabet matches the first letter in the text library, the term included in the first group of query results is included in the text library
  • the terms are the same; in the case where the text library includes a first pinyin letter matching the first letter, the first group of query results is the first pinyin letter in the text library and the The first letter matches the set of terms.
  • the memory 620 can be the memory of the terminal 600 or the memory and external memory of the terminal 600.
  • the memory 620 includes NVRAM nonvolatile memory, DRAM dynamic random access memory, SRAM static random access memory, flash memory, and a hard disk, an optical disk, a USB disk, a floppy disk, or a tape drive.
  • the input unit 630 can be configured to receive input numeric or character information, such as a Chinese character string or a letter string input by a user, and generate a signal input related to user settings and function control of the terminal 600.
  • the input unit 630 may include a touch panel 631.
  • the touch panel 636 also referred to as a touch screen, can collect touch operations on or near the user (such as the user's operation on the touch panel 631 or the touch panel 631 by using any suitable object or accessory such as a finger, a stylus, or the like. ), and drive the corresponding connection device according to a preset program.
  • the touch panel 631 can include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 630 may further include other input devices 632, which may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like. One or more of them.
  • the terminal 600 can also include a display unit 640 that can be used to display information input by the user or information provided to the user and various menu interfaces of the terminal 600.
  • the display unit 640 may display the set of query results after each group of query results in the text library or the previous set of query results according to a letter in the alphabet string, or according to the The last pinyin in the Pinyin string corresponding to a Chinese character in the Chinese character string, after obtaining a set of query results in the previous set of query results, displaying the set of query results.
  • the display unit 640 can include a display panel 641.
  • the display panel 641 can be configured in the form of an LCD (Liquid Crystal Display) or an OLED (Organic Light-Emitting Diode).
  • the touch panel 631 covers the display panel 641 to form a touch display screen.
  • the touch display screen detects a touch operation on or near the touch display screen, the touch display screen transmits to the processor 660 to determine the type of the touch event.
  • the processor 660 then provides a corresponding visual output on the touch display based on the type of touch event.
  • the touch display screen includes an application interface display area and a common control display area.
  • the arrangement manner of the application interface display area and the display area of the common control is not limited, and the arrangement manner of the two display areas can be distinguished by up-and-down arrangement, left-right arrangement, and the like.
  • the application interface display area can be used to display the interface of the application. Each interface can contain at least one application diagram Interface elements such as flags and/or widget desktop controls.
  • the application interface display area can also be an empty interface that does not contain any content.
  • the common control display area is used to display controls with high usage, such as setting buttons, interface numbers, scroll bars, phone book icons, and the like.
  • the processor 660 is a control center of the terminal 600, and connects various parts of the entire mobile phone by using various interfaces and lines, and executes various kinds of the terminal 600 by running or executing software programs and/or modules and data stored in the memory 620. The function and processing of the data, thereby overall monitoring of the terminal 600.
  • the processor 660 can include one or more processing units.
  • the terminal 600 shown in FIG. 6 can still query the target text that the user wants to query if the received keyword is incorrect or inaccurate, and the method improves the tolerance of the text search method to the keyword input error. Simplify the query process under the keyword input error, which can improve the query efficiency and query accuracy of the target text, thereby improving the user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Document Processing Apparatus (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种用于终端的文本查找方法和装置,根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果(S102a),根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果(S103a),从而提高了查询方法对关键字输入错误的容忍度,从而提高了查询出目标文本的概率。

Description

一种用于移动终端的文本查找方法和装置 技术领域
本发明涉及移动终端领域,更具体的涉及一种用于移动终端的文本查找方法和装置。
背景技术
随着终端的发展,通过输入关键字获得其匹配的信息是用户在终端上存查询信息的常用手段。这些信息对应的数据库的数据量往往不大,但需要能较为快速和精确地查找出用户所需的信息,比如查找手机中的联系人信息如姓名,又比如通过安装的输入法字库,在终端上键入需要的文本等。
由于其鲜明的业务特点和广泛的使用领域,许多厂家都对以上类似场景下的信息查询方法做了研究,也做了许多改进。前现行的查询方法,可以将用户输入的汉字字符转化为对应的拼音,这样,即使用户输入的汉字是错误的,只要是欲搜索的正确汉字的同音字,仍然可以得到从数据库中搜索到符合用户查询初衷的汉字字符串;或者仅凭用户输入的欲查询的字符串的部分关键字进行模糊搜索,列出包含这些部分关键字的符合查询条件的字符串,用可在列出的结果中选择所需字符串,还可以进一步获得字符串对应的信息。
然而,现有的查询方法要求用户输入的关键字是欲查询字符串的一部分或者对应的一部分拼音,才能够根据输入的字符获得用户欲查询的目标信息,不能容忍输入错误。而由于方言或者语言习惯,很多用户存在无法拼对单词或者弄错某些汉字对应的拼音的情况,如果用户输入的关键字中有错误,如cat输入为cut,林(lin)输入为凌(ling),hu(胡)输入为fu(符),则往往查询出的结果为空或者无法获得用户欲查询的字符串,使用户无法获得欲查询的信息,用户只能删除部分或全部的关键字重新回忆和输入,查询出目标信息的概 率不高,查询不够准确,也浪费了用户的时间,影响用户体验。
发明内容
有鉴于此,本发明实施例提供了一种用于移动终端的文本查找方法和装置,以提高对关键字输入错误的容忍度,从而提高目标文本的查询效率和准确率。
第一方面,本发明实施例提供了一种用于移动终端的文本查找方法,所述方法包括:
接收用户输入的字母串;
根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
在第一方面的第一种可能的实现方式中,所述方法还包括:
在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括 的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
在第一方面的第二种可能的实现方式中,所述方法还包括:
在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
结合第一方面,或者第一方面第一至第二种任意一种可能的实现方式,在第三种可能的实现方式中,所述方法还包括:
每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
第二方面,本发明实施例提供了一种用于移动终端的文本查找方法,所述查找方法包括:
接收用户输入的汉字串;
根据所述汉字串得到所述汉字串对应的拼音串;
根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终 端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
在第二方面的第一种可能的实现方式中,所述方法还包括:
在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
在第二方面的第二种可能的实现方式中,所述方法还包括:
在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
结合第二方面,或者第二方面第一至第二种任意一种可能的实现方式,在第三种可能的实现方式中,所述方法还包括:
每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果;
第三方面,本发明实施例提供了一种文本查找装置,所述查找装置包括:
接收单元,用于接收用户输入的字母串;
查找单元,用于根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所 述第i+1组查询结果与所述第i组结果相同。
在第三方面的第一种可能的实现方式中,所述查找单元还用于在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
结合第三方面第一种可能的实现方式,在第二种可能的实现方式中,所述查找单元还用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
结合第三方面,或者第三方面第一至第二种任意一种可能的实现方式,在第三种可能的实现方式中,所述装置还包括:
显示单元,用于每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
第四方面,本发明实施例提供了一种用于移动终端的文本查找装置,所述查找装置包括:
接收单元,用于接收用户输入的汉字串;
转换单元,用于根据所述汉字串得到所述汉字串对应的拼音串;
查找单元,用于根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
在第四方面的第一种可能的实现方式中,所述查询单元还用于:
在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条 的集合。
结合第四方面第一种可能的实现方式,在第二种可能的实现方式中,所述查询单元还用于:
在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
结合第四方面,或者第四方面第一至第二种任意一种可能的实现方式,在第三种可能的实现方式中,所述装置还包括:
显示单元,用于每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
与现有的技术相比,本发明实施例具有如下有益效果:
在本发明实施例中,提供的一种用于移动终端的文本查找方法和装置,在输入的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一 些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1a和图1b为本发明实施例提供的文本查找方法的流程示意图;
图2为本发明实施例提供的文本查找方法在一种具体场景下的流程示意图;
图3为本发明实施例提供的一种文本查找装置的结构图;
图4为本发明实施例提供的另一种文本查找装置的结构图;
图5为本发明实施例提供的一种终端的装置结构图;
图6为本发明实施例提供的另一种终端的装置结构图。
具体实施方式
本发明实施例提供了一种用于移动终端的文本查找方法和装置,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
图1a和图1b所示的是本发明实施例提供的文本查找方法的流程示意图,为了方便说明。图1a和图1b所对应的实施例以一次查找过程为例进行说明。一次查找过程就是根据用户输入的关键字显示出符合用户要求的匹配结果的过程,关键字可以是一个汉字或者一个字串。这种文本查找方法用于终端设备,终端设备可以是手机、笔记本电脑、台式电脑等等,本发明实施例不做限定。具体的,这种文本查找方法可以用于终端的通讯录中联系人中文或英文信息的查找、通过查找终端数据库中的文件名获得对应的文件、或者采用某种输入法, 根据用户输入的关键字输入正确的文本等场景中,本发明实施例不做限定。图1a所述的查找方法,用户输入的是字母,包括以下步骤:
S101a:接收用户输入的字母串。
其中,字母串的长度取决于用户的输入。字母串中的字母可以是大写或者小写或者大写和小写的混合。
需要说明的是,本发明实施例中,某个字母与另一个字母匹配可以理解为这两个字母完全相同或者仅仅是大小写不同,如A与a,m与M。
S102a:根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同。
应当理解的是,第i组查询结果与所述第i-1组查询结果相同,换言之,就是表示第i-1组查询结果中不包括匹配所述第i个字母的词条。类似的,第i组查询结果中包括的词条与所述文本库中包括的词条相同,换言之,就是表示文本库中不包括匹配所述第i个字母的词条。
应当理解的是,这表示在用户输入的字母串中有错误的字母,这里表示为第i个字母,第i个字母可以是第一个字母,在文本库中不包括首个拼音字母或首个英文字母与第i个字母匹配的词条,或者,第i个字母可以是字母串中间的某个字母,在第i-1组查询结果中,没有与第i个字母匹配的词条。在本方法实施例中,无需删除用户输入错误的字母或者用户重新输入字母串从头查找,而是仍然获得第i组查询结果,第i组查询结果与第i-1组查询结果或者 文本库相同。S102a的这个过程,相当于忽略了第i个字母,或者将第i个字母当做了任意字母进行查询。
具体的,在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
可选的,显示第i组查询结果。
需要理解的是,非空子集包括全集。
需要理解的是,终端中的文本库,可以是终端中预设的文本库,也可以是用户动态加载或载入终端中的文本库,本发明实施例不做限定。
S103a:根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所 述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
可选的,显示第i+1组结果。
可选的,每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
S104a:显示所述字母串对应的最后一组查询结果。
需要说明的是,由于本发明的技术方案是个递归流程,采用整个查询过程中的第i-1个字母、第i个字母以及第i+1个字母对应的步骤有代表性地来说明,但本发明的完整的技术方案中还包括根据用户输入的字母串中的其他字母来查找直到获得最终一组查询结果的过程,但都遵循本发明实施例中披露的步骤的规律,本领域技术人员应当能够结合本发明实施例中披露的步骤和本领域常用的技术手段获得完整的技术方案。
本领域技术人员应当理解,本发明实施例中,一次查询过程指的是根据用户输入的字母串通过在文本库中查找,直到获得最后一组查询结果的过程。例如,用户输入n个字母,则获得的第n组查询结果就是最后一组查询结果。在这个过程中:要获得第i组查询结果,就需要获得第1组查询结果,再从第1组查询结果中获得第2组查询结果,再从第2组查询结果中获得第3组查询结果……直到从第i-1组查询结果中获得第i组查询结果。
另外,需要说明的是,结合现有技术,本发明实施例中,对于“第i组查询结果中包括匹配所述第i+1个字母的词条”应当理解为:
在一个实施例中,S102a中获得第i组查询结果的查询过程中,实际上是将第i个字母转化为任意字母来进行查询。则在这个实施例中,则第i组查询 结果中匹配字母串中的第i+1个字母的词条表示:这些词条的第i+1个拼音字母或者英文字母与字母串中的第i+1个字母完全相同或者仅大小写不同。应当理解的是,如果这些词条的第i+1个拼音字母或者英文字母又恰好完全相同或者或者仅大小写不同,并且这些词条的第i+1个拼音字母或者英文字母与字母串中的第i+1个字母完全相同或者仅大小写不同,那么也会出现第i+1组查询结果与第i组查询结果相同的情况,然而这种情况下,第i+1组查询结果的词条匹配所述第i+1个字母。
在另一个实施例中,在S102a中获得第i组查询结果的查询过程中,原理上是将第i个字母忽略来进行查询,并在获得第i组查询结果后将第i个字母对应的查询过程忽略。则在这个实施例中,本领域技术人员应该理解的是,如果在第i个字母之前,已经根据m个字母成功查找出了m组匹配的查询结果,其中m小于i,那么在第i组查询结果中,词条的拼音拼写或者英语拼写的前m个字母相同;则第i组查询结果中匹配字母串中的第i+1个字母的词条满足:这些词条的拼音拼写或者英语拼写的第m+1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同。应当理解的是,如果这些词条的第m+1个字母又恰好完全相同或者或者仅大小写不同,并且这些词条的第m+1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同,那么也会出现第i+1组查询结果与第i组查询结果相同的情况,然而这种情况下,第i+1组查询结果的词条匹配所述第i+1个字母。
如果在第i个字母之前,没有根据字母串中的任何一个字母查找出匹配的查询结果,则第i组查询结果中匹配字母串中i+1个字母的词条满足,词条的拼音拼写或者英语拼写的第1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同。
需要说明的是,可以接收用户输入的字母串中的所有字母后,再开始 S102a及以后的步骤;也可以接收第i个字母,根据第i组查询结果或者文本库获得第i+1组查询结果,再接收第i+1个字母,根据第i+1组查询结果获得第i+2组查询结果,也就是接收字母串中的字母和获得查询结果交替进行,本发明实施例对此不做限定。
为了方便理解,现以图2a所示的流程,在查找联系人的场景下做简要说明,在此情景下,终端预设的文本库就是终端中预先存储的通讯录,由以下词条组成:“曹芳”、“方静”、“李亮”、“林夕”、“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”、”Lucy”和”Linda”。
以将错误的字母忽略并在获得第i组查询结果后将错误的字母对应的查询过程忽略的情况,进行说明。
比如,用户要查找的词条是“陆清”,用户输入的字母串为mlfuq。
字母串的第一个字母是m,并且文本库中查找不到首字母或首个拼音是m的词条,则第一个字母错误,则将字母m忽略,第一个字母对应的第一组查询结果包括的词条与通讯录中的包括的词条相同,第一组查询结果具体为“曹芳”、“方静”、“李亮”、“林夕”、“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”、”Lucy”和”Linda”。
可选的,显示第一组查询结果,能够更方便用户查看。
字母串的第二个字母是l,从第一组查询结果中查找出第二组查询结果,由于第一个字母m错误,忽略第一个字母对应的查询过程,即查找出第一组查询结果中的词条中首字母或者首拼音与l匹配的词条,则第二组查询结果包括的所有词条的首字母或者首拼音与l匹配,第二组查询结果具体为“李亮”、“林夕”、“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”、”Lucy”和”Linda”。
可选的,显示第二组查询结果,能够更方便用户查看。
字母串的第三个字母是f,从第二组查询结果中查找出第三组查询结果,即查找出第二组查询结果中的词条中第二个字母或者第二个拼音与f匹配的词条。但是在第二组查询结果中,没有词条的拼音或者拼写中的第二个字母与f匹配,则第三组查询结果与第二组查询结果相同,具体为“李亮”、“林夕”、“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”、”Lucy”和”Linda”。
可选的,显示第三组查询结果,能够更方便用户查看。
字母串的第四个字母是u,从第三组查询结果中查找出第四组查询结果,由于第三个字母f错误,忽略第三个字母对应的查询过程,即查找出第三组查询结果中的词条的第二个字母或者第二个拼音与u匹配的词条,第四组查询结果具体为:“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”和”Lucy”。
可选的,显示第四组查询结果,能够更方便用户查看。
字母串的第五个字母是q,从第四组查询结果中查找出第五组查询结果,由于第四个字母u对应匹配的第四组查询结果,即查找出第四组查询结果中的词条的第三个字母或者第三个拼音与u匹配的词条,第五组查询结果具体为:“卢琦”和“陆清”。
由于用户不再输入其他字母改变字母串,本次查询过程结束,第五组查询结果是最后一组查询结果,显示第五组查询结果。
可选的,接收用户的下一步针对词条“陆清”对应的联系人的操作,比如选中、删除、修改、查看等等。
需要说明的是,显然,如果用户输入的字母串是“luq”,即用户输入的关键字没有错误的情况下,采用现有的技术即可匹配出相应的结果,本发明实施例不再赘述。
以将错误的字母转化为任意字母的情况,进行说明。
比如,用户要查找的词条是“李亮”,输入的字母串是“nil”。
字母串的第一个字母是n,根据第一个字母从文本库中查找出第一组查询结果。文本库中查找不到首字母或首个拼音是n的词条,则第一个字母错误,则将字母n转化为任意字母来查找,第一组查询结果包括的词条与通讯录中的包括的词条相同,第一组查询结果具体为“曹芳”、“方静”、“李亮”、“林夕”、“卢明”、“卢琦”、“路一阳”、“陆清”、“陆怀山”、“鲁月”、”Lucy”和”Linda”。
可选的,显示第一组查询结果,能够更方便用户查看。
字母串的第二个字母是i,根据第二个字母从第一组查询结果中查找出第二组查询结果。由于第一个字母错误,实际是字母n转化为任意字母来查找而获得的第一组查询结果,因此从第一组查询结果中查找出第二组查询结果,即查找出第一组查询结果中的词条中第二个字母或者第二个拼音与i匹配的词条,则第二组查询结果包括的所有词条的第二个字母或者第二个拼音与i匹配,第二组查询结果具体为“李亮”、“林夕”和”Linda”。
可选的,显示第二组查询结果,能够更方便用户查看。
字母串的第三个字母是l,根据第三个字母从第二组查询结果中查找出第三组查询结果,即查找出第二组查询结果中的词条中第三个字母或者第三个拼音与l匹配的词条,则第三组查询结果具体为“李亮”。
由于用户不再输入其他字母改变字母串,本次查询过程结束,第三组查询结果是最后一组查询结果,显示第三组查询结果。
可选的,接收用户的下一步针对词条“李亮”对应的联系人的操作,比如选中、删除、修改、查看等等。
需要说明的是,显然,如果用户输入的字母串是“lil”,即用户输入的关键字没有错误的情况下,采用现有的技术即可匹配出相应的结果,本发明实施例不再赘述。
图1b所表示的查找方法中,同样应用于终端,与图1a不同的是,用户输入的是汉字串。此方法包括以下步骤:
步骤S101b:接收用户输入的汉字串。
步骤S102b:根据所述汉字串得到所述汉字串对应的拼音串。
具体的,根据所述汉字串,通过汉字与其对应的拼音的转化代码,以得到所述汉字串对应的拼音串。
步骤S103b:根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同。
应当理解的是,第i组查询结果与所述第i-1组查询结果相同,换言之,就是表示第i-1组查询结果中不包括匹配所述第i个拼音字母的词条。类似的,第i组查询结果中包括的词条与所述文本库中包括的词条相同,换言之,就是表示文本库中不包括匹配所述第i个拼音字母的词条。
应当理解的是,这表示在用户输入的汉字串中有与欲查询的词条中的汉字不同音的汉字,即错误的汉字,这里体现为拼音串中的第i个字母,第i个字母可以是第一个字母,在文本库中不包括首个拼音字母与第i个字母匹配的词条,或者,第i个字母可以是拼音串中间的某个字母,在第i-1组查询结果中,没有与第i个字母匹配的词条。在本方法实施例中,无需删除用户输入错误的汉字或者用户重新输入汉字串从头查找,而是仍然获得第i组查询结果,第i组查询结果与第i-1组查询结果或者文本库相同。S102a的这个过程,相当于 忽略了第i个字母,或者将第i个字母当做了任意字母。
具体的,在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
需要理解的是,非空子集包括全集。
步骤S104b:根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
需要说明的是,由于本发明的技术方案是个递归流程,采用整个查询过程中的第i-1个字母、第i个字母以及第i+1个字母对应的步骤有代表性地来说明,但本发明的完整的技术方案中还包括根据用户输入的字母串中的其他字母来查找直到获得最终一组查询结果的过程,但都遵循本发明实施例中披露的步骤的规律,本领域技术人员应当能够结合本发明实施例中披露的步骤和本领域常用的技术手段获得完整的技术方案。
本领域技术人员应当理解,本发明实施例中,一次查询过程指的是根据用户输入的汉字串转化成的拼音串通过在文本库中查找,直到获得最后一组查询结果的过程。例如,用户输入的汉字串转化成的拼音串包括n个字母,则获得的第n组查询结果就是最后一组查询结果。在这个过程中:要获得第i组查询结果,就需要获得第1组查询结果,再从第1组查询结果中获得第2组查询结果,再从第2组查询结果中获得第3组查询结果……直到从第i-1组查询结果中获得第i组查询结果。
可选的,每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音字母,在上一组查询结果中得到所述最后一个拼音字母对应的一组查询结果后,显示所述一组查询结果。应当理解的是,由于汉字串对应的拼音串是根据汉字的顺序一个一个转译的,本领域技术人员很容易实现标记每个汉字的最后一个拼音字母,本发明实施例对如何标记每个汉字的最后一个拼音字母不做限制。显示最后一个拼音字母对应的一组查询结果,方便用户查看查询出的词条,帮助用户决定是否增加汉字串中包括的汉字。
可选的,在根据第m个字母从第m-1组查找结果或者文本库中查找出的第m组查询结果只包括一个词条的情况下,停止根据第m+1个字母的查找。显示第m组查询结果。
另外,需要说明的是,结合现有技术,本发明实施例中,对于“第i组查 询结果中包括匹配所述第i+1个字母的词条”应当理解为:
在一个实施例中,S103b中获得第i组查询结果的查询过程中,实际上是将第i个字母转化为任意字母来进行查询。则在这个实施例中,则第i组查询结果中匹配字母串中的第i+1个字母的词条表示:这些词条的第i+1个拼音字母与字母串中的第i+1个字母完全相同或者仅大小写不同。应当理解的是,如果这些词条的第i+1个拼音字母又恰好完全相同或者或者仅大小写不同,并且这些词条的第i+1个拼音字母与字母串中的第i+1个字母完全相同或者仅大小写不同,那么也会出现第i+1组查询结果与第i组查询结果相同的情况,然而这种情况下,第i+1组查询结果的词条匹配所述第i+1个字母。
在另一个实施例中,在S103b中获得第i组查询结果的查询过程中,原理上是将第i个字母忽略来进行查询,并在获得第i组查询结果后将第i个字母对应的查询过程忽略。则在这个实施例中,本领域技术人员应该理解的是,如果在第i个字母之前,已经根据m个字母成功查找出了m组匹配的查询结果,其中m小于i,那么在第i组查询结果中,词条的拼音拼写的前m个字母相同;则第i组查询结果中匹配字母串中的第i+1个字母的词条满足:这些词条的拼音拼写第m+1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同。应当理解的是,如果这些词条的第m+1个字母又恰好完全相同或者或者仅大小写不同,并且这些词条的第m+1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同,那么也会出现第i+1组查询结果与第i组查询结果相同的情况,然而这种情况下,第i+1组查询结果的词条匹配所述第i+1个字母。
如果在第i个字母之前,没有根据字母串中的任何一个字母查找出匹配的查询结果,则第i组查询结果中匹配字母串中i+1个字母的词条满足,词条的拼音拼写的第1个字母与字母串中的第i+1个字母完全相同或者仅大小写不同。
需要说明的是,当用户输入的汉字串比较长时,可以接收用户输入的汉字 串中的所有汉字后,再开始S102b及以后的步骤;也可以接收一部分汉字串,开始S102b及以后的步骤,获得这一部分汉字串的最后一组查询结果,并在这个过程中或以后再接收第二部分汉字串,在获得上一部分汉字串的最后一组查询结果后,再开始关于第二部分的汉字串的S102b及以后的步骤,如此往复直到获得整个汉字串的最后一组查询结果,的也就是接收汉字串、转化汉字串和查询过程交替进行,本发明实施例对此不做限定。比如,在不同的应用场景下,一次查找过程中,用户可能一次性输入所有查找关键字,也可能分次输入查找的关键词,比如在通讯录中查找联系人时输入联系人的姓名等等,本领域技术人员可以通过本发明实施例的披露内容总结出技术方案流程,本发明实施例不再赘述。
步骤S105b:显示所述拼音串对应的最后一组查询结果。
本领域技术人员应当理解,要获得第n+1组查询结果,i需要依次取1到n,即依次获得第2组查询结果,第3组查询结果……第n组查询结果。
则对于第i组查询结果中的所有词条,这些词条对应的第i+1匹配子串是这些词条的拼音串或者英文拼写中,从第一个字母起顺序和字母组成相同的最长的连续子串。
类似的,现以图1b方法的流程,在查找联系人的场景下做简要说明,在此情景下,文本库就是终端中预先存储的通讯录,由词条“李东”、“林化”、“林内”、“林米”、“林想”、“林言进”和“陆潜”组成。
一方面,以将错误的字母忽略并在获得第i组查询结果后将错误的字母对应的查询过程忽略的情况,进行说明。
用户想要搜索的联系人时“林言进”,由于发音问题,用户输入的汉字串为“凌言”(这里举例为用户一次性输入完整名字的例子,用户一个一个汉字输入的情况类似,不再举例)。
终端接收用户输入的汉字串,即“凌言”;根据汉字串“凌言”通过汉字转化为拼音的代码,获得对应的拼音串“lingyan”。
根据拼音串的第一个查询字母“l”,从文本库中获得第一组查询结果,由词条“李东”、“林化”、“林内”、“林米”、“林想”、“林言进”和“陆潜”组成。第一组查询结果中的每个词条第一个拼音字母与第一个查询字母匹配,并且由于文本库中的词条的第一个拼音字母都相同,第一组查询结果中包括的词条与文本库中包括的词条相同。
根据拼音串的第二个查询字母“i”,从第一组查询结果中获得第二组查询结果,第二组查询结果由词条由“李东”、“林化”、“林内”、“林米”、“林想”和“林言进”组成。第二组查询结果中的每个词条第二个拼音字母与第二个查询字母匹配。
根据拼音串的第三个查询字母“n”,从第二组查询结果中获得第三组查询结果,第三组查询结果由词条由“林化”、“林内”、“林米”、“林想”和“林言进”组成。第三组查询结果中的每个词条第三个拼音字母与第三个查询字母匹配,并且由于文本库中的词条的第三个拼音字母都相同,第三组查询结果与第二组查询结果相同。
根据拼音串的第四个查询字母“g”,从第三组查询结果中查找,以获得第四组查询结果。由于用户的输入错误,第四个查询字母是错误的字母,在第三组查询结果中不包括匹配第四个查询字母的词条,将第四个查询字母忽略进程查询,获得的第四组查询结果与第三组查询结果相同,第四组查询结果由词条“林化”、“林内”、“林米”、“林想”和“林言进”组成。
可选的,显示第四组查询结果,能够更方便用户查看。
根据拼音串的第五个查询字母“y”,从第四组查询结果中查找,以获得第五组查询结果。由于用户的输入错误,第四个查询字母是错误的字母,忽略 第四个字母的查询过程,从第四组查询结果中查找对应的拼音串的第四个字母是“y”的词条,则第五组查询结果由“林言进”组成。
类似的,根据拼音串的第六个查询字母“a”,从第五组查询结果中查找,以获得第六组查询结果,显然第五组查询结果与第六组查询结果相同,第六组查询结果由“林言进”组成;根据拼音串的第七个查询字母“n”,从第六组查询结果中查找,以获得第七组查询结果,显然第七组查询结果与第六组查询结果相同,第七组查询结果由“林言进”组成,由于用户未输入其他汉字,本次查询过程结束,第七组查询结果是最后一组查询结果,显示第七组查询结果。
可选的,接收用户的下一步针对词条“林言进”对应的联系人的操作,比如选中、删除、修改、查看等等。
需要说明的是,显然,如果用户输入的汉字串是“林言”,即用户输入的关键字没有错误的情况下,采用现有的技术即可匹配出相应的结果,本发明实施例不再赘述。
或者优选的,由于第五组查询结果只包括一个查询词条,停止根据第六个查询字母的查找和根据第七个查询字母的查找,本次查询过程结束,显示第五组查询结果。
另一方面,以将错误的字母转化为任意字母的情况,进行说明。
比如,用户要查找的词条是“林言进”,由于发音错误,输入的汉字串是“您言”,对应的拼音串是“ninyan”。
拼音串的第一个字母是n,根据第一个拼音字母从文本库中查找第一组查询结果,并且文本库中查找不到首字母或首个拼音是n的词条,则第一个字母错误,则将字母n转化为任意字母来查找,第一组查询结果包括的词条与通讯录中的包括的词条相同,第一组查询结果具体为由词条“李东”、“林化”、“林内”、“林米”、“林想”、“林言进”和“陆潜”组成。
拼音串的第二个字母是i,根据第二个字母从第一组查询结果中查找出第二组查询结果。由于第一个字母错误,实际是字母n转化为任意字母来查找而获得的第一组查询结果,因此从第一组查询结果中查找出第二组查询结果,即查找出第一组查询结果中的词条中第二个拼音与i匹配的词条,则第二组查询结果包括的所有词条的第二个字母或者第二个拼音与i匹配,第二组查询结果具体为“李东”、“林化”、“林内”、“林米”、“林想”和“林言进”。
拼音串的第三个字母是n,根据第三个字母从第二组查询结果中查找出第三组查询结果,即查找出第二组查询结果中的词条中第三个拼音与n匹配的词条,则第三组查询结果具体为“林化”、“林内”、“林米”、“林想”和“林言进”。
由于第三个字母是汉字串中第一个汉字“您”的最后一个拼音字母n,可选的,显示第三组查询结果,以方便用户查看。
拼音串的第四个字母是y,根据第四个字母从第三组查询结果中查找出第四组查询结果,即查找出第三组查询结果中的词条中第四个拼音字母与y匹配的词条,则第四组查询结果具体为“林言进”。
类似的,根据拼音串的第五个查询字母“a”,从第四组查询结果中查找,以获得第五组查询结果,显然第五组查询结果与第四组查询结果相同,第五组查询结果由“林言进”组成;根据拼音串的第六个查询字母“n”,从第五组查询结果中查找,以获得第六组查询结果,显然第六组查询结果与第五组查询结果相同,第六组查询结果由“林言进”组成,由于用户未输入其他汉字,本次查询过程结束,第六组查询结果是最后一组查询结果也是汉字串中一个汉字的最后一个拼音字母对应的查询结果,显示第六组查询结果。
可选的,接收用户的下一步针对词条“林言进”对应的联系人的操作,比如选中、删除、修改、查看等等。
需要说明的是,显然,如果用户输入的汉字串是“林言”,即用户输入的 关键字没有错误的情况下,采用现有的技术即可匹配出相应的结果,本发明实施例不再赘述。
或者优选的,由于第四组查询结果只包括一个查询词条,停止根据第五个查询字母的查找和根据第六个查询字母的查找,本次查询过程结束,显示第四组查询结果。
需要说明的是,在图1a和图1b所对应的方法在其他场景下的具体例子,比如通过查找终端数据库中的文件名获得对应的文件、或者采用某种输入法,根据用户输入的关键字输入正确的文本等等,执行方式和在终端的通讯录(电话簿)中查找联系人的场景下很类似,本领域技术人员很容易联想和理解,本申请文件不再在其他应用场景中举例详细说明,同样落入本申请文件的保护范围。应当理解,本发明实施例不限定文本查找的具体应用场景,也不局限于本发明实施例中举例的几种场景。
图1a和图1b所对应的用于终端的文本查找方法,在输入的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。
图2所示是的本发明实施例中文本查找方法的另一个流程示意图,是图1a和图1b所示的方法的另一种表述方式。同样的,这种文本查找方法应用于终端。图2所示的方法包括以下步骤:
S201:接收用户输入的字母或者汉字。
可选的,如果用户输入的是汉字,则调用转换代码使用户输入的汉字转换为拼音,从而用于同音字匹配和错误字符的处理。
需要说明的是,将汉字转换为拼音所采用的代码或者实现方法属于现有技术,本发明实施例对实施的具体方法不做限定。
S202:按照用户输入的字母或者由用户输入的汉字转化成的字母的顺序,在文本库中进行多轮查找,每一轮以一个字母作为关键字,直到遍历所有字母,获得最终的查找结果。
具体的,在按照顺序进行多轮查找的过程中,以某一轮查找为例进行说明:
在本轮查找的搜索范围内,根据本轮查找字母,对搜索范围内包括的联系人进行查找,获得本轮查找字母所匹配的结果,其中,查找的搜索范围是上一轮查找的结果;
在本轮查找的搜索范围内存在与本轮查找字母所匹配的结果的情况下,则可以认为用户输入的字母或者汉字有误,本轮查找字母是一个错误的字符,则对错误字符进行特殊处理后,再次进行查找,从而获得的本轮查找的结果与上一轮查找结果相同;或者,则对错误字符进行特殊处理后,本轮查找的结果维持上一轮查找的结果不变。具体的,对错误字符进行的特殊处理可以是忽略、将字符作为任意字符等等,具体方式本发明实施例不做限定。
可选的,显示本轮查找结果。
S203:显示最终的查找结果。
需要理解的是,图2所示的文本查找方法同样适用于多种场景。为了更好的说明图2所示的方法,以在通讯录中查找联系人的场景为例,用一个具体的例子来描述,这个例子中,对于错误的字母,获得这个字母对应的一组查询结果后,忽略这组查询结果。例如,用户想要查找的联系人姓名为“林附进”,输入的是拼音字母,由于通讯录内符合“lin”这个发音的名字很多,在输入“lin”时仍然无法快速准确定位联系人,但在输入第二个字的拼音“fu”前,将第一个字的拼音多输入了一个字母,变成了“ling”,导致第一个字的音输入错误,使用图2所示的方法,在以g为关键字的第四轮查找中找不到匹配的联系人,则对第四轮的关键字进行特殊处理,比如将第四轮的关键字忽略或者 将其作为任意字符,用户可以正常输入第二个字对应的第一个拼音字母“f”,可以准确定位到联系人。
具体的,用户输入第一个字母“l”,从通讯录中查找出的结果为“李源”、“李铭”、“林华”、“林内”、“林自”、“林际”、“林祥”、“林东”和“林附进”,优选的,显示第一轮结果;用户输入第二个字母“i”,从通讯录中查找出的结果为“李源”、“李铭”、“林华”、“林内”、“林自”、“林际”、“林祥”、“林东”和“林附进”,优选的,显示第二轮结果;用户输入第三个字母“n”,从通讯录中查找出的结果为“林华”、“林内”、“林自”、“林际”、“林祥”、“林东”和“林附进”,优选的,显示第三轮结果;用户输入第四个字母“g”,从通讯录中查找出的结果为“林华”、“林内”、“林自”、“林际”、“林祥”、“林东”和“林附进”,优选的,显示第四轮结果;用户输入第五个字母“f”,从通讯录中查找出的结果为“林附进”,查找完成,显示第五轮结果。或者,具体的,用户输入“lingf”,在以g为关键字的第四轮查找中找不到匹配的联系人,则对第四轮的关键字进行特殊处理,比如将第四轮的关键字忽略或者将其作为任意字符,从而继续在通讯录中进行第五轮查找,获得查找结果“林附进”,查找完成,显示第五轮结果。或者,具体的,用户输入第一个汉字对应的拼音时输入错误而输入成“ling”,在以g为关键字的第四轮查找中找不到匹配的联系人,则对第四轮的关键字进行特殊处理,比如将第四轮的关键字忽略或者将其作为任意字符,从通讯录中查找出的结果为“林华”、“林内”、“林自”、“林际”、“林祥”、“林东”和“林附进”,显示第四轮结果;由于结果较多,用户继续输入“f”,从而继续在通讯录中进行第五轮查找,获得查找结果“林附进”,查找完成,显示第五轮结果。
需要说明的是,显然,如果用户输入的第一汉字串就是“林”、第二汉字串就是“附”,即用户输入的关键字没有错误的情况下,图1a对应的方法同样 适用。
需要说明的是,在图2所对应的方法在其他场景下的具体例子,比如通过查找终端数据库中的文件名获得对应的文件或者采用某种输入法,根据用户输入的关键字输入正确的文本等等,执行方式和在终端的通讯录(电话簿)中查找联系人的场景下很类似,本领域技术人员很容易联想和理解,本申请文件不再在其他应用场景中举例详细说明,同样落入本申请文件的保护范围。应当理解,本发明实施例不限定文本查找的具体应用场景,也不局限于本发明实施例中举例的几种场景。
需要说明的是,在采用某种输入法,根据用户输入的关键字输入正确的文本的应用场景下,如果用户输入的关键字不能查询到匹配的字或者词,也可以显示与用户输入的关键字相同的词条。如用户输入“lingf”,显示“lingf”,用户输入“凌燕”,显示“凌燕”。
图2所对应的用于终端。的文本查找方法,在输入的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。
图3所示的是一种文本查找的装置300,所述装置用于终端,包括:
接收单元301,用于接收用户输入的字母串;
查找单元302,用于根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述 文本库中包括的词条相同;
根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,查找单元302还用于在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,查找单元302还用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
可选的,所述装置300还包括显示单元303,用于每根据所述字母串中 的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
可选的,所述显示单元303还用于显示用户输入的字母串。
图4所示的是一种文本查找的装置400,所述装置用于终端,包括:
接收单元401,用于接收用户输入的汉字串;
转换单元402,用于根据所述汉字串得到所述汉字串对应的拼音串;
查找单元403,用于根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,所述查询单元403还用于在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,所述查询单元403还用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
可选的,所述查询单元403还用于,在根据第m个字母从第m-1组查找结果或者文本库中查找出的第m组查询结果只包括一个词条的情况下,停止根据第m+1个字母的查找。
所述装置还包括显示单元404,用于每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
可选的,所述显示单元404还用于显示第m组查询结果。
可选的,所述显示单元404还用于显示用户输入的汉字串。
可见,采用图3或者图4所示的装置后,在输入的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。
图5描述了本发明实施例提供的一种终端设备500的结构,本发明实施例 所述的数据传输方法适用于终端设备500。该终端设备500包括:至少一个处理器501,用户接口503,网络接口504,存储器505,至少一个通信总线502。通信总线502用于实现这些组件之间的连接通信。该终端设备500可选的包含用户接口503,包括显示器(例如,触摸屏、LCD、CRT、全息成像(Holographic)或者投影(Projector)等),键盘或者点击设备(例如,鼠标,轨迹球(trackball),触感板或者触摸屏等),用户接口503可以用于接收用户输入的字母串。
存储器505可以包括只读存储器和随机存取存储器,并向处理器501提供指令和数据。存储器505的一部分还可以包括非易失性随机存取存储器(NVRAM)。
在一些实施方式中,存储器505存储了如下的元素,可执行模块或者数据结构,或者他们的子集,或者他们的扩展集:操作系统5051,包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务;应用程序模块5052,包含各种应用程序,例如桌面(launcher)、媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。
在本发明实施例中,通过调用存储器505存储的程序或指令,处理器501用于:根据用户输入的字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;在所述第i组查 询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,所述处理器501还用于:在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,所述处理器501还用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
可选的,每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,所述处理器501还用于:控制用户接口503显示所述一组查询结果。
可选的,所述处理器501还用于控制用户接口503显示用户输入的字母串。
在本发明另一个实施例中,通过调用存储器505存储的程序或指令,处理器501用于:根据用户输入的汉字串得到所述汉字串对应的拼音串;根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本 库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,所述处理器501还用于在在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,所述处理器501还用于在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
可选的,每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,所述处理器501还用于控制用户接 口503显示所述一组查询结果。
可选的,所述处理器501还用于在根据第m个字母从第m-1组查找结果或者文本库中查找出的第m组查询结果只包括一个词条的情况下,停止根据第m+1个字母的查找;控制用户接口503显示第m组查询结果。
可选的,所述处理器501还用于控制用户接口503显示用户输入的字母串。
类似的,终端设备500还可执行图1a、图1b以及图2的方法及实施例,本发明实施例在此不再赘述。
可见,采用图5所示的设备后,终端接收到的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件(例如处理器)来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
本发明实施例涉及一种终端600及文本查找方法,该终端600可以为手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、或车载电脑等。
图6示出的是与本发明实施例提供的终端600的部分结构的框图。参考图6,终端600包括RF(Radio Frequency,射频)电路610、存储器620、输入单元630、显示单元640、传感器650、音频电路660、WiFi(wireless fidelity,无线保真)模块670、处理器680、以及电源690 等部件。本领域技术人员可以理解,图6中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图6对终端600的某些构成部件进行具体的介绍。本发明实施例的一种终端600,包括,存储器620、处理器660及输入单元630等,该存储器620存储终端预设的文本库;该输入单元630用于接收用户输入的字母串;该处理器660用于根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,该处理器660用于在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第 i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,该处理器660用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
在另一种实施方式中,图6所示的终端600,其处理器660还有另一种运行方式,在这种实施方式下该处理器660用于根据所述汉字串得到所述汉字串对应的拼音串;根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
具体的,在这种实现方式下,该处理器660用于在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中 词条的非空子集,在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
具体的,在这种实现方式下,该处理器660用于在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
可以理解的,存储器620可以为该终端600的内存或者该终端600的内存和外存。存储器620包括NVRAM非易失存储器、DRAM动态随机存储器、SRAM静态随机存储器、Flash闪存以及硬盘、光盘、USB盘、软盘或磁带机。
该输入单元630可用于接收输入的数字或字符信息,如用户输入的汉字串或者字母串,以及产生与终端600的用户设置以及功能控制有关的信号输入。具体地,本发明实施例中,该输入单元630可以包括触控面板631。触控面板636,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板631上或在触控面板631的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板631可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给该处理器660,并能 接收处理器660发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板631。除了触控面板631,输入单元630还可以包括其他输入设备632,其他输入设备632可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
该终端600还可以包括显示单元640,该显示单元640可用于显示由用户输入的信息或提供给用户的信息以及终端600的各种菜单界面。具体的,该显示单元640可以每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果或者每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。以及可选的,在根据第m个字母从第m-1组查找结果或者文本库中查找出的第m组查询结果只包括一个词条的情况下,显示第m组查询结果。该显示单元640可包括显示面板641,可选的,可以采用LCD(Liquid Crystal Display,液晶显示器)或OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板641。
本发明实施例中,该触控面板631覆盖该显示面板641,形成触摸显示屏,当该触摸显示屏检测到在其上或附近的触摸操作后,传送给处理器660以确定触摸事件的类型,随后处理器660根据触摸事件的类型在触摸显示屏上提供相应的视觉输出。
本发明实施例中,该触摸显示屏包括应用程序界面显示区及常用控件显示区。该应用程序界面显示区及该常用控件显示区的排列方式并不限定,可以为上下排列、左右排列等可以区分两个显示区的排列方式。该应用程序界面显示区可以用于显示应用程序的界面。每一个界面可以包含至少一个应用程序的图 标和/或widget桌面控件等界面元素。该应用程序界面显示区也可以为不包含任何内容的空界面。该常用控件显示区用于显示使用率较高的控件,例如,设置按钮、界面编号、滚动条、电话本图标等应用程序图标等。
该处理器660是终端600的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在该存储器620内的软件程序和/或模块以及数据,执行终端600的各种功能和处理数据,从而对终端600进行整体监控。可选的,该处理器660可包括一个或多个处理单元。
可见,图6所示的终端600在接收到的关键字存在错误或者不准确的情况下,仍可查询到用户欲查询的目标文本,此方法提高了文本查找方法对关键字输入错误的容忍度,简化关键字输入错误情况下的查询过程,能够提高目标文本的查询效率和查询准确率,进而提高用户体验。
以上为本发明实施例所提供的用于移动终端的文本查找方法和装置,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本发明的限制。

Claims (24)

  1. 一种用于移动终端的文本查找方法,其特征在于,所述方法包括:
    接收用户输入的字母串;
    根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同;
    或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与第i组查询结果相同。
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下, 所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
    在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
  4. 根据权利要求1到3任一所述的方法,其特征在于,所述方法还包括:
    根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
  5. 一种用于移动终端的文本查找方法,其特征在于,所述查找方法包括:
    接收用户输入的汉字串;
    根据所述汉字串得到所述汉字串对应的拼音串;
    根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
    或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得 到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  7. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
    在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
    在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
  8. 根据权利要求5到7任一所述的方法,其特征在于,所述方法还包括:
    每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
  9. 一种用于移动终端的文本查找装置,其特征在于,所述查找装置包括:
    接收单元,用于接收用户输入的字母串;
    查找单元,用于根据所述字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
    或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
  10. 根据权利要求9所述的装置,其特征在于,所述查找单元还用于在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  11. 根据权利要求10所述的装置,其特征在于,所述查找单元还用于在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
  12. 根据权利要求9到11任一所述的方法,其特征在于,所述装置还包括:
    显示单元,用于每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
  13. 一种用于移动终端的文本查找装置,其特征在于,所述查找装置包括:
    接收单元,用于接收用户输入的汉字串;
    转换单元,用于根据所述汉字串得到所述汉字串对应的拼音串;
    查找单元,用于根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
    或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得 到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
  14. 根据权利要求13所述的装置,其特征在于,所述查询单元还用于:
    在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  15. 根据权利要求14所述的装置,其特征在于,所述查询单元还用于:
    在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
    在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
    在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
  16. 根据权利要求13到15任一所述的装置,其特征在于,所述装置还包 括:
    显示单元,用于每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
  17. 一种终端设备,其特征在于,所述终端设备包括,存储器和处理器,所述存储器用于存储所述处理器执行的程序或指令,所述处理器用于:
    根据用户输入的字母串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同;
    或者,根据所述字母串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述字母串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与第i组查询结果相同。
  18. 根据权利要求17所述的终端设备,其特征在于,所述处理器用于:
    在i大于2的情况下,根据所述字母串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  19. 根据权利要求17所述的终端设备,其特征在于,所述处理器用于:在i等于2的情况下,根据所述字母串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,在所述文本库中不包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
    在所述文本库中包括首个拼音字母或首个英文字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母或首个英文字母与所述第1个字母匹配的词条的集合。
  20. 根据权利要求17到19任一所述的终端设备,其特征在于,所述终端设备还包括用户接口,
    所述处理器用于在所述处理器每根据所述字母串中的一个字母在所述文本库中或上一组查询结果中得到一组查询结果后,控制所述用户接口显示所述一组查询结果。
  21. 一种用于移动终端的文本查找终端设备,其特征在于,所述终端设备包括,存储器、处理器和用户接口,所述存储器用于存储所述处理器执行的程序或指令,
    所述用户接口用于接收用户输入的汉字串;
    所述处理器用于根据所述汉字串得到所述汉字串对应的拼音串;
    根据所述拼音串中的第i个字母,其中i大于1,在第i-1组查询结果中进行查找,以得到第i组查询结果,所述第i-1组查询结果包括的词条是所述终端中的文本库的词条的非空子集,所述第i组查询结果与所述第i-1组查询结果相同,
    或者,根据所述拼音串中的第i个字母,其中i等于1,在所述文本库中进行查找,以得到第i组查询结果,所述第i组查询结果中包括的词条与所述文本库中包括的词条相同;
    根据所述拼音串中的第i+1个字母,在所述第i组查询结果中查找,以得到第i+1组查询结果,
    在所述第i组查询结果中包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果是所述第i组查询结果中匹配所述第i+1个字母的词条的集合;
    在所述第i组查询结果中不包括匹配所述第i+1个字母的词条的情况下,所述第i+1组查询结果与所述第i组结果相同。
  22. 根据权利要求21所述的终端设备,其特征在于,所述处理器用于:
    在i大于2的情况下,根据所述拼音串中的第i-1个字母,在第i-2组查询结果中查询,以得到所述第i-1组查询结果,所述第i-2组查询结果包括的词条是所述终端中的文本库中词条的非空子集,
    在所述第i-2组查询结果中不包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果与所述第i-2组查询结果相同;
    在所述第i-2组查询结果中包括匹配所述第i-1个字母的词条的情况下,所述第i-1组查询结果是所述第i-2组查询结果中匹配所述第i-1个字母的词条的集合。
  23. 根据权利要求21所述的终端设备,其特征在于,所述处理器用于:
    在i等于2的情况下,根据所述拼音串中的第1个字母,在所述文本库中进行查找,以得到第1组查询结果,
    在所述文本库中不包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果中包括的词条与所述文本库中包括的词条相同;
    在所述文本库中包括首个拼音字母与所述第1个字母匹配的词条的情况下,所述第1组查询结果是所述文本库中首个拼音字母与所述第1个字母匹配的词条的集合。
  24. 根据权利要求21到23任一所述的终端设备,其特征在于,所述用户接口还用于在所述处理器每根据所述汉字串中的一个汉字对应的拼音串中的最后一个拼音,在上一组查询结果中得到一组查询结果后,显示所述一组查询结果。
PCT/CN2016/070053 2015-01-04 2016-01-04 一种用于移动终端的文本查找方法和装置 WO2016107611A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510003762.1 2015-01-04
CN201510003762.1A CN104504142B (zh) 2015-01-04 2015-01-04 一种用于移动终端的文本查找方法和装置

Publications (1)

Publication Number Publication Date
WO2016107611A1 true WO2016107611A1 (zh) 2016-07-07

Family

ID=52945539

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/070053 WO2016107611A1 (zh) 2015-01-04 2016-01-04 一种用于移动终端的文本查找方法和装置

Country Status (2)

Country Link
CN (1) CN104504142B (zh)
WO (1) WO2016107611A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504142B (zh) * 2015-01-04 2018-02-02 华为技术有限公司 一种用于移动终端的文本查找方法和装置
CN105653061B (zh) * 2015-12-29 2020-03-31 北京京东尚科信息技术有限公司 针对拼音输入法的词条检索及错词检测的方法和系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101308487A (zh) * 2008-06-25 2008-11-19 中国科学院地理科学与资源研究所 一种自然语言表达动态交通信息的时空融合方法
US20120036133A1 (en) * 2010-08-04 2012-02-09 Hon Hai Precision Industry Co., Ltd. Computing device and method for searching for parameters in a data model
CN102833380A (zh) * 2012-07-26 2012-12-19 北京小米科技有限责任公司 通信终端中的联系人查找方法及装置
CN104504142A (zh) * 2015-01-04 2015-04-08 华为技术有限公司 一种用于移动终端的文本查找方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101206673A (zh) * 2007-12-25 2008-06-25 北京科文书业信息技术有限公司 网络搜索过程中关键词的智能纠错系统及方法
US8527488B1 (en) * 2010-07-08 2013-09-03 Netlogic Microsystems, Inc. Negative regular expression search operations

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101308487A (zh) * 2008-06-25 2008-11-19 中国科学院地理科学与资源研究所 一种自然语言表达动态交通信息的时空融合方法
US20120036133A1 (en) * 2010-08-04 2012-02-09 Hon Hai Precision Industry Co., Ltd. Computing device and method for searching for parameters in a data model
CN102833380A (zh) * 2012-07-26 2012-12-19 北京小米科技有限责任公司 通信终端中的联系人查找方法及装置
CN104504142A (zh) * 2015-01-04 2015-04-08 华为技术有限公司 一种用于移动终端的文本查找方法和装置

Also Published As

Publication number Publication date
CN104504142A (zh) 2015-04-08
CN104504142B (zh) 2018-02-02

Similar Documents

Publication Publication Date Title
US10241673B2 (en) Alternative hypothesis error correction for gesture typing
US10489508B2 (en) Incremental multi-word recognition
EP2987054B1 (en) Consistent text suggestion output
EP3005066B1 (en) Multiple graphical keyboards for continuous gesture input
KR101872549B1 (ko) 시스템 레벨 검색 사용자 인터페이스에서의 등록 기법
US9047268B2 (en) Character and word level language models for out-of-vocabulary text input
US20140372931A1 (en) Text suggestion output using past interaction data
WO2014062358A1 (en) Multi-gesture text input prediction
US20140164981A1 (en) Text entry
EP2909702B1 (en) Contextually-specific automatic separators
US20110161859A1 (en) Electronic device and method for pinyin input
WO2016107611A1 (zh) 一种用于移动终端的文本查找方法和装置
WO2022233275A1 (zh) 输入矫正方法和装置
WO2022135294A1 (zh) 候选词显示方法及装置、电子设备
JP2012083815A (ja) 文字列変換装置、文字列変換方法、コンピュータプログラムおよび記録媒体
TWI472956B (zh) 拼音輸入系統及方法
CN109597497B (zh) 一种信息预测方法、装置及设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16732877

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16732877

Country of ref document: EP

Kind code of ref document: A1