Dongba character processing method, device and equipment and storage medium

By constructing a grapheme density and grapheme tree among Dongba graphemes, the problem of poor translation of Dongba characters was solved, and clear expression and accurate translation of Dongba scriptures were achieved.

CN122290144APending Publication Date: 2026-06-26SUZHOU VOCATIONAL UNIVERSITY (SUZHOU OPEN UNIVERSITY)
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SUZHOU VOCATIONAL UNIVERSITY (SUZHOU OPEN UNIVERSITY)
Filing Date
2026-03-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing technologies are insufficient for effectively analyzing and translating Dongba script, resulting in poor translation results for Dongba scriptures.

Method used

By constructing the primitive density between Dongba primitives, a primitive tree is generated, and the serialized representation results are used for model training to improve translation performance.

Benefits of technology

It improved the accuracy and efficiency of Dongba script translation, and achieved a clear expression of Dongba scriptures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290144A_ABST
    Figure CN122290144A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, device, and storage medium for processing Dongba characters, relating to the field of character recognition technology. The method includes: determining the pixel density between Dongba pixels of a Dongba character to be processed; the pixel density characterizes the distance relationship between any two Dongba pixels; merging related Dongba pixels based on the pixel density, and constructing a pixel tree using corresponding pixel combinations; generating a serialized representation of the Dongba character to be processed based on the pixel tree, training a model using the serialized representation, and then performing Dongba character translation using the trained model. As can be seen, this application considers the Dongba pixels of a Dongba character and the distance relationships between pixels, constructing the Dongba character into a pixel tree with a clear structure and semantic expression; subsequently, using the pixel tree to achieve the serialized representation of the Dongba character can improve the model training effect and further improve the Dongba character translation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of character recognition technology, and in particular to a method, apparatus, device, and storage medium for processing Dongba characters. Background Technology

[0002] Dongba script is a pictographic writing system. Its pictographic nature allows Dongba priests to express rich meanings with only a few characters. This expressive method makes Dongba scriptures look like both words and pictures, but it also presents an obstacle for ordinary people to learn and study Dongba script. As a writing system, Dongba script, like Chinese characters, contains strokes, constituent elements, and structures. However, unlike Chinese characters, the combination of Dongba pictographic elements is not strictly regulated and is more arbitrary. Directly applying the structural analysis and radical extraction methods used for Chinese characters to process Dongba script does not yield good results in translating Dongba scriptures.

[0003] Therefore, how to effectively analyze and process Dongba characters and improve the translation effect of Dongba scriptures is a problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method, apparatus, device, and storage medium for processing Dongba characters. Considering the Dongba primitives of Dongba characters and the distance relationships between them, the Dongba characters are constructed into a corresponding primitive tree with a clear structure and semantic expression. Then, the serialization representation of Dongba characters is achieved using the primitive tree, which can improve the model training effect and further improve the translation effect of Dongba characters. The specific solution is as follows: Firstly, this application provides a method for processing Dongba characters, including: Determine the element density between each Dongba element of the Dongba character to be processed; the element density characterizes the distance relationship between any two Dongba elements. Based on the density of the primitives, the relevant Dongba primitives are merged, and a primitive tree is constructed using the corresponding primitive combinations. The serialized representation of the Dongba character to be processed is generated based on the primitive tree, and the serialized representation is used to train the model. Then, the trained model is used to perform the Dongba character translation operation.

[0005] Optionally, determining the element density between the Dongba elements of the Dongba script to be processed includes: The overlap ratio is calculated by calculating the overlap relationship between the bounding rectangles corresponding to any two Dongba graphic elements to be processed, and the angle between the line connecting the center of gravity of the two Dongba graphic elements and the preset coordinate axis is calculated to obtain the angle between the center of gravity. The spatial relationship between the two Dongba primitives is determined based on the overlap ratio and the centroid angle. Based on the spatial relationship of the primitives, the primitive density between the two Dongba primitives is generated.

