Symbol processing method, device, electronic device and storage medium

By identifying the target symbols of the string to be recognized in web page rendering, the difficulty of identifying and typing complex characters such as combined emojis in web page rendering is solved, and the accuracy and usability of web page rendering is achieved.

CN114638218BActive Publication Date: 2025-02-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210293122.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-23
Publication Date
2025-02-28
Estimated Expiration
2042-03-23

AI Technical Summary

Technical Problem

In web page rendering, especially when using canvas rendering technology, there are difficulties in identifying and typing complex characters such as combined emojis, resulting in web page layout exceptions and cursor position rendering errors.

Method used

By obtaining the character string to be identified, determining its first target encoding unit and target encoding unit number, determining the set of candidate symbols from the preset dictionary, and matching the candidate symbols with the character string to be identified to determine the target symbol.

Benefits of technology

It realizes accurate recognition of complex characters such as combined emojis, avoids web page layout exceptions and cursor position rendering errors, and improves the accuracy and usability of web page rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114638218B_ABST
    Figure CN114638218B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of computer technology, and in particular to a symbol processing method, device, electronic device and storage medium. According to the symbol processing method provided by the embodiment of the present disclosure, the method includes: obtaining a character string to be recognized; determining the first target coding unit corresponding to the character string to be recognized and the number of target coding units corresponding to the character string to be recognized; determining a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized; matching the candidate symbols in the candidate symbol set with the character string to be recognized, and determining the target symbol from the character string to be recognized based on the matching result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a symbol processing method, device, electronic device and storage medium. Background Art

[0002] In related web page development technologies, in order to improve the performance of web page rendering, canvas rendering technology is used for rendering in scenes with complex rendering elements. Using canvas technology to render elements requires layout of page elements.

[0003] In the field of canvas text rendering, it is necessary to combine the font and width of the text for typesetting, text wrapping, etc. In web pages, all text has a unique corresponding Unicode code point. However, some text, such as some combined emoticons (emoji), may be composed of multiple independent characters, so a technology for recognizing such combined emoticons is needed. Because accurate typesetting of text in canvas depends on accurately recognizing a string of characters as independent characters, once the recognition is wrong, it will lead to incorrect typesetting results. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, according to one or more embodiments of the present disclosure, a symbol processing method is provided, including:

[0006] Obtaining a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit;

[0007] Determine a first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized;

[0008] Determine a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized;

[0009] The candidate symbols in the candidate symbol set are matched with the character string to be recognized, and a target symbol is determined from the character string to be recognized based on the matching result.

[0010] In a second aspect, according to one or more embodiments of the present disclosure, a symbol processing device is provided, comprising:

[0011] A character acquisition unit to be recognized, used to acquire a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit;

[0012] A character-to-be-recognized determining unit, used to determine a first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized;

[0013] A candidate symbol determination unit, configured to determine a candidate symbol set from a preset dictionary, wherein the candidate symbol set includes at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized;

[0014] A matching unit is used to match the candidate symbols in the candidate symbol set with the character string to be recognized, and determine a target symbol from the character string to be recognized based on the matching result.

[0015] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory so that the electronic device executes the symbol processing method provided according to one or more embodiments of the present disclosure.

[0016] In a fourth aspect, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes the symbol processing method provided according to one or more embodiments of the present disclosure.

[0017] According to one or more embodiments of the present disclosure, by determining the first target coding unit corresponding to the string to be recognized and the number of target coding units corresponding to the string to be recognized, candidate symbols that are the same as the first target coding unit of the string to be recognized and whose number of target coding units is less than the number of target coding units of the string to be recognized are determined from a preset dictionary, and by matching each candidate symbol with the string to be recognized, and determining the target symbol from the string to be recognized based on the matching result, the target character can be efficiently and accurately identified from the string, thereby avoiding problems such as web page layout anomalies and cursor position rendering errors caused by incorrect target symbol recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0019] Figure 1 It is a schematic diagram of combined emoticons;

[0020] Figure 2 A flowchart of a symbol processing method provided according to an embodiment of the present disclosure;

[0021] Figure 3 A schematic diagram of a character string to be recognized and its first character and a set of candidate symbols provided according to an embodiment of the present disclosure;

[0022] Figure 4 A schematic diagram of a symbol recognition method provided according to another embodiment of the present disclosure;

[0023] Figure 5 A flowchart of a method for generating a preset dictionary according to an embodiment of the present disclosure;

[0024] Figure 6 A schematic diagram of the structure of a symbol processing device provided according to an embodiment of the present disclosure;

