[go: up one dir, main page]

CN101599085A - A kind of word lookup method and apparatus - Google Patents

A kind of word lookup method and apparatus Download PDF

Info

Publication number
CN101599085A
CN101599085A CNA200910148347XA CN200910148347A CN101599085A CN 101599085 A CN101599085 A CN 101599085A CN A200910148347X A CNA200910148347X A CN A200910148347XA CN 200910148347 A CN200910148347 A CN 200910148347A CN 101599085 A CN101599085 A CN 101599085A
Authority
CN
China
Prior art keywords
word
phonetic
complementary
record
phrase
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CNA200910148347XA
Other languages
Chinese (zh)
Other versions
CN101599085B (en
Inventor
徐佳宏
黄生玲
麻林茂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ipanel TV Inc
Original Assignee
Shenzhen Ipanel TV Inc
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 Shenzhen Ipanel TV Inc filed Critical Shenzhen Ipanel TV Inc
Priority to CN200910148347XA priority Critical patent/CN101599085B/en
Publication of CN101599085A publication Critical patent/CN101599085A/en
Priority to HK10105645.6A priority patent/HK1138922A1/en
Application granted granted Critical
Publication of CN101599085B publication Critical patent/CN101599085B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The embodiment of the invention discloses a kind of word lookup method and apparatus.The word lookup method comprises: font file is imported internal memory, and according to font file generation phonetic offset table, font file comprises respectively the word record that is complementary with each phonetic, and the phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file; Obtain first phonetic; From the phonetic offset table, find out the word that is complementary with first phonetic and be recorded in side-play amount in the font file; The side-play amount that utilization finds out reads out in the word record that is complementary with first phonetic one or more words for you to choose from font file.The technical scheme of the embodiment of the invention can reduce the consumption of word lookup to memory source relatively, helps the save memory resource.

Description

A kind of word lookup method and apparatus
Technical field
The present invention relates to field of computer technology, be specifically related to a kind of word lookup method and apparatus.
Background technology
The user carries out for example on the various electronic such as computer, mobile phone, set-top box, personal digital assistant input method software being installed usually alternately for convenience.
Existing input method software is in carrying out initialized process; usually can earlier font file and dictionary file be imported in the internal memory; generate search tree according to font file and dictionary file then; the search tree that generates comprises a large amount of tree-like nodes, and each node of search tree comprises all usually whether a word, the phonetic of this word, this word in the font file has multiple information such as phrase.
In the existing word lookup mode, after receiving the phonetic of user input, whole Chinese characters of the phonetic correspondence of utilizing search tree to find out to receive, and show that in batches finding out Chinese character selects for the user.
In realizing process of the present invention, the inventor finds, existing word lookup mode is to utilize search tree to carry out the matched and searched of phonetic and word, therefore must in internal memory, generate earlier search tree, and the shared memory source of search tree is more relatively usually, and existing word lookup mode is unfavorable for the save memory resource.
Summary of the invention
Embodiment of the invention technical matters to be solved is, a kind of word lookup method and apparatus is provided, and can reduce the consumption of word lookup to memory source relatively, helps the save memory resource.
For solving the problems of the technologies described above, the embodiment of the invention provides following technical scheme:
A kind of word lookup method comprises:
Font file is imported internal memory, and according to described font file generation phonetic offset table, described font file comprises respectively the word record that is complementary with each phonetic, and described phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file; Obtain first phonetic; From described phonetic offset table, find out the word that is complementary with first phonetic and be recorded in side-play amount in the described font file; Utilize the described side-play amount that finds out, from described font file, read out in the word record that is complementary with first phonetic one or more words for you to choose.
Preferably, described method also comprises:
The dictionary file is imported internal memory, and according to described dictionary file generation word offset table, described dictionary file comprises respectively the phrase record that is complementary with a plurality of words, and described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
Preferably, describedly utilize described dictionary file to generate the word offset table to be specially: utilize described dictionary file to generate the word offset table that adopts the hash storage organization.
Preferably, described method also comprises:
After obtaining selecteed word, from the word offset table, find out phrase that the word with described acquisition is complementary and be recorded in side-play amount in the described dictionary file; Utilize the side-play amount of the described phrase record that finds out, from described dictionary file, read out in the phrase record that the word with described acquisition is complementary one or more phrases for you to choose.
Preferably, described method also comprises:
Obtain second phonetic; From described phonetic offset table, find out the word that is complementary with second phonetic and be recorded in side-play amount in the described font file, and utilize the described side-play amount that finds out, in described font file, find the word record that is complementary with second phonetic; From the word offset table, find out the side-play amount in described dictionary file of the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary, and the side-play amount of utilizing the described phrase that finds out to write down, in dictionary, find the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary; Word in phrase in the phrase record that each Chinese character in the word record that will be complementary with first phonetic is complementary and the word record that is complementary with second phonetic carries out cross-matched, read out in the phrase record that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose according to the result of cross-matched from the dictionary file, described second word that reads out one or more phrases is identical with one of them word during the word that second phonetic is complementary writes down.
A kind of word lookup device comprises:
First imports generation module, be used for font file is imported internal memory, and utilize described font file to generate the phonetic offset table, described font file comprises respectively the word record that is complementary with each phonetic, and described phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file; Acquisition module is used to obtain first phonetic; First searches module, is used for finding out the word that is complementary with first phonetic from described phonetic offset table and is recorded in side-play amount the described font file; The word read module is used to utilize described first to search the side-play amount that module searches goes out, and reads out in the word record that is complementary with first phonetic one or more words for you to choose from described font file.
Preferably, described device also comprises:
Second imports generation module, the dictionary file is imported internal memory, and utilize described dictionary file to generate the word offset table, described dictionary file comprises respectively the phrase record that is complementary with a plurality of words, and described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
Preferably, the described second importing generation module comprises:
Second imports submodule, is used for the dictionary file is imported internal memory, and described dictionary file comprises respectively the phrase record that is complementary with a plurality of words; Second generates submodule, be used to utilize the described second dictionary file that imports the submodule importing to generate the word offset table that adopts the hash storage organization, described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
Preferably, described device also comprises:
Second searches module, is used for after obtaining selecteed word, finds out phrase that the word with described acquisition is complementary and be recorded in side-play amount in the described dictionary file from the word offset table; The speech read module is used to utilize described second side-play amount of searching the phrase record that module searches goes out, and reads out in the phrase record that the word with described acquisition is complementary one or more phrases for you to choose from described dictionary file.
Preferably, described acquisition module also is used for, and obtains second phonetic;
Described first searches module also is used for, and finds out the word that is complementary with second phonetic and be recorded in side-play amount in the described font file from described phonetic offset table;
Described device also comprises: module searched in word, is used to utilize described first to search the side-play amount that module searches goes out, and finds the word record that is complementary with second phonetic in described font file;
Described second searches module also is used for, and finds out the side-play amount in described dictionary file of the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary from the word offset table;
Described device also comprises: module searched in phrase, is used to utilize described second side-play amount of searching the phrase record that module searches goes out, and finds the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary in dictionary;
Institute's predicate read module also is used for, word in phrase in the phrase record that each Chinese character in the word record that will be complementary with first phonetic is complementary and the word record that is complementary with second phonetic carries out cross-matched, read out in the phrase record that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose according to the result of cross-matched from the dictionary file, described second word that reads out one or more phrases is identical with one of them word during the word that second phonetic is complementary writes down.
By technique scheme as can be seen, the technical scheme of the embodiment of the invention has following advantage: generate the phonetic offset table according to font file in internal memory, utilize the phonetic offset table from font file, to search the word that mates with phonetic, the more existing search tree that generates in internal memory is compared, phonetic offset table volume simple in structure is little, can reduce the consumption of word lookup relatively, help the save memory resource memory source.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use is done to introduce simply in will describing embodiment below, apparently, accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain other accompanying drawing according to these accompanying drawings.
Fig. 1 is a kind of word lookup method flow diagram that the embodiment of the invention provides;
Fig. 2 is the another kind of word lookup method flow diagram that the embodiment of the invention provides;
Fig. 3 is the structural representation of a kind of word lookup device of providing of the embodiment of the invention.
Embodiment
The embodiment of the invention provides a kind of word lookup method and apparatus, can reduce the consumption of word lookup to memory source relatively, helps the save memory resource.
Below be elaborated respectively by specific embodiment.
See also Fig. 1, a kind of word lookup method first embodiment of the embodiment of the invention can comprise:
110, font file is imported internal memory, and according to font file generation phonetic offset table, above-mentioned font file comprises respectively the word record that is complementary with each phonetic, and above-mentioned phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file.
Under a kind of application scenarios, in initialization procedure, font file is imported internal memory, and each phonetic can have a word record that is complementary in font file, and every word record in the font file can comprise phonetic and the part or all of word that can be complementary with this phonetic.
Can in internal memory, generate the phonetic offset table according to font file, the phonetic offset table is mainly used in word that record is complementary with each phonetic and is recorded in side-play amount in the font file, just the word that is complementary of each phonetic is recorded in the reference position in the font file, can find this word record fast in font file according to the reference position that word is recorded in the font file.
120, obtain first phonetic.
Under a kind of application scenarios, can obtain first phonetic of user by input equipment input, first phonetic can be a complete phonetic, the beginning part that also can certain phonetic.
130, from above-mentioned phonetic offset table, find out the word that is complementary with first phonetic and be recorded in side-play amount in the above-mentioned font file.
140, utilize the above-mentioned side-play amount that finds out, from font file, read out in the word record of the above-mentioned phonetic correspondence of obtaining one or more words for you to choose.
Under a kind of application scenarios, can adopt the mode that in batches reads, from font file, read out in the word record of the first phonetic correspondence one or more words for you to choose.
By technique scheme as can be seen, in the present embodiment, in internal memory, generate the phonetic offset table according to font file, utilize the phonetic offset table from font file, to search the word that mates with phonetic, the more existing search tree that generates in internal memory is compared, phonetic offset table volume simple in structure is little, can reduce the consumption of word lookup to memory source relatively, helps the save memory resource.
For ease of understanding technical scheme of the present invention,, technical solution of the present invention is described in more detail below by specific embodiment more.
See also Fig. 2, another embodiment of the method for a kind of word lookup of the embodiment of the invention can comprise:
201, font file and dictionary file are imported internal memory.
Under a kind of application scenarios, in initialization procedure, font file and dictionary file are imported internal memory, and can in internal memory, generate phonetic offset table and word offset table according to font file and dictionary file.
Further, the font file and the dictionary file that import in the internal memory can be to have removed simplifying character library and simplifying dictionary of be of little use word and word seldom, to reduce the consumption of memory source as far as possible.
Under a kind of application scenarios, font file can be as shown in table 1, but be not limited to this:
Table 1
Figure A20091014834700091
As shown in table 1, the record in the font file all can be referred to as the word record, and wherein, every word record in the font file can comprise: be used to write down the phonetic field of phonetic and be used to write down the field of the part or all of word that can be complementary with this phonetic.
As can be seen, each phonetic in font file shown in the table 1 to the word record of a coupling should be arranged, utilize the font file shown in the table 1 can clearly write down each phonetic and can and the word that is complementary of this phonetic between corresponding relation, can from font file, find the word record that this phonetic is complementary according to phonetic, and then find out one or more words that can be complementary with this phonetic.
Under a kind of application scenarios, the dictionary file can be as shown in table 2, but be not limited to this:
Table 2
Figure A20091014834700101
As shown in table 2, the record in the dictionary file all can be referred to as the phrase record, and wherein, every record in the dictionary file can comprise: the field and the phrase field that is used to write down with the whole phrases headed by this word that are used to write down word.
As can be seen, each word phrase record all in the dictionary file shown in the table 2 to there being one to be complementary, utilize the dictionary file shown in the table 2 can clearly write down word and with the corresponding relation between a plurality of phrases headed by this word, can from the dictionary file, find the phrase record that this word is complementary according to certain word, and then can find with the one or more phrases headed by this word.
Under a kind of application scenarios, the data structure of the phonetic offset table that generates according to font file can be as shown in table 3, but be not limited to this:
Table 3
Phonetic Side-play amount Record length
a 0 15
ai 16 20
an 37 25
...... ...... ......
As shown in table 3, every record of phonetic offset table can comprise: be used for writing down phonetic the phonetic field, be used to write down the offset field that the word that is complementary with this phonetic is recorded in the side-play amount of font file.
Above-mentioned phonetic offset table can further include the length information that is used to write down the word record that is complementary with this phonetic, with the convenient whole words that read out this phonetic correspondence from font file.
As can be seen, utilize the phonetic offset table can clearly write down the word that is complementary with each phonetic and be recorded in reference position (side-play amount) in the font file, according to the side-play amount that writes down in the phonetic offset table, the word record that is complementary with this phonetic can be in font file, found fast, and then one or more words that can be complementary with this phonetic can be from font file, read out fast.
Under a kind of application scenarios, the data structure of the word offset table that generates according to the dictionary file can be as shown in table 4, but be not limited to this:
Table 4
Word Phonetic Side-play amount Child node
Ah a 500 Have
Ah e 1500 No
...... ...... ...... ......
As shown in table 4, every record of word offset table can comprise: be used for writing down word field, be used to write down the offset field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file, the phonetic field that is used to write down this word phonetic, the phonetic field is mainly used in the phonetic of this word of record when being polyphone.
The word offset table can also comprise and is used to write down the child node field whether this word has child node, if child node is arranged, represent that other word also can find the record of this word by Ha Xi (HASH) table,, represent that other words can not find the record of this word by the HASH table if there is not child node.
Under a kind of application scenarios, the word offset table can adopt the storage organization of HASH table, adopts the HASH algorithm to search search when searching search.
202, obtain the phonetic of user's input.
Under a kind of application scenarios, can obtain the phonetic of user by input equipment (for example, keyboard) input, the phonetic of the user who obtains input can be a complete phonetic, also can be the beginning part of certain phonetic.For instance, can obtain the phonetic " zhuo " of user by the keyboard input.
203, from the phonetic offset table, find out the word that is complementary with the above-mentioned phonetic that obtains and be recorded in side-play amount in the font file.
Under a kind of application scenarios, can in the phonetic offset table, search according to the phonetic that obtains, find out the word that is complementary with the above-mentioned phonetic that obtains and be recorded in side-play amount in the font file.
For instance, if the phonetic of the user who gets access to input is " zhuo ", then can search in the phonetic offset table according to phonetic " zhuo ", and then find out and word that phonetic " zhuo " is complementary is recorded in side-play amount in the font file, for example finding out side-play amount is 5000.
Especially, if the phonetic that gets access to has only initial consonant, then can be with all comprise that a plurality of phonetics of this initial consonant are as match objects in the phonetic offset table, can in the phonetic offset table, find out with above-mentioned all words that comprise that the phonetic of this initial consonant is complementary and be recorded in side-play amount in the font file, and then can be with the preferential output of the pairing Chinese character of the most approaching phonetic that gets access in a series of phonetic objects that find for you to choose.
204, utilize the side-play amount of the above-mentioned word record that finds out, from font file, read out in the word record that is complementary with the above-mentioned phonetic that obtains one or more words for you to choose.
Wherein, the side-play amount that word in the font file is recorded in the font file is that word is recorded in the reference position in the font file, be recorded in reference position in the font file according to the meter pointer address of font file and word, just can in font file, find this word record fast.
For instance, be recorded in side-play amount 5000 in the font file, also be recorded in reference position in the font file if in the phonetic offset table, find out the word that is complementary with phonetic " zhuo " with regard to the word that has obtained to be complementary with phonetic " zhuo ".Be recorded in reference position in the font file according to the meter pointer address of font file with word that " zhuo " is complementary, just can in font file, find this word record fast, so can from font file, read out in this word record one or more words for you to choose.
Further, if the word in this word record is more, can from font file, read out in batches in this word record word for you to choose.
Can be according to user's selection, the word that input is selected by the user.
205, obtain selecteed word, and from the word offset table, find out phrase that the word with above-mentioned acquisition is complementary and be recorded in side-play amount in the dictionary file.
Under a kind of application scenarios, after the selection according to the user obtains selecteed certain word, can further carry out association, in the word offset table, search, find out phrase that the selecteed word with above-mentioned acquisition is complementary and be recorded in side-play amount in the dictionary file.
206, utilize the side-play amount of the above-mentioned phrase record that finds out, from the dictionary file, read out in the phrase record that the word with above-mentioned acquisition is complementary one or more speech for you to choose.
Wherein, the side-play amount that phrase in the dictionary file is recorded in the dictionary file is that phrase is recorded in the reference position in the dictionary file, be recorded in reference position in the dictionary file according to the meter pointer address of dictionary file and phrase, just can in the dictionary file, find this phrase record fast.
For instance, if the word that obtains to be selected by the user is " growing sturdily ", can in the Chinese character offset table, searches the phrase that is complementary with " growing sturdily " and be recorded in side-play amount in the dictionary file, also be recorded in reference position in the dictionary file with regard to the phrase that has obtained to be complementary with " growing sturdily ".Be recorded in reference position in the dictionary file according to the meter pointer address of dictionary file with phrase that " growing sturdily " is complementary, just can in the dictionary file, find this phrase record fast, so can from the dictionary file, read out in this phrase record one or more speech for you to choose.Further, if the phrase in this phrase record is more, can from the dictionary file, read out in batches in this phrase record phrase for you to choose.
Can be according to user's selection, the phrase that input is selected by the user.
Under a kind of application scenarios,, can be earlier find out whole words the word record that is complementary with first phonetic (below represent) with set A from font file if get access to continuously two or more phonetics of input of user.From the word offset table, find out with set A in the side-play amount in described dictionary file of the phrase record that is complementary of each Chinese character, and utilize the side-play amount of the phrase record find out, in dictionary, find whole phrases in the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary (below represent) with set B.From the phonetic offset table, find out the word that is complementary with second phonetic and be recorded in side-play amount in the font file, and utilize the side-play amount find out, in font file, find whole Chinese characters in the word record that is complementary with second phonetic (below represent) with set B, set B and set C are carried out cross-matched, result according to cross-matched, from the dictionary file read out in the phrase record (set B) that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose, wherein, in above-mentioned second word that reads out one or more phrases and the word record (set C) that second phonetic is complementary one or multiword are identical, by that analogy.
For instance, be " zhuo zhuang " if get access to the phonetic of the continuous input of user, wherein, first phonetic is " zhuo ", and second phonetic is " zhuang ".
If from font file, find and can comprise with the word that first phonetic " zhuo " is complementary: ", show, table, catch, Zhuo, chisel, pay, burn, drink, clumsy, turbid, wash, grow sturdily, peck, hack, bracelet, the drop of water " etc.If finding the phrase that is complementary with above-mentioned " wearing " word from the dictionary file comprises: " (weight, power, hand, eye in, eye, think, reality, eyespot, land, look, adorn, fall, anticipate, black) " etc.
From font file, find and to comprise with the word that second phonetic " zhuang " is complementary: " dress, shape, strong, village, hit, woman's persona, building, stake, strong, Zhuang brocade, rash " etc.
The phrase that will be complementary with " wearing " word and can searching with the word cross-matched that second phonetic " zhuang " is complementary, search and to draw by cross-matched, second word of word " dress " that is complementary with phonetic " zhuang " and the phrase " dressing " that is complementary with " wearing " word is identical, and then can from dictionary, read out phrase " dressing " for you to choose, by that analogy.
By technique scheme as can be seen, in the present embodiment, in internal memory, generate phonetic offset table and word offset table according to font file and dictionary file, utilize phonetic offset table and word offset table from font file and dictionary file, to search words, the more existing search tree that generates in internal memory is compared, phonetic offset table and the simple volume of word offset list structure are little, can reduce the consumption of word lookup to memory source relatively, help the save memory resource.
Be better implement technical scheme of the present invention, corresponding, a kind of word lookup device also is provided in the embodiment of the invention.
See also Fig. 3, a kind of word lookup device of the embodiment of the invention can comprise: the first importing generation module 310, acquisition module 320, first are searched module 330 and word read module 340.
Wherein, first imports generation module 310, be used for font file is imported internal memory, and utilize font file to generate the phonetic offset table, above-mentioned font file comprises respectively the word record that is complementary with each phonetic, and above-mentioned phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file.
Acquisition module 320 is used to obtain first phonetic.
First searches module 330, is used for finding out the word that is complementary with first phonetic from above-mentioned phonetic offset table and is recorded in side-play amount the above-mentioned font file.
Word read module 340 is used to utilize first to search the side-play amount that module 330 finds out, and reads out in the word record that is complementary with first phonetic one or more words for you to choose from above-mentioned font file.
Under a kind of application scenarios, above-mentioned word lookup device can also comprise: second imports generation module (not shown among Fig. 3).
Second imports generation module, the dictionary file is imported internal memory, and according to above-mentioned dictionary file generation word offset table, above-mentioned dictionary file comprises respectively the phrase record that is complementary with a plurality of words, and above-mentioned word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
Under a kind of application scenarios, second imports generation module can comprise: second imports submodule and second generates submodule (not shown among Fig. 3).
Second imports submodule, is used for the dictionary file is imported internal memory, and above-mentioned dictionary file comprises respectively the phrase record that is complementary with a plurality of words.
Second generates submodule, be used for generating the word offset table that adopts the hash storage organization according to the second dictionary file that imports the submodule importing, above-mentioned word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
Under a kind of application scenarios, above-mentioned word lookup device can also comprise: second searches module and speech read module (not shown among Fig. 3)
Second searches module, is used for after obtaining selecteed word, finds out phrase that the word with above-mentioned acquisition is complementary and be recorded in side-play amount in the described dictionary file from the word offset table.
The speech read module is used to utilize second side-play amount of searching the phrase record that module searches goes out, and reads out in the phrase record that the word with above-mentioned acquisition is complementary one or more phrases for you to choose from above-mentioned dictionary file.
Under a kind of application scenarios, acquisition module 320 can also be used for, and obtains second phonetic.
First searches module 330 also is used for, and finds out the word that is complementary with second phonetic and be recorded in side-play amount in the above-mentioned font file from above-mentioned phonetic offset table.
Above-mentioned word lookup device can also comprise:
Module searched in word, is used to utilize first to search the side-play amount that module 330 finds out, and finds the word record that is complementary with second phonetic in above-mentioned font file.
Second searches module can also be used for, and finds out the side-play amount in above-mentioned dictionary file of the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary from the word offset table.
Above-mentioned word lookup device can also comprise:
Module searched in phrase, is used to utilize second side-play amount of searching the phrase record that module searches goes out, and finds the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary in dictionary.
The speech read module can also be used for, word in phrase in the phrase record that each Chinese character in the word record that will be complementary with first phonetic is complementary and the word record that is complementary with second phonetic carries out cross-matched, read out in the phrase record that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose according to the result of cross-matched from the dictionary file, above-mentioned second word that reads out one or more phrases is identical with one of them word during the word that second phonetic is complementary writes down.
Be understandable that the function of each functional module of the word lookup device of present embodiment can be according to the method specific implementation among the embodiment two, but the associated description in its specific implementation process reference example two repeats no more herein.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
In sum, in the technical scheme of the embodiment of the invention, in internal memory, generate phonetic offset table and word offset table according to font file and dictionary file, utilize phonetic offset table and word offset table from font file and dictionary file, to search words, the more existing search tree that generates in internal memory is compared, phonetic offset table and the simple volume of word offset list structure are little, can reduce the consumption of word lookup to memory source relatively, help the save memory resource.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of the foregoing description is to instruct relevant hardware to finish by program, this program can be stored in the computer-readable recording medium, and storage medium can comprise: ROM (read-only memory), random access memory, disk or CD etc.
More than a kind of word lookup method and apparatus that the embodiment of the invention provided is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1, a kind of word lookup method is characterized in that, comprising:
Font file is imported internal memory, and according to described font file generation phonetic offset table, described font file comprises respectively the word record that is complementary with each phonetic, and described phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file;
Obtain first phonetic;
From described phonetic offset table, find out the word that is complementary with first phonetic and be recorded in side-play amount in the described font file;
Utilize the described side-play amount that finds out, from described font file, read out in the word record that is complementary with first phonetic one or more words for you to choose.
2, method according to claim 1 is characterized in that, described method also comprises:
The dictionary file is imported internal memory, and according to described dictionary file generation word offset table, described dictionary file comprises respectively the phrase record that is complementary with a plurality of words, and described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
3, method according to claim 2 is characterized in that, describedly utilizes described dictionary file to generate the word offset table to be specially:
Utilize described dictionary file to generate the word offset table that adopts the hash storage organization.
4, according to claim 2 or 3 described methods, it is characterized in that described method also comprises:
After obtaining selecteed word, from the word offset table, find out phrase that the word with described acquisition is complementary and be recorded in side-play amount in the described dictionary file;
Utilize the side-play amount of the described phrase record that finds out, from described dictionary file, read out in the phrase record that the word with described acquisition is complementary one or more phrases for you to choose.
5, according to claim 2 or 3 described methods, it is characterized in that described method also comprises:
Obtain second phonetic;
From described phonetic offset table, find out the word that is complementary with second phonetic and be recorded in side-play amount in the described font file, and utilize the described side-play amount that finds out, in described font file, find the word record that is complementary with second phonetic;
From the word offset table, find out the side-play amount in described dictionary file of the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary, and the side-play amount of utilizing the described phrase that finds out to write down, in dictionary, find the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary;
Word in phrase in the phrase record that each Chinese character in the word record that will be complementary with first phonetic is complementary and the word record that is complementary with second phonetic carries out cross-matched, read out in the phrase record that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose according to the result of cross-matched from the dictionary file, described second word that reads out one or more phrases is identical with one of them word during the word that second phonetic is complementary writes down.
6, a kind of word lookup device is characterized in that, comprising:
First imports generation module, be used for font file is imported internal memory, and utilize described font file to generate the phonetic offset table, described font file comprises respectively the word record that is complementary with each phonetic, and described phonetic offset table comprises and is used for writing down the field of phonetic and is used to write down the field that the word that is complementary with this phonetic is recorded in the side-play amount of font file;
Acquisition module is used to obtain first phonetic;
First searches module, is used for finding out the word that is complementary with first phonetic from described phonetic offset table and is recorded in side-play amount the described font file;
The word read module is used to utilize described first to search the side-play amount that module searches goes out, and reads out in the word record that is complementary with first phonetic one or more words for you to choose from described font file.
7, device according to claim 6 is characterized in that, described device also comprises:
Second imports generation module, the dictionary file is imported internal memory, and utilize described dictionary file to generate the word offset table, described dictionary file comprises respectively the phrase record that is complementary with a plurality of words, and described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
8, device according to claim 7 is characterized in that,
Described second imports generation module comprises:
Second imports submodule, is used for the dictionary file is imported internal memory, and described dictionary file comprises respectively the phrase record that is complementary with a plurality of words;
Second generates submodule, be used to utilize the described second dictionary file that imports the submodule importing to generate the word offset table that adopts the hash storage organization, described word offset table comprises and is used for writing down the field of word and is used to write down the field that the phrase that is complementary with this word is recorded in the side-play amount of dictionary file.
9, according to claim 7 or 8 described devices, it is characterized in that described device also comprises:
Second searches module, is used for after obtaining selecteed word, finds out phrase that the word with described acquisition is complementary and be recorded in side-play amount in the described dictionary file from the word offset table;
The speech read module is used to utilize described second side-play amount of searching the phrase record that module searches goes out, and reads out in the phrase record that the word with described acquisition is complementary one or more phrases for you to choose from described dictionary file.
10, according to claim 7 or 8 described devices, it is characterized in that,
Described acquisition module also is used for, and obtains second phonetic;
Described first searches module also is used for, and finds out the word that is complementary with second phonetic and be recorded in side-play amount in the described font file from described phonetic offset table;
Described device also comprises:
Module searched in word, is used to utilize described first to search the side-play amount that module searches goes out, and finds the word record that is complementary with second phonetic in described font file;
Described second searches module also is used for, and finds out the side-play amount in described dictionary file of the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary from the word offset table;
Described device also comprises:
Module searched in phrase, is used to utilize described second side-play amount of searching the phrase record that module searches goes out, and finds the phrase record that each Chinese character in the word record that is complementary with first phonetic is complementary in dictionary;
Institute's predicate read module also is used for, word in phrase in the phrase record that each Chinese character in the word record that will be complementary with first phonetic is complementary and the word record that is complementary with second phonetic carries out cross-matched, read out in the phrase record that each Chinese character the word record that is complementary with first phonetic is complementary one or more phrases for you to choose according to the result of cross-matched from the dictionary file, described second word that reads out one or more phrases is identical with one of them word during the word that second phonetic is complementary writes down.
CN200910148347XA 2009-06-15 2009-06-15 Word lookup method and word lookup device Active CN101599085B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN200910148347XA CN101599085B (en) 2009-06-15 2009-06-15 Word lookup method and word lookup device
HK10105645.6A HK1138922A1 (en) 2009-06-15 2010-06-08 Method and apparatus for looking up words

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200910148347XA CN101599085B (en) 2009-06-15 2009-06-15 Word lookup method and word lookup device

Publications (2)

Publication Number Publication Date
CN101599085A true CN101599085A (en) 2009-12-09
CN101599085B CN101599085B (en) 2011-06-29

Family

ID=41420530

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200910148347XA Active CN101599085B (en) 2009-06-15 2009-06-15 Word lookup method and word lookup device

Country Status (2)

Country Link
CN (1) CN101599085B (en)
HK (1) HK1138922A1 (en)

Also Published As

Publication number Publication date
CN101599085B (en) 2011-06-29
HK1138922A1 (en) 2010-09-03

Similar Documents

Publication Publication Date Title
CN102479191B (en) Method and device for providing multi-granularity word segmentation result
US9002758B2 (en) Ranking for inductive synthesis of string transformations
CN103123649B (en) A kind of message searching method based on microblog and system
US10275483B2 (en) N-gram tokenization
US20140280088A1 (en) Combined term and vector proximity text search
CN107291792A (en) Method and system for determining related entities
CN109918669A (en) Entity determines method, apparatus and storage medium
CN104699732A (en) Method for forming user profile and information processing equipment
CN103930889A (en) Presenting search results in hierarchical form
WO2017012243A1 (en) Voice recognition method and apparatus, terminal device and storage medium
US9336495B2 (en) Query generation and time difference features for supervised semantic indexing
Caldarola et al. Improving the visualization of wordnet large lexical database through semantic tag clouds
CN105138649A (en) Data search method and device and terminal
He et al. FastBTM: Reducing the sampling time for biterm topic model
Paelke et al. Location based context awareness through tag-cloud visualizations
CN101599085B (en) Word lookup method and word lookup device
CN112257386A (en) A method for generating the layout of scene space relationship information in scene conversion
Guo et al. Pergo: an ontology towards model driven pervasive game development
Li et al. PRIS at TAC2012 KBP Track.
CN115203378B (en) Retrieval enhancement method, system and storage medium based on pre-training language model
CN110209895A (en) Vector index method, apparatus and equipment
CN104699724A (en) Lucene-based data searching method and device
CN106383865A (en) Artificial intelligence-based recommended data acquisition method and apparatus
Zhang et al. Unsupervised multiple choices question answering via universal corpus
CN116361421B (en) Text retrieval method, device and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1138922

Country of ref document: HK

C14 Grant of patent or utility model
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: GR

Ref document number: 1138922

Country of ref document: HK