[0006] Optionally, determining the spatial relationship between the two Dongba primitives based on the overlap ratio and the centroid angle includes: If the overlap ratio represents complete overlap, then the two Dongba elements are determined to be in an enclosing relationship. If the overlap ratio indicates that the two Dongba elements are not completely overlapping and is greater than the first preset ratio, then the two Dongba elements are determined to be superimposed. If the overlap ratio is not greater than the first preset ratio, and the angle between the centers of gravity is within the first preset angle range, then the two Dongba symbols are determined to be in a left-right relationship; the first preset angle range represents the range from the first preset angle threshold to the second preset angle threshold; the second preset angle threshold is the difference between the right angle and the first preset angle threshold. If the overlap ratio is not greater than the first preset ratio, and the angle between the centers of gravity is within the second preset angle range or the third preset angle range, then the two Dongba symbols are determined to be in an up-down relationship; the second preset angle range represents the angle from the second preset angle threshold to a right angle, and the third preset angle range represents the angle from zero to the first preset angle threshold.

[0007] Optionally, generating the corresponding element density between the two Dongba elements based on the element spatial relationship includes: The Euclidean distance between the centroids of the two Dongba primitives is calculated to obtain the primitive position distance between the two Dongba primitives. If the angle between the centers of gravity is greater than the second preset angle threshold, then the difference between the right angle and the angle between the centers of gravity is determined as the angular distance between the two Dongba symbols; otherwise, the angle between the centers of gravity is determined as the angular distance between the two Dongba symbols. The spatial relationship between the graphic elements is calculated by weighting the positional distance and angular distance between the graphic elements using a preset weighting coefficient. This yields the graphic element density between the two Dongba graphic elements.

[0008] Optionally, the step of using preset weighting coefficients corresponding to the spatial relationship between the primitives to perform a weighted calculation on the positional distance and angular distance between the primitives to obtain the primitive density between the two Dongba primitives includes: If the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in an enclosing or overlapping relationship, then the first preset weighting coefficient is used to perform a weighted calculation on the positional distance of the graphic elements and the angular distance of the graphic elements to obtain the graphic element density between the two Dongba graphic elements; If the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in a left-right or up-down relationship, then the second preset weighting coefficient is used to perform a weighted calculation on the positional distance of the graphic elements and the angular distance of the graphic elements to obtain the graphic element density between the two Dongba graphic elements.

[0009] Optionally, generating the serialized representation result corresponding to the Dongba character to be processed based on the primitive tree includes: A preorder traversal of the primitive tree is performed to obtain a first serialized representation result; the first serialized representation result includes Dongba primitives and corresponding primitive spatial relationships in sequence. Alternatively, a post-order traversal of the primitive tree can be performed to obtain a second serialized representation result; the second serialized representation result includes, in sequence, primitive spatial relationships and corresponding Dongba primitives.

[0010] Optionally, the step of merging related Dongba primitives based on the primitive density and constructing a primitive tree using the corresponding primitive combinations includes: The Dongba characters to be processed are sorted according to the order of their density from smallest to largest, and two characters to be merged are determined from the sorted queue in order. The two elements to be merged are merged, and the Dongba elements corresponding to the Dongba characters to be processed are reordered. The next two elements to be merged are determined, until all Dongba elements of the Dongba characters to be processed are merged. Based on the last-in-first-out principle, a primitive tree is constructed by combining primitives obtained from each merging operation.

[0011] Secondly, this application provides a Dongba character processing device, comprising: The primitive density determination module is used to determine the primitive density between each Dongba primitive of the Dongba character to be processed; the primitive density represents the distance relationship between any two Dongba primitives. The primitive tree construction module is used to merge related Dongba primitives based on the primitive density and construct a primitive tree using the corresponding primitive combinations. The serialization representation module is used to generate the serialization representation result corresponding to the Dongba character to be processed based on the primitive tree; The Dongba script translation operation execution module is used to train the model using the serialized representation results, and then use the trained model to perform Dongba script translation operations.

[0012] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the Dongba character processing method as described above.

[0013] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the Dongba character processing method described above.

[0014] Therefore, this application first determines the primitive density between the Dongba primitives of the Dongba character to be processed; the primitive density represents the distance relationship between any two Dongba primitives; then, based on the primitive density, a merging operation is performed on the relevant Dongba primitives, and a primitive tree is constructed using the corresponding primitive combinations; then, a serialized representation result corresponding to the Dongba character to be processed is generated according to the primitive tree, and the serialized representation result is used for model training, and then the trained model is used to perform Dongba character translation operations. In this way, this application considers the Dongba primitives of the Dongba character and the distance relationship between the primitives, constructing the Dongba character into a corresponding primitive tree with a clear structure and semantic expression; then, the serialized representation of the Dongba character is realized with the help of the primitive tree, and the serialized representation result can improve the model training effect, and further improve the Dongba character translation effect. Attached Figure Description