[0025] Figure 7 The figure is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0026] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0027] It should be understood that the steps described in the embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0028] As used herein, the term "including" and its variations are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The term "responsive to" and related terms refer to a signal or event being affected to a certain extent by another signal or event, but not necessarily completely or directly. If event x occurs "responsive to" event y, x may be directly or indirectly responsive to y. For example, the occurrence of y may ultimately lead to the occurrence of x, but there may be other intermediate events and / or conditions. In other cases, y may not necessarily lead to the occurrence of x, and x may occur even if y has not yet occurred. In addition, the term "responsive to" may also mean "at least partially responsive to".

[0029] The term "determine" broadly covers a variety of actions, which may include obtaining, calculating, computing, processing, deriving, investigating, searching (e.g., searching in a table, database, or other data structure), ascertaining, and similar actions, and may also include receiving (e.g., receiving information), accessing (e.g., accessing data in a memory) and similar actions, as well as parsing, selecting, choosing, establishing, and similar actions, etc. The relevant definitions of other terms will be given in the following description. The relevant definitions of other terms will be given in the following description.

[0030] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0031] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0032] For the purposes of this disclosure, the phrase "A and / or B" means (A), (B), or (A and B).

[0033] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0034] In order to assist in understanding the various embodiments of the present disclosure, the following glossary is provided. Other glossaries and explanations may be given according to the context of the present disclosure.

[0035] (1) Unicode: Unicode, also known as the Universal Code or Unicode, is an industry standard in the field of computer science that can accommodate a character encoding scheme for all the text and symbols in the world.

[0036] (2) Unicode code point: The value or position of a character in a coded character set. Any value in the Unicode code space, i.e., from 0 hex to 10FFFF hex The integer range of .

[0037] (3) Unicode Scalar: Unicode scalar is a basic coding unit of Unicode. The Unicode scalar value is any Unicode code point other than high-surrogate code points and low-surrogate code points, that is, the integer 0. hex To D7FF hex and E000 hex to 10FFFF hex (inclusive) range.

[0038] (4) Character: The basic coding unit of Unicode character encoding.

[0039] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure.

[0040] An emoji may consist of a single character (corresponding to a single Unicode scalar) or may consist of multiple characters (corresponding to multiple Unicode scalars). Figure 1 , Figure 1 A schematic diagram of multiple combined emojis is shown. Combined emoji 11 is an emoji ZWJ sequence, which consists of multiple emojis connected by zero-width ligatures (ZeroWidth Joiner, ZWJ), and is displayed as one emoji on supported platforms. Combined emoji 11 is composed of a male emoji, a zero-width ligature, a female emoji, a zero-width ligature, a girl emoji, a zero-width ligature, and a girl emoji in sequence, corresponding to a total of 7 Unicode scalars. Zero-width ligature (ZWJ) is a Unicode character that acts as an invisible character to act as a glue to connect other characters together to create a new emoji.

[0041] Combination emoji 12 is also an emoji zero-width ligature sequence, which consists of a female emoji, a zero-width ligature, and a notebook emoji, corresponding to a total of 3 Unicode scalars.

[0042] Combined emoji 13 is an emoji modifier sequence consisting of an OK hand gesture emoji and a skin color modifier, corresponding to a total of 2 Unicode scalars. When a modifier is inserted after a supported basic emoji character, an emoji modifier sequence is automatically created, resulting in a single emoji with skin color.

[0043] Combining emoji 145 is composed of the numeric character "1", the variation connector (Variation Selector-16) and the combining enclosing keycap (The Combining Enclosing Keycap) emoji, corresponding to a total of 3 Unicode variants. The variation connector is an invisible code point that specifies that the preceding character should be displayed with the emoji.

[0044] Combined emojis 11, 12, 13, and 14 appear as a single emoji on supported platforms.

[0045] It can be seen that a single combined symbol is actually composed of multiple independent symbols. If the combined symbol is not correctly identified as a single symbol, an abnormal character width will be obtained when the canvas is rendered and typed, resulting in a chaotic and unsightly page layout, and even a large number of blank spaces, overlapping characters, and other problems. In addition, when using the canvas to render content, it is necessary to consider the rendering cursor position. If the combined symbol cannot be accurately identified, the cursor will move abnormally. For example, the combined emoji 11 consists of 7 Unicode scalars, and its character length is 7. However, if these 7 Unicode scalars cannot be identified as a single symbol, the cursor will be abnormally placed after the 7 characters, seriously affecting the usability of the web page.

[0046] refer to Figure 2 , Figure 2 A flowchart of a symbol processing method 100 provided in an embodiment of the present disclosure is shown. The method 100 includes:

[0047] Step S120: obtaining a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit.

[0048] In some embodiments, the character string to be recognized may be a character string input by a user. For example, the user may input a paragraph of text, which may include Chinese characters, symbols, letters, numbers, emoticons, and the like.

[0049] In some embodiments, the target coding unit may include a Unicode scalar or character, or a basic coding unit under other coding standards, which is not limited in this embodiment.

