A character library generation method and device, electronic equipment, and storage medium
Patent Information
- Application Number
- CN202310506094.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-06
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-05-06
AI Technical Summary
[0003]然而,原始字符的数量本身就很庞大,在此种情况下若再手动的查找隐藏字符,工作量大、难度高、容易出错且智能化程度低,极大地降低了文字库的生成效率
[0045] The present application provides a method for generating a character library. In the method, first, character units corresponding to an original character are acquired, and after successful acquisition, all combinations of the character units are performed to generate a plurality of combined characters. After generation, valid characters are screened out from the combined characters; wherein the character units are the minimum units forming one character, and the aforementioned valid characters are hidden characters existing in the original character; after successful screening, the valid characters are associated with the original character, and stored in the character library after association. It can be seen from the above content that in the present application, a plurality of combined characters are formed by performing all combinations on the minimum units in the original character, and then hidden characters existing in the original character can be found out by screening the combined characters. The entire searching process does not require manual intervention, can be implemented automatically, reduces the searching workload, is not prone to errors, has a simple searching method, and improves the searching efficiency. Furthermore, on the basis of improving the searching efficiency, the generation efficiency of the character library is also greatly improved.
Smart Images

Figure CN116521926B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of character recognition, in particular to a method, an apparatus, an electronic device and a computer-readable storage medium for generating a character library. Background Art
[0002] At present, there are many word games on the market. Among them, one type of word game requires players to find multiple hidden characters hidden in original characters. For example, if the original character is "Li (李)", the player needs to find Chinese characters hidden in the character "Li". To implement the above game function, game planners need to construct a character library in advance, which contains hidden characters corresponding to each original character. In the prior art, when constructing a character library, game planners usually manually find hidden characters hidden in original characters.
[0003] However, the number of original characters is inherently large. Under such circumstances, manually searching for hidden characters brings large workload, high difficulty, proneness to errors and low intelligence, which greatly reduces the generation efficiency of the character library. Summary of the Invention
[0004] An object of embodiments of the present application is to provide a method, an apparatus, an electronic device and a computer-readable storage medium for generating a character library, which greatly improves the generation efficiency of the character library.
[0005] In a first aspect, the present application provides a method for generating a character library, comprising:
[0006] acquiring character units corresponding to an original character; wherein the character units are minimal units constituting one character;
[0007] performing full combination on the character units to form a plurality of combined characters;
[0008] screening valid characters from the plurality of combined characters;
[0009] associating the original character with the valid characters and storing the association in the character library.
[0010] In this embodiment, a plurality of combined characters are formed by performing full combination on minimal units of the original character, and then hidden characters existing in the original character can be found by screening the combined characters. The whole searching process does not require manual intervention and can be realized automatically, which reduces the searching workload, is not prone to errors, has a simple searching mode, and improves the searching efficiency of hidden characters. Further, on the basis of improving the searching efficiency, the generation efficiency of the character library is also greatly improved.
[0011] In an embodiment, the character units are carried in a character unit image;
[0012] By fully combining the character units, multiple composite characters are formed, including:
[0013] The character unit images are fully combined according to a preset combination method to form multiple combined character images.
[0014] In this embodiment, the image of the character unit containing the character unit is obtained. After successful acquisition, the character unit image is fully combined according to a preset combination method. After full combination, a combined character image carrying the combined character is obtained. It can be seen that this embodiment forms combined characters by combining images, which is a simple and quick method.
[0015] In one embodiment, the position of the character unit in the character unit image is the same as its position in the original character;
[0016] The character unit images are fully combined according to a preset combination method to form multiple combined character images, including:
[0017] The selected character unit images in each combination are combined in an overlay manner to form multiple combined character images.
[0018] In this embodiment, character unit images are combined by overlaying, resulting in a combined character image carrying the combined characters. It can be seen that this embodiment forms combined characters through image overlay, and the algorithm logic is simple and easy to implement.
[0019] In one embodiment, the original characters are English characters, and the character unit image is a letter unit image;
[0020] The character unit images are fully combined according to a preset combination method to form multiple combined character images, including:
[0021] The selected letter unit images in each combination are spliced left and right to form multiple combined character images.
[0022] In this embodiment, letter unit images are combined by splicing them left and right to obtain a combined character image carrying English characters. It can be seen that this embodiment uses image splicing to form combined characters, a simple and easy-to-implement method.
[0023] In one embodiment, filtering out valid characters from multiple combinations of characters includes:
[0024] Image recognition is used to determine whether the combined characters in each combined character image are valid characters, and combined character images carrying valid characters are selected based on the determination results.
[0025] In this embodiment, valid characters in the combined characters are filtered out by image recognition. The filtering method is simple and easy to implement.
[0026] In one embodiment, after associating the original character with the valid character and storing it in the character library, the method further includes:
[0027] Send a first display instruction so that the user terminal displays the original characters upon receiving the first display instruction;
[0028] Receive input instructions and determine whether the input characters carried by the input instructions are valid characters corresponding to the original characters in the character library;
[0029] If the input character carried by the input command is a valid character corresponding to the original character in the character library, a second display command is sent so that the user terminal displays the input character when it receives the second display command;
[0030] If the input character carried by the input command is not a valid character corresponding to the original character in the character library, a prompt message is generated.
[0031] Secondly, this application provides a character library generation apparatus, which includes:
[0032] The acquisition module is used to acquire the character unit corresponding to the original character; where the character unit is the smallest unit that constitutes a character.
[0033] The combination module is used to fully combine character units to form multiple combined characters;
[0034] The filtering module is used to filter out valid characters from multiple combinations of characters.
[0035] The association module is used to associate raw characters with valid characters and save them in the text library.
[0036] In one embodiment, the character unit is carried in the character unit image;
[0037] The combined module is also used for:
[0038] The character unit images are fully combined according to a preset combination method to form multiple combined character images.
[0039] Thirdly, this application also provides an electronic device, which includes:
[0040] processor;
[0041] Memory used to store processor-executable instructions;
[0042] The processor is configured to execute the aforementioned method for generating the text library.
[0043] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program can be executed by a processor to implement the above character library generation method.
[0044] The beneficial effects of the present application compared with the prior art are as follows:
[0045] The present application provides a method for generating a character library. In the method, first, character units corresponding to an original character are acquired, and after successful acquisition, all combinations of the character units are performed to generate a plurality of combined characters. After generation, valid characters are screened out from the combined characters; wherein the character units are the minimum units forming one character, and the aforementioned valid characters are hidden characters existing in the original character; after successful screening, the valid characters are associated with the original character, and stored in the character library after association. It can be seen from the above content that in the present application, a plurality of combined characters are formed by performing all combinations on the minimum units in the original character, and then hidden characters existing in the original character can be found out by screening the combined characters. The entire searching process does not require manual intervention, can be implemented automatically, reduces the searching workload, is not prone to errors, has a simple searching method, and improves the searching efficiency. Furthermore, on the basis of improving the searching efficiency, the generation efficiency of the character library is also greatly improved. Description of Drawings
[0046] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the accompanying drawings required for the embodiments of the present application are briefly introduced below.
[0047] Figure 1 which is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0048] Figure 2 which is a flow schematic diagram of the character library generation method provided by the first embodiment of the present application;
[0049] Figure 3 which is a flow schematic diagram of the character library generation method provided by the second embodiment of the present application;
[0050] Figure 4 which is a stroke unit image corresponding to the Chinese character "Wang" provided by an embodiment of the present application;
[0051] Figure 5 which is a schematic diagram of a plurality of combined character images formed after performing all combinations on the stroke unit images corresponding to the Chinese character "Wang" provided by an embodiment of the present application;
[0052] Figure 6 which is a letter unit image corresponding to the English character "tea" provided by an embodiment of the present application;
[0053] Figure 7 This is a schematic diagram illustrating multiple combined character images formed by fully combining the letter unit images corresponding to the English character "tea" according to an embodiment of this application;
[0054] Figure 8 A flowchart illustrating the application process of a text library provided in an embodiment of this application;
[0055] Figure 9 A schematic diagram illustrating the display of original characters by an electronic device according to an embodiment of this application;
[0056] Figure 10 This is a schematic diagram illustrating a player inputting found characters into an electronic device, according to an embodiment of this application.
[0057] Figure 11 This is a schematic diagram of the display of an electronic device when a hidden character is successfully found, according to an embodiment of this application.
[0058] Figure 12 A block diagram of a text library generation apparatus provided in an embodiment of this application. Detailed Implementation
[0059] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0060] Similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0061] Please refer to Figure 1 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 1 As shown, the electronic device 1 in the embodiment includes at least one processor 11 and a memory 12. Figure 1 Taking a processor 11 as an example, the processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 to enable the electronic device 1 to perform all or part of the process of the method in the following embodiments. The electronic device 1 is used to execute the text library generation method provided in the following embodiments of this application. The electronic device can be a server, desktop computer, etc.
[0062] The memory 12 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), Erasable Programmable Read Only Memory (EPROM for short), Programmable Read-Only Memory (PROM for short), Read-Only Memory (ROM for short), magnetic memory, flash memory, magnetic disk or optical disk.
[0063] The present application also provides a computer-readable storage medium, which stores a computer program, and the computer program can be executed by the processor 11 to implement the generation method of the character library provided by the following embodiments of the present application.
[0064] Please refer to Figure 2 , which is a schematic flowchart of the generation method of the character library provided by the first embodiment of the present application. Specifically, as shown in Figure 2 , the generation method of the character library in this embodiment includes the following steps S210 to S240. The working principle of the generation method of the character library in this embodiment will be described in detail below.
[0065] Step S210: Acquire the character unit corresponding to the original character.
[0066] Wherein, the original character is the target character for which hidden characters are to be searched; the character unit is the smallest unit that constitutes one character; all characters are composed of a combination of multiple character units. The specific type of the character unit is determined by the type of the original character. For example, when the original character is an English character, the character unit may be an English letter; when the original character is a Chinese character, the character unit is a stroke. A stroke refers to various continuous points and lines that form a Chinese character, such as horizontal (一), vertical (丨), left-falling stroke (丿), etc., and is the smallest continuous stroke unit that constitutes the shape of a Chinese character. The local database of the electronic device stores the character unit corresponding to each original character.
[0067] In this step, when generating the text library, the electronic device first needs to find the hidden characters present in each original character. Specifically, when searching for hidden characters, the electronic device first needs to obtain the character unit corresponding to the original character. Only after successful acquisition can subsequent operations be performed. Specifically, the game designer can send a trigger command to the electronic device, which contains the original character information. After receiving the trigger command, the electronic device first parses the original character information from the command. After successful parsing, the electronic device retrieves the character unit corresponding to the original character from its local database. Only after successful retrieval can the electronic device proceed with subsequent operations.
[0068] Step S220: Perform full combination of character units to form multiple combined characters.
[0069] The full combination involves combining all character units once.
[0070] In this step, after acquiring the character units corresponding to the original character, the electronic device can combine all the character units at once to form multiple combined characters. Specifically, after acquiring the character units corresponding to the original character, the electronic device can first determine all possible combinations of the character units. Then, the electronic device combines the character units according to the aforementioned combination information to obtain multiple combined characters. For example, suppose the original character has 3 character units, A, B, and C; the electronic device determines that the possible combinations of these 3 character units are A, B, C, AB, AC, BC, and ABC. After determining the above combination methods, the electronic device combines the character units according to the aforementioned combination information to obtain 7 combined characters.
[0071] Step S230: Filter out the valid characters from multiple combinations of characters.
[0072] Among them, valid characters are those that are actually words in the combination of characters, and valid characters can express the corresponding meaning.
[0073] The combined characters formed by multiple character units may contain characters that are not actually characters. Therefore, after obtaining multiple combined characters, this step requires further filtering to identify the truly valid characters. During filtering, the electronic device can directly delete characters that are not characters. After deleting all non-character characters, the truly valid characters can be identified from the combined characters. Since valid characters are obtained by combining character units within the combined characters, and each valid character is itself a real character capable of expressing a corresponding meaning, it can be determined that the valid character is the hidden character existing within the original characters. After filtering out the valid character from the combinations, the electronic device has found the hidden character existing within the original characters.
[0074] Step S240: Associate the original characters with the valid characters and save them in the character library.
[0075] In this step, after the electronic device finds a valid character, that is, after finding the hidden character that exists in the original character, it can associate the valid character with the original character, and then save both the original character and the valid character in the pre-created text library.
[0076] The electronic device repeats steps S210-S240 until all valid characters of the multiple original characters are saved in the character library. Once all characters are successfully saved, the creation of the character library is complete.
[0077] As can be seen from the above, this application combines the smallest units of the original characters to form multiple composite characters. Hidden characters within the original characters can then be found by filtering these composite characters. The entire search process is automated and requires no manual intervention, reducing workload, minimizing errors, simplifying the search method, and improving efficiency. Furthermore, in addition to improving search efficiency, it also significantly enhances the efficiency of text library generation.
[0078] Please refer to Figure 3 This is a flowchart illustrating the method for generating a text library according to the second embodiment of this application. Specifically, as shown... Figure 3 As shown, the method includes steps S310-S340, wherein, in this embodiment, the aforementioned character units are carried within a character unit image. The working principle of the character library generation method in this embodiment will be explained in detail below.
[0079] Step S310: Obtain the character unit image corresponding to the original character.
[0080] Each character unit image carries the character units contained in the original character, and the electronic device's local database stores the character unit image corresponding to each original character. The type of the character unit image is determined by the type of the character units it carries. For example, if the character unit is a stroke, then the character unit image is a stroke unit image; if the character unit is an English letter, then the character unit image is a letter unit image.
[0081] In this step, after receiving the trigger instruction, the electronic device parses out original character information from the trigger instruction, and acquires the character unit image corresponding to the original character from a local database after successful parsing. By way of example, assume that after parsing the original character as the Chinese character "土" from the trigger instruction, the electronic device can acquire the stroke unit image corresponding to the Chinese character "土" from the local database, and successfully acquire a first stroke unit image carrying the stroke "一", a second stroke unit image carrying the stroke "丨" and a third stroke unit image carrying the stroke "一" after acquisition. Assume that after parsing the original character as the English character "tea" from the trigger instruction, the electronic device can acquire the letter unit images corresponding to the English character "tea" from the local database, and successfully acquire a first letter unit image carrying the English letter "t", a second letter unit image carrying the English letter "e" and a third letter unit image carrying the English letter "a" after acquisition.
[0082] Step S320: performing full combination on the character unit images according to a preset combination mode to form a plurality of combined character images.
[0083] wherein the combined character image carries a combined character, and the combined character is formed by combining character units in the character unit images.
[0084] In this step, after acquiring the character unit images corresponding to the original character, the electronic device can perform one-time full combination on all the character unit images, and thus form a plurality of combined character images carrying combined characters after combination. Specifically, after successfully acquiring the character unit images corresponding to the original character, the electronic device further determines combination information that can be formed by the character unit images; wherein the combination information at least includes selection information of the character unit images. After determining the above combination information, the electronic device can first select corresponding character unit images according to the selection information of the character unit images included in the above combination information, and form a plurality of combinations after selection. Meanwhile, after obtaining each combination, the electronic device combines the character unit images selected in each combination according to the preset combination mode, and can obtain a plurality of combined character images carrying combined characters after all combinations are successfully completed.
[0085] In this embodiment, after the electronic device acquires the character unit image where the character unit is located and succeeds in acquisition, full combination is performed on the character unit images according to the preset combination mode, and the combined character image carrying the combined character can be obtained after full combination. It can be seen that in this embodiment, combined characters are formed by means of image combination, and the formation mode of combined characters is simple and fast.
[0086] Embodiment 1: The electronic device may combine the selected character unit images in each combination according to a superposition method, and thereby obtain a combined character image carrying combined characters through this method. Wherein, in this embodiment, the position of the character unit in the character unit image is consistent with the position in the original character.
[0087] Taking the original character being the Chinese character "王" as an example below, the generation principle of the combined character image will be explained in detail:
[0088] In this embodiment, as shown in Figure 4 , the electronic device acquires the stroke unit images of the Chinese character "王", which are respectively a first stroke unit image carrying the stroke unit "一", a second stroke unit image carrying the stroke unit "一", a third stroke unit image carrying the stroke unit "丨", and a fourth stroke unit image carrying the stroke unit "一". Wherein, from Figure 4 , it can be seen that the position of each stroke unit in its corresponding stroke unit image is consistent with the position in the original character, and each stroke unit image is arranged in the manner shown in Figure 4 . After the stroke unit images are acquired successfully, the electronic device determines the combination information that can be formed by the stroke unit images corresponding to the Chinese character "王". Specifically, the electronic device may use a preset algorithm to calculate the combination information that can be formed by the stroke unit images corresponding to the Chinese character "王". For example, the aforementioned preset algorithm may be an inverse Gray code algorithm. After successful calculation, the following results are obtained: "0000", "0001", "0011", "0010", "0110", "0111", "0101", "0100", "1100", "1101", "1111", "1110", "1010", "1011", "1001", "1000". The above combination information includes selection information of stroke unit images, wherein the combination information "0001" indicates that only the fourth stroke unit image is selected; the combination information "1100" indicates that the first stroke unit image and the second stroke unit image are selected; the combination information "1101" indicates that the first stroke unit image, the second stroke unit image and the fourth stroke unit image are selected; the combination information "1111" indicates that the first stroke unit image, the second stroke unit image, the third stroke unit image and the fourth stroke unit image are selected at the same time; and so on, other cases will not be described herein.
[0089] After obtaining the above combination information, the electronic device can select stroke unit images according to the stroke unit image selection information contained in the combination information, and form a plurality of combinations after selection. Wherein, after forming each combination, the electronic device can combine the stroke unit images selected in each combination according to a superposition method, and after all combinations are successfully completed, the electronic device can obtain a plurality of combined character images carrying Chinese characters. Specifically, when combining the selected stroke unit images in each combination in a superposition manner, color value opacity detection can be performed on the selected stroke unit images, and the parts with color value opacity greater than 0 are retained; wherein, the parts with color value opacity greater than 0 are the stroke information contained in the stroke unit images. Then the retained stroke information is merged into a new image, and after the merging is successful, the above new image is the combined character image. Wherein, the combined character image has the same image size as the stroke unit image. For example, the electronic device selects the first stroke unit image "一", the third stroke unit image "丨" and the fourth stroke unit image "一" according to the combination information "1011", forms a combination after selection, then the electronic device combines the selected stroke units in the combination in a superposition manner, and forms a combined character image carrying the Chinese character "工" after combination, and repeats the above method until all combined character images are combined.
[0090] Specifically, as shown in Figure 5 , it is a schematic diagram of a plurality of combined character images formed after full combination of stroke unit images corresponding to the Chinese character "王".
[0091] It should be noted that the above method for forming a combined character image can also be applied to the case where the original character is an English character. The specific implementation process is the same as that of the above embodiment, the only difference is that when the original character is an English character, the character unit image is a letter unit image carrying an English letter. Based on the above reasons, the specific principle will not be repeated here.
[0092] In this embodiment, the character unit images are combined by means of superposition, and after combination, a combined character image carrying a combined character can be obtained. It can be seen that in this embodiment, combined characters are formed by means of image superposition, and the algorithm logic is simple and easy to implement.
[0093] Embodiment 2: When the original character is an English character, the electronic device can also splice the selected character unit images in each combination left and right, so as to obtain a combined character image carrying a combined character in this way.
[0094] The following takes the original character as the English character "eat" as an example to explain in detail the generation principle of the combined character image:
[0095] In this embodiment, as Figure 6 As shown, the electronic device acquires letter unit images of the English character "eat," namely, a first letter unit image carrying the English letter "e," a second letter unit image carrying the English letter "a," and a third letter unit image carrying the English letter "t." After successfully acquiring the letter unit images, the electronic device determines the combination information that can be formed by the letter unit images corresponding to the English character "eat." Specifically, the electronic device can use a preset algorithm to calculate the combination information that can be formed by the letter unit images corresponding to the English character "eat." For example, the preset algorithm can be a recursive algorithm. After successful calculation, the following results are obtained: "e", "a", "t", "ea", "ae", "et", "te", "at", "ta", "eat", "eta", "tea", "tae", "ate", "aet". The above combination information includes the selection information and the arrangement information of the letter unit images. Among them, the combination information "et" means that the first letter unit image and the third letter unit image are selected at the same time, and the arrangement information of the letter unit images is that the letter unit image "e" is on the left and the letter unit image "t" is on the right; the combination information "eta" means that the first letter unit image, the second letter unit image and the third letter unit image are selected at the same time, and the arrangement information of the letter unit images is that the letter unit image "e" is on the left, the letter unit image "t" is in the middle and the letter unit image "a" is on the right; the combination information "tae" means that the first letter unit image, the second letter unit image and the third letter unit image are selected at the same time, and the arrangement information of the letter unit images is that the letter unit image "t" is on the left, the letter unit image "a" is in the middle and the letter unit image "e" is on the right, and so on. Other cases will not be explained.
[0096] After obtaining the aforementioned combination information, the electronic device can select letter unit images based on the letter unit image selection information contained in the combination information, forming multiple combinations. After forming each combination, the electronic device can, based on the arrangement information of the letter unit images contained in the combination information, splice the selected letter unit images left and right within each combination. By combining the letter unit images in this way, the electronic device obtains multiple combined character images carrying English characters after all combinations are successfully completed. For example, the electronic device selects the second letter unit image "a" and the first letter unit image "e" based on the combination information "ae," forming a combination. Then, the electronic device splices the letter unit images "a" and "e" left and right according to the arrangement information of "a" on the left and "e" on the right. Specifically, during splicing, the letter unit image "a" is placed on the left and the letter unit image "e" is placed on the right. After successful splicing, a combined character image carrying the English characters "ae" is formed. This process is repeated until all combined character images are obtained.
[0097] Specifically, such as Figure 7 As shown, it is a schematic diagram of multiple combined character images formed by combining the letter unit images corresponding to the English character "tea".
[0098] In this embodiment, letter unit images are combined by splicing them left and right to obtain a combined character image carrying English characters. It can be seen that this embodiment uses image splicing to form combined characters, a simple and easy-to-implement method.
[0099] Step S330: Determine whether the combined characters carried in each combined character image are valid characters through image recognition, and filter out the combined character images carrying valid characters based on the determination results.
[0100] In this step, after acquiring the combined character images, the electronic device can use image recognition to determine whether the combined characters in each combined character image are valid characters, and then filter out the combined character images carrying valid characters based on the judgment results. Specifically, the electronic device uses OCR image recognition technology to sequentially identify whether the combined characters in each combined character image are valid characters. If the combined characters in the combined character image are found to be valid, the image is retained; if the combined characters in the combined character image are found to be invalid, the image is deleted. After all the combined character images have been recognized, the electronic device can filter out the combined character images carrying valid characters.
[0101] In this step, valid characters in combined characters are screened out by means of image recognition, and the screening method is simple and easy to implement.
[0102] Step S340: associating the original characters with the valid characters and storing them in a character library.
[0103] In this step, after screening out the combined character image carrying valid characters, the electronic device can extract the valid characters, associate the valid characters with the original characters after successful extraction, and store both the original characters and the valid characters in the pre-created character library after association. Illustratively, the character library may be a JSON text file, and in this case the electronic device may store the original characters and the valid characters in the JSON text file.
[0104] In an embodiment, the valid characters may contain repeated characters, that is, the same character appears multiple times. In this case, deduplication processing may be performed first, and after deduplication processing, the original characters are associated with the valid characters, and after association, both the original characters and the valid characters are stored in the pre-created character library. Illustratively, as Figure 5 shown, after full combination of the stroke unit images corresponding to the Chinese character "王", a plurality of combined character images are formed; after screening, it is found that Figure 5 the combined characters carried in the combined character images are all valid characters. At this time, the electronic device performs feature extraction on the above valid characters, and finds after extraction that the valid characters include three "二" characters and three "一" characters, so the electronic device performs deduplication processing first, and only retains one "二" character and one "一" character. After deduplication processing, the valid characters are associated with the original characters, and after association, the original characters and the valid characters are stored in the pre-created character library.
[0105] It can be seen from the above content that the character library generation method in the present application can cover multiple languages and has a wide application range.
[0106] It should be noted that when the original characters are English characters, a game planner can generate combined character images according to the rules of the word game; when the word game stipulates that the alphabet order in the English characters is not allowed to be changed when searching for hidden characters, the game planner can adopt the method in the first embodiment described above to obtain combined character images; when the word game stipulates that the alphabet order in the English characters is allowed to be changed when searching for hidden characters, the game planner can adopt the method in the second embodiment described above to obtain combined character images. Then after obtaining the combined character images, the combined characters are screened out. Further, valid characters are screened out from the combined characters, then the valid characters are associated with the original characters, and after association, they are stored in the character library, thus completing the generation of the character library.
[0107] In one embodiment, after completing the generation of the character library, the electronic device can apply the character library so that the character library can support the orderly operation of the text game. Specifically, as Figure 8 shown, the electronic device can apply the character library by performing the following steps S410 to S430.
[0108] Step S410: Send a first display instruction, so that the user terminal displays the original character when receiving the first display instruction.
[0109] After the character library is established, the game planner can release the text game. After the game is released, users can experience the text game through their user terminals. Wherein, the electronic device is network-connected with a plurality of user terminals, and the user terminals may be mobile phones, tablet computers, notebook computers, etc.
[0110] In this step, when the user plays the text game, the user can send a trigger instruction to the electronic device through the user terminal located by the user. Wherein, the trigger instruction is used to instruct the user to start experiencing the text game. After receiving the trigger instruction, the electronic device sends a first display instruction to the user terminal, and then the user terminal displays the original character carried in the first display instruction after receiving the first display instruction. For example, as Figure 9 shown, after receiving the display instruction, the user terminal can display the original character "gold" through its display component.
[0111] Step S420: Receive an input instruction, determine whether the input character carried in the input instruction is a valid character corresponding to the original character in the character library, and perform a corresponding operation according to the determination result.
[0112] Wherein, the input character is a character found by the user. The input character is a character that the user considers to be hidden in the original character. A valid character is a character that is actually hidden in the original character.
[0113] In this step, after displaying the original character, the user terminal can send an input instruction to the electronic device via the user terminal. Wherein, the input instruction carries an input character; the input character is not necessarily a valid character. After receiving the input instruction, the electronic device can determine whether the input character is a character hidden in the original character by judging whether the input character is a valid character corresponding to the original character in the character library. Then a corresponding operation is performed according to the judgment result. If the judgment result shows that the input character carried in the input instruction is a valid character corresponding to the original character in the character library, it proves that the input character is a character hidden in the original character. In this case, the electronic device can send a second display instruction to the user terminal, so that the user terminal displays the input character when receiving the second display instruction, which indicates that the user has successfully found the hidden character. If the judgment result shows that the input character carried in the input instruction is not a valid character corresponding to the original character in the character library, it proves that the input character is not a character hidden in the original character. In this case, the electronic device generates a prompt message, and sends the prompt message to the user terminal after the prompt message is successfully generated. Wherein, the prompt message is used to indicate that the hidden character search failed.
[0114] For example, as Figure 10 shown, a user can select a corresponding stroke of the original character "金" by means of touch control, and then send an input instruction to the electronic device in this way. Wherein, the input instruction includes the input character "人". After receiving the input instruction, the electronic device judges whether the input character "人" is a valid character corresponding to the original character "金" in the character library. After judgment, the electronic device confirms that the input character "人" is a valid character corresponding to the original character "金" in the character library, which indicates that the input character "人" is a character hidden in the original character "金", at this time as Figure 11 shown, the electronic device can send a second display instruction to the user terminal, and the user terminal displays the input character "人" after receiving the display instruction. By displaying the input character "人", it indicates that the user has successfully found the hidden character.
[0115] The above step S420 is repeated continuously until the user finds all hidden characters hidden in the original character.
[0116] Please refer to Figure 12 , which is a block diagram of an apparatus for generating a character library provided by an embodiment of the present application. As Figure 12 shown, the apparatus 500 for generating a character library in this embodiment includes an obtaining module 510, a combining module 520, a screening module 530 and an associating module 540. The functions of each functional module will be described in detail below.
[0117] The obtaining module 510 is configured to obtain a character unit corresponding to an original character; wherein the character unit is the minimum unit constituting one character.
[0118] The combination module 520 is used to fully combine character units to form multiple combined characters.
[0119] The filtering module 530 is used to filter out valid characters from multiple combinations of characters.
[0120] The association module 540 is used to associate the original characters with the valid characters and save them in the text library.
[0121] In one embodiment, the character unit is carried in the character unit image; the combination module 520 is also used to fully combine the character unit image according to a preset combination method to form multiple combined character images.
[0122] In one embodiment, the position of the character unit in the character unit image is the same as its position in the original character; the combination module 520 is also used to combine the selected character unit images in each combination in a superimposed manner to form multiple combined character images.
[0123] In one embodiment, the original characters are English characters, and the character unit image is a letter unit image; the combination module 520 is also used to splice the selected letter unit images in each combination from left to right to form a combined character image.
[0124] In one embodiment, the filtering module 530 is further configured to determine whether the combined characters carried by each combined character image are valid characters through image recognition, and to filter out the valid characters in the combined characters based on the determination result.
[0125] The specific implementation process of the functions and roles of each module in the above-mentioned device can be found in the implementation process of the corresponding steps in the above-mentioned text library generation method, and will not be repeated here.
[0126] The apparatuses and methods disclosed in the several embodiments provided in this application can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatuses, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0127] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0128] If a function is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
Claims
1. A method for generating a text library, characterized in that, The method for generating the text library includes: Obtain the character unit corresponding to the original character; wherein, the character unit is the smallest unit that constitutes a character; The character units are fully combined to form multiple combined characters; Filter out the valid characters from the multiple combined characters; valid characters are those that are words in the combined characters. The original character is associated with the valid character and stored in the character library.
2. The method for generating a text library according to claim 1, characterized in that, The character unit is carried in the character unit image; The process of combining the character units to form multiple combined characters includes: The character unit images are fully combined according to a preset combination method to form multiple combined character images.
3. The method for generating a text library according to claim 2, characterized in that, The position of the character unit in the character unit image is the same as its position in the original character; The step of combining the character unit images according to a preset combination method to form multiple combined character images includes: The selected character unit images in each combination are combined in an overlay manner to form the multiple combined character images.
4. The method for generating a text library according to claim 2, characterized in that, The original characters are English characters, and the character unit image is an alphabet unit image; The step of combining the character unit images according to a preset combination method to form multiple combined character images includes: The selected letter unit images in each combination are spliced left and right to form the multiple combined character images.
5. The method for generating a text library according to claim 2, characterized in that, The step of filtering out the valid characters from the multiple combinations of characters includes: Image recognition is used to determine whether the combined characters in each combined character image are valid characters, and combined character images carrying valid characters are selected based on the determination results.
6. The method for generating a text library according to claim 1, characterized in that, After associating the original character with the valid character and storing it in the character library, the method further includes: Send a first display instruction so that the user terminal displays the original characters upon receiving the first display instruction; Receive an input instruction and determine whether the input character carried by the input instruction is a valid character corresponding to the original character in the character library; If the input character carried by the input instruction is a valid character corresponding to the original character in the character library, a second display instruction is sent so that the user terminal displays the input character when it receives the second display instruction; If the input character carried by the input instruction is not a valid character corresponding to the original character in the character library, a prompt message is generated.
7. A device for generating a text library, characterized in that, The device for generating the text library includes: The acquisition module is used to acquire the character unit corresponding to the original character; wherein, the character unit is the smallest unit that constitutes a character; The combination module is used to fully combine the character units to form multiple combined characters; The filtering module is used to filter out valid characters from the multiple combined characters; valid characters are characters that are words in the combined characters. The association module is used to associate the original character with the valid character and save them in the character library.
8. The text library generation apparatus according to claim 7, characterized in that, The character unit is carried in the character unit image; The combined module is also used for: The character unit images are fully combined according to a preset combination method to form multiple combined character images.
9. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store processor-executable instructions; The processor is configured to execute the method for generating a text library according to any one of claims 1-5.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that can be executed by a processor to perform the method for generating a text library as described in any one of claims 1-5.
Citation Information
Patent Citations
A method for processing Chinese character information and a method for splitting and storing Chinese characters.
CN102262683A