[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0016] Figure 1 This is a flowchart of a method for processing Dongba characters disclosed in this application; Figure 2 This is a schematic diagram of the spatial relationship of primitives disclosed in this application; Figure 3 This is a schematic diagram of a binary tree node disclosed in this application; Figure 4 This application discloses a specific flowchart of a method for processing Dongba characters. Figure 5 This is a schematic diagram of the structure of a Dongba character processing device disclosed in this application; Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] See Figure 1 As shown, this embodiment of the invention discloses a method for processing Dongba characters, including: Step S11: Determine the element density between each Dongba element of the Dongba character to be processed; the element density represents the distance relationship between any two Dongba elements.

[0019] In this application, to construct the Dongba character tree, it is necessary to first determine the density between Dongba characters; specifically, based on the distance relationship between the Dongba characters corresponding to them, the density between each Dongba character is calculated.

[0020] It should be noted that Dongba script has the organizational form of general writing, but its structure is relatively loose. For example, "sunset" can be written as: , or If the structural definition is too strict, it will be detrimental to the analysis of Dongba variant characters. Therefore, this embodiment only defines four types of internal structures for Dongba characters: 1) top-bottom structure; 2) left-right structure; 3) superimposed structure; and 4) enclosing structure. In a specific embodiment, determining the element density between each Dongba element of the Dongba character to be processed may include: calculating the overlap ratio of the bounding rectangles corresponding to any two Dongba elements of the Dongba character to be processed, and calculating the angle between the centroid of the two Dongba elements and a preset coordinate axis; determining the element spatial relationship between the two Dongba elements based on the overlap ratio and the centroid angle; and generating the corresponding element density between the two Dongba elements based on the element spatial relationship. Specifically, in calculating the density between Dongba graphic elements, it is necessary to clarify the spatial relationship between two Dongba graphic elements. The spatial relationship is determined by the superposition ratio between the bounding rectangles of the graphic elements and the angle between the line connecting the centroids of the graphic elements and the preset x-axis. Then, combining the superposition ratio and the centroid angle, the spatial relationship between the two Dongba graphic elements can be determined. Furthermore, based on the spatial relationship and the distance between the two Dongba graphic elements, the density of the graphic elements can be generated.

[0021] In one specific embodiment, determining the spatial relationship between the two Dongba graphic elements based on the overlap ratio and the angle between their centers of gravity can include: if the overlap ratio indicates complete overlap, then the two Dongba graphic elements are determined to be in an enclosing relationship; if the overlap ratio indicates non-complete overlap and is greater than a first preset ratio, then the two Dongba graphic elements are determined to be in a superimposed relationship; if the overlap ratio is not greater than the first preset ratio and the angle between their centers of gravity is within a first preset angle range, then the two Dongba graphic elements are determined to be in a left-right relationship; the first preset angle range indicates a range from a first preset angle threshold to a second preset angle threshold; the second preset angle threshold is the difference between a right angle and the first preset angle threshold; if the overlap ratio is not greater than the first preset ratio and the angle between their centers of gravity is within a second preset angle range or a third preset angle range, then the two Dongba graphic elements are determined to be in an up-down relationship; the second preset angle range indicates a range from the second preset angle threshold to a right angle, and the third preset angle range indicates a range from zero to the first preset angle threshold. Understandably, due to the relatively loose structure of Dongba characters, an angle threshold can be introduced to expand the effective range of vertical or horizontal relationships when determining the spatial relationships of Dongba graphic elements. This also clarifies the division of areas for overlapping and enclosing relationships. For example... Figure 2 The diagram shows the different spatial relationships of the graphic elements.

[0022] In another specific embodiment, generating the corresponding element density between the two Dongba elements based on the element spatial relationship may include: calculating the Euclidean distance between the centroids of the two Dongba elements to obtain the element position distance between the two Dongba elements; if the centroid angle is greater than a second preset angle threshold, then the difference between the right angle and the centroid angle is determined as the element angular distance between the two Dongba elements; otherwise, the centroid angle is determined as the element angular distance between the two Dongba elements; using a preset weighting coefficient corresponding to the element spatial relationship to perform a weighted calculation on the element position distance and the element angular distance to obtain the element density between the two Dongba elements. Specifically, in the process of generating element density, the position distance and angular distance of the two Dongba elements are considered; wherein, the element position distance refers to the Euclidean distance between the centroids of the two Dongba elements, which is calculated to obtain the element position distance; the corresponding angular distance is calculated based on the centroid angle, and when the positions of the two elements tend to be horizontal or vertical, the angular distance decreases; conversely, it increases.