[0050] Step S140: Determine the first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized.

[0051] Step S160: Determine a set of candidate symbols from a preset dictionary, the set of candidate symbols including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized.

[0052] Step S180: Match the candidate symbols in the candidate symbol set with the character string to be recognized, and determine a target symbol from the character string to be recognized based on the matching result.

[0053] In some embodiments, the target symbol is a combined symbol, and a combined symbol includes at least two target coding units.

[0054] In some embodiments, the combined symbol includes a combined emoticon.

[0055] The following uses a combination of emoticons as an example for illustration. Assume that the string to be recognized is Figure 3 The character string 30 to be identified includes how Figure 1 The combined emoticon 12 and the text "abc" shown correspond to a total of 6 Unicode scalars (of which the combined emoticon 12 corresponds to 3 Unicode scalars), then the first Unicode scalar or character 121 corresponding to the character string 30 to be recognized is determined, that is, the female emoticon (Unicode code point is 1F469), and the number or length of Unicode scalars corresponding to the character string 30 to be recognized is 6. Then, from the preset dictionary, it is found that there are P symbols with the female emoticon 121 (Unicode code point is 1F469) as the first Unicode scalar and the number of corresponding characters or Unicode scalars does not exceed 6 (that is, the length is less than or equal to 6), then these P symbols are taken as candidate symbols to form a candidate symbol set. See Figure 3 , which schematically shows a candidate symbol set 31 corresponding to the string to be recognized 30, which includes several candidate symbols. Finally, the candidate symbols in the candidate symbol set 31 are matched with the string to be recognized 300, and based on the matching result, the target symbol, i.e., the combined emoticon 12, is determined from the string to be recognized.

[0056] It should be noted that the candidate symbol can be represented in the form of a combination symbol, a character, and / or a Unicode code point sequence, or in other equivalent forms, such as a description of the symbol, etc., which is not limited in this embodiment. Figure 1 The combined emoji 12 is composed of a female emoji, a zero-width ligature, and a notebook emoji in sequence, and the corresponding Unicode code point sequence is [1F469,200D,1F4BB], which is described as “woman technologist” under Unicode encoding.

[0057] In this way, according to the symbol recognition method provided by one or more embodiments of the present disclosure, by determining the first target coding unit corresponding to the string to be recognized and the number of target coding units corresponding to the string to be recognized, a candidate symbol whose first target coding unit is the same as the first target coding unit of the string to be recognized and the number of target coding units is less than the number of target coding units of the string to be recognized is determined from a preset dictionary, and each candidate symbol is matched with the string to be recognized, and the target symbol is determined from the string to be recognized based on the matching result, so that the target character can be efficiently and accurately identified from the string, thereby avoiding problems such as web page layout anomalies and cursor position rendering errors caused by incorrect target symbol recognition.

[0058] In some embodiments, the preset dictionary is dedicated to recording symbols of the same type as the target symbol. The target symbol is a combination symbol as an example for schematic description. The keyword of the preset dictionary is the target coding unit, and the value corresponding to the keyword is at least one combination symbol starting with the keyword. In this embodiment, after obtaining the first target coding unit of the string to be identified, it is used as a keyword to search in the preset dictionary, so that all combination symbols starting with the target coding unit can be queried. Exemplarily, the keyword and its corresponding value can be stored in the dictionary in the form of a key-value pair (Key-Value). For example, in the dictionary, if key A is the target coding unit A, the first target coding unit of all symbols contained in the value A corresponding to key A is the target coding unit A. If the first target coding unit of the string to be identified does not belong to the key of the dictionary, it can be determined that the first symbol of the string to be identified is not a combination symbol. In this way, by recording the combination symbol in a dedicated dictionary, the possibility that the first symbol of the string to be identified is a combination symbol can be judged in O(1) time. Those skilled in the art can understand that the above possibility judgment is related to the comprehensiveness of the dictionary's inclusion of keywords.

[0059] In some embodiments, step S180 includes:

[0060] Step A1: Separate the target symbol from the character string to be recognized.

[0061] In this embodiment, by separating the determined target symbol from the character string to be recognized, subsequent processing involving the target symbol, such as web page typesetting, cursor position positioning, etc., can be facilitated.

[0062] In some embodiments, before executing step S160, method 100 further includes the following steps: determining that the target encoding unit corresponding to the character string to be recognized includes at least one emoticon. In this embodiment, only when it is determined that the target encoding unit corresponding to the character string to be recognized includes at least one emoticon, the target symbol is matched based on a preset dictionary, so that the preset dictionary can be effectively used to save computing resources.

[0063] In some embodiments, step S180 includes:

[0064] Step B1: Match the candidate symbols in the candidate symbol set with the character string to be recognized in order from most to least based on the number of corresponding target coding units.

