CN107220224A - A kind of literary generation method of square seedling derived based on intelligence - Google Patents
A kind of literary generation method of square seedling derived based on intelligence Download PDFInfo
- Publication number
- CN107220224A CN107220224A CN201710353172.0A CN201710353172A CN107220224A CN 107220224 A CN107220224 A CN 107220224A CN 201710353172 A CN201710353172 A CN 201710353172A CN 107220224 A CN107220224 A CN 107220224A
- Authority
- CN
- China
- Prior art keywords
- component
- msub
- mrow
- bounding box
- seedling
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
- G06F40/129—Handling non-Latin characters, e.g. kana-to-kanji conversion
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Breeding Of Plants And Reproduction By Means Of Culturing (AREA)
Abstract
The present invention relates to a kind of character generating method, more particularly to a kind of literary generation method of square seedling derived based on intelligence;This method comprises the following steps:A:Set up component bounding box and it is normalized;B:Determine bounding box topological transformation coefficient;C:Map function is carried out to component bounding box;D:Set up the code tree of correspondence derivation;E:Set up intelligence and derive model;F:Algorithm generation square seedling text is derived according to intelligence.The neat specification of square seedling word shape generated using the present invention, and space encoder is not take up, it disclosure satisfy that practicality requirement.
Description
Technical field
The present invention relates to a kind of character generating method, more particularly to a kind of literary generation side of square seedling derived based on intelligence
Method.
Background technology
It is typically " word for word " to be encoded and character design, character data is deposited when current operation system handles ideograph
Reserves are huge, and coded character set is also difficult to reduce weight.Square seedling text is the main carriers of Wuling Shan Mountain section Miao nationality culture among the people, is one
The ideograph with fixed structure characteristic is planted, is essentially all combinde rqdical character.Because of its information processing research starting very late,
Unicode and other character set standards not yet distribute code bit for it.In the prior art, a kind of Component- Based Development combinatorial operation expresses
The literary dynamic creation method of the square seedling of formula.This method is by by OpenType font technologies, constructing the literary combinde rqdical character of square seedling
Type matrix, plans font layout table, writes the mapping script that combination is replaced, and can just be not take up the interval situation of Unicode codings
The seedling Chinese character of lower generation different structure.However, this method must be needed based on the character data of the literary combinde rqdical character of square seedling
Type matrix is made to each square seedling text.Display is will be unable to without the corresponding square seedling text of type matrix.
The content of the invention
It is an object of the invention to provide a kind of literary generation method of square seedling derived based on intelligence, character data is solved
Amount of storage is huge, the problem of coded character set is difficult to weight reducing.
The present invention is achieved in that kind of the literary generation method of square seedling based on intelligence derivation comprises the following steps:
A:Set up component bounding box and it is normalized;
B:Determine bounding box topological transformation coefficient;
C:Map function is carried out to component bounding box;
D:Set up the code tree of correspondence derivation;
E:Set up intelligence and derive model;
F:Algorithm generation square seedling text is derived according to intelligence.
The present invention further technical scheme be:The step A is:A seedling Chinese character grid is given, its wide and high score
Wei not W and H;Using the grid upper left corner as origin, the rectangular coordinate system under setting up an X axis right side, Y axially;In this coordinate system
In, component bounding box is one together decided on by the left upper apex coordinate (x, y) and wide (w) of component character picture and high (h)
Individual minimum enclosed rectangle, is represented by a four-tuple B:B=(x, y, w, h).Wherein, x ∈ (0, W), y ∈ (0, H), w ∈ (0,
W-x),h∈(0,H-y);And be by component bounding box normalized:
The present invention further technical scheme be:The step B is:Given bounding box B=(x, y, w, h) and B'=(x',
Y', w', h'), the B topological transformation coefficient formulas (1) for being transformed to B ' are calculated:
The present invention further technical scheme be:In the step C, calculate target member in the location of Miao Wenzhong and
Size, is related to placed in the middle, tiling and aspect ratio adjustment map function;
Between two parties
The width and height of bounding box are constant after adjustment, and only left upper apex coordinate changes.Given bounding box B1=(x1,y1,
w1,h1) and B2=(x2,y2,w2,h2), by B1Along X-direction, Y direction, while being centered to B along X-axis and Y direction2In, three
New bounding box B ' is obtained in the case of kind1=(x ', y ', w1,h1) in x ' and y ' respectively with formula (2), (3), (4) calculate:
Tiling
By above-mentioned bounding box B1Along X-direction, Y direction, while arriving bounding box B along X-axis and Y direction tiling2In, point
New bounding box B'=(x are not obtained2,y1,w2,h1), B'=(x1,y2,w1,h2) and B'=(x2,y2,w2,h2)。
Aspect ratio is adjusted
It is that the bounding box obtained after r is adjusted is B ' by aspect ratio if former component bounding box is B=(x, y, w, h);That
, for left right model component, keep highly constant, be adjusted by formula (5);For upper mo(u)ld bottom half component, keep width constant, press
Formula (6) is adjusted;For outsourcing component or component is included, height and width all change, if h/w≤r, enter by formula (5)
Row adjustment, otherwise, is adjusted by formula (6).
B '=(x, y, h/r, h) (5)
B '=(x, y, w, w.r) (6)
The present invention further technical scheme be:The step D is:Using the recursiveness of binary tree, each node in tree
The solution of data is decomposed in simple subtree and solved, and sets up the code tree of correspondence derivation;Code tree is the symbol of derivation tree
Number change description;In code tree, by the upper left of left right model, upper mo(u)ld bottom half, interior external form, and gusset type bag, lower-left bag and upper right bag this 7
Seedling text structure, is represented with alphabetical " Z ", " S ", " N ", " A ", " B " and " C " respectively;By the Unicode of its standard character of component
Coded representation;The code tree of 2 member type seedlings text is 1 level structure, divides 2 layers;The code tree of 3 member type seedlings text is 2 level structures, divides 3
Layer.
The present invention further technical scheme be:The step E is to derive model by 3 Level building seedling text intelligence;Top
Layer is the submodule for completing code tree disintegration;Intermediate layer is the submodule that structure derivation is carried out for different structure seedling text,
Solution work for completing each node topological transformation coefficient in code tree;Bottom is the submodule that component aspect ratio is adjusted;By
In tiled configuration and up-down structure can be classified as to the class of crossbar structure one, external and internal compositionses and 3 kinds of side wall structures are classified as comprising knot
The class of structure one, therefore intermediate layer derives submodule just for crossbar structure and comprising two structures of structure design.
The present invention further technical scheme be:The step F includes following algorithm:
The algorithm of top layer submodule:
1) the Unicode coded sequences of component and seedling text structure type according to contained by seedling text, set up corresponding seedling text generation
Code tree;
2) pre-reset mechanism of depth-first is carried out to code tree, Miao Wen generation coded sequence is obtained;
3) analysis generation coded sequence, according to flow, calls corresponding structure to derive submodule, derives text of emerging and is included
The transformation parameter of whole components;
4) according to the component transformation parameter of acquisition, original members are converted into the target member in seedling text.Crossbar structure is pushed away
The algorithm of sub-module:
1) according to the standard bounding box of each component, its proportion in the literary structure of whole seedling is determined, and according to it in seedling text
The order occurred in structure, determines its maximum possible bounding box;
2) for tiled configuration, each component is centered to the maximal encasing box of the literary structure of seedling by formula (2) along X-direction
In;For up-down structure, each component is centered in Miao Wen maximal encasing box along Y direction by formula (3);
3) call aspect ratio to adjust the aspect ratio that submodule adjusts each component, obtain bounding box of each component in Miao Wenzhong;
4) conversion coefficient of each component is calculated using formula (1).
The derivation algorithm of submodule is derived comprising structure:
1) take the maximal encasing box of outsourcing component as its Miao Wenzhong actual bounding box;
2) aspect ratio is called to adjust submodule, the standard bounding box for including component is adjusted into it wraps in Miao Wenzhong maximum
Enclose the size of box;
3) bounding box that component is included after adjustment is arrived to the maximum enclosure of outsourcing component along X-axis and Y direction tiling simultaneously
In box, its actual bounding box in Miao Wenzhong is obtained;
4) conversion coefficient of each component is calculated using formula (1).
Aspect ratio adjusts the algorithm of submodule:
1) to the component of crossbar structure, check whether its aspect ratio is located between minimum value and maximum.If so, then protecting
Hold current aspect ratio constant;Otherwise, it is average value by the adjustment aspect ratio of left right model component by formula (5), by formula (6) by upper mo(u)ld bottom half
The aspect ratio of component is adjusted to average value;
2) to the component comprising structure, its aspect ratio and average value are compared.If being equal to, current aspect ratio is kept
It is constant;If being more than, aspect ratio is adjusted to average value by formula (6);If being less than, aspect ratio is adjusted to average by formula (5)
Value.
The beneficial effects of the invention are as follows:Based on intelligently deriving the square seedling text that the target member font data tried to achieve is generated
The neat specification of font, and space encoder is not take up, it disclosure satisfy that practicality requirement;This method has 3 features:One is, based on structure
The thought that part converts to generate square seedling text is the core of the model;Two are, come to realize that component becomes using the recursiveness of binary tree
The solution of parameter is changed, the easy and effective property of the literary generation method of square seedling is not only ensure that, and embodies the intelligence of character derivation
Property;Three are, in the model, and the Various types of data needed for the intelligence of square seedling text generation is derived is stored in independent information bank, is made
The language feature for obtaining square seedling text is able to separate from the programmed logic of word processor, is easy to carry out software function in the future
Adjusting and optimizing and extension.
Brief description of the drawings
Fig. 1 is the literary structural representation of a kind of square seedling that the present invention is provided;
Fig. 2 is a kind of DFA state diagrams for identification square seedling text that the present invention is provided;
Fig. 3 is a kind of component bounding box schematic diagram that the present invention is provided;
Fig. 4 is a kind of structural representation for intelligent derivation system that the present invention is provided;
Fig. 5 is a kind of reasoning flow figure for literary generation method of square seedling derived based on intelligence that the present invention is provided;
Fig. 6 is a kind of square seedling word example C that the present invention is provided6Derivation schematic diagram;
Fig. 7 is a kind of square seedling word example C that the present invention is provided6Derivation result.
Embodiment
Embodiment one:
Fig. 1-Fig. 7 is a kind of schematic diagram of the literary generation method of square seedling derived based on intelligence.Its structure of square seedling text is big
Cause to be divided into 4 classes shown in Fig. 1:Left right model, upper mo(u)ld bottom half, gusset type and interior external form.Wherein, gusset type can be divided into upper left bag, a left side again
Lower 3 kinds of bag and upper right bag.According to the coinage principle and structure word mode of square seedling text, when a seedling text is by 3 and 3 above sections
During composition, certain two therein or 3 parts can generally constitute a simple Chinese character.Now, this simple Chinese character is preferably considered as one
Individual component.The result that the 1129 square seedlings text sorted out is counted is shown, most of seedling text can be considered 2 components
Type, the Miao Wenxu of only indivedual left right models and upper mo(u)ld bottom half is handled as 3 member types.
The component of square seedling text can be classified as 16 classes:Left component (cl), right component (cr), upper member (cu), lower member (cd)、
Upper left outsourcing component (colu), bottom right include component (cird), lower-left outsourcing component (cold), upper right include component (ciru), upper right
Outsourcing component (coru), lower-left include component (cild), full outsourcing component (coa), include component (c entirelyia), right left component (crl)、
Right component (crr), bottom left component (cdl) and bottom right component (cdr).If representing square seedling text, C with SGiRepresent component character
(i=start, end, first, middle, final), then square seedling text composition usable set form be expressed as SG=
{CstartCendOr SG={ CfirstCmiddleCfinal}.Wherein, Cstart={ cl, cu, colu, cold, coru, coa, Cend={ cr,
cd, cird, ciru, cild, cia, Cfirst={ cl, cu, Cmiddle={ crl, cdl, Cfinal={ crr, cdr}。
One square seedling text is made up of 2-3 component.Based on 16 class components, can construct the determination of identification square seedling text has
Finite automaton DFA (Deterministic Finite Automata).The DFA is expressed as M=(K, A, F, S, Z) with five-tuple,
Wherein:
1) K is state finite aggregate, K={ 0,1,2,3,4,5,6,7,8,9 };
2) A is incoming symbol finite aggregate, A={ cl, cu, colu, cold, coru, coa, cr, cd, cird, ciru, cild, cia,
crl, cdl, crr, cdr};
3) F is the mapping ensemblen on K × A → K, F={ f (0, cl)=1, f (0, cu)=2, f (0, colu)=3, f (0, cold)
=4, f (0, coru)=5, f (0, coa)=6, f (1, crl)=7, f (1, cr)=9, f (2, cdl)=8, f (2, cu)=9, f (3,
cird)=9, f (4, ciru)=9, f (5, cild)=9, f (6, cia)=9, f (7, crr)=9, f (8, cdr)=9 };
4) S ∈ K, are initial states, and value is unique, S=0;
5)It is final state collection (final state is also referred to as ending state, acceptable state or recognizable state), Z={ 9 }.
The state diagram that Fig. 2 gives the DFA is represented.From the initial state 0 in Fig. 2, final state 9 is reached (with double circle tables
Show) free routing on component character string synthesize square seedling text.
The character of the Chinese character, Chinese character radicals and the pure symbol that are used as the literary component of square seedling is referred to as original structure herein
Part, composition part when square seedling text is shown is referred to as target member.Target member is obtained by original members through topological transformation.When
When the target complete component that one seedling text is included is obtained by original members conversion, this square seedling text can be directly by this
A little target member combinations are obtained.
Bounding box is a kind of can correctly to reflect the position of complex geometry object and the simple of size property and geometric figure.
In order to simplify component map function, the processing to its bounding box is converted into the processing of the literary component character picture of seedling herein.Therefore,
To emerging, literary component bounding box is defined as follows:
Define 1 and give a square seedling Chinese character grid, it is respectively W and H that it is wide and high.Using the grid upper left corner as origin,
The rectangular coordinate system set up under the X axis right side, a Y-axis.In this coordinate system, component bounding box is by component character picture
The minimum enclosed rectangle (as shown in Figure 2) that left upper apex coordinate (x, y) and wide (w) and high (h) are together decided on, can table
It is shown as a four-tuple B:B=(x, y, w, h).Wherein, x ∈ (0, W), y ∈ (0, H), w ∈ (0, W-x), h ∈ (0, H-y);For
It is easy to analysis, according to topological invariance principle, is by component bounding box normalized:Herein
Bounding box refers both to normalize bounding box.
The generating process of square seedling text can be exchanged into the calculating process of component bounding box.The process is exactly to be determined by calculating
Topological transformation coefficient, the process of target member bounding box is progressively adjusted to by the standard bounding box of original members.
Given bounding box B=(x, y, w, h) and B'=(x', y', w', h'), the B topological transformation coefficients for being transformed to B ' are used
Formula (1) is calculated:
Because the standard bounding box information of original members can be obtained directly from corresponding Hanzi font library, therefore topological transformation coefficient
Determination problem be converted to the Solve problems of target member bounding box.
It is exactly to calculate target member in the location of Miao Wenzhong and size to solve target member bounding box, is related to residence
In, tiling and aspect ratio adjustment etc. map function.
1) it is placed in the middle
Mean the centre position that a bounding box is adjusted to another bounding box along some change in coordinate axis direction between two parties.Adjustment
The width and height of bounding box are constant afterwards, and only left upper apex coordinate changes.Given bounding box B1=(x1,y1,w1,h1) and B2=
(x2,y2,w2,h2), by B1Along X-direction, Y direction, while being centered to B along X axles and Y direction2In, in the case of three kinds
To new bounding box B '1=(x ', y ', w1,h1) in x ' and y ' respectively with formula (2), (3), (4) calculate:
2) tile
Tiling, which is meant, to be extended a bounding box or is compressed in another bounding box along a certain change in coordinate axis direction.Will be upper
State bounding box B1Along X-direction, Y direction, while arriving bounding box B along X-axis and Y direction tiling2In, respectively obtain new encirclement
Box B'=(x2,y1,w2,h1), B'=(x1,y2,w1,h2) and B'=(x2,y2,w2,h2)。
3) aspect ratio is adjusted
Aspect ratio is the important parameter for reflecting component shape in seedling text.Different types of component carries out aspect ratio adjustment
Method is different.It is that the bounding box obtained after r is adjusted is B ' by aspect ratio if former component bounding box is B=(x, y, w, h).
So, for left right model component, keep highly constant, be adjusted by formula (5);For upper mo(u)ld bottom half component, width is kept not
Become, be adjusted by formula (6);For outsourcing component or component is included, height and width all change, if h/w≤r, by formula
(5) it is adjusted, otherwise, is adjusted by formula (6).
B '=(x, y, h/r, h) (5)
B '=(x, y, w, w.r) (6)
The key for solving target member bounding box is position and the size data for obtaining topological transformation coefficient and bounding box.This
The derivation of the literary grace On Binary Tree Representation seedling text generation of " structure+component " form.The non-leaf node of derivation tree represents Miao Wen
Structure, leaf node represents specific component.Utilize the recursiveness of binary tree, you can the solution of each node data in tree is decomposed letter
Go to solve in single subtree.Code tree is the symbolism description of derivation tree.In code tree, by left right model, upper mo(u)ld bottom half, interior external form,
And upper left bag, lower-left bag and the literary structure of this 7 seedling of upper right bag of gusset type, respectively with alphabetical " Z ", " S ", " N ", " A ", " B "
" C " is represented;By the Unicode coded representations of its standard character of component.The code tree of 2 member type seedlings text is 1 level structure, point
2 layers.The code tree of 3 member type seedlings text is 2 level structures, divides 3 layers.Word example C in Fig. 16And C8Coding be respectively " S 5408Z
76EE 76EE " and " B 51A0 5B50 ".
Seedling text intelligence derives 3 levels progress structure design that model can be as shown in Figure 4.Top layer decomposes to complete code tree
The submodule of work;Intermediate layer is the submodule that structure derivation is carried out for different structure seedling text, each in code tree for completing
The solution work of node topological transformation coefficient.Bottom is the submodule that component aspect ratio is adjusted.In view of the similar of derivation
Property, tiled configuration and up-down structure can be classified as to the class of crossbar structure one, external and internal compositionses and 3 kinds of side wall structures are classified as to include structure
One class.Therefore, intermediate layer only need to derive submodule for crossbar structure and comprising two structures of structure design.
Top layer submodule presses whole code tree of depth-first postorder traversal first, and code tree is decomposed into many height successively
Tree.As soon as often decompositing stalk tree, giving corresponding structure by the subtree derives submodule solution, and replaces this with solving result
Stalk tree.So circulation, is finished until all subtrees are solved.
The algorithm design of top layer submodule is as follows:
1) the Unicode coded sequences of component and seedling text structure type according to contained by seedling text, set up corresponding seedling text generation
Code tree.
2) pre-reset mechanism of depth-first is carried out to code tree, Miao Wen generation coded sequence is obtained.
3) analysis generation coded sequence, according to flow shown in Fig. 5, calls corresponding structure to derive submodule, derivation is emerged
Text includes the transformation parameter of whole components.
4) according to the component transformation parameter of acquisition, original members are converted into the target member in seedling text.
The component of crossbar structure seedling text, the shape shown in Miao Wenzhong is not only relevant in the order that Miao Wenzhong occurs with it,
Also size with itself is relevant.Proportion shared by component is directly proportional with original members size.The encirclement of 2 member type seedlings text component
Box, directly takes the standard bounding box of original members.The bounding box of 3 member type seedlings text component, is to carry out depth-first to spanning tree
Travel through obtained result.The bounding box relevant information of each component is maintained in member position information bank.The storehouse is specifically included
There are the data such as the maximal encasing box list of component name, element type, structure name, positional number, each position.During solution, directly from this
Take out related data in storehouse to act on each component, you can obtain the maximal encasing box of respective members.
The algorithm design that crossbar structure derives submodule is as follows:
1) according to the standard bounding box of each component, its proportion in the literary structure of whole seedling is determined, and according to it in seedling text
The order occurred in structure, determines its maximum possible bounding box.
2) for tiled configuration, each component is centered to the maximal encasing box of the literary structure of seedling by formula (2) along X-direction
In;For up-down structure, each component is centered in Miao Wen maximal encasing box along Y direction by formula (3).
3) call aspect ratio to adjust the aspect ratio that submodule adjusts each component, obtain bounding box of each component in Miao Wenzhong.
4) conversion coefficient of each component is calculated using formula (1).
Common trait comprising structure seedling text is to serve as framework by outsourcing component, includes Component Embedding into this framework,
The maximum possible bounding box of each component is determined by outsourcing component.The bounding box relevant information of each component is also stored in member position
In information bank.During solution, taking-up related data is acted on each component directly from the storehouse, you can obtain respective members most
Big bounding box.
The derivation algorithm design for deriving submodule comprising structure is as follows:
1) take the maximal encasing box of outsourcing component as its Miao Wenzhong actual bounding box.
2) aspect ratio is called to adjust submodule, the standard bounding box for including component is adjusted into it wraps in Miao Wenzhong maximum
Enclose the size of box.
3) maximal encasing box that component bounding box arrives outsourcing component along X-axis and Y direction tiling simultaneously will be included after adjustment
In, obtain its actual bounding box in Miao Wenzhong.
4) conversion coefficient of each component is calculated using formula (1).
When seedling text intelligence is derived, each structure, which derives submodule, need to call aspect ratio to adjust submodule, according to from component in length and breadth
Than the related data read in information bank, component is adjusted by different adjustment modes.Component aspect ratio information storehouse is included
Component name, element type, structure name, component occurrence number, and aspect ratio minimum value, maximum, average value, variance etc.
Data.
The algorithm design of aspect ratio adjustment submodule is as follows:
1) to the component of crossbar structure, check whether its aspect ratio is located between minimum value and maximum.If so, then protecting
Hold current aspect ratio constant;Otherwise, it is average value by the adjustment aspect ratio of left right model component by formula (5), by formula (6) by upper mo(u)ld bottom half
The aspect ratio of component is adjusted to average value.
2) to the component comprising structure, its aspect ratio and average value are compared.If being equal to, current aspect ratio is kept
It is constant;If being more than, aspect ratio is adjusted to average value by formula (6);If being less than, aspect ratio is adjusted to average by formula (5)
Value.
Based on above-mentioned algorithm, since Miao Wen generation solution procedure can be analyzed to a series of one-levels encoding leaf nodes
The character generation of structure is solved.Below with seedling text C6Exemplified by come illustrate seedling text generation intelligent Derivation process, according to Fig. 6, seedling
Literary C6Component conversion coefficient solution procedure be described as follows:
1) structure series is determined.C6There are 2 level structures:Top level architecture is " S ", and final stage structure is " Z ".
2) final stage structure is separated, solved as a pseudo- seedling text, shown in such as Fig. 7 (a).Generation code sequence now
It is classified as " Z 76EE 76EE ".Submodule is derived using crossbar structure, two sub- components " 76EE " and " 76EE " is obtained in pseudo- seedling text
In bounding box.
3) pseudo- seedling literary (being expressed as " #1 ") is considered as a component, be incorporated in upper level structure, such as shown in Fig. 7 (b).This
When, generation coded sequence be " S 5408#1 ".Submodule is derived using crossbar structure, two components " 5408 " and " #1 " is obtained
It is used as C6The bounding box that middle target member shows.
4) according to formula (1), the topological transformation coefficient of each component of seedling text is calculated.
5) each component is entered into line translation by above topology conversion coefficient and obtains corresponding target member, by these objective cross
To together, obtaining seedling Chinese character C6。
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
Any modifications, equivalent substitutions and improvements made within refreshing and principle etc., should be included in the scope of the protection.
Claims (7)
1. a kind of literary generation method of square seedling derived based on intelligence, it is characterised in that this method comprises the following steps:
A:Set up component bounding box and it is normalized;
B:Determine bounding box topological transformation coefficient;
C:Map function is carried out to component bounding box;
D:Set up the code tree of correspondence derivation;
E:Set up intelligence and derive model;
F:Algorithm generation square seedling text is derived according to intelligence.
2. a kind of literary generation method of square seedling derived based on intelligence according to claim 1, it is characterised in that:The step
Suddenly A is:A square seedling Chinese character grid is given, it is respectively W and H that it is wide and high;Using the grid upper left corner as origin, one is set up
Rectangular coordinate system under the X axis right side, Y-axis;In this coordinate system, component bounding box is by the left upper apex of component character picture
The minimum enclosed rectangle that coordinate (x, y) and wide (w) and high (h) are together decided on, is represented by a four-tuple B:B=
(x,y,w,h);Wherein, x ∈ (0, W), y ∈ (0, H), w ∈ (0, W-x), h ∈ (0, H-y);And by component bounding box normalization
Manage and be:
3. a kind of literary generation method of square seedling derived based on intelligence according to claim 2, it is characterised in that:The step
Suddenly B is:Given bounding box B=(x, y, w, h) and B'=(x', y', w', h'), B is transformed to B ' topological transformation coefficient formula
(1) calculate:
<mrow>
<mfenced open = "{" close = "">
<mtable>
<mtr>
<mtd>
<mrow>
<msub>
<mi>R</mi>
<mi>w</mi>
</msub>
<mo>=</mo>
<msup>
<mi>w</mi>
<mo>&prime;</mo>
</msup>
<mo>/</mo>
<mi>w</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msub>
<mi>R</mi>
<mi>h</mi>
</msub>
<mo>=</mo>
<msup>
<mi>h</mi>
<mo>&prime;</mo>
</msup>
<mo>/</mo>
<mi>h</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msup>
<mi>x</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<mi>x</mi>
<mo>+</mo>
<mi>x</mi>
<mo>.</mo>
<msub>
<mi>R</mi>
<mi>w</mi>
</msub>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msup>
<mi>y</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<mi>y</mi>
<mo>+</mo>
<mi>y</mi>
<mo>.</mo>
<msub>
<mi>R</mi>
<mi>h</mi>
</msub>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<mo>.</mo>
</mrow>
4. a kind of literary generation method of square seedling derived based on intelligence according to claim 3, it is characterised in that:The step
In rapid C, target member is calculated in the location of Miao Wenzhong and size, is related to placed in the middle, tiling and aspect ratio adjustment conversion behaviour
Make;
Between two parties
The width and height of bounding box are constant after adjustment, and only left upper apex coordinate changes;Given bounding box B1=(x1,y1,w1,h1)
And B2=(x2,y2,w2,h2), by B1Along X-direction, Y direction, while being centered to B along X-axis and Y direction2In, three kinds of situations
Under obtain new bounding box B '1=(x ', y ', w1,h1) in x ' and y ' respectively with formula (2), (3), (4) calculate:
<mrow>
<mfenced open = "{" close = "">
<mtable>
<mtr>
<mtd>
<mrow>
<msup>
<mi>x</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>x</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mo>|</mo>
<msub>
<mi>w</mi>
<mn>1</mn>
</msub>
<mo>-</mo>
<msub>
<mi>w</mi>
<mn>2</mn>
</msub>
<mo>|</mo>
<mo>/</mo>
<mn>2</mn>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msup>
<mi>y</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>y</mi>
<mn>1</mn>
</msub>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>2</mn>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<mfenced open = "{" close = "">
<mtable>
<mtr>
<mtd>
<mrow>
<msup>
<mi>x</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>x</mi>
<mn>1</mn>
</msub>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msup>
<mi>y</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>y</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mo>|</mo>
<msub>
<mi>h</mi>
<mn>1</mn>
</msub>
<mo>-</mo>
<msub>
<mi>h</mi>
<mn>2</mn>
</msub>
<mo>|</mo>
<mo>/</mo>
<mn>2</mn>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>3</mn>
<mo>)</mo>
</mrow>
</mrow>
<mrow>
<mfenced open = "{" close = "">
<mtable>
<mtr>
<mtd>
<mrow>
<msup>
<mi>x</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>x</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mo>|</mo>
<msub>
<mi>w</mi>
<mn>1</mn>
</msub>
<mo>-</mo>
<msub>
<mi>w</mi>
<mn>2</mn>
</msub>
<mo>|</mo>
<mo>/</mo>
<mn>2</mn>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow>
<msup>
<mi>y</mi>
<mo>,</mo>
</msup>
<mo>=</mo>
<msub>
<mi>y</mi>
<mn>2</mn>
</msub>
<mo>+</mo>
<mo>|</mo>
<msub>
<mi>h</mi>
<mn>1</mn>
</msub>
<mo>-</mo>
<msub>
<mi>h</mi>
<mn>2</mn>
</msub>
<mo>|</mo>
<mo>/</mo>
<mn>2</mn>
</mrow>
</mtd>
</mtr>
</mtable>
</mfenced>
<mo>-</mo>
<mo>-</mo>
<mo>-</mo>
<mrow>
<mo>(</mo>
<mn>4</mn>
<mo>)</mo>
</mrow>
</mrow>
Tiling
By above-mentioned bounding box B1Along X-direction, Y direction, while arriving bounding box B along X-axis and Y direction tiling2In, respectively
To new bounding box B'=(x2,y1,w2,h1), B'=(x1,y2,w1,h2) and B'=(x2,y2,w2,h2);
Aspect ratio is adjusted
It is that the bounding box obtained after r is adjusted is B ' by aspect ratio if former component bounding box is B=(x, y, w, h);So,
For left right model component, keep highly constant, be adjusted by formula (5);For upper mo(u)ld bottom half component, keep width constant, by formula
(6) it is adjusted;For outsourcing component or component is included, height and width all change, if h/w≤r, carried out by formula (5)
Adjustment, otherwise, is adjusted by formula (6);
B '=(x, y, h/r, h) (5)
B '=(x, y, w, w.r) (6).
5. a kind of literary generation method of square seedling derived based on intelligence according to claim 4, it is characterised in that:The step
Suddenly D is:Using the recursiveness of binary tree, the solution of each node data in tree is decomposed in simple subtree and solved, foundation pair
Answer the code tree of derivation;Code tree is the symbolism description of derivation tree;In code tree, by left right model, upper mo(u)ld bottom half, inside and outside
Type, and gusset type upper left bag, lower-left bag and the literary structure of upper right bag this 7 seedling, respectively with alphabetical " Z ", " S ", " N ", " A ",
" B " and " C " is represented;By the Unicode coded representations of its standard character of component;The code tree of 2 member type seedlings text is 1 grade of knot
Structure, divides 2 layers;The code tree of 3 member type seedlings text is 2 level structures, divides 3 layers.
6. a kind of literary generation method of square seedling derived based on intelligence according to claim 5, it is characterised in that:The step
Suddenly E is:Model is derived by 3 Level building seedling text intelligence;Top layer is the submodule for completing code tree disintegration;Intermediate layer is
The submodule of structure derivation, the solution for completing each node topological transformation coefficient in code tree are carried out for different structure seedling text
Work;Bottom is the submodule that component aspect ratio is adjusted;Due to that tiled configuration and up-down structure can be classified as into crossbar structure one
Class, external and internal compositionses and 3 kinds of side wall structures are classified as to include the class of structure one, therefore intermediate layer is set just for crossbar structure and comprising structure
Two structures of meter derive submodule.
7. a kind of literary generation method of square seedling derived based on intelligence according to claim 6, it is characterised in that:The step
Rapid F includes following algorithm:
The algorithm of top layer submodule:
1) the Unicode coded sequences of component and seedling text structure type according to contained by seedling text, set up corresponding seedling text generation coding
Tree;
2) pre-reset mechanism of depth-first is carried out to code tree, Miao Wen generation coded sequence is obtained;
3) analysis generation coded sequence, according to flow, calls corresponding structure to derive submodule, derives text of emerging and includes all
The transformation parameter of component;
4) according to the component transformation parameter of acquisition, original members are converted into the target member in seedling text;
Crossbar structure derives the algorithm of submodule:
1) according to the standard bounding box of each component, its proportion in the literary structure of whole seedling is determined, and according to it in the literary structure of seedling
The order of middle appearance, determines its maximum possible bounding box;
2) for tiled configuration, in the maximal encasing box that each component is centered to the literary structure of seedling by formula (2) along X-direction;It is right
In up-down structure, each component is centered in Miao Wen maximal encasing box along Y direction by formula (3);
3) call aspect ratio to adjust the aspect ratio that submodule adjusts each component, obtain bounding box of each component in Miao Wenzhong;
4) conversion coefficient of each component is calculated using formula (1);
The derivation algorithm of submodule is derived comprising structure:
1) take the maximal encasing box of outsourcing component as its Miao Wenzhong actual bounding box;
2) call aspect ratio to adjust submodule, the standard bounding box for including component is adjusted to its maximal encasing box in Miao Wenzhong
Size;
3) bounding box that component is included after adjustment is tiled into the maximal encasing box of outsourcing component along X-axis and Y direction simultaneously,
Obtain its actual bounding box in Miao Wenzhong;
4) conversion coefficient of each component is calculated using formula (1);
Aspect ratio adjusts the algorithm of submodule:
1) to the component of crossbar structure, check whether its aspect ratio is located between minimum value and maximum;If so, then keeping working as
Preceding aspect ratio is constant;Otherwise, it is average value by the adjustment aspect ratio of left right model component by formula (5), by formula (6) by upper mo(u)ld bottom half component
Aspect ratio be adjusted to average value;
2) to the component comprising structure, its aspect ratio and average value are compared;If being equal to, current aspect ratio is kept not
Become;If being more than, aspect ratio is adjusted to average value by formula (6);If being less than, aspect ratio is adjusted to average value by formula (5).
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710353172.0A CN107220224A (en) | 2017-05-18 | 2017-05-18 | A kind of literary generation method of square seedling derived based on intelligence |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710353172.0A CN107220224A (en) | 2017-05-18 | 2017-05-18 | A kind of literary generation method of square seedling derived based on intelligence |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107220224A true CN107220224A (en) | 2017-09-29 |
Family
ID=59944240
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710353172.0A Withdrawn CN107220224A (en) | 2017-05-18 | 2017-05-18 | A kind of literary generation method of square seedling derived based on intelligence |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107220224A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006124139A2 (en) * | 2005-05-13 | 2006-11-23 | Microsoft Corporation | Method and system of character placement in opentype fonts |
CN101551711A (en) * | 2009-05-21 | 2009-10-07 | 华南理工大学 | Chinese character coding input method based on structure and primitive |
CN101930299A (en) * | 2010-08-25 | 2010-12-29 | 华南理工大学 | Method for intelligently generating Chinese character without character library |
-
2017
- 2017-05-18 CN CN201710353172.0A patent/CN107220224A/en not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006124139A2 (en) * | 2005-05-13 | 2006-11-23 | Microsoft Corporation | Method and system of character placement in opentype fonts |
CN101551711A (en) * | 2009-05-21 | 2009-10-07 | 华南理工大学 | Chinese character coding input method based on structure and primitive |
CN101930299A (en) * | 2010-08-25 | 2010-12-29 | 华南理工大学 | Method for intelligently generating Chinese character without character library |
Non-Patent Citations (1)
Title |
---|
莫礼平等: "一种湘西民间苗文字形的动态生成方法及其实现途径", 《北京大学学报(自然科学版)》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Kaplan et al. | A Euclidean lattice construction of supersymmetric Yang-Mills theories with sixteen supercharges | |
Goffin et al. | Convex nondifferentiable optimization: A survey focused on the analytic center cutting plane method | |
CN107623594A (en) | A kind of three-dimensional level network topology method for visualizing of geographical location information constraint | |
TW432304B (en) | Integrated circuit design method, database apparatus for designing integrated circuit and integrated circuit design support apparatus | |
CN114881237B (en) | Quantum computing processing method and device and electronic equipment | |
Devriendt et al. | Unified mean-field framework for susceptible-infected-susceptible epidemics on networks, based on graph partitioning and the isoperimetric inequality | |
CN102193786A (en) | Device and method for constructing self-adaptive graphic user interface (GUI) | |
CN108052580A (en) | A kind of space-time data immersion visual analysis method based on multilayer related network | |
CN104658033A (en) | Method and device for global illumination rendering under multiple light sources | |
CN106066888B (en) | The source database building method and actual situation corresponding method of transformer station secondary system | |
CN107608951A (en) | Report form generation method and system | |
Ruszczyński | Advances in risk-averse optimization | |
CN101930299B (en) | Method for intelligently generating Chinese character without character library | |
Groz et al. | Deterministic regular expressions in linear time | |
CN107220224A (en) | A kind of literary generation method of square seedling derived based on intelligence | |
CN109086515A (en) | The modeling method of primary equipment pictorial information in intelligent substation SSD based on SVG | |
CN107330209A (en) | A kind of moulding wall intelligent template implementation method based on Parametric designing | |
Simpson et al. | Structural modeling project–overview | |
Gaubert et al. | Asymptotic analysis of heaps of pieces and application to timed Petri nets | |
Strodthoff et al. | Layered Reeb graphs for three-dimensional manifolds in boundary representation | |
Grußien | Capturing polynomial time and logarithmic space using modular decompositions and limited recursion | |
CN112100157B (en) | Cross-platform multidimensional database architecture design method and system | |
Calafiore et al. | Randomized algorithms for reduced order H/sub/spl infin//controller design | |
CN113486180A (en) | Remote supervision relation extraction method and system based on relation hierarchy interaction | |
CN113887212A (en) | Power grid dispatching instruction multi-purpose identification method based on multi-attention capsule network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20170929 |
|
WW01 | Invention patent application withdrawn after publication |