[0023] Furthermore, the density of the two Dongba graphic elements is obtained by weighting the positional distance and angular distance of the graphic elements using a preset weighting coefficient corresponding to the spatial relationship of the graphic elements. This can include: if the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in an enclosing or overlapping relationship, then a first preset weighting coefficient is used to weight the positional distance and angular distance of the graphic elements to obtain the density of the two Dongba graphic elements; if the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in a left-right or up-down relationship, then a second preset weighting coefficient is used to weight the positional distance and angular distance of the graphic elements to obtain the density of the two Dongba graphic elements. It is understood that when the spatial relationship of the graphic elements is an overlapping or enclosing relationship, the angular distance of the graphic elements has a relatively small impact on the density of the graphic elements, while when the relationship is up-down or left-right, both the positional distance and the angular distance of the graphic elements will affect the determination of the density of the graphic elements.

[0024] Step S12: Merge the relevant Dongba primitives based on the primitive density, and construct a primitive tree using the corresponding primitive combinations.

[0025] In this application, the above steps generate the element density of each Dongba element in the Dongba character to be processed based on the distance relationship between Dongba elements. Then, based on the element density, related Dongba elements can be merged, and a element tree can be constructed by combining the corresponding element combinations. It should be noted that the construction of the Dongba element tree mainly consists of two stages: the first stage is to construct an element structure stack based on element relationships; the second stage is to construct the Dongba element tree based on the element structure stack. Specifically, in the first stage, the element density in the Dongba character is first calculated, and element merging is performed based on the element density. The merging information, i.e., element combinations, is stored in a stack. Then, the nodes of the tree are expanded based on the element combinations stored in the structure stack to obtain the complete element tree.

[0026] In one specific embodiment, merging related Dongba symbols based on their density and constructing a symbol tree using corresponding symbol combinations can include: sorting the Dongba symbols corresponding to the Dongba character to be processed in ascending order of density, and determining two symbols to be merged from the sorted queue in sequence; merging the two symbols to be merged, re-sorting the Dongba symbols corresponding to the Dongba character to be processed, and determining the next two symbols to be merged, until all Dongba symbols of the Dongba character to be processed have been merged; and constructing a symbol tree using the symbol combinations obtained from each merging operation based on the last-in-first-out principle. Specifically, the process of merging symbols involves pushing the number and structural information (top-bottom, left-right, overlapping, surrounding) of the pair of symbols with the lowest density onto a stack, merging them into a symbol combination; then, using the symbol combination as a new symbol, repeatedly determining the pair of symbols (combinations) with the lowest density and pushing them onto the stack, until all symbols have been merged. At this point, the primitive numbers and structural information stored in the stack become the node information for the subsequent primitive tree. Information is popped from the stack one by one from top to bottom, and the primitive tree's nodes are expanded layer by layer based on the popped information until all information is popped, resulting in a complete primitive tree. It can be understood that the leaf nodes of the primitive tree store primitives and are called primitive nodes; all parent nodes store primitive structures and are called structure nodes. Specifically, as shown... Figure 3 As shown.

[0027] Step S13: Generate the serialized representation result corresponding to the Dongba character to be processed based on the primitive tree, and use the serialized representation result to train the model, and then use the trained model to perform the Dongba character translation operation.

[0028] In this application, the above steps can be used to construct a graph tree corresponding to Dongba characters; then, the serialized representation of the corresponding Dongba characters can be generated based on the graph tree; that is, when it is necessary to analyze the constituent elements of Dongba characters, a pictographic character can be converted into a sequence by traversing the graph tree, which facilitates the subsequent translation of Dongba scriptures using the serialized Dongba characters.