[0065] The following is an exemplary description using a combined emoticon as an example. The combined emoticons may have one or more identical target coding units. For example, assuming that the combined emoticon A is composed of a male emoticon, a zero-width ligature, a female emoticon, a zero-width ligature, a girl emoticon, a zero-width ligature, and a girl emoticon in sequence, and the combined emoticon B is composed of a male emoticon, a zero-width ligature, and a female emoticon in sequence, then the first three target coding units of the combined emoticon A and the combined emoticon B are all exactly the same. If it is only determined that the combined emoticon B can be exactly the same as the first three target coding units of the string to be recognized, it is not possible to directly conclude that the first symbol of the string to be recognized is the combined emoticon B at this time, and it is still necessary to further determine whether the combined emoticon A matches the first 7 target coding units of the string to be recognized. However, if it is first determined that the longer combined emoticon A matches the first 7 target coding units of the string to be recognized, it is no longer necessary to determine whether the shorter combined emoticon B matches the string to be recognized. In this way, in this embodiment, by matching the candidate symbols in the candidate symbol set with the string to be recognized in order from most to least based on the number of corresponding target coding units, the recognition speed of the target symbol can be improved.

[0066] In some embodiments, step S180 includes the following matching steps:

[0067] Step C10: determining the target code quantity M corresponding to the candidate symbol with the Nth largest number of target code units in the candidate symbol set, intercepting the first M target code units from the character string to be recognized as the first character string to be recognized and matching them with the candidate symbols in the candidate symbol set; wherein the initial value of N is 1;

[0068] Step C21: if there is a first candidate symbol in the candidate symbol set that is the same as the first character string to be recognized, taking the first candidate symbol as the matching result;

[0069] Step C22: If there is no first candidate symbol identical to the first character string to be recognized in the candidate symbol set, the value of N is increased by 1 and the matching step is repeated.

[0070] The following is an exemplary explanation. Assume that the number of target coding units corresponding to the string to be recognized is 7 (i.e., the length is 7), and the number of target coding units corresponding to each candidate symbol is the following three categories: 5, 3, and 2. When N is 1, the value of the target coding number corresponding to the candidate symbol with the largest number of target coding units (i.e., the longest length) is 5 (i.e., M=5). Then, the first 5 target coding units in the string to be recognized are intercepted as the first string to be recognized a, and matched with all candidate vectors with the corresponding target coding number of 5 (i.e., the length is 5). If there is a candidate symbol A that is exactly the same as the first string to be recognized a, then candidate symbol A is used as the matching result. If it does not exist, the value of N is increased by one and the above matching steps are repeated, that is, the value of the target code quantity corresponding to the candidate symbol with the second largest number of target code units (that is, the second longest length) in the candidate symbol set is determined to be 3 (at this time, N=2, M=3), and the first three target code units in the character string to be recognized are intercepted as the first character string b to be recognized, and matched with all candidate vectors with the corresponding target code quantity of 3 (that is, length 3). If there is a candidate symbol B that is exactly the same as the first character string b to be recognized, the candidate symbol B is taken as the matching result. If it does not exist, the value of N is increased by one and the matching step is repeated, that is, the value of the target code quantity corresponding to the candidate symbol with the third largest number of target code units (i.e., the third longest length) in the candidate symbol set is determined to be 3 (at this time, N=3, M=2), and the first two target code units in the string to be recognized are intercepted as the first string to be recognized c, and matched with all candidate vectors with the corresponding target code quantity of 2 (i.e., length 2). If there is a candidate symbol C that is exactly the same as the first string to be recognized c, the candidate symbol C is used as the matching result; if it does not exist, it can be determined that the first symbol of the string to be recognized is not the target symbol.

[0071] It should be noted that, in the present embodiment, the first string to be identified is exactly the same as the candidate symbol, including the number of target coding units, code points and relative order. For example, if the Unicode code point sequence corresponding to the first string to be identified is [1F469, 200D, 1F4BB], then the Unicode code point sequence corresponding to the candidate symbol that is exactly the same as it should also be [1F469, 200D, 1F4BB].

[0072] In some embodiments, the keyword of the preset dictionary is the target coding unit, and the value corresponding to the keyword is at least one symbol with the keyword as the first target coding unit. In this way, by querying the keyword, a set of symbols with the keyword as the first target coding unit can be obtained. In this embodiment, after obtaining the first target coding unit of the string to be identified, it is queried in the preset dictionary as a keyword, so that all symbols starting with the target coding unit can be queried. Exemplarily, keywords and their corresponding values ​​can be stored in the dictionary in the form of key-value pairs. For example, in the dictionary, if key A is the target coding unit A, the first target coding unit of all symbols contained in value A corresponding to key A is target coding unit A.

