Method and apparatus for chinese character sorting, searching and inserting
By employing a multi-level sorting method based on the first character code, stroke count, and stroke string, the problem of instability in the traditional Chinese character radical method is solved, achieving efficient and easy-to-use sorting and retrieval of Chinese characters, and constructing a systematic and rigorous dictionary solution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-09
- Publication Date
- 2026-03-31
AI Technical Summary
Traditional Chinese character radical-based sorting and retrieval methods suffer from inconsistent radical definitions and a lack of strict regularity, leading to retrieval difficulties. Furthermore, other methods, such as stroke and stroke order methods or pinyin methods, are inefficient or inconvenient to use in certain situations.
The method of sorting Chinese characters based on the first basic character component is adopted. Multi-level sorting is performed by the first character code, the number of strokes, and the stroke string. The first character code is used as the highest priority field, and the stroke string is used as the lowest priority field. The dictionary is constructed and search is performed in combination with the "Information Processing GB13000.1 Character Set Chinese Character Component Specification" and the Chinese character stroke order specification.
It achieves systematic, rigorous, and practical Chinese character sorting and retrieval, improves retrieval efficiency, simplifies the Chinese character search process, and avoids the ambiguity and inconvenience caused by the non-fixed radicals in traditional methods.
Smart Images

Figure CN115525728B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a method and apparatus for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries. Background Technology
[0002] The sorting and retrieval of Chinese characters fall into two main categories: morphological sorting and phonetic sorting. Morphological sorting is based on the shape of the character and mainly includes radical sorting, stroke and stroke order sorting, and number sorting. Phonetic sorting is based on the pronunciation of the character, and currently, it is mainly based on the Pinyin system.
[0003] Since Xu Shen's *Shuowen Jiezi* established the radical system for arranging Chinese characters more than 1,800 years ago, it has held a dominant position until the advent of the Pinyin system a few decades ago. The radical system categorizes Chinese characters into hundreds of different radicals (groups), selecting a character or symbol as the representative of each radical. To search for a character, one first determines the radical it belongs to and the position of its radical, then finds the character in the nearest row after that radical. If a radical contains many characters, it can also use stroke count and stroke order to assist in searching within that radical. *Shuowen Jiezi* defines 540 radicals, the *Kangxi Dictionary* defines 214, the *Xinhua Dictionary* uses 189, *Ciyuan* uses 250, and the *Chinese Character Radical Table* defines 201. In short, *Shuowen Jiezi*'s radical definition is more detailed and comprehensive, while later radicals have been largely categorized and merged.
[0004] The stroke count and stroke order method sorts characters based on the number of strokes and their stroke order. This method first sorts by stroke count, then by stroke order. The number method assigns a number to each character based on its shape. The phonetic method sorts characters according to their pronunciation. The Pinyin method uses Roman letters to represent sounds and for sorting.
[0005] However, the main drawback of the traditional, still widely used radical system is the vague definition and position of radicals, lacking strict regularity. Determining a character's radical sometimes relies on its position, sometimes on its sound, sometimes on its shape, sometimes on habit, sometimes on the relationship and meaning between the radical and the character, and sometimes on rigid rules, often leaving users bewildered. A radical can be a single-component character, a component, or even a structural element. Often, after looking up several characters, one will encounter a situation that requires a lot of time, or even forces one to give up. The radical system turns something as simple as looking up an unfamiliar character in a dictionary into something that relies on luck and probability.
[0006] The stroke-and-stroke-order method has too many characters with the same number of strokes, making searching inconvenient. It is generally used as a supplementary method to other methods. The number method is either applicable to a limited number of characters or too many, making both difficult to remember. The pinyin method has many characters with the same pronunciation, and it is impossible to search for characters that are unfamiliar or whose pronunciation is unknown. Summary of the Invention
[0007] In view of this, embodiments of the present invention provide a method and apparatus for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries. This method can solve the problems of sorting and retrieving difficulties caused by the traditional radical-based character lookup method, which is characterized by the instability of the definition and position of radicals and the lack of strict regularity. It breaks away from the tradition of needing to use radicals that are not characters themselves, and has the characteristics of being systematic, rigorous, practical, efficient, easy to learn and use.
[0008] To achieve the above objectives, according to one aspect of the present invention, a method for sorting Chinese characters is provided.
[0009] A method for sorting Chinese characters based on their first basic component includes: obtaining the first basic component of a Chinese character according to stroke order as the first character, and encoding the first character to obtain a first character code. The first character includes the first component of the Chinese character that can stand alone and cannot be divided, and the first main stroke component of a Chinese character that does not include any component; obtaining the number of strokes in each Chinese character, and obtaining the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; sorting the Chinese characters using the first character code as a first sorting field, the number of strokes as a second sorting field, and the stroke string as a third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority.
[0010] Optionally, obtaining the first basic character-forming component of a Chinese character according to stroke order as the first character, and encoding the first character to obtain the first character code includes: encoding the basic components of the Chinese character to obtain the basic component two-character code; splitting the Chinese character into basic components, and obtaining the Chinese character two-character code according to the basic component two-character code; obtaining the first basic character-forming component of the Chinese character according to stroke order as the first character, establishing the association relationship between the basic component and the first character, and generating a first matching table of the basic component two-character code and the first character code; determining the first character code of the Chinese character according to the Chinese character two-character code and the first matching table.
[0011] Optionally, encoding the basic components of Chinese characters to obtain the basic component dual-character codes includes: obtaining the basic components of Chinese characters according to the "GB13000.1 Character Set Chinese Character Component Specification for Information Processing"; sorting the basic components according to the number of strokes; sorting the basic components with the same number of strokes in the first sorting according to the stroke order included in the basic components; and saving the second sorted basic components to a table to generate an ordered code table to obtain the basic component dual-character codes, wherein the rows and columns of the ordered code table are encoded with different types of characters respectively.
[0012] Optionally, encoding the basic components of Chinese characters to obtain the double-character code for basic components includes: obtaining the basic components of Chinese characters according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing"; classifying the basic components into formed components and non-formed components according to whether the basic component is a formed component, and performing a first sorting; respectively performing a second sorting on the formed components and the non-formed components according to the number of strokes of the basic components; for the basic components with the same number of strokes among the formed components and non-formed components after the second sorting, respectively performing a third sorting according to the stroke order included in the basic components; saving the basic components after the third sorting into a table to generate an ordered code table to obtain the double-character code for basic components, wherein the horizontal and vertical columns of the ordered code table are encoded with different types of characters.
[0013] Optionally, splitting Chinese characters into basic components and obtaining the double-character code for Chinese characters according to the double-character code for basic components includes: splitting Chinese characters into basic components according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing"; obtaining the double-character codes of the basic components included in each Chinese character according to the double-character code for basic components; for each Chinese character, according to the "Specification for the Stroke Order of Chinese Characters in GB13000.1 Character Set", combining the double-character codes of the basic components included in the Chinese character in the stroke order of the basic components included in the Chinese character to obtain the double-character code for Chinese characters.
[0014] Optionally, the first-character code includes a formed first-character code and a stroke first-character code; determining the first-character code of a Chinese character according to the double-character code for Chinese characters and the first matching table includes: obtaining the double-character codes of the basic components included in the double-character code for Chinese characters; sequentially checking the first-character codes in the first matching table corresponding to each double-character code of the basic components according to the order of the double-character codes of the basic components; for each double-character code of the basic components, if a certain first-character code in the first matching table corresponding to the double-character code of the basic components is a formed first-character code, then taking the formed first-character code as the first-character code of the Chinese character; otherwise, according to the first matching table, obtaining the first-character code corresponding to the first double-character code of the basic components included in the double-character code for Chinese characters as the first-character code of the Chinese character.
[0015] Optionally, if the first formed component of a Chinese character is "mouth", and the Chinese character also includes formed components that are not "mouth", then determining the first formed component that is not "mouth" of the Chinese character as the first character of the Chinese character.
[0016] Optionally, obtaining the stroke string corresponding to each Chinese character according to the preset stroke character encoding rule includes: defining a corresponding letter as the character encoding of the stroke for each stroke; for the strokes included in each Chinese character, splicing the character encodings corresponding to all strokes in the stroke order to obtain the stroke string corresponding to each Chinese character.
[0017] Optionally, obtaining the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule includes: defining a corresponding letter for each stroke as the character encoding of the stroke; for the strokes included in each basic component, concatenating the character encodings corresponding to all the strokes in the stroke order to obtain the stroke string corresponding to each basic component; establishing an association relationship between the basic component double-character code and the basic component stroke string and generating a second matching table; for each Chinese character, obtaining the basic component double-character codes included in the Chinese character double-character code of the Chinese character; for each basic component double-character code, looking up the corresponding basic component stroke string from the second matching table; and concatenating the basic component stroke strings corresponding to each basic component double-character code in the order of the basic component double-character codes in the Chinese character double-character code to obtain the stroke string of the Chinese character.
[0018] Optionally, the Chinese character double-character code, the basic component double-character code, and the first character code are double-letter codes formed by using uppercase and lowercase letters; and when sorting according to the first character code, sorting is performed by comparing in sequence according to the character order of the double-letter code; when sorting according to the stroke string, sorting is performed by comparing in sequence according to the character order of the stroke string.
[0019] Optionally, the main stroke components include "one" (一), "vertical" (丨), "left-falling stroke" (丿), "dot" (丶), and "turning stroke" (乙); and the method further includes: according to the "Chinese Character Breaking Stroke Specification" of the GB13000.1 Character Set, merging the stroke "rising stroke" into the first character "one" (一), merging the stroke "vertical hook" into the first character "vertical" (丨), merging the stroke "diagonal stroke" into the first character "dot" (丶), and merging all "turning" strokes into the first character "turning stroke" (乙).
[0020] According to another aspect of the embodiments of the present invention, a Chinese character sorting device is provided.
[0021] A Chinese character sorting device based on the first basic character-forming component includes: a first character processing module, configured to obtain the first basic character-forming component of a Chinese character as the first character according to the stroke order and encode the first character to obtain a first character code, where the first character includes the first character-forming component that can be an independent character and cannot be split in the Chinese character, and the first main stroke component of a Chinese character that does not include any character-forming components; a stroke processing module, configured to obtain the number of strokes included in each Chinese character and obtain the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; and a multi-level sorting module, configured to sort the Chinese characters with the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, where the priority of the first sorting field is the highest and the priority of the third sorting field is the lowest.
[0022] According to another aspect of the embodiments of the present invention, a method for constructing a dictionary is provided.
[0023] A method for constructing a dictionary based on the Chinese character sorting method according to the first basic character component described in the embodiments of the present invention includes: obtaining the first basic character component of a Chinese character according to stroke order as the first character, and encoding the first character to obtain the first character code, wherein the first character includes the first character component of the Chinese character and the first main stroke component of the Chinese character excluding any character component; obtaining the number of strokes included in each Chinese character, and obtaining the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; sorting the Chinese characters using the first character code as a first sorting field, the number of strokes as a second sorting field, and the stroke string as a third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority; for each sorted Chinese character, obtaining the storage location of each Chinese character in the dictionary text, and generating a character lookup table according to each sorted Chinese character and its corresponding storage location; sorting the first character according to the number of strokes and stroke order to generate the first character table; and constructing a dictionary using the first character table, the character lookup table, and the dictionary text.
[0024] Optionally, the character lookup table has page numbers, and sorting the first characters according to the number of strokes and stroke order to generate a first character table includes: sorting the first characters in ascending order of the number of strokes; sorting the first characters after the first sorting in stroke order; and generating a first character table based on the second sorted first characters and the page number of each first character in the character lookup table.
[0025] Optionally, before encoding the first character to obtain the first character code, the method further includes: adjusting the obtained first character according to the size of the dictionary and the characters included.
[0026] Optionally, adjusting the first character obtained based on the size of the dictionary and the characters it includes: determining whether to adjust the first character obtained based on the size of the dictionary; if so, calculating the probability of occurrence of each component in the first character obtained; deleting components with a probability less than the set threshold that will not cause confusion after deletion from the first character obtained; or merging components containing the same component.
[0027] According to another aspect of the present invention, an apparatus for constructing a dictionary is provided.
[0028] An apparatus for constructing a dictionary based on the Chinese character sorting method according to the first basic character component as described in the embodiments of the present invention includes: a first character processing module, which obtains the first basic character component of a Chinese character according to stroke order as the first character, and encodes the first character to obtain a first character code, wherein the first character includes the first character component of the Chinese character and the first main stroke component of the Chinese character excluding any character component; a stroke processing module, which obtains the number of strokes included in each Chinese character, and obtains the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; and a multi-level sorting module, which uses the first character code as a first sorting field, and the number of strokes as a sorting field. The second sorting field, with the stroke count string serving as the third sorting field, sorts the Chinese characters. The first sorting field has the highest priority, and the third sorting field has the lowest priority. The character lookup table generation module is used to obtain the storage location of each sorted Chinese character in the dictionary text and generate a character lookup table based on each sorted Chinese character and its corresponding storage location. The first character table generation module is used to sort the first characters according to their stroke count and stroke order to generate a first character table. The dictionary construction module is used to construct a dictionary using the first character table, the character lookup table, and the dictionary text.
[0029] According to another aspect of the present invention, a Chinese character retrieval method is provided.
[0030] A method for retrieving Chinese characters using a dictionary constructed according to embodiments of the present invention includes: obtaining the first basic character-forming component of the Chinese character to be retrieved according to stroke order as the first character; if the Chinese character includes character-forming components, then the first character is the first character-forming component in the Chinese character; if the Chinese character does not include any character-forming components, then the first character is the first main stroke component of the Chinese character; finding the first character from the first character table and obtaining the character lookup table page corresponding to the first character; and searching for the Chinese character from the character lookup table page.
[0031] Optionally, finding the first character from the first character table and obtaining the corresponding character lookup table page includes: finding the first character from the first character table and obtaining the page number of the first character in the character lookup table; obtaining the corresponding character lookup table page based on the page number.
[0032] According to another aspect of the present invention, a Chinese character retrieval device is provided.
[0033] An apparatus for Chinese character retrieval using a dictionary constructed according to embodiments of the present invention includes: a first character acquisition module, used to acquire the first basic character-forming component of the Chinese character to be retrieved according to stroke order as the first character; if the Chinese character includes character-forming components, then the first character is the first character-forming component in the Chinese character; if the Chinese character does not include any character-forming components, then the first character is the first main stroke component of the Chinese character; a first character table lookup module, used to find the first character from the first character table and obtain the character lookup table page corresponding to the first character; and a character lookup table lookup module, used to find the Chinese character from the character lookup table page.
[0034] According to another aspect of the present invention, an electronic device is provided.
[0035] An electronic device includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, enable the one or more processors to implement the methods for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries provided in the embodiments of the present invention.
[0036] According to another aspect of the present invention, a computer-readable medium is provided.
[0037] A computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the methods for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries provided in embodiments of the present invention.
[0038] One embodiment of the above invention has the following advantages or beneficial effects: The first basic character-forming component of a Chinese character is obtained according to stroke order as the first character, and the first character is encoded to obtain the first character code. The first character includes the first character-forming component of the Chinese character and the first main stroke component of a Chinese character that does not include any character-forming components. The number of strokes included in each Chinese character is obtained, and the stroke string corresponding to each Chinese character is obtained according to a preset stroke character encoding rule. The Chinese characters are sorted using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, where the first sorting field has the highest priority and the third sorting field has the lowest priority. This technical solution uses the first basic character-forming component (first character) as the standard for sorting and retrieving Chinese characters, solving the problem of sorting and retrieving difficulties caused by the traditional radical-based character lookup method due to the unfixed definition and position of radicals and the lack of strict regularity. It breaks the tradition of needing to use radicals that are not characters themselves, and has the characteristics of being systematic, rigorous, practical, efficient, easy to learn and use.
[0039] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description
[0040] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:
[0041] Figure 1 This is a schematic diagram of the main steps of the Chinese character sorting method according to an embodiment of the present invention;
[0042] Figure 2 This is a schematic diagram of the dual-character code representation of the basic components of Chinese characters according to an embodiment of the present invention;
[0043] Figure 3 This is a schematic representation of the first character code encoding in one embodiment of the present invention;
[0044] Figure 4 This is a schematic diagram illustrating the process of determining the first character code of a Chinese character according to an embodiment of the present invention;
[0045] Figure 5 This is a schematic representation of stroke character encoding according to an embodiment of the present invention;
[0046] Figure 6 This is a schematic diagram illustrating the implementation process of obtaining the stroke string corresponding to a Chinese character according to another embodiment of the present invention;
[0047] Figure 7 This is a schematic representation of a word lookup table-assisted sorting method according to an embodiment of the present invention;
[0048] Figure 8 This is a schematic representation of a word lookup table-assisted sorting method according to another embodiment of the present invention;
[0049] Figure 9 This is a schematic diagram illustrating the main steps of a dictionary construction method according to an embodiment of the present invention;
[0050] Figure 10 is a schematic diagram of the character lookup representation according to an embodiment of the present invention;
[0051] Figure 11 This is a schematic representation of the first character of one embodiment of the present invention;
[0052] Figure 12 This is a schematic diagram of the first character code of a sample dictionary according to an embodiment of the present invention;
[0053] Figure 13 This is a schematic diagram illustrating the main steps of the Chinese character retrieval method according to an embodiment of the present invention;
[0054] Figure 14 This is a schematic diagram of the first character representation of an electronic dictionary according to an embodiment of the present invention;
[0055] Figure 15 This is a schematic representation of an electronic dictionary character lookup method according to an embodiment of the present invention;
[0056] Figure 16This is a schematic diagram of the Chinese character text content in an electronic dictionary according to an embodiment of the present invention;
[0057] Figure 17 This is a schematic diagram of the main modules of a Chinese character sorting device according to an embodiment of the present invention;
[0058] Figure 18 This is a schematic diagram of the main modules of an apparatus for constructing a dictionary according to an embodiment of the present invention;
[0059] Figure 19 This is a schematic diagram of the main modules of the Chinese character retrieval device according to an embodiment of the present invention;
[0060] Figure 20 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;
[0061] Figure 21 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation
[0062] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0063] To address the problems existing in current technologies, this invention provides a simple, fast, accurate, and unambiguous method for sorting and retrieving Chinese characters based on their first fundamental component. This method can be used in dictionaries and other applications, and is referred to as the "first-character method." This invention solves the problems of ambiguity, irregularity, and reliance on luck inherent in traditional radical-based character lookup methods, as well as the inconvenience of stroke-based and stroke-order-based retrieval methods.
[0064] Figure 1 This is a schematic diagram illustrating the main steps of a Chinese character sorting method according to an embodiment of the present invention. Figure 1 As shown, the Chinese character sorting method of this embodiment mainly includes the following steps S101 to S103.
[0065] Step S101: Obtain the first basic character-forming component of a Chinese character according to the stroke order as the first character, and encode the first character to obtain the first character code. The first character includes the first character-forming component that can stand alone and cannot be divided, and the first main stroke component of a Chinese character that does not include any character-forming components. In the embodiments of the present invention, the encoding (e.g., first character code, Chinese character two-character code, basic component two-character code, etc.) is introduced in the form of letter code as an example. In specific implementation, the encoding form can be flexibly set as needed, such as: letters and numbers combined, letters and special symbols combined, etc.
[0066] Based on the achievements of modern computer technology research, the state issued the "GB13000.1 Character Set Chinese Character Component Specification for Information Processing" and the attached "Table of Basic Chinese Character Components". The release of this national standard provided the foundation for establishing a new character shape retrieval method. The "Table of Basic Chinese Character Components" defines 560 basic components.
[0067] According to the above national standards, components are character-forming units composed of strokes that function to assemble Chinese characters. Basic components are the smallest, no longer subdivided parts, and are divided into basic character-forming components (which are characters themselves, hereinafter referred to as character-forming components) and basic non-character-forming components (which are not characters themselves, hereinafter referred to as non-character-forming components). All Chinese characters can be composed of basic components. That is to say, the 20,902 Chinese characters in the GB13000.1 character set, including traditional Chinese characters and Japanese / Korean kanji, can all be composed of these 560 basic components.
[0068] Of these 560 basic components, 225 are character-forming components (classification is determined by whether a component is included in the 7,000 commonly used characters in the *Modern Chinese Common Character List*). The remaining 335 are non-character components. These 335 non-character components account for approximately 60% of the total number of components. Moreover, with the exception of a few radicals, most of them are unfamiliar structural forms that people cannot name.
[0069] Conversely, the 225 character-forming components are mostly commonly used and familiar single-component characters. In popular reference books like dictionaries, could these 225 character-forming components be used to search for all Chinese characters, instead of using the other 335 non-character components?
[0070] Through the analysis of approximately four thousand commonly used Chinese characters, it was found that although non-character components appear frequently and are widely used in Chinese characters, it is rare for a Chinese character to contain no character-forming components at all. Therefore, it is entirely possible to use character-forming components for character retrieval. In this way, people can avoid unfamiliar shapes and symbols when searching for Chinese characters.
[0071] Stroke counting is a commonly used auxiliary tool in Chinese character layout and indexing. When used appropriately, it can be helpful to users.
[0072] In order to label and store each of the above 560 basic components in a computer, considering applications such as keyboard typing, it would be convenient if they could be represented by Roman letters. However, there are only 26 letters from A to Z, and including upper and lower case, there are a total of only 52, which is necessarily insufficient. By using two letters, there are 26×26 = 676 different combinations, which can meet the needs of 560 components, and there is still 116 spaces for expansion. The utilization rate of the double-letter resource is quite high, at 83% (560 / 676).
[0073] Each basic component can be more conveniently determined by encoding the Chinese character basic components. In one embodiment of the present invention, based on the inventive concept of separating formed components from non-formed components, arranging components according to strokes, and using double letters for encoding, the Chinese character basic components are encoded. Specifically, the steps for encoding the basic components of Chinese characters to obtain the double-character code for basic components include: obtaining the basic components of Chinese characters according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing"; dividing the basic components into formed components and non-formed components according to whether the basic component is a formed component, and performing a first sorting; respectively performing a second sorting on the formed components and non-formed components according to the number of strokes of the basic components; for the basic components with the same number of strokes among the formed components and non-formed components after the second sorting, respectively performing a third sorting according to the stroke order included in the basic components; saving the basic components after the third sorting into a table to generate an ordered code table to obtain the double-character code for basic components, wherein the horizontal and vertical columns of the ordered code table are encoded with different types of characters.
[0074] Next, in conjunction with the accompanying drawings, taking the double-letter code as an example, the encoding process of the double-character code for Chinese character basic components in one embodiment of the present invention is introduced. Figure 2 is a schematic diagram of the double-character code for Chinese character basic components in one embodiment of the present invention. As Figure 2 shown, in the double-character code table of the Chinese character basic components, all 560 basic components are encoded according to the strokes and stroke order included in the Chinese characters, and each basic component is represented by two letters.
[0075] When compiling the double-character code table for Chinese character basic components, first, the formed components among the 560 basic components are arranged in the first half, and the non-formed components are arranged in the second half. Then, the basic components within the two parts are arranged in ascending order according to the number of strokes. Then, the basic components with the same number of strokes are arranged according to the stroke order. Finally, all the above basic components are sequentially filled into a 25x24 grid to generate an ordered code table, that is, a double-character code table for Chinese character basic components is constructed according to the stroke order of the basic components included in the Chinese characters. Among them, the row and column where a basic component is located determine the double-character code of the basic component. For example, for "wood", which is in row D and column e, its double-character code is De.
[0076] According to another embodiment of the present invention, the steps of encoding the basic components of Chinese characters to obtain the double-character codes of basic components may also be: obtaining the basic components of Chinese characters according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing"; performing a first sorting on the basic components according to the number of strokes of the basic components; for the basic components with the same number of strokes among the basic components after the first sorting, performing a second sorting according to the stroke order included in the basic components; saving the basic components after the second sorting into a table to generate an ordered code table to obtain the double-character codes of basic components, wherein the horizontal and vertical columns of the ordered code table are encoded with different types of characters. When constructing the double-character code table of basic components, it is also possible to Figure 2 , not separating the formed components from the non-formed components, but mixing them together and performing sorting and encoding uniformly.
[0077] Based on the double-character codes of Chinese character basic components, Chinese characters can be encoded according to the specification to obtain the double-character codes of Chinese characters. In the embodiments of the present invention, splitting Chinese characters into basic components and obtaining the double-character codes of Chinese characters based on the double-character codes of basic components may specifically include the following steps: splitting Chinese characters into basic components according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing"; obtaining the double-character codes of the basic components included in each Chinese character according to the double-character codes of basic components; for each Chinese character, according to the "Specification for Chinese Character Stroke Order of GB13000.1 Character Set", combining the double-character codes of the basic components included in the Chinese character in the stroke order of the basic components included in the Chinese character to obtain the double-character code of the Chinese character.
[0078] In specific implementation, first, according to the "Specification for Chinese Character Components of GB13000.1 Character Set for Information Processing", Chinese characters are split into basic components. Since the specification stipulates that basic components cannot be further split, those that are separated or joined can be split, and those that are crossed (intersected) cannot be split, so the steps of character splitting are relatively simple and clear. For example, "明" is split into "日" and "月". "韭" is split into "非" and "一". When encountering individual characters with two or more splitting methods, during splitting, the number of components should be as small as possible. First, split those that are separated, then those that are joined, and then, the first component should have as many strokes as possible.
[0079] After splitting the character into basic components, the corresponding double-character codes of basic components can be found in the double-character code table of Chinese character basic components. Then, according to the "Specification for Chinese Character Stroke Order of GB13000.1 Character Set", in accordance with the stroke order of each basic component of the character in the character, the double-character codes corresponding to these basic components are combined together to obtain the double-character code of the character.
[0080] The following is an example based on Figure 2 the double-character code table of Chinese character basic components shown below.
[0081] "Mu" contains only one basic component "Mu" (component double-character code De), so the code of the character "Mu" (i.e., the double-character code of the character "Mu") is De.
[0082] "Yang" is split into two components "Mu" (double-character code is De) and "Yang" (double-character code is Hs). According to the stroke order of the two basic components, the code of "Yang" is DeHs.
[0083] "Pin" is split into three "Kou" (double-character code is Bp), so the code of "Pin" is BpBpBp.
[0084] "Han" is split into "Shui" (double-character code is Oh) and "You" (double-character code is As), so the code of "Han" is OhAs.
[0085] "Shun" is split into "Chuan" (double-character code is Bu), "Shi" (double-character code is Kc) and "Bei" (double-character code is Du), so the code of "Shun" is BuKcDu.
[0086] According to the above coding method, encoding all 20,902 Chinese characters, traditional Chinese characters and Japanese and Korean Chinese characters in the GB13000.1 character set, a complete Chinese character double-character code can be obtained. The code length of each character varies from two letters of a single basic component to multiple letters.
[0087] The Chinese character double-character code of the embodiment of the present invention includes all basic components of Chinese characters, so it is complete and holographic, and has uniqueness and bidirectionality. The code of each character is unique, without duplicate codes, and the code can be deduced from the character, and the character can be deduced from the code. The Chinese character coding of the embodiment of the present invention can be used in sorting, retrieval and other occasions.
[0088] The Chinese character double-character code table of an embodiment of the present invention is shown in Table 1, in which only a few Chinese characters and the corresponding Chinese character double-character codes are listed示例性地.
[0089] Table 1
[0090] Chinese character Chinese character dual character code Wood De Sample DeHs Taste BpBpBp Classic UeAj Chinese OhAs Character OjCk Pen UhEc Shun BuKcDu code KcBpLnAa
[0091] Most Chinese characters contain at least one formed character component, but about half of Chinese characters do not start with a formed character component. When people look up characters, are they willing to look for formed character components that are not at the beginning of a character? Through multiple tests, it is found that people are so familiar with these formed character components that they like to use them to look up characters very much and don't care whether they are at the beginning of a character. Therefore, this leads to an important concept of this invention, the first basic formed character component, abbreviated as "the first character". For Chinese characters containing formed character components, the "first character" of a Chinese character is also the first formed character component encountered in a Chinese character according to the stroke order, called the formed first character. For example, "wood" in "pole" and "dry" in "sweat" (since "氵" is not a formed character component, it is skipped).
[0092] However, not all Chinese characters include formed character components. For those Chinese characters that do not contain any formed character components, as a supplement, this invention will select the first stroke of the character and merge it into five main stroke components "一", "乙", "丨", "丿" and "丶" as the first character. But since the main stroke components "一" and "乙" are already included in the formed character components, therefore, in the embodiments of this invention, "乙" is used as both a formed character component and a main stroke component; "一" is only used as a main stroke component. Among them, according to the "Chinese Character Fold Stroke Specification of GB13000.1 Character Set", the stroke "提" is merged into "一", the stroke "竖钩" is merged into "丨", the stroke "捺" is merged into "丶", and all "折" strokes are merged into "乙". In this way, all characters without formed character components will also have a "first character" according to the first stroke of the character, called the stroke first character. The stroke first character and the formed first character together constitute the "first character" of this invention. Those skilled in the art should understand that the division of the stroke first character and the formed first character in this invention is not unique. "一" and "乙" can be used as either formed first characters or stroke first characters, and can be flexibly set according to the application scenario requirements specifically.
[0093] After obtaining the first character of a Chinese character, this invention compiles a double character code for the first character and names it the double character code of the first basic formed character component, abbreviated as the first character code. Correspondingly, the first character code also includes the formed first character code and the stroke first character code. Figure 3 It is the schematic diagram of the first character code encoding of an embodiment of this invention. As Figure 3 shown, in the embodiments of this invention, the double letter codes composed of upper and lower case letters are used to encode 228 obtained first characters, and the obtained first character code encoding is shown. Since the non-character component is very similar in shape to the formed character component "月" and is often used interchangeably, therefore, when used for this purpose, it is treated the same as "月". Similarly, the non-character component "□" (frame) is treated the same as "口".
[0094] When performing the encoding of the first character code, specifically: First, arrange all the first characters according to the number of strokes, and for those with the same number of strokes, arrange them according to the stroke order; then, fill them into a newly created table in sequence. The horizontal rows of this table are encoded with lowercase letters, and the lowercase letters start from 'a' and do not exceed 'y', and the vertical columns are encoded with uppercase letters, and the uppercase letters start from 'A' and do not exceed 'Y'. In Figure 3 For example, taking the first character 'one' as an example, its first character code is 'Aa'.
[0095] However, in the specific implementation process, when determining the first character codes of thousands of Chinese characters one by one, obviously, the efficiency of querying one by one from the above-mentioned first character code encoding table is relatively low. In order to efficiently determine the first characters and first character codes of Chinese characters through a computer program, in an embodiment of the present invention, step S101 obtains the first basic formed component of a Chinese character as the first character according to the stroke order and encodes the first character to obtain the first character code, which may specifically include the following steps: encoding the basic components of the Chinese character to obtain the double-character code of the basic component; splitting the Chinese character into basic components and obtaining the double-character code of the Chinese character according to the double-character code of the basic component; obtaining the first basic formed component of the Chinese character as the first character according to the stroke order, establishing the association relationship between the basic component and the first character, and generating the first matching table between the double-character code of the basic component and the first character code; determining the first character code of the Chinese character according to the double-character code of the Chinese character and the first matching table.
[0096] In the introduction of the previous embodiments, how to obtain the double-character code of the basic component and the double-character code of the Chinese character has been introduced. Next, in combination with Table 2 and Figure 4 the constructed first matching table will be introduced, as well as determining the first character code of the Chinese character based on the double-character code of the Chinese character and the first matching table. The first column and the second column in Table 2 below show the content included in the first matching table in an embodiment of the present invention.
[0097] Table 2
[0098] Basic component dual character code Initial code Basic component stroke string Aa Aa a Ab Ae V … … … Aj Am e.g. Bp Cc cAa Bu Ch ECC … … … Hs Jj feaaac Kc Aa ae Lg Ad fe Ln Ae AX Oh Ad ffb Oj Ad ffC Ue Ab cAacca Uh Ac eafeaf … … … Xh Ao ecAaaScAaaAaaAgea
[0099] When constructing the first matching table, it is necessary to construct it in combination with Figure 2 the shown double-character code table of the basic components of Chinese characters and Figure 3 the shown first character code encoding table. For each basic component in Figure 2 , if this basic component is a formed component, it directly corresponds to Figure 3 a certain formed first character in Figure 2 . For example, the basic component 'eight' in Figure 3Its corresponding initial character code can be found to be "Am", and thus the association relationship between the double-character code of the basic component and the initial character code can be established. In another case, if the basic component is a non-character component, the main stroke component corresponding to the first stroke of the non-character component is obtained, and this main stroke component is used as the initial character corresponding to the basic component. For example: Figure 2 For the basic component "氵" in Figure 2 , its corresponding double-character code of the basic component is "Oh". Since it is a non-character component, the main stroke component "丶" corresponding to the first stroke "丶" of this non-character component needs to be obtained, and the association relationship between the initial character code "Ad" of this main stroke component and the double-character code of the basic component is established. Thus, the association relationship between the basic component and the initial character can be established, and the first matching table between the double-character code of the basic component and the initial character code can be generated.
[0100] Figure 4 It is a schematic diagram of the implementation process of determining the initial character code of a Chinese character in an embodiment of the present invention. As Figure 4 shown, in an embodiment of the present invention, when determining the initial character code of each Chinese character according to the double-character code of the Chinese character and the first matching table, the following steps mainly can be included: obtaining the double-character code of the basic component included in the double-character code of the Chinese character; sequentially checking the initial character codes in the first matching table corresponding to each double-character code of the basic component according to the order of the double-character codes of the basic components; for each double-character code of the basic component, if a certain initial character code in the first matching table corresponding to this double-character code of the basic component is a formed-character initial character code, then this formed-character initial character code is used as the initial character code of the Chinese character; otherwise, according to the first matching table, the initial character code corresponding to the first double-character code of the basic component included in the double-character code of the Chinese character is obtained as the initial character code of the Chinese character. Specifically, according to the order of the double-character codes of the basic components included in the double-character code of the Chinese character, one double-character code of the basic component is taken out each time, and the initial character code in the corresponding first matching table is checked. If this initial character code is a formed-character initial character code, then this formed-character initial character code is used as the initial character code; otherwise, it means that this Chinese character does not have a formed component. At this time, the initial character code corresponding to the first double-character code of the basic component included in the double-character code of the Chinese character can be obtained and used as the initial character code of this Chinese character.
[0101] According to one embodiment of the present invention, if the first formed component of a certain Chinese character is "口", and this Chinese character also includes formed components other than "口", then the first formed component other than "口" of this Chinese character is determined as the initial character of this Chinese character. This is because there are relatively many composite characters in which the initial character "口" participates in forming characters, and the combination with other initial characters is not balanced. Therefore, reducing the chance that a character contains the initial character "口" is beneficial to the uniform distribution of dictionary characters among each initial character, and is conducive to fast sorting and retrieval.
[0102] According to the above-introduced step S101, the first basic formed component of the Chinese character can be obtained as the initial character according to the stroke order and encoded to obtain the initial character code.
[0103] Step S102: Obtain the number of strokes included in each Chinese character, and obtain the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule. Specifically, when obtaining the stroke string corresponding to each Chinese character according to the preset stroke character encoding rule, in one embodiment of the present invention, a corresponding letter is defined for each stroke as the character encoding of the stroke; for the strokes included in each Chinese character, the character encodings corresponding to all strokes are concatenated in the stroke order to obtain the stroke string corresponding to each Chinese character. Figure 5 It is the schematic diagram of stroke character encoding representation in one embodiment of the present invention. As Figure 5 , for the characters belonging to the same first character, according to the "Chinese Character Folding Stroke Specification" in the GB3000.1 Character Set, they are sorted according to the number of strokes and the stroke order. For the convenience of comparing strokes, a corresponding letter is defined for each stroke as the character encoding. If the letter is earlier, the stroke sorting is earlier. Taking the character "十" as an example, it has two strokes "一" and "丨". According to Figure 5 , the corresponding character encoding of "一" is the letter "a", and the corresponding character encoding of "丨" is the letter "c". Therefore, the stroke string of "十" is "ac".
[0104] In another embodiment of the present invention, obtaining the stroke string corresponding to each Chinese character according to the preset stroke character encoding rule may specifically include the steps of: defining a corresponding letter for each stroke as the character encoding of the stroke; for the strokes included in each basic component, concatenating the character encodings corresponding to all strokes in the stroke order to obtain the stroke string corresponding to each basic component; establishing an association relationship between the basic component double character code and the basic component stroke string and generating a second matching table; for each Chinese character, obtaining the basic component double character codes included in the Chinese character double character code according to the Chinese character double character code of the Chinese character; for each basic component double character code, looking up the corresponding basic component stroke string in the second matching table; and concatenating the basic component stroke strings corresponding to each basic component double character code in the order of the basic component double character codes in the Chinese character double character code to obtain the stroke string of the Chinese character.
[0105] In this embodiment, the Chinese character is split into basic components, and the stroke string corresponding to the basic component is pre-generated according to the stroke character encoding rule. Then, the stroke string corresponding to the Chinese character can be obtained by concatenating the stroke strings corresponding to the basic components, which can obtain the stroke string of the Chinese character more quickly and conveniently. In the embodiment of the present invention, the number of strokes included in a Chinese character is the number of characters included in the stroke string of the Chinese character.
[0106] In this embodiment, the process of generating the stroke string corresponding to the basic component is similar to the process of generating the stroke string of the Chinese character in the foregoing embodiment, and will not be elaborated here. Below, in combination with Table 2 and Figure 6Introduce the constructed second matching table and determine the stroke string corresponding to a Chinese character based on the stroke string of the basic component. In the description of the embodiments of the present invention, the first matching table and the second matching table are integrated and shown in Table 2 above. The first column and the third column in Table 2 show the content included in the second matching table in another embodiment of the present invention.
[0107] When constructing the second matching table, it is necessary to combine Figure 2 and Figure 5 to construct it. According to the strokes and stroke order included in the basic component, and Figure 5 , the stroke string of the basic component can be obtained. For example: Figure 2 For the basic component "八" in Figure 5 , its corresponding basic component double character code is "Aj". According to its strokes and stroke order, the stroke string "eg" can be obtained from
[0108] Figure 6 Figure 6
[0109]
[0110] Step S103: Sort the Chinese characters with the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field. Among them, the priority of the first sorting field is the highest, and the priority of the third sorting field is the lowest. Among them, when sorting according to the first character code, compare and sort in sequence according to the character order of the double character code; when sorting according to the stroke string, compare and sort in sequence according to the character order of the stroke string.
[0110] When sorting Chinese characters, a new character sorting table is first created, as shown in Table 3. The first column of the table lists the characters to be sorted, the second column lists the first character's code, the third column lists the number of strokes, and the fourth column lists the stroke string. Then, all first characters are inserted into Table 3. Specifically, the first character's code is used as the highest priority sorting field, the number of strokes as the second priority sorting field, and the stroke string as the lowest priority sorting field. After sorting, all first characters are inserted into Table 3. Finally, for any Chinese character to be sorted, its first character code, number of strokes, and stroke string are compared one by one with the existing characters in Table 3 to determine its insertion position. After all fields to be sorted are inserted into Table 3, the sorting result is obtained.
[0111] Table 3
[0112]
[0113]
[0114] Figure 7 This is a schematic representation of a character lookup table used for auxiliary sorting according to an embodiment of the present invention. In this embodiment, the example of sorting Chinese characters and adding them to a dictionary is used for illustration. Figure 7 This diagram illustrates a page after the first characters have been sorted and inserted into the auxiliary sorting table of the dictionary. At this stage, each row contains one first character, with a blank line between each character. The first column of each row is the first character or a character to be added to the dictionary later; the second column is the page number of that character in the dictionary text; the third column is the first character code contained in that character; the fourth column is the number of strokes in that character; and the fifth column is the complete stroke string represented by letter symbols for that character.
[0115] The order of a character in this table is determined by the contents of the last three columns of each row. The third column is compared first, then the fourth, and finally the fifth. For the third column, when sorting by the first character code, the characters are compared sequentially according to their double-character codes. For the fourth column, the characters are sorted in ascending order. For the fifth column, when sorting by stroke count, the characters are compared sequentially according to their stroke counts, with lowercase letters preceding uppercase letters. Following this rule, once a character defines these three parameters, it knows where it should be added to an existing character lookup table's auxiliary sorting table.
[0116] Figure 8 This is a schematic representation of the character lookup table-assisted sorting method according to another embodiment of the present invention. Figure 8 This diagram illustrates a page after the Chinese characters to be sorted have been sorted and inserted into the auxiliary sorting table of the character lookup table. For any given Chinese character, it can be inserted into the auxiliary sorting table of the character lookup table according to the aforementioned sorting method.
[0117] Based on steps S101 to S103 above, the first basic character component (first character) can be used as the standard for sorting Chinese characters. This solves the problem of sorting and retrieval difficulties caused by the traditional radical-based character lookup method, which is characterized by the lack of fixed definitions and positions of radicals and the absence of strict regularity. It breaks the tradition of needing to use radicals that are not characters themselves, and has the characteristics of being systematic, rigorous, practical, efficient, easy to learn and use.
[0118] According to another aspect of the present invention, a method for constructing a dictionary is provided. The dictionary in this invention can be an electronic dictionary or a commonly used physical dictionary.
[0119] Figure 9 This is a schematic diagram illustrating the main steps of a method for constructing a dictionary according to an embodiment of the present invention. Figure 9 As shown, the method for constructing a dictionary in this embodiment of the invention mainly includes the following steps S901 to S906.
[0120] Step S901: Obtain the first basic character component of a Chinese character according to the stroke order as the first character, and encode the first character to obtain the first character code. The first character includes the first character component of a Chinese character that can stand alone and cannot be separated, and the first main stroke component of a Chinese character that does not include any character component.
[0121] Step S902: Obtain the number of strokes in each Chinese character, and obtain the stroke string corresponding to each Chinese character according to the preset stroke character encoding rules;
[0122] Step S903: Sort Chinese characters using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field. The first sorting field has the highest priority, and the third sorting field has the lowest priority.
[0123] Step S904: For each sorted Chinese character, obtain the storage location of each Chinese character in the dictionary text, and generate a character lookup table based on each sorted Chinese character and its corresponding storage location;
[0124] Step S905: Sort the first characters according to the number of strokes and stroke order to generate a list of first characters;
[0125] Step S906: Construct the dictionary using the initial character list, the index table, and the dictionary text.
[0126] In the above steps, steps S901 to S903 are implemented in the same way as steps S101 to S103, and will not be described again here.
[0127] In step S904, the character lookup table is used to find the specific storage location of a character in the dictionary text. It is divided into groups based on the first character, with each group starting with the first character and including all characters containing that first character, arranged in stroke order. The character lookup table includes all characters in the dictionary. Users use the first character list and the character lookup table to find the storage location of a character in the dictionary text. For electronic dictionaries, the storage location of a character in the dictionary text might be a page in a table of a database; for physical dictionaries, the storage location of a character in the dictionary text might be a page in the dictionary. Figure 10 is a schematic diagram of the character lookup table according to an embodiment of the present invention, showing several pages of the character lookup table. The specific storage location of a character in the dictionary text can be found by referring to the character lookup table.
[0128] In step S905, the first characters are sorted according to their stroke count and stroke order, and the table used for first character retrieval is called the first character table in this invention. This is the first table that users look up when searching for a character; it is the overall table for character lookup. It tells the user all the first characters and their page numbers in the character lookup table. From this table, the user finds the first character of a word and its storage location in the character lookup table, and then searches for the specific word in the character lookup table. For electronic dictionaries, the first character points to the character lookup table through a data location pointer; therefore, the first character table does not need to include the page number of the first character in the character lookup table. For physical dictionaries, the character lookup table has page numbers, and when sorting the first characters according to their stroke count and stroke order to generate the first character table, the first characters are sorted firstly from smallest to largest stroke count; then, for the first sorted first characters, those with the same stroke count are sorted a second time according to stroke order; finally, the first character table is generated based on the second sorted first characters and the page number of each first character in the character lookup table. Figure 11 This is a schematic diagram of the first character representation in one embodiment of the present invention. In the first character table, the page in the character index where each first character belongs is marked below it, and the number in the box in front of the first character indicates the number of strokes of the first character.
[0129] Furthermore, according to one embodiment of the present invention, in the specific process of generating a dictionary, before encoding the first character to obtain the first character code, the obtained first character can be adjusted according to the size of the dictionary and the characters it includes. Specifically, it is determined whether the obtained first character needs to be adjusted based on the size of the dictionary; if so, the occurrence probability of each component in the obtained first character is statistically analyzed; according to a set threshold, components with an occurrence probability less than the threshold and whose deletion will not cause confusion are deleted from the obtained first character; or, two basic components that contain each other or two very similar basic components are merged.
[0130] Figure 12 This is a schematic diagram of the first character code of a sample dictionary according to an embodiment of the present invention. The sample dictionary of the present invention contains approximately four thousand characters, and its first character code is as follows: Figure 12As shown, it only contains 171 initial characters. Usually, if the number of characters in a dictionary is relatively small, the number of initial characters can also be a little less. The obtained initial characters can be adjusted. Specifically, first, the occurrence probability of each component character in the obtained initial characters needs to be counted. If the occurrence probability is less than a certain pre-set threshold, it means that the characters formed by this initial character are relatively few, and this initial character can be considered not necessary and can be removed. Two basic components where one contains the other or two very similar basic components can also be merged. For example, merge "犬" into "大", merge "方" into "万", merge "户" into "尸", merge "玉" into "王", merge "孑" into "子", and so on. In addition, for some component characters with a relatively low occurrence probability, which are rarely used in this dictionary and are not likely to cause confusion after being removed, they can be directly deleted. However, for individual component characters, such as "四", although it is not used as an initial character in other characters of the four thousand characters, it is still retained to avoid confusion.
[0131] The following introduces the dictionary construction method of the present invention in combination with a specific embodiment. In the embodiment of the present invention, the process of constructing a dictionary mainly includes the following steps:
[0132] 1. Extract and analyze the initial characters of the characters for constructing the dictionary to determine the initial characters included in the dictionary, and obtain the initial character codes as Figure 12 shown, the number of strokes, the stroke string corresponding to each initial character, and its page number in the dictionary text;
[0133] 2. Insert the initial characters into the auxiliary sorting table of the character lookup table as Figure 7 shown;
[0134] 3. Insert each character in the dictionary into the Figure 7 table according to the following steps:
[0135] The first step: Find the initial character contained in this character and the corresponding initial character code in the Figure 12 initial character code table. Note that component characters cannot be split. For example, if the first basic component character contained is "自", then "自" must be selected, and "目" cannot be selected;
[0136] The second step: Calculate the number of strokes contained in this character;
[0137] The third step: Write out the strokes of this character and convert all the strokes into a stroke string according to Figure 5 ;
[0138] The fourth step: Find the page number of this character in the dictionary text;
[0139] The fifth step: Arrange this character in the order of its initial character code, the number of strokes, and the stroke string, and compare it with Figure 5Compare the characters in it, and then insert the character into the corresponding line in sequence;
[0140] 4. After inserting all the characters in the dictionary into the Figure 7 auxiliary sorting table of the character index shown, the characters in the first two columns of the table and the page numbers of the dictionary text are the contents required by the character index. Extract them, put them together, and write the page numbers for pagination of these contents, and the character index is made. For the convenience of reading, a blank line is left before each first character in the table;
[0141] 5. After making the character index, fill the page number of the first character in the character index back to the Figure 12 below the first character of, and remove the letter code, then the Figure 11 shown first character table is made. The numbers below each first character in the table indicate the page number of the first character in the character index;
[0142] 6. A dictionary can be constructed according to the first character table, the character index and the dictionary text.
[0143] Among them, in the above embodiments, if the first formed character component contained in a character is "mouth", and there is still a formed character component other than "mouth" behind it, then "mouth" is not selected, but the first formed character component other than "mouth" behind it is selected as the first character, so as to evenly distribute the first characters and improve the retrieval efficiency. For example, for the character "scare", select "down", not "mouth".
[0144] In addition, if a character does not include any first characters other than the first character of pure strokes, then a main stroke first character is selected according to the first stroke of the character. According to the "GB13000.1 Character Set Chinese Character Folding Stroke Specification", the stroke "raising" is merged into the first character "one", the stroke "vertical hook" is merged into the first character "vertical", the stroke "right-falling stroke" is merged into the first character "dot", and all "folding" strokes are merged into the first character "crooked".
[0145] Since the formed character components themselves are mostly the simplest and most commonly used single characters, originating from the original pictographs, their word-formation functions are the strongest, the semantic components they represent in a compound character are very large, and the phonetic components they represent in a compound character are also very heavy. The character groups gathered around them have very distinct group characteristics of Chinese characters, and the difference in the number of characters in each group is not as obvious as the radical method, and the distribution is relatively balanced, which is conducive to rapid character retrieval.
[0146] According to another aspect of the present invention, a Chinese character retrieval method is provided.
[0147] Figure 13 is a schematic diagram of the main steps of the Chinese character retrieval method according to the embodiment of the present invention. As Figure 13As shown in the figure, the Chinese character retrieval method according to the embodiment of the present invention is a method for retrieving Chinese characters using the dictionary constructed above, mainly including the following steps S1301 to S1303.
[0148] Step S1301: Obtain the first basic formed character component of the Chinese character to be retrieved as the first character according to the stroke order; if the Chinese character includes formed character components, the first character is the first formed character component in the Chinese character; if the Chinese character does not include any formed character components, the first character is the first main stroke component of the Chinese character.
[0149] Step S1302: Search for the first character in the first character table and obtain the page of the character search table corresponding to the first character.
[0150] Step S1303: Search for the Chinese character in the page of the character search table.
[0151] The following combines the appendix Figure 14-16 Introduce how to use the first character method to search for the character "class" on the electronic dictionary. Figure 14 It is a schematic diagram of the first character table of the electronic dictionary according to an embodiment of the present invention; Figure 15 It is a schematic diagram of the character search table of the electronic dictionary according to an embodiment of the present invention; Figure 16 It is a schematic diagram of the Chinese character text content of the electronic dictionary according to an embodiment of the present invention. First, in Figure 14 Select the first character "king" of the character "class" in the first character table of, then you can get Figure 15 The character search table of "king" shown in; then, select the character "class" in the character search table of Figure 15, and you can get Figure 16 The detailed explanation of the character "class" shown in. The whole process is very simple and fast.
[0152] In another embodiment of the present invention, if the dictionary is a physical dictionary, the step of searching for the first character in the first character table and obtaining the page of the character search table corresponding to the first character may specifically be: searching for the first character in the first character table and obtaining the page number of the first character in the character search table; obtaining the page of the character search table corresponding to the first character according to the page number. Specifically, in a dictionary sorted by the first character table and the character search table, the corresponding character search method is as follows:
[0153] 1. When searching for a character, first find the first character contained in the character and its page number in the character search table according to the stroke order in the first character table;
[0154] 2. According to the page number of the first character found in the character search table, find the position of the first character at the corresponding page number in the character search table;
[0155] 3. Immediately following the position of the above first character, search for the character according to the number of strokes and stroke order of the Chinese character to be found.
[0156] Since the number of characters contained in the general first character is not large, this character lookup process is straightforward. In a few cases, the number of strokes and the stroke order need to be used. If it cannot be found, it means that the dictionary does not include this character, and there is no ambiguity.
[0157] In the specific implementation process, if the first formed character component of a character is "mouth", and there are formed character components other than "mouth" after it, then find the first formed character component other than "mouth" that appears later as the first character, and obtain the page number of this first character in the character lookup table for character lookup. If a character does not include any formed character components, then find a stroke first character according to the first stroke of this character and the page number of this stroke first character in the character lookup table for character lookup.
[0158] The following are Figure 11 some examples of Chinese character retrieval using the first character table of
[0159] To look up the character "杆", according to the stroke order, "木" is the first character contained in this character. Then find "木" and its page number 10 in the character lookup table ( Figure 11 ). Then find page 10 and the first character "木" on this page in the character lookup table (Figure 10). "杆" is below it, and the number indicates that its page number in the dictionary text is page 55. You can find the detailed information of this character on page 55 of the text.
[0160] To look up the character "汗". The first basic component of this character is "three dots of water", which is a non-formed character component and needs to be skipped. Select the first character "干". Then find "干" and its page number 5 in the character lookup table, and then find page 5 and the position of "干" in the character lookup table. "汗" is below it, and the number indicates that its page number in the dictionary text is page 56.
[0161] To look up the character "叮", you need to skip "口" and look up the first character "丁". According to the character lookup table, "丁" is on page 2 of the character lookup table. Then find the first character "丁" and "叮" on page 2 of the character lookup table.
[0162] To look up the character "勾", because this character does not contain any formed character components, so look up the first stroke first character "丿" of this character in the character lookup table. According to the character lookup table, "丿" is on page 1 of the character lookup table. Then find "丿" and the character "勾" on page 1 of the character lookup table. ;
[0163] According to one embodiment of the present invention, the detailed dictionary content of a character can be directly placed at the corresponding position of the character in the index, thus eliminating the need to use numbers to point to the page number of the dictionary text. After completing the auxiliary sorting of the index, the order of the characters remains unchanged, but the content of each line of characters is removed and replaced with the complete content of the character in the dictionary. Then, the index is renamed to the main text of the dictionary, and the page number of the index that the original first character index pointed to is the position of the first character in the main text of the dictionary, achieving this in one step.
[0164] Furthermore, since traditional Chinese characters and Japanese / Korean characters use the same character-forming components as simplified Chinese characters, this invention is also applicable to traditional Chinese characters and Japanese / Korean characters without requiring any modifications.
[0165] According to another aspect of the present invention, a Chinese character sorting device is provided. Figure 17 This is a schematic diagram of the main modules of a Chinese character sorting device according to an embodiment of the present invention. Figure 17 As shown, the Chinese character sorting device 1700 of this embodiment mainly includes a first character processing module 1701, a stroke processing module 1702, and a multi-level sorting module 1703.
[0166] The first character processing module 1701 is used to obtain the first basic character-forming component of a Chinese character according to the stroke order as the first character, and to encode the first character to obtain the first character code. The first character includes the first character-forming component of the Chinese character that can stand alone and cannot be separated, and the first main stroke component of the Chinese character that does not include any character-forming component.
[0167] The stroke processing module 1702 is used to obtain the number of strokes included in each Chinese character and to obtain the stroke string corresponding to each Chinese character according to the preset stroke character encoding rules.
[0168] The multi-level sorting module 1703 is used to sort the Chinese characters using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority.
[0169] According to an embodiment of the present invention, the first character processing module 1701 can also be used to: encode the basic components of a Chinese character to obtain a basic component dual character code; split the Chinese character into basic components and obtain a Chinese character dual character code based on the basic component dual character code; obtain the first basic character component of the Chinese character according to the stroke order as the first character, establish the association relationship between the basic component and the first character, and generate a first matching table of the basic component dual character code and the first character code; determine the first character code of the Chinese character based on the Chinese character dual character code and the first matching table.
[0170] According to another embodiment of the present invention, the first character processing module 1701 can also be used to: obtain the basic components of Chinese characters according to the "Information Processing GB13000.1 Character Set Chinese Character Component Specification"; sort the basic components according to the number of strokes of the basic components; sort the basic components with the same number of strokes in the first sorted basic components according to the stroke order included in the basic components; save the second sorted basic components to a table to generate an ordered code table to obtain the dual character code of the basic components, wherein the horizontal rows and vertical columns of the ordered code table are encoded with different types of characters respectively.
[0171] According to another embodiment of the present invention, the first character processing module 1701 can also be used to: obtain the basic components of Chinese characters according to the "Information Processing GB13000.1 Character Set Chinese Character Component Specification"; divide the basic components into character components and non-character components according to whether the basic components are character components, and perform a first sort; perform a second sort on the character components and the non-character components according to the number of strokes of the basic components; perform a third sort on the basic components with the same number of strokes among the character components and non-character components after the second sort, according to the stroke order included in the basic components; save the basic components after the third sort to a table to generate an ordered code table to obtain the dual character code of the basic components, wherein the horizontal rows and vertical columns of the ordered code table are encoded with different types of characters respectively.
[0172] According to another embodiment of the present invention, the first character processing module 1701 can also be used to: split Chinese characters into basic components according to the "GB13000.1 Character Set Chinese Character Component Specification for Information Processing"; obtain the double character code of the basic components included in each Chinese character according to the double character code of the basic components; and for each Chinese character, according to the "GB13000.1 Character Set Chinese Character Stroke Order Specification", combine the double character codes of the basic components included in the Chinese character according to the stroke order of the basic components in the Chinese character to obtain the double character code of the Chinese character.
[0173] According to another embodiment of the present invention, the first character code includes a character-forming first character code and a stroke-based first character code; the first character processing module 1701 can also be used to: obtain the basic component double character codes included in the Chinese character double character code; check the first character code in the first matching table corresponding to each basic component double character code in sequence according to the order of the basic component double character codes; for each basic component double character code, if a certain first character code in the first matching table corresponding to the basic component double character code is a character-forming first character code, then take the character-forming first character code as the first character code of the Chinese character; otherwise, according to the first matching table, obtain the first character code corresponding to the first basic component double character code included in the Chinese character double character code as the first character code of the Chinese character.
[0174] According to another embodiment of the present invention, if the first forming component of a Chinese character is "mouth", and the Chinese character further includes forming components other than "mouth", then the first forming component other than "mouth" of the Chinese character is determined as the first character of the Chinese character.
[0175] According to another embodiment of the present invention, the stroke processing module 1702 can also be used for: defining a corresponding letter for each stroke as the character code of the stroke; for the strokes included in each Chinese character, splicing the character codes corresponding to all strokes in the stroke order to obtain the stroke string corresponding to each Chinese character.
[0176] According to another embodiment of the present invention, the stroke processing module 1702 can also be used for: defining a corresponding letter for each stroke as the character code of the stroke; for the strokes included in each basic component, splicing the character codes corresponding to all strokes in the stroke order to obtain the stroke string corresponding to each basic component; establishing an association relationship between the double-character code of the basic component and the stroke string of the basic component and generating a second matching table; for each Chinese character, obtaining the double-character code of the basic component included in the double-character code of the Chinese character according to the double-character code of the Chinese character; for each double-character code of the basic component, looking up the corresponding stroke string of the basic component in the second matching table; splicing the stroke strings of the basic components corresponding to each double-character code of the basic component in the order of the double-character codes of the basic components in the double-character code of the Chinese character to obtain the stroke string of the Chinese character.
[0177] According to another embodiment of the present invention, the double-character code of the Chinese character, the double-character code of the basic component, and the first-character code are double-letter codes composed of uppercase and lowercase letters; and when sorting according to the first-character code, sorting is performed by comparing in turn according to the character order of the double-letter code; when sorting according to the stroke string, sorting is performed by comparing in turn according to the character order of the stroke string. According to still another embodiment of the present invention, the main stroke components include "-", "|", " / ", ".", and "乙"; and the Chinese character sorting device 1700 further includes a stroke merging module (not shown in the figure), which is used for: according to the "Chinese Character Folding Pen Specification of GB13000.1 Character Set", merging the stroke "raising" into the first character "-", merging the stroke "vertical hook" into the first character "|", merging the stroke "right-falling stroke" into the first character ".", and merging all "folding" strokes into the first character "乙".
[0178] According to another aspect of the present invention, a device for constructing a dictionary is provided. Figure 18 It is a schematic diagram of the main modules of the device for constructing a dictionary according to an embodiment of the present invention. As Figure 18As shown, the dictionary construction device 1800 of this embodiment mainly includes a first character processing module 1701, a stroke processing module 1702, a multi-level sorting module 1703, a character lookup table generation module 1804, a first character table generation module 1805, and a dictionary construction module 1806. The first character processing module 1701, stroke processing module 1702, and multi-level sorting module 1703 are the same as the modules included in the Chinese character sorting device 1700.
[0179] The first character processing module 1701 obtains the first basic character-forming component of a Chinese character according to the stroke order as the first character, and encodes the first character to obtain the first character code. The first character includes the first character-forming component of the Chinese character and the first main stroke component of the Chinese character that does not include any character-forming components.
[0180] The stroke processing module 1702 obtains the number of strokes in each Chinese character and obtains the stroke string corresponding to each Chinese character according to the preset stroke character encoding rules;
[0181] The multi-level sorting module 1703 sorts the Chinese characters using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority.
[0182] The character lookup table generation module 1804 is used to obtain the storage location of each sorted Chinese character in the dictionary text, and generate a character lookup table based on each sorted Chinese character and its corresponding storage location.
[0183] The first character table generation module 1805 is used to sort the first characters according to the number of strokes and the stroke order to generate a first character table;
[0184] The dictionary construction module 1806 is used to construct a dictionary using the first character table, the character lookup table, and the dictionary text.
[0185] According to an embodiment of the present invention, the character lookup table has page numbers, and the first character table generation module 1805 can also be used to: sort the first characters in ascending order of the number of strokes; sort the first characters with the same number of strokes in the stroke order for the first sorted first characters; and generate a first character table based on the second sorted first characters and the page number of each first character in the character lookup table.
[0186] According to another embodiment of the present invention, the dictionary construction apparatus 1800 further includes a first character adjustment module (not shown in the figure) for adjusting the obtained first character according to the size of the dictionary and the characters included before encoding the first character to obtain the first character code.
[0187] According to another embodiment of the present invention, the first character adjustment module (not shown in the figure) can also be used to: determine whether to adjust the obtained first character according to the size of the dictionary; if so, count the occurrence probability of each formed character component in the obtained first character; according to the set threshold, delete the formed character component whose occurrence probability is less than the threshold and will not cause confusion after deletion from the obtained first character; or, merge two basic components where one contains the other or two very similar basic components.
[0188] The specific implementation of the first character adjustment module is completed by adjusting the matching in the component double-character code / first character code matching table. As long as the first character corresponding to a component is replaced, the first character adjustment module will run the entire Chinese character sorting device again, obtain a new dictionary arrangement result, and give a statistical result for reference. Since changing one first character may affect many Chinese characters, the calculation amount is very large. Without the first character adjustment module, such adjustment cannot be scientifically and accurately achieved. The following are several examples. For example: if "广" and "厂" are to be merged, just change the first character corresponding to the component "广" to the same first character code corresponding to the component "厂"; if a formed character component "文" is not to be used as the first character, just change the first character code corresponding to this component to the stroke first character "丶" corresponding to the first stroke "丶" of this component. In short, it is very convenient and efficient.
[0189] According to another aspect of the present invention, a Chinese character retrieval device is provided. Figure 19 It is a schematic diagram of the main modules of the Chinese character retrieval device according to an embodiment of the present invention. As Figure 19 shown, the Chinese character retrieval device 1900 according to the embodiment of the present invention mainly includes a first character acquisition module 1901, a first character table lookup module 1902, and a character inspection table lookup module 1903.
[0190] The first character acquisition module 1901 is used to obtain the first basic formed character component of the Chinese character to be retrieved as the first character according to the stroke order; if the Chinese character includes a formed character component, the first character is the first formed character component in the Chinese character; if the Chinese character does not include any formed character components, the first character is the first main stroke component of the Chinese character;
[0191] The first character table lookup module 1902 is used to find the first character from the first character table and obtain the page of the character inspection table corresponding to the first character;
[0192] The character inspection table lookup module 1903 is used to find the Chinese character from the page of the character inspection table.
[0193] According to an embodiment of the present invention, the first character table lookup module 1902 can also be used to: find the first character from the first character table, and obtain the page number of the first character in the character inspection table; obtain the page of the character inspection table corresponding to the first character according to the page number.
[0194] According to the technical solution of this invention, the first basic character-forming component of a Chinese character is obtained according to stroke order as the first character, and the first character is encoded to obtain the first character code. The first character includes the first character-forming component of the Chinese character that can stand alone and cannot be divided, and the first main stroke component of the Chinese character that does not include any character-forming component. The number of strokes included in each Chinese character is obtained, and the stroke string corresponding to each Chinese character is obtained according to a preset stroke character encoding rule. The Chinese characters are sorted using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority. This technical solution uses the first basic character-forming component (first character) as the standard for sorting and retrieving Chinese characters, which solves the problem of sorting and retrieving difficulties caused by the non-fixed definition and position of radicals and the lack of strict regularity in traditional radical-based character lookup methods. It breaks the tradition of needing to use radicals that are not characters themselves, and has the characteristics of being systematic, rigorous, practical, efficient, easy to learn and use.
[0195] Figure 20 An exemplary system architecture 2000 is shown, which can be applied to the methods or apparatus for sorting, retrieving, and constructing Chinese characters and dictionaries according to embodiments of the present invention.
[0196] like Figure 20 As shown, system architecture 2000 may include terminal devices 2001, 2002, and 2003, network 2004, and server 2005. Network 2004 serves as the medium for providing communication links between terminal devices 2001, 2002, and 2003 and server 2005. Network 2004 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0197] Users can use terminal devices 2001, 2002, and 2003 to interact with server 2005 via network 2004 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 2001, 2002, and 2003, such as electronic dictionary applications, web browser applications, search applications, input method applications, virtual keyboard applications, etc. (for example only).
[0198] Terminal devices 2001, 2002, and 2003 can be various electronic devices with a display screen and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0199] Server 2005 can be a server that provides various services, such as a backend management server that supports Chinese character sorting requests sent by users using terminal devices 2001, 2002, and 2003 (for example only). The backend management server can analyze and process the received data such as Chinese character sorting requests, and feed back the processing results (such as Chinese character sorting results - for example only) to the terminal devices.
[0200] It should be noted that the methods for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries provided in the embodiments of the present invention can be executed by server 2005 or terminal 2001, 2002, 2003. Correspondingly, the apparatus for sorting Chinese characters, retrieving Chinese characters, and constructing dictionaries can also be set in server 2005 or terminal 2001, 2002, 2003.
[0201] It should be understood that Figure 20 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0202] The following is for reference. Figure 21 It shows a schematic diagram of the structure of a computer system 2100 suitable for implementing terminal devices or servers of the present invention. Figure 21 The terminal device or server shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0203] like Figure 21 As shown, the computer system 2100 includes a central processing unit (CPU) 2101, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 2102 or programs loaded from storage section 2108 into random access memory (RAM) 2103. The RAM 2103 also stores various programs and data required for the operation of the system 2100. The CPU 2101, ROM 2102, and RAM 2103 are interconnected via bus 2104. An input / output (I / O) interface 2105 is also connected to bus 2104.
[0204] The following components are connected to I / O interface 2105: an input section 2106 including a keyboard, mouse, etc.; an output section 2107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 2108 including a hard disk, etc.; and a communication section 2109 including a network interface card such as a LAN card, modem, etc. The communication section 2109 performs communication processing via a network such as the Internet. A drive 2110 is also connected to I / O interface 2105 as needed. Removable media 2111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 2110 as needed so that computer programs read from them can be installed into storage section 2108 as needed.
[0205] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 2109, and / or installed from removable medium 2111. When the computer program is executed by central processing unit (CPU) 2101, it performs the functions defined above in the system of this invention.
[0206] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0207] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0208] The units or modules described in the embodiments of the present invention can be implemented in software or hardware. The described units or modules can also be housed in a processor; for example, a processor can be described as including a first-character processing module, a stroke processing module, and a multi-level sorting module. The names of these units or modules do not necessarily limit the unit or module itself. For example, the first-character processing module can also be described as "a module for obtaining the first basic character-forming component of a Chinese character according to stroke order as the first character, and encoding the first character to obtain the first-character code."
[0209] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, which, when executed by the device, cause the device to include: obtaining the first basic character-forming component of a Chinese character according to stroke order as the first character, and encoding the first character to obtain a first character code, wherein the first character includes the first character-forming component of the Chinese character that can independently form a character and cannot be divided, and the first main stroke component of the Chinese character that does not include any character-forming component; obtaining the number of strokes included in each Chinese character, and obtaining the stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; sorting the Chinese characters using the first character code as a first sorting field, the number of strokes as a second sorting field, and the stroke string as a third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority.
[0210] According to the technical solution of this invention, the first basic character-forming component of a Chinese character is obtained according to stroke order as the first character, and the first character is encoded to obtain the first character code. The first character includes the first character-forming component of the Chinese character that can stand alone and cannot be divided, and the first main stroke component of the Chinese character that does not include any character-forming component. The number of strokes included in each Chinese character is obtained, and the stroke string corresponding to each Chinese character is obtained according to a preset stroke character encoding rule. The Chinese characters are sorted using the first character code as the first sorting field, the number of strokes as the second sorting field, and the stroke string as the third sorting field, wherein the first sorting field has the highest priority and the third sorting field has the lowest priority. This technical solution uses the first basic character-forming component (first character) as the standard for sorting and retrieving Chinese characters, which solves the problem of sorting and retrieving difficulties caused by the non-fixed definition and position of radicals and the lack of strict regularity in traditional radical-based character lookup methods. It breaks the tradition of needing to use radicals that are not characters themselves, and has the characteristics of being systematic, rigorous, practical, efficient, easy to learn and use.
[0211] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for searching Chinese characters, characterized in that, The method comprises the following steps: receiving a Chinese character retrieval request sent by a user using a terminal device, and returning a first character table to the terminal device; receiving a first character selected by the user from the first character table displayed on the terminal device, wherein the first character is obtained according to stroke order as a first basic component of a Chinese character to be retrieved; if the Chinese character comprises a component, the first character is the first component in the Chinese character; if the Chinese character does not comprise any component, the first character is the first main stroke component of the Chinese character; finding the first character from the first character table, obtaining a retrieval table page corresponding to the first character, and returning the retrieval table page to the terminal device; receiving a Chinese character selected by the user on the retrieval table page displayed on the terminal device, finding the Chinese character from the retrieval table page, and returning the found Chinese character to the terminal device; wherein the first character table and the retrieval table are generated in the following manner: obtaining the first character as a first basic component of a Chinese character according to stroke order, and encoding the first character to obtain a first character code, wherein the first character comprises a first component in the Chinese character, and a first main stroke component of a Chinese character not comprising any component; obtaining the number of strokes of each Chinese character, and obtaining a stroke string corresponding to each Chinese character according to a preset stroke character encoding rule; sorting the Chinese characters according to the first character code as a first sorting field, the number of strokes as a second sorting field, and the stroke string as a third sorting field, wherein the first sorting field has the highest priority, and the third sorting field has the lowest priority; for each sorted Chinese character, obtaining a storage location of the Chinese character in a dictionary text, and generating a retrieval table according to each sorted Chinese character and the storage location corresponding to the Chinese character; sorting the first characters according to the number of strokes and stroke order to generate a first character table.
2. The method for searching Chinese characters according to claim 1, wherein, finding the first character from the first character table, and obtaining a retrieval table page corresponding to the first character comprises: finding the first character from the first character table, and obtaining a page number of the first character in the retrieval table; obtaining the retrieval table page corresponding to the first character according to the page number.
3. The method for searching Chinese characters according to claim 1, wherein, obtaining the first character as a first basic component of a Chinese character according to stroke order, and encoding the first character to obtain a first character code comprises: encoding a basic component of a Chinese character to obtain a basic component double character code; splitting the Chinese character into a basic component, and obtaining a Chinese character double character code according to the basic component double character code; obtaining the first character as a first basic component of a Chinese character according to stroke order, establishing an association between the basic component and the first character, and generating a first matching table of the basic component double character code and the first character code; determining the first character code of the Chinese character according to the Chinese character double character code and the first matching table.
4. The method for searching Chinese characters according to claim 3, wherein, encoding a basic component of a Chinese character to obtain a basic component double character code comprises: obtaining a basic component of a Chinese character according to the GB13000.1 Character Set for Information Processing; first sorting the basic components according to the number of strokes; second sorting the basic components with the same number of strokes in the first sorted basic components according to the stroke order of the basic components. The second sorted basic components are saved into a table to generate an ordered code table to obtain the basic component double character code, wherein horizontal rows and vertical columns of the ordered code table are encoded by different types of characters.
5. The method for searching Chinese characters according to claim 3, wherein, The basic components of Chinese characters are encoded to obtain the basic component double character code, comprising: The basic components of Chinese characters are obtained according to the "Chinese Character Component Specification for GB13000.1 Character Set for Information Processing"; The basic components are divided into character components and non-character components according to whether the basic components are character components, and the basic components are sorted in the first order; The character components and the non-character components are sorted in the second order according to the number of strokes of the basic components; The basic components with the same number of strokes in the second sorted character components and non-character components are sorted in the third order according to the order of strokes included in the basic components; The third sorted basic components are saved into a table to generate an ordered code table to obtain the basic component double character code, wherein horizontal rows and vertical columns of the ordered code table are encoded by different types of characters.
6. The method for searching Chinese characters according to claim 3, wherein, The Chinese characters are divided into basic components, and the Chinese character double character code is obtained according to the basic component double character code, comprising: The Chinese characters are divided into basic components according to the "Chinese Character Component Specification for GB13000.1 Character Set for Information Processing"; The double character code of each basic component included in the Chinese character double character code is obtained according to the basic component double character code; The double character code of each basic component included in the Chinese character double character code is combined to obtain the Chinese character double character code according to the order of strokes of the basic components in the Chinese character according to the "Chinese Stroke Order Specification for GB13000.1 Character Set for Information Processing".
7. The method for searching Chinese characters according to claim 3, wherein, The initial code includes character initial code and stroke initial code; The initial code of the Chinese character is determined according to the Chinese character double character code and the first matching table, comprising: The basic component double character code included in the Chinese character double character code is obtained; The initial code corresponding to each basic component double character code in the first matching table is checked in turn according to the order of the basic component double character code; For each basic component double character code, if the initial code corresponding to the basic component double character code in the first matching table is a character initial code, the character initial code is taken as the initial code of the Chinese character; Otherwise, the initial code corresponding to the first basic component double character code included in the Chinese character double character code is obtained as the initial code of the Chinese character according to the first matching table.
8. The method for searching Chinese characters according to any one of claims 1-7, wherein, If the first character component of a Chinese character is "Kou", and the Chinese character also includes a character component that is not "Kou", the first character component that is not "Kou" of the Chinese character is determined as the initial code of the Chinese character.
9. The method for searching Chinese characters according to any one of claims 1-7, wherein, The stroke string corresponding to each Chinese character is obtained according to the preset stroke character coding rule, comprising: A corresponding letter is defined for each stroke as the character coding of the stroke; The stroke string corresponding to each Chinese character is obtained by splicing the character coding of all strokes according to the stroke order.
10. The method for searching Chinese characters according to any one of claims 3-7, wherein, The stroke string corresponding to each Chinese character is obtained according to the preset stroke character coding rule, comprising: A corresponding letter is defined for each stroke as the character coding of the stroke; For each basic component, all the characters corresponding to strokes included in the basic component are encoded and spliced according to stroke order to obtain a stroke string corresponding to each basic component; An association between the basic component double-character code and the basic component stroke string is established, and a second matching table is generated; For each Chinese character, the basic component double-character code included in the Chinese character double-character code is obtained according to the Chinese character double-character code of the Chinese character; For each basic component double-character code, the corresponding basic component stroke string is searched from the second matching table; According to the order of the basic component double-character code in the Chinese character double-character code, the basic component stroke string corresponding to each basic component double-character code is spliced to obtain the stroke string of the Chinese character.
11. The method for searching Chinese characters according to any one of claims 3-7, wherein, The Chinese character double-character code, the basic component double-character code and the initial character code are double-letter codes composed of uppercase and lowercase letters; and when sorting according to the initial character code, the characters of the double-letter code are compared in sequence for sorting; and when sorting according to the stroke string, the characters of the stroke string are compared in sequence for sorting.
12. The method for searching Chinese characters according to claim 1, wherein, The main stroke component includes "one", "vertical", "vertical", "dot" and "Yi"; and the method further comprises: According to the GB13000.1 Character Set Chinese Character Folding Stroke Specification, the stroke "ti" is merged into the initial character "one", the stroke "vertical hook" is merged into the initial character "vertical", the stroke "na" is merged into the initial character "dot", and all "folding" strokes are merged into the initial character "Yi".
13. The method for searching Chinese characters according to claim 1, wherein, The method further comprises: Building a dictionary through the initial character table, the character searching table and the dictionary main text; Finding the initial character contained in the Chinese character and the corresponding initial character code of the initial character in the initial character code table; Calculating the number of strokes contained in the Chinese character, writing the strokes of the Chinese character, and converting all the strokes into a stroke string; Finding the page number of the Chinese character in the dictionary main text; Comparing the Chinese character with the characters in the auxiliary sorting table of the character searching table according to the initial character code, the number of strokes and the stroke string of the Chinese character in sequence, and then inserting the Chinese character into the corresponding row in sequence.
14. The method for searching Chinese characters according to claim 1, wherein, The character searching table has page numbers, and the initial characters are sorted according to the number of strokes and the stroke order to generate the initial character table, which comprises: Firstly, the initial characters are sorted according to the number of strokes from small to large; Secondly, the initial characters sorted in the first step are sorted according to the stroke order of the initial characters with the same number of strokes; Generating the initial character table according to the initial characters sorted in the second step and the page numbers of each initial character in the character searching table.
15. The method for searching Chinese characters according to claim 13, wherein, Before encoding the initial characters to obtain the initial character code, it further comprises: Adjusting the obtained initial characters according to the size of the dictionary and the included characters.
16. The method for searching Chinese characters according to claim 15, wherein, Adjusting the obtained initial characters according to the size of the dictionary and the included characters comprises: Determining whether the obtained initial characters need to be adjusted according to the size of the dictionary; If yes, calculating the appearance probability of each character component in the obtained initial characters; According to the set threshold, deleting the character components with an appearance probability less than the threshold and which will not cause confusion after deletion from the obtained initial characters; or merging the character components containing the same character components. It comprises:
17. An apparatus for Chinese character retrieval, characterized by comprising: A module for receiving a Chinese character searching request sent by a user using a terminal device, and returning an initial character table to the terminal device; The first character obtaining module is configured to receive a first character selected by a user from a first character table displayed on the terminal device, wherein a first basic character component of a Chinese character to be searched is obtained as the first character according to stroke order; if the Chinese character includes a character component, the first character is a first character component of the Chinese character; if the Chinese character does not include any character component, the first character is a first main stroke component of the Chinese character; The first character table searching module is configured to search for the first character from the first character table, obtain a character searching table page corresponding to the first character, and return the character searching table page to the terminal device; The character searching table searching module is configured to receive a Chinese character selected by a user from the character searching table page displayed on the terminal device, search for the Chinese character from the character searching table page, and return the searched Chinese character to the terminal device. The first character table and the character searching table are generated in the following manner: A first basic character component of a Chinese character is obtained as a first character according to stroke order, and a first character code is obtained by encoding the first character, wherein the first character includes a first character component in the Chinese character, and a first main stroke component of a Chinese character that does not include any character component; The number of strokes included in each Chinese character is obtained, and a stroke string corresponding to each Chinese character is obtained according to a preset stroke character encoding rule; The Chinese characters are sorted by taking the first character code as a first sorting field, the number of strokes as a second sorting field, and the stroke string as a third sorting field, wherein the first sorting field has the highest priority, and the third sorting field has the lowest priority; For each sorted Chinese character, a storage location of the Chinese character in a dictionary text is obtained, and a character searching table is generated according to each sorted Chinese character and the storage location corresponding to the Chinese character. The first character is sorted according to the number of strokes and stroke order to generate a first character table.
18. An electronic device, comprising: One or more processors; A storage device configured to store one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-16. The program is executed by the processor to implement the method according to any one of claims 1-16.
19. A computer readable medium having stored thereon a computer program, characterized in that,
Citation Information
Patent Citations
Chinese character radical indexing system
CN1400110A
Chinese computer dictionary compile method Chinese word-building information requiring containing
CN1598813A