[0029] In a specific embodiment, generating the serialized representation result corresponding to the Dongba character to be processed based on the primitive tree may include: performing a preorder traversal of the primitive tree to obtain a first serialized representation result; the first serialized representation result includes Dongba primitives and corresponding primitive spatial relationships in sequence; or, performing a postorder traversal of the primitive tree to obtain a second serialized representation result; the second serialized representation result includes primitive spatial relationships and corresponding Dongba primitives in sequence. It is understood that by representing Dongba characters through a preorder traversal of the primitive tree, the primitives constituting the Dongba characters will be located at the beginning of the sequence, while the structure will be located at the end; however, when it is necessary to analyze the structural features of Dongba characters, a postorder traversal can be used to represent them, placing the structural features at the beginning and the primitives at the end.

[0030] Therefore, this application considers the Dongba primitives of Dongba characters and the distance relationships between primitives, and constructs Dongba characters into a corresponding primitive tree with clear structure and semantic expression; then, the primitive tree is used to realize the serialization representation of Dongba characters. The serialization representation result can improve the training effect of Dongba character translation model, and further improve the translation effect of Dongba characters.

[0031] like Figure 4 As shown, this embodiment discloses a method for processing Dongba characters, and will describe in detail the construction process of the primitive tree, specifically including: The construction of the Dongba primitive tree is mainly divided into two stages: the first stage is to build a primitive structure stack based on primitive relationships; the second stage is to build the Dongba primitive tree based on the primitive structure stack.

[0032] In the first stage, the spatial relationships and density of the graphic elements in the Dongba script are calculated. The number and structural information of the pair of graphic elements with the lowest density are pushed onto a stack and merged into a graphic element combination. Then, the graphic element combination is treated as a new graphic element, and the graphic element merging operation is repeated until all graphic elements are merged. Specifically, the spatial relationships of graphic elements can be determined based on the stacking ratio between the bounding rectangles of the graphic elements and the angle between the line connecting the centroids of the graphic elements and the x-axis. Therefore, for the m graphic elements Ri that make up the Dongba script, if their centroids are... The circumscribed rectangle is First, calculate the overlap ratio of the bounding rectangles of the two primitives. for: ; in, and Let Ri and Rj be the areas of the bounding rectangles of primitives Ri and Rj, respectively. Let Ri be the overlapping area of ​​the bounding rectangles of primitives Ri and Rj. The specific calculation formula is as follows: ; ; Next, calculate the angle between the line connecting the centroids of the elements and the x-axis. Create points. And draw the horizontal vector through the centroid Ci. The angle between the line connecting the centroids of the primitives and the x-axis is... for: .

[0033] It should be noted that, due to the relatively loose structure of Dongba characters, a threshold was introduced when determining the spatial relationships of Dongba graphic elements. This expands the effective range of top-bottom or left-right relationships, and also provides the division areas for overlapping and enclosing relationships. Therefore, the criteria for determining spatial relationships between primitives are: ; Among these methods, by statistically analyzing the top-bottom and left-right structural relationships of a large number of Dongba characters, we can obtain... This allows for the effective identification of primitives with similar shapes.

[0034] The density of primitives is further calculated, specifically based on their positional and angular distances. The positional distance refers to the Euclidean distance between the centroids of primitives. And primitive angular distance The angular distance is related to the position of the graphic element. When the position of the graphic element tends to be horizontal or vertical, the angular distance decreases; conversely, it increases. Therefore, the angular distance of the graphic element is: ; Additionally, when the spatial relationship between primitives is one of overlap or enclosure, It has little impact on the density of graphic elements, but when the relationship is vertical or horizontal, and Both factors affect the determination of primitive density; therefore, the density of primitives Ri and Rj is calculated. for: ; It is important to note that the smaller the value of close(), the closer the relationship between primitives Ci and Cj, and vice versa.

[0035] In the first stage of processing, the number and structural information of the pair of primitives with the lowest primitive density are pushed onto the stack and merged into a primitive combination. Then, the primitive combination is treated as a new primitive, and the primitive merging operation is repeated until all primitives are merged. This merging and stacking process is bottom-up, merging primitives layer by layer until a complete Dongba script is obtained. Figure 4As shown, in the primitive structure stack, negative values ​​can be used to mark the primitive numbers that have been merged or participated in the merging, and the number of the left node of the primitive tree is used as the number of the new primitive after merging. Additionally, when the new primitive contains multiple sub-primitives, they are listed using parentheses (e.g., 6(6,3) indicates that the node is a primitive combination, including two primitives with primitive numbers 6 and 3 respectively, and the number 6 of the left node is used as the new number of this primitive combination). After the first stage is completed, the structural node at the top of the primitive structure stack is the root node of the Dongba primitive tree, representing the main structure of the Dongba characters.