[0073] It should be noted that in one or more embodiments of the present disclosure, the target coding unit used as a keyword in the dictionary can be represented in the form of a character, a Unicode code point, or in other equivalent forms, such as a description of the target coding unit; the symbol used as a keyword in the dictionary can be represented in the form of a combination of symbols, characters, and / or a Unicode code point sequence, or in other equivalent forms, such as a description of the symbol, etc., which is not limited in this embodiment. For example, see Figure 1 The combined emoji 12 is composed of a female emoji, a zero-width ligature, and a notebook emoji in sequence, and the corresponding Unicode code point sequence is [1F469,200D,1F4BB], which is described as “womantechnologist” under Unicode encoding.

[0074] In some embodiments, before executing step S160, method 100 further includes:

[0075] Step S150: Determine whether the first target encoding unit is the first encoding unit; if the first target encoding unit is not the first encoding unit, execute step S160; if the first target encoding unit is the first encoding unit, determine that the starting symbol of the character string to be recognized is not the target symbol.

[0076] In this embodiment, by determining whether the first target coding unit is the first coding unit, if the first target coding unit is the first coding unit, it is determined that the starting symbol of the string to be identified is not the target symbol, so that the possibility that the first symbol of the string to be identified is the target symbol can be judged in advance, and when it is judged that it is impossible to be the target symbol (that is, the first target coding unit is the first coding unit), the judgment process can be terminated in advance.

[0077] In some embodiments, the target character is a combined symbol, and the first encoding unit is a target encoding unit used only for a single-character symbol, wherein the single-character symbol consists of one target encoding unit; the step S150 includes: determining whether the first target encoding unit is a first encoding unit based on a preset first encoding unit set; wherein the first encoding unit set includes at least one first encoding unit.

[0078] In this embodiment, by setting all target encoding units that are only used for single-character symbols in a set, it is determined whether the first target encoding unit of the string to be recognized belongs to the set. In this way, it is possible to determine whether the first symbol of the string to be recognized is a single-character symbol within O(1) time, thereby improving query efficiency.

[0079] The following uses emoticons as an example for illustration. Some emoticons can be used as separate emoticons or as part of other combined emoticons, for example, Figure 1 The female emoticon shown can be used as a separate emoticon and as the first character of the combined emoticon 12. However, there are some emoticon characters that are only used as separate emoticons (i.e., single-character symbols) and cannot be used for other combined characters. In this regard, according to one or more embodiments of the present disclosure, when it is determined that the first character of the string to be identified is only used for a separate emoticon, it can be determined that the character cannot be the starting character of the combined emoticon, and therefore, it is determined that the first symbol of the string to be identified cannot be a combined emoticon, so that the judgment process can be terminated in advance.

[0080] refer to Figure 4 , Figure 4 It is shown that a symbol recognition method 400 provided according to an embodiment of the present disclosure includes:

[0081] Step S401: obtaining a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit;

[0082] Step S402: Determine the first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized

[0083] Step S403: Determine whether the first target coding unit may correspond to the target symbol; if it is determined that it may correspond to the target symbol, execute step S404; if it is determined that it may not correspond to the target symbol, execute step S409;

[0084] Step S404: determining a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized;

[0085] Step S405: determine whether the candidate symbol set is empty; if it is not empty, execute step S406; if it is empty, execute step S409;

[0086] Step S406: Determine the value M of the target code number corresponding to the candidate symbol with the Nth largest number of target code units in the candidate symbol set, intercept the first M target code units from the character string to be recognized as the first character string to be recognized, and take out all the candidate symbols with the Nth largest number of target code units from the candidate symbol set to match with the first character string to be recognized; the initial value of N is 1;

[0087] Step S407: determine whether the selected candidate symbol matches the first character string to be recognized; if it is determined to match, execute step S408; if it is determined not to match, continue to return to execute step S405, and when step S406 is executed next time, the value of N is increased by one, and so on, until step S407 or step S405 is determined to be yes;

[0088] Step S408: determining a target symbol from the character string to be recognized based on the matching result;

[0089] Step S409: Determine whether the first symbol of the character string to be recognized is not a target symbol.

[0090] In some embodiments, the preset dictionary is generated by the following steps:

[0091] Step D1: obtaining information on the mapping relationship between symbols and target coding units;

[0092] Step D2: Based on the mapping relationship information and according to the type of each symbol, generate a dictionary corresponding to the type.

[0093] In some embodiments, the symbol types may include but are not limited to single-character symbol types, combined symbol types, expression zero-width ligature sequence types, expression modifier sequence types, etc. Each type may correspond to a specific dictionary, thereby improving the efficiency of dictionary lookup.

[0094] refer to Figure 5 , Figure 5 The method 500 for generating a preset dictionary according to an embodiment of the present disclosure includes:

[0095] Step S501: reading an emoticon data file, wherein the emoticon data file includes mapping relationship information between emoticons and target coding units;

[0096] Step S502: determine whether there is any unread mapping relationship information in the data file; if the determination is yes, execute step S503; if the determination is no, execute step S505;

[0097] Step S503: reading mapping relationship information;

[0098] Step S504: determining the type of the symbol, and based on the type of the symbol, saving the mapping relationship information into a dictionary corresponding to the type;

[0099] After step S504 is completed, steps S502 to S504 are repeatedly executed until all the mapping relationship information of the emoticon data file is read.

[0100] Accordingly, if Figure 6 As shown, according to an embodiment of the present disclosure, a symbol processing device 600 is provided, comprising:

[0101] The character acquisition unit 620 is used to acquire a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit;

[0102] The character-to-be-recognized determining unit 640 is used to determine the first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized;

[0103] A candidate symbol determination unit 660 is used to determine a candidate symbol set from a preset dictionary, wherein the candidate symbol set includes at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized;

[0104] The matching unit 680 is configured to match the candidate symbols in the candidate symbol set with the character string to be recognized, and determine a target symbol from the character string to be recognized based on the matching result.

[0105] According to one or more embodiments of the present disclosure, by determining the first target coding unit corresponding to the string to be recognized and the number of target coding units corresponding to the string to be recognized, candidate symbols that are the same as the first target coding unit of the string to be recognized and whose number of target coding units is less than the number of target coding units of the string to be recognized are determined from a preset dictionary, and by matching each candidate symbol with the string to be recognized, and determining the target symbol from the string to be recognized based on the matching result, the target character can be efficiently and accurately identified from the string, thereby avoiding problems such as web page layout anomalies and cursor position rendering errors caused by incorrect target symbol recognition.

[0106] In some embodiments, the target symbol is a combined symbol, and one of the combined symbols includes at least two target coding units.

[0107] In some embodiments, the preset dictionary is dedicated to recording symbols of the same type as the target symbol.

[0108] In some embodiments, the matching unit is further configured to separate the target symbol from the character string to be recognized.

[0109] In some embodiments, the combined symbol includes a combined emoticon.

[0110] In some embodiments, the symbol processing device further includes:

[0111] The symbol determination unit is used to determine whether the target encoding unit corresponding to the character string to be recognized includes at least one emoticon.

[0112] In some embodiments, the matching unit is used to match the candidate symbols in the candidate symbol set with the character string to be recognized in sequence based on the number of corresponding target encoding units from most to least.

[0113] In some embodiments, matching the candidate symbols in the candidate symbol set with the character string to be recognized comprises the following matching steps:

[0114] Determine the target code number value M corresponding to the candidate symbol with the Nth largest number of target code units in the candidate symbol set, and intercept the first M target code units from the character string to be recognized as the first character string to be recognized to match with the candidate symbols in the candidate symbol set; wherein the initial value of N is 1;

[0115] If there is a first candidate symbol in the candidate symbol set that is the same as the first character string to be recognized, taking the first candidate symbol as the matching result;

[0116] If there is no first candidate symbol identical to the first character string to be recognized in the candidate symbol set, the value of N is increased by 1 and the matching step is repeated.

[0117] In some embodiments, the keyword of the preset dictionary is a target coding unit, and the value corresponding to the keyword is at least one symbol with the keyword as the first target coding unit.

[0118] In some embodiments, the symbol processing device further includes:

[0119] The first coding determination unit is used to determine whether the first target coding unit is the first coding unit; the candidate symbol determination unit is used to perform the step of determining the candidate symbol set from the preset dictionary if the first target coding unit is not the first coding unit;

[0120] A determination unit is configured to determine, if the first target encoding unit is the first encoding unit, that a starting symbol of the character string to be recognized is not the target symbol.

[0121] In some embodiments, the first encoding unit is a target encoding unit used only for a single-character symbol, and the single-character symbol consists of one target encoding unit; the determining whether the first target encoding unit is the first encoding unit includes: determining whether the first target encoding unit is the first encoding unit based on a preset first encoding unit set; wherein the first encoding unit set includes at least one of the first encoding units.

[0122] In some embodiments, the target code unit comprises a Unicode scalar or character.

[0123] In some embodiments, the symbol processing device further includes a dictionary generating unit for acquiring mapping relationship information including symbols and target coding units, and generating a dictionary corresponding to the type according to the type of each symbol based on the mapping relationship information.

[0124] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, and the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.

[0125] Accordingly, according to one or more embodiments of the present disclosure, there is provided an electronic device, including:

[0126] at least one memory and at least one processor;

[0127] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute the symbol processing method provided according to one or more embodiments of the present disclosure.