[0036] Furthermore, the second stage involves popping information from the primitive structure stack one by one from top to bottom. Based on the popped information, the Dongba primitive tree decomposes the primitive combinations in the Dongba characters layer by layer, starting from the root node, expanding the structural nodes and primitive nodes of the primitive tree until all information is popped, resulting in a complete primitive tree. During the primitive tree expansion process, the higher the level of the structural node, the closer it is to the main structure of the Dongba character, and the more important it is; conversely, the higher the level of the primitive node, the larger its proportion in the Dongba character, and the stronger its semantic expression.

[0037] Since Dongba character primitives are all binary trees, when analyzing the constituent elements of Dongba characters, a preorder traversal of the binary tree can be used to represent the characters, placing the primitives at the beginning of the sequence and the structure at the end. Conversely, when analyzing the structural features of Dongba characters, a postorder traversal can be used, placing the structural features at the beginning and the primitives at the end. Figure 3 In Dayan Town, Lijiang ( Taking the primitive tree of ")" as an example, the serialized representation of the character obtained by preorder traversal and postorder traversal is as follows: Preorder traversal: ['shangxia', 'shangxia', 'zuoyou', 1, 3, 'overLay', 4, 2, 0]; Post-order traversal: [1, 3, 'zuoyou', 4, 2, 'overLay', 'shangxia', 0, 'shangxia']; In this system, each number represents the sequence number of a primitive node, while the string represents the name of a structural node, thus converting an abstract pictographic script into a sequence. This sequence-based representation of Dongba characters facilitates model training and significantly improves the translation of Dongba characters.

[0038] Therefore, this application considers the Dongba primitives of Dongba characters and the distance relationships between primitives, constructing Dongba characters into a corresponding primitive tree with a clear structure and semantic expression; by analyzing the constituent elements and structural features of Dongba characters, it provides a Dongba pictographic character representation method based on primitive trees, which can represent Dongba characters in a sequential manner; the sequential representation of Dongba characters facilitates Dongba character-related research and can improve the training effect of Dongba character recognition models or translation models.

[0039] like Figure 5 As shown, this embodiment discloses a Dongba character processing device, including: The primitive density determination module 11 is used to determine the primitive density between each Dongba primitive of the Dongba character to be processed; the primitive density represents the distance relationship between any two Dongba primitives. The primitive tree construction module 12 is used to merge related Dongba primitives based on the primitive density and construct a primitive tree using the corresponding primitive combination. Serialization representation module 13 is used to generate the serialization representation result corresponding to the Dongba character to be processed based on the primitive tree; The Dongba character translation operation execution module 14 is used to train the model using the serialized representation result, and then use the trained model to perform the Dongba character translation operation.

[0040] As can be seen, this application considers the Dongba primitives of Dongba characters and the distance relationships between primitives, and constructs Dongba characters into a corresponding primitive tree with a clear structure and semantic expression; then, the primitive tree is used to realize the serialization representation of Dongba characters, and the serialization representation result can improve the model training effect, and further improve the translation effect of Dongba characters.

[0041] In one specific embodiment, the primitive density determination module 11 may include: The overlap ratio calculation unit is used to calculate the overlap ratio by calculating the overlap relationship between the bounding rectangles corresponding to any two Dongba characters to be processed. The centroid angle calculation unit is used to calculate the centroid angle by the angle between the line connecting the centroids of the two Dongba primitives and the preset coordinate axis. The primitive spatial relationship determination submodule is used to determine the primitive spatial relationship between the two Dongba primitives based on the overlap ratio and the centroid angle. The primitive density generation submodule is used to generate the primitive density between the two Dongba primitives based on the primitive spatial relationship.

[0042] In another specific embodiment, the primitive spatial relationship determination submodule may include: The enclosure relationship determination unit is used to determine that the two Dongba primitives are in an enclosure relationship when the overlap ratio representations completely overlap. The superposition relationship determination unit is used to determine that the two Dongba elements are superimposed when the overlap ratio represents non-complete overlap and is greater than a first preset ratio. The left-right relationship determination unit is used to determine that the two Dongba graphic elements are in a left-right relationship when the overlap ratio is not greater than the first preset ratio and the angle between the centers of gravity is within the first preset angle range; the first preset angle range represents the range from the first preset angle threshold to the second preset angle threshold; the second preset angle threshold is the difference between the right angle and the first preset angle threshold. The top-bottom relationship determination unit is used to determine that the two Dongba graphic elements are in a top-bottom relationship when the overlap ratio is not greater than the first preset ratio and the angle between the centers of gravity is within the second preset angle range or the third preset angle range; the second preset angle range represents the angle from the second preset angle threshold to a right angle, and the third preset angle range represents the angle from zero to the first preset angle threshold.

[0043] In yet another specific embodiment, the primitive density generation submodule includes: The primitive position distance calculation unit is used to calculate the Euclidean distance between the centroids of the two Dongba primitives to obtain the primitive position distance between the two Dongba primitives. The element angle distance calculation unit is used to determine the difference between the right angle and the centroid angle as the element angle distance between the two Dongba elements when the centroid angle is greater than the second preset angle threshold; otherwise, the centroid angle is determined as the element angle distance between the two Dongba elements. The primitive density generation unit is used to perform weighted calculations on the positional distance and angular distance of the primitives using preset weight coefficients corresponding to the spatial relationship of the primitives, so as to obtain the primitive density between the two Dongba primitives.

[0044] In one specific embodiment, the element density generation unit is specifically used to: if the element spatial relationship indicates that the two Dongba elements are in an enclosing or overlapping relationship, then a first preset weighting coefficient is used to perform a weighted calculation on the element position distance and the element angle distance to obtain the element density between the two Dongba elements; if the element spatial relationship indicates that the two Dongba elements are in a left-right or up-down relationship, then a second preset weighting coefficient is used to perform a weighted calculation on the element position distance and the element angle distance to obtain the element density between the two Dongba elements.

[0045] In one specific embodiment, the serialization representation module 13 may include: The first serialization representation unit is used to perform a preorder traversal of the primitive tree to obtain a first serialization representation result; the first serialization representation result includes Dongba primitives and corresponding primitive spatial relationships in sequence. The second serialization representation unit is used to perform a post-order traversal of the primitive tree to obtain a second serialization representation result; the second serialization representation result includes, in sequence, primitive spatial relationships and corresponding Dongba primitives.

[0046] In one specific embodiment, the primitive tree construction module 12 may include: The unit for determining the graphic elements to be merged is used to sort the Dongba graphic elements corresponding to the Dongba characters to be processed in order of increasing density of the graphic elements, and to determine two graphic elements to be merged from the sorted queue in order. The graphic element merging unit is used to merge two graphic elements to be merged, reorder the Dongba graphic elements corresponding to the Dongba characters to be processed, and determine the next two graphic elements to be merged, until all Dongba graphic elements of the Dongba characters to be processed have been merged. The primitive tree construction unit is used to construct a primitive tree based on the principle of last-in-first-out by combining primitives obtained from each merging operation.

[0047] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0048] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the Dongba character processing method disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0049] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0050] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0051] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the Dongba character processing method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0052] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned Dongba character processing method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0053] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0054] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0055] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0056] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0057] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only intended to help understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for processing Dongba characters, characterized in that, include: Determine the element density between each Dongba element of the Dongba character to be processed; the element density characterizes the distance relationship between any two Dongba elements. Based on the density of the primitives, the relevant Dongba primitives are merged, and a primitive tree is constructed using the corresponding primitive combinations. The serialized representation of the Dongba character to be processed is generated based on the primitive tree, and the serialized representation is used to train the model. Then, the trained model is used to perform the Dongba character translation operation.