[0128] Accordingly, according to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, which stores program code, and the program code can be executed by a computer device to enable the computer device to perform the symbol processing method provided according to one or more embodiments of the present disclosure.

[0129] Reference below Figure 7 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0130] like Figure 7 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0131] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0132] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0133] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0134] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0135] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0136] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.

[0137] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0138] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0139] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.

[0140] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0141] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0142] According to one or more embodiments of the present disclosure, a symbol processing method is provided, including: obtaining a character string to be recognized, the character string to be recognized corresponding to at least one target coding unit; determining a first target coding unit corresponding to the character string to be recognized and the number of target coding units corresponding to the character string to be recognized; determining a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized; matching the candidate symbols in the candidate symbol set with the character string to be recognized, and determining the target symbol from the character string to be recognized based on the matching result.

[0143] According to one or more embodiments of the present disclosure, the target symbol is a combined symbol, and one combined symbol includes at least two target coding units.

[0144] According to one or more embodiments of the present disclosure, the preset dictionary is specifically used to record symbols of the same type as the target symbol.

[0145] According to one or more embodiments of the present disclosure, determining a target symbol from the character string to be recognized includes: separating the target symbol from the character string to be recognized.

[0146] According to one or more embodiments of the present disclosure, the combined symbol includes a combined emoticon.

[0147] According to one or more embodiments of the present disclosure, before determining a candidate symbol set from a preset dictionary, the symbol processing method further includes: determining that a target encoding unit corresponding to the character string to be recognized includes at least one emoticon.

[0148] According to one or more embodiments of the present disclosure, matching the candidate symbols in the candidate symbol set with the string to be recognized includes: matching the candidate symbols in the candidate symbol set with the string to be recognized in order from most to least based on the number of corresponding target coding units.

[0149] According to one or more embodiments of the present disclosure, the matching of the candidate symbols in the candidate symbol set with the string to be recognized includes the following matching steps: determining the numerical value M of the target coding number corresponding to the candidate symbol with the Nth largest number of target coding units in the candidate symbol set, and intercepting the first M target coding units from the string to be recognized as the first string to be recognized to match with the candidate symbols in the candidate symbol set; wherein the initial value of N is 1; if there is a first candidate symbol in the candidate symbol set that is identical to the first string to be recognized, then the first candidate symbol is used as the result of the matching; if there is no first candidate symbol in the candidate symbol set that is identical to the first string to be recognized, then the value of N is increased by 1 and the matching step is repeated.

[0150] According to one or more embodiments of the present disclosure, the keyword of the preset dictionary is a target coding unit, and the value corresponding to the keyword is at least one symbol with the keyword as the first target coding unit.

[0151] According to one or more embodiments of the present disclosure, the symbol processing method also includes: before executing the step of determining a set of candidate symbols from a preset dictionary, determining whether the first target coding unit is a first coding unit; if the first target coding unit is not the first coding unit, executing the step of determining a set of candidate symbols from a preset dictionary; if the first target coding unit is the first coding unit, determining that the starting symbol of the character string to be recognized is not the target symbol.

[0152] According to one or more embodiments of the present disclosure, the first encoding unit is a target encoding unit used only for a single-character symbol, and the single-character symbol consists of one target encoding unit; the determining whether the first target encoding unit is the first encoding unit includes: determining whether the first target encoding unit is the first encoding unit based on a preset first encoding unit set; wherein the first encoding unit set includes at least one of the first encoding units.

[0153] According to one or more embodiments of the present disclosure, the target encoding unit includes a Unicode scalar or a character.

[0154] According to one or more embodiments of the present disclosure, the preset dictionary is generated by the following steps: obtaining mapping relationship information between symbols and target coding units; based on the mapping relationship information, generating a dictionary corresponding to the type according to the type of each symbol.

[0155] According to one or more embodiments of the present disclosure, a symbol processing device is provided, comprising: a character acquisition unit to be recognized, used to acquire a character string to be recognized, the character string to be recognized corresponds to at least one target encoding unit; a character determination unit to be recognized, used to determine the first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized; a candidate symbol determination unit, used to determine a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target encoding unit corresponding to the candidate symbol is the same as the first target encoding unit corresponding to the character string to be recognized, and the number of target encoding units corresponding to the candidate symbol is not greater than the number of target encoding units corresponding to the character string to be recognized; a matching unit, used to match the candidate symbols in the candidate symbol set with the character string to be recognized, and determine the target symbol from the character string to be recognized based on the matching result. According to one or more embodiments of the present disclosure, an electronic device is provided, comprising: at least one memory and at least one processor; wherein the memory is used to store program code, and the processor is used to call the program code stored in the memory to enable the electronic device to perform the symbol processing method provided according to one or more embodiments of the present disclosure.