2. The Dongba script processing method according to claim 1, characterized in that, The determination of the graphic element density between the Dongba graphic elements of the Dongba characters to be processed includes: The overlap ratio is calculated by calculating the overlap relationship between the bounding rectangles corresponding to any two Dongba graphic elements to be processed, and the angle between the line connecting the center of gravity of the two Dongba graphic elements and the preset coordinate axis is calculated to obtain the angle between the center of gravity. The spatial relationship between the two Dongba primitives is determined based on the overlap ratio and the centroid angle. Based on the spatial relationship of the primitives, the primitive density between the two Dongba primitives is generated.

3. The Dongba script processing method according to claim 2, characterized in that, Determining the spatial relationship between the two Dongba primitives based on the overlap ratio and the centroid angle includes: If the overlap ratio represents complete overlap, then the two Dongba elements are determined to be in an enclosing relationship. If the overlap ratio indicates that the two Dongba elements are not completely overlapping and is greater than the first preset ratio, then the two Dongba elements are determined to be superimposed. If the overlap ratio is not greater than the first preset ratio, and the angle between the centers of gravity is within the first preset angle range, then the two Dongba symbols are determined to be in a left-right relationship; the first preset angle range represents the range from the first preset angle threshold to the second preset angle threshold; the second preset angle threshold is the difference between the right angle and the first preset angle threshold. If the overlap ratio is not greater than the first preset ratio, and the angle between the centers of gravity is within the second preset angle range or the third preset angle range, then the two Dongba symbols are determined to be in an up-down relationship; the second preset angle range represents the angle from the second preset angle threshold to a right angle, and the third preset angle range represents the angle from zero to the first preset angle threshold.

4. The Dongba script processing method according to claim 3, characterized in that, The step of generating the corresponding element density between the two Dongba elements based on the element spatial relationship includes: The Euclidean distance between the centroids of the two Dongba primitives is calculated to obtain the primitive position distance between the two Dongba primitives. If the angle between the centers of gravity is greater than the second preset angle threshold, then the difference between the right angle and the angle between the centers of gravity is determined as the angular distance between the two Dongba symbols; otherwise, the angle between the centers of gravity is determined as the angular distance between the two Dongba symbols. The spatial relationship between the graphic elements is calculated by weighting the positional distance and angular distance between the graphic elements using a preset weighting coefficient. This yields the graphic element density between the two Dongba graphic elements.

5. The Dongba script processing method according to claim 4, characterized in that, The step of using preset weighting coefficients corresponding to the spatial relationship of the graphic elements to perform a weighted calculation on the positional distance and angular distance of the graphic elements to obtain the graphic element density between the two Dongba graphic elements includes: If the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in an enclosing or overlapping relationship, then the first preset weighting coefficient is used to perform a weighted calculation on the positional distance of the graphic elements and the angular distance of the graphic elements to obtain the graphic element density between the two Dongba graphic elements; If the spatial relationship of the graphic elements indicates that the two Dongba graphic elements are in a left-right or up-down relationship, then the second preset weighting coefficient is used to perform a weighted calculation on the positional distance of the graphic elements and the angular distance of the graphic elements to obtain the graphic element density between the two Dongba graphic elements.

6. The Dongba script processing method according to claim 2, characterized in that, The step of generating the serialized representation of the Dongba characters to be processed based on the primitive tree includes: A preorder traversal of the primitive tree is performed to obtain a first serialized representation result; the first serialized representation result includes Dongba primitives and corresponding primitive spatial relationships in sequence. Alternatively, a post-order traversal of the primitive tree can be performed to obtain a second serialized representation result; the second serialized representation result includes, in sequence, primitive spatial relationships and corresponding Dongba primitives.

7. The Dongba script processing method according to any one of claims 1 to 6, characterized in that, The step of merging related Dongba primitives based on the primitive density and constructing a primitive tree using the corresponding primitive combinations includes: The Dongba characters to be processed are sorted according to the order of their density from smallest to largest, and two characters to be merged are determined from the sorted queue in order. The two elements to be merged are merged, and the Dongba elements corresponding to the Dongba characters to be processed are reordered. The next two elements to be merged are determined, until all Dongba elements of the Dongba characters to be processed are merged. Based on the last-in-first-out principle, a primitive tree is constructed by combining primitives obtained from each merging operation.

8. A Dongba character processing device, characterized in that, include: The primitive density determination module is used to determine the primitive density between each Dongba primitive of the Dongba character to be processed; the primitive density represents the distance relationship between any two Dongba primitives. The primitive tree construction module is used to merge related Dongba primitives based on the primitive density and construct a primitive tree using the corresponding primitive combinations. The serialization representation module is used to generate the serialization representation result corresponding to the Dongba character to be processed based on the primitive tree; The Dongba script translation operation execution module is used to train the model using the serialized representation results, and then use the trained model to perform Dongba script translation operations.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the Dongba character processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the Dongba character processing method as described in any one of claims 1 to 7.