[0156] According to one or more embodiments of the present disclosure, a non-transitory computer storage medium is provided, wherein the non-transitory computer storage medium stores a program code, and when the program code is executed by a computer device, the computer device executes a symbol processing method provided according to one or more embodiments of the present disclosure.

[0157] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0158] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0159] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A symbol processing method, characterized in that: include: Obtaining a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit; Determine a first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized; Determine a candidate symbol set from a preset dictionary, the candidate symbol set including at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized; Matching candidate symbols in the candidate symbol set with the character string to be recognized, and determining a target symbol from the character string to be recognized based on the matching result; Wherein, the target symbol is a combination symbol, and one combination symbol includes at least two target encoding units; the combination symbol includes a combination emoticon.

2. The symbol processing method according to claim 1, characterized in that: The preset dictionary is specifically used to record symbols of the same type as the target symbol.

3. The symbol processing method according to claim 1, characterized in that: Determining a target symbol from the character string to be recognized includes: The target symbol is separated from the character string to be recognized.

4. The symbol processing method according to claim 1, characterized in that: Before determining the candidate symbol set from the preset dictionary, it also includes: It is determined that the target encoding unit corresponding to the character string to be recognized includes at least one emoticon.

5. The symbol processing method according to claim 1, characterized in that: The matching of the candidate symbols in the candidate symbol set with the character string to be recognized includes: The candidate symbols in the candidate symbol set are matched with the character string to be recognized in sequence based on the number of corresponding target coding units from large to small.

6. The symbol processing method according to claim 1, characterized in that: The matching of the candidate symbols in the candidate symbol set with the character string to be recognized comprises the following matching steps: Determine the target code number value M corresponding to the candidate symbol with the Nth largest number of target code units in the candidate symbol set, and intercept the first M target code units from the character string to be recognized as the first character string to be recognized to match with the candidate symbols in the candidate symbol set; wherein the initial value of N is 1; If there is a first candidate symbol in the candidate symbol set that is the same as the first character string to be recognized, taking the first candidate symbol as the matching result; If there is no first candidate symbol identical to the first character string to be recognized in the candidate symbol set, the value of N is increased by 1 and the matching step is repeated.

7. The symbol processing method according to claim 1, characterized in that: The keyword of the preset dictionary is a target coding unit, and the value corresponding to the keyword is at least one symbol with the keyword as the first target coding unit.

8. The symbol processing method according to claim 1, characterized in that: Also includes: Before executing the step of determining the candidate symbol set from the preset dictionary, determining whether the first target encoding unit is a first encoding unit; If the first target encoding unit is not the first encoding unit, executing the step of determining a candidate symbol set from a preset dictionary; If the first target encoding unit is the first encoding unit, it is determined that the starting symbol of the character string to be recognized is not the target symbol.

9. The symbol processing method according to claim 8, characterized in that: The first encoding unit is a target encoding unit used only for a single-character symbol, and the single-character symbol consists of one target encoding unit; The determining whether the first target coding unit is the first coding unit includes: determining whether the first target coding unit is the first coding unit based on a preset first coding unit set; wherein the first coding unit set includes at least one first coding unit.

10. The symbol processing method according to claim 1, characterized in that: The target code unit includes a Unicode scalar or character.

11. The symbol processing method according to claim 1, characterized in that: The preset dictionary is generated by the following steps: Obtaining information on the mapping relationship between the included symbol and the target coding unit; Based on the mapping relationship information and according to the type of each symbol, a dictionary corresponding to the type is generated.

12. A symbol processing device, characterized in that: include: A character acquisition unit to be recognized, used to acquire a character string to be recognized, wherein the character string to be recognized corresponds to at least one target encoding unit; A character-to-be-recognized determining unit, used to determine a first target encoding unit corresponding to the character string to be recognized and the number of target encoding units corresponding to the character string to be recognized; A candidate symbol determination unit, configured to determine a candidate symbol set from a preset dictionary, wherein the candidate symbol set includes at least one candidate symbol; wherein the first target coding unit corresponding to the candidate symbol is the same as the first target coding unit corresponding to the character string to be recognized, and the number of target coding units corresponding to the candidate symbol is not greater than the number of target coding units corresponding to the character string to be recognized; a matching unit, configured to match the candidate symbols in the candidate symbol set with the character string to be recognized, and determine a target symbol from the character string to be recognized based on the matching result; Wherein, the target symbol is a combination symbol, and one combination symbol includes at least two target encoding units; the combination symbol includes a combination emoticon.

13. An electronic device, characterized in that: include: at least one memory and at least one processor; The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to enable the electronic device to execute any one of the methods described in claims 1 to 11.

14. A non-transitory computer storage medium, characterized in that The non-transitory computer storage medium stores program codes, and when the program codes are executed by a computer device, the computer device executes the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Character string detection method and device, computer equipment and storage medium

    CN112395877A