A kind of wrongly written character font editor, coding and input system and method
Technical field
The present invention relates to wrongly written character shape editor, printing and Plate making printing field, particularly common in digitizing teaching Chinese as a foreign language wrongly written character input system and method, be specially a kind of wrongly written character font editor, coding and input system and method.
Background technology
Computing machine is utilized to carry out Chinese charater input, typesetting and printing, it is the extremely usual thing of current office automation and print field one, but, if inputted and the Chinese character do not had in printing computer character library, user often will make a great fuss, common way has two kinds: one to be utilize EUDC Editor manufacture, and two is make a Chinese character picture temporarily to substitute temporarily.Wrongly written character belongs to the word do not had in character library, a small amount of wrongly written character can be undertaken by above-mentioned method, but along with the development of China's Chinese teaching particularly teaching Chinese as a foreign language, the people that the foreigner learns writing of Chinese characters gets more and more, due to the complicacy of Chinese character learning, occurred that the error type of the foreigner when writing Chinese characters and quantity are doubled and redoubled, the mode using character library to manufacture wrongly written character and editor's wrongly written character picture can not adapt to the needs of digitizing Chinese teaching far away.
Many scholars start to study in wrongly written character editor and identification for this reason, and have achieved some achievements.More typically have " the wrongly written character processing scheme based on international standard " of the Inner Mongol Normal University Lee little Khanh Hoa woods teacher people, in this scenario, two teachers.Based on ideograph variant sequence thereof standard in Unicode 5.1 standard (ideographic variation sequences, IVS), design and Implement.Organization and management wrongly written character centered by correcting a wrongly written character or a misspelt word, uses a standardized form of Chinese charcters to add IVS variant selector and represents that wrongly written character is encoded, and application OpenType font technology carries out input and output wrongly written character processing scheme.
The method more than processing wrongly written character is all on the basis of original character library, utilize the clear area in standard character library or the Hanzi internal code region that seldom uses to deposit wrongly written character, the maximum deficiency of these methods is the space encoder occupying Chinese character preciousness, along with the expansion of wrongly written character scale, these spaces can run out by book very much, such as, Chinese GBK GB is [AAA1-AFFE], [F8A1-FEFE] and [A140-A7A0], only these 3 sections just have 4636, Unicode is encoded to [E000-F8FF] totally 6400.Even if each Chinese character is got a wrongly written character and deposited and also need 6400, and actual conditions, the quantity of wrongly written character is not far that a Chinese character only has a wrongly written character, because of a little above wrongly written character input and processing scheme a lot of defect in addition in process wrongly written character in enormous quantities.
For this reason, need a kind of method finding wrongly written character to input and edit, editor's quantity of wrongly written character can be opened, facilitate user to input, the publication of better service Chinese character and printing, for Chinese teaching particularly teaching Chinese as a foreign language digitized wrongly written character editor and printing environment are provided.
Summary of the invention
For the deficiencies in the prior art, the invention provides a kind of by self-built wrongly written character font storehouse, and the wrongly written character font editor of dynamically editor, coding and input system and method can be carried out.
Technical scheme of the present invention is achieved in that a kind of wrongly written character font editor, coding and input system, it is characterized in that, comprise the wrongly written character font storehouse editor module for creating wrongly written character font storehouse, for extracting the wrongly written character characteristic extracting module of the unique point of wrongly written character font in wrongly written character font storehouse, for the wrongly written character coding module of encoding to the unique point of wrongly written character, and for the wrongly written character load module by the wrongly written character input computing machine after coding.
Above-mentioned wrongly written character font editor, coding and input system, wrongly written character font storehouse editor module suspended time editing user needs the wrongly written character inputted to create wrongly written character font storehouse, for edited wrongly written character, wrongly written character font storehouse editor module passes to wrongly written character characteristic extracting module the wrongly written character characteristic of wrongly written character text structure; The wrongly written character characteristic that the analysis of wrongly written character characteristic extracting module receives, adopts the characteristic point information in wrongly written character feature extraction algorithm extraction wrongly written character characteristic, and characteristic point information is passed to wrongly written character coding module; The characteristic point information extracted in wrongly written character characteristic extracting module is carried out coded treatment by wrongly written character dynamic coding algorithm by wrongly written character coding module, and is stored by the wrongly written character after coded treatment; Wrongly written character load module receives the correct Chinese character of user's input, retrieve the wrongly written character finding this word corresponding and encodes, and be input in editing machine by the wrongly written character of encoding through wrongly written character coding module and carry out making a plate and printing by font.
Above-mentioned wrongly written character font editor, coding and input system, also comprise the wrongly written character suspended time editing module of the wrongly written character information receiving needs adjustment and editor, wrongly written character suspended time editing module calls wrongly written character font storehouse editor module by the wrongly written character suspended time editing process in document, and the wrongly written character characteristic of wrongly written character text structure is passed to wrongly written character characteristic extracting module.
Utilize above-mentioned wrongly written character font editor, the wrongly written character font editor of coding and input system, coding and input method, comprise the steps:
A. wrongly written character font storehouse editor module is utilized to create wrongly written character font storehouse: in wrongly written character font storehouse, to store correct Chinese character and the wrongly written character corresponding to each correct Chinese character;
B. wrongly written character characteristic extracting module is passed through to the characteristic extract minutiae information of wrongly written character font in wrongly written character font storehouse;
C. utilize wrongly written character coding module to encode to wrongly written character: the characteristic point information according to wrongly written character font is encoded to wrongly written character, create key;
D. realized the input of wrongly written character font by wrongly written character load module: according to the correct Chinese character of input, in wrongly written character font storehouse, found the wrongly written character corresponding to correct Chinese character of input by key, select the wrongly written character font needed, wrongly written character font can be inputted.
Above-mentioned wrongly written character font editor, coding and input method, in step: the wrongly written character needing input by drawing and copy compiles user, the stroke structure of wrongly written character is carried out visual amendment and combination, be included in hand-written increase wrongly written character in wrongly written character font storehouse, copy amendment wrongly written character, select copying object, increase wrongly written character stroke, mobile stroke position, delete stroke, increase stroke reference mark, delete stroke reference mark, preserve the wrongly written character after editor, wrongly written character parts and stroke copy the selection into background transparent degree, wrongly written character parts and stroke are copied, wrongly written character stroke changes thickness and stores the wrongly written character font of edit-modify.
Wrongly written character font editor, coding and input method, in stepb: wrongly written character characteristic extracting module adopts wrongly written character feature extraction algorithm to extract the characteristic point information of wrongly written character, wrongly written character feature extraction algorithm adopts the pen unit of definition wrongly written character and the method extract minutiae information of unique point and man-machine interaction, pen unit is adopted to define wrongly written character stroke: the stroke structure that pen unit one of being made up of one or more oriented pen section is complete, if a pen unit is made up of n oriented pen section, the oriented pen section in pen unit is called the characteristic of wrongly written character font; Pen unit is described as: SS
n={ BS
1, BS
2, BS
3..., BS
nor SS
n={ (X
i1, Y
i1) | (X
j1, Y
j1), (X
i2, Y
i2) | (X
j2, Y
j2) ..., (X
in, Y
in) | (X
jn, Y
jn); BS
nrepresent the n-th oriented pen section; (X
in, Y
in) represent the starting point coordinate of the n-th oriented pen section, be called for short gesture point; (X
jn, Y
jn) represent the end point coordinate of the n-th oriented pen section, be called for short stationary point; The initial boundary point of pen unit is called beginning circle point, and the termination circle point of pen unit is called whole boundary point, and all gesture points in wrongly written character pen unit and stationary point are called the unique point of wrongly written character.
Above-mentioned wrongly written character font editor, coding and input method, in step C: adopt wrongly written character dynamic coding algorithm to be encoded with the coordinate of be expert at sequence number and each unique point of wrongly written character by wrongly written character font, establishment one simultaneously take line number as the key of index.
Above-mentioned wrongly written character font editor, coding and input method, the algorithm steps of wrongly written character dynamic coding algorithm is as follows:
Step 1: set up or open wrongly written character font storehouse, and initializing variable;
Variable initializer show will describe storehouse ZXDATA (i) to separation D, beginning circle point H, whole boundary point T, pen unit number ele_num and font and carry out initialization operation, and separation is used for adjacent two pen units to separate;
Open ZXscript//open font to describe storehouse
INT ele_num←0,m;
POINT D←(m,0),H←(m,0),D←(m,m);
ZXDATA (i) ← and m, 0, m, m} // library initialization is described
Step 2: select action type: if action type is " Ins ", then go to step 2.1; If action type is " Mov ", then go to step 2.2; If action type is " Del ", then go to step 2.3; If action type is " Edit ", then turn to step 2.4; If action type is " NoOper ", then turn to step 3;
Step 2.1: insert pen unit;
Inserting the first En of the pen with n pen section is that pen section by inserting this unit one by one realizes, if insertion position is pos:
Step 2.1.1 inserts a separation (m, 0) in insertion position; Pen section counting variable i is put 1; Insertion position pos is from adding 1;
Step 2.1.2 inserts i-th pen section of pen unit En in insertion position, that is: B [i] .x, B [i] .y, Z [i] .x and Z [i] .y; B [i] and Z [i] is respectively gesture point and the stationary point of i-th pen section; Setting-out section between B [i] and Z [i]; Insertion position pos is from adding 2; Hop count i is from adding 1;
If step 2.1.3 i < is n, go to step 2.1.2; Otherwise pen unit number ele num, from adding 1, goes to step 2;
Step 2.2: move integrally pen unit;
Move integrally pen unit to be realized by the coordinate that in amendment pen unit, each is put except beginning circle Dian Hezhong circle point, if Vertex [i] is i-th point in pen unit to be moved, dx and dy is horizontal increment and vertical increment respectively, and VerCount is counting in pen unit to be moved except beginning circle Dian Hezhong circle point:
It is 1 that step 2.2.1 puts i;
Step 2.2.2Vertex [i] .x and Vertex [i] .y increases dx and dy respectively; I is from adding 1;
If step 2.2.3 i < is VerCount, go to step 2.2.2; Otherwise, go to step 2;
Step 2.3: delete pen unit;
Delete pen unit to be realized by each point of deletion pen unit; If Vertex [i] is i-th point in pen unit to be moved, VerCount is counting except beginning circle Dian Hezhong circle point in pen unit to be deleted;
Step 2.3.1 deletes a separation (m, 0); Putting i is 1;
Step 2.3.2 deletes Vertex [i]; I is from adding 1;
If step 2.2.3 i < is VerCount, go to step 2.3.2; Otherwise, go to step 2;
Step 2.4: editor's pen unit;
Editor's pen unit mainly refers to certain section in mobile pen unit, and this gesture point mainly through mobile corresponding pen section or stationary point realize; If the gesture point of pen section to be moved or stationary point are Vertex [i], dx and dy is horizontal increment and vertical increment respectively, the method for this point mobile is:
Vertex[i].x=Vertex[i].x+dx;
Vertex[i].y=Vertex[i].y+dy;
Go to step 2;
Step 3: preserve amendment, closes font and describes storehouse.
Above-mentioned wrongly written character font editor, coding and input method, in step D: user inputs correct Chinese character in editing machine, found the row at wrongly written character place by key, all wrongly written character list displays of being expert at by wrongly written character, user selects and used a wrong word, and can input wrongly written character font.
The invention has the beneficial effects as follows: by self-defined wrongly written character character library, a standardized form of Chinese charcters and wrongly written character are carried out the mapping code of one-to-many, and each wrongly written character in character library can in use be edited and revise dynamically; Edit and revise each wrongly written character and can use dynamic drafting, increase and decrease stroke and imitation, amended wrongly written character can also re-start coding and store.
The present invention can carry out the input operation of wrongly written character, thus solves the difficulty of the wrongly written character input existed for many years in puzzlement wrongly written character printing and digitizing Chinese teaching; In addition, the structure taking full advantage of modern Chinese character is changeable, the characteristic of font complexity, the imitation of the editor in wrongly written character storehouse and amendment and Chinese character is organically combined, ensure that when not changing original character form structure, the wrongly written character font of dynamic making various ways, obtains source for digitized Chinese teaching and wrongly written character print publishing provide a kind of wrongly written character, is a kind of simple and convenient and wrongly written character input method efficiently.
Accompanying drawing explanation
Fig. 1 is the module composition diagram of wrongly written character font editor of the present invention, coding and input system.
In figure: the editor module of 1-wrongly written character font storehouse, 2-wrongly written character characteristic extracting module, 3-wrongly written character coding module, 4-wrongly written character load module, 5-wrongly written character suspended time editing module.
Embodiment
The present invention is described further by reference to the accompanying drawings:
The present embodiment wrongly written character font editor, coding and input system, comprise the wrongly written character font storehouse editor module 1 for creating wrongly written character font storehouse, for extracting the wrongly written character characteristic extracting module 2 of the unique point of wrongly written character font in wrongly written character font storehouse, for the wrongly written character coding module 3 of encoding to the unique point of wrongly written character, and for the wrongly written character load module 4 by the wrongly written character input computing machine after coding.
Wrongly written character font storehouse editor module 1 suspended time editing user needs the wrongly written character inputted to create wrongly written character font storehouse, and for edited wrongly written character, wrongly written character font storehouse editor module 1 passes to wrongly written character characteristic extracting module 2 the wrongly written character characteristic of wrongly written character text structure;
The wrongly written character characteristic that wrongly written character characteristic extracting module 2 analysis receives, adopts the characteristic point information in wrongly written character feature extraction algorithm extraction wrongly written character characteristic, and characteristic point information is passed to wrongly written character coding module 3;
The characteristic point information extracted in wrongly written character characteristic extracting module 2 is carried out coded treatment by wrongly written character dynamic coding algorithm by wrongly written character coding module 3, and is stored by the wrongly written character after coded treatment;
Wrongly written character load module 4 receives the correct Chinese character of user's input, the wrongly written character coding finding this correct Chinese character corresponding is retrieved by font, find all wrongly written characters that this correct Chinese character is corresponding, then select corresponding wrongly written character by user, and the wrongly written character of encoding through wrongly written character coding module 3 is input in editing machine carries out making a plate and printing.
Also comprise the wrongly written character suspended time editing module 5 of the wrongly written character information receiving needs adjustment and editor, wrongly written character suspended time editing module 5 calls wrongly written character font storehouse editor module 1 by the wrongly written character suspended time editing process in document, amended wrongly written character can rejoin in wrongly written character font table, and the wrongly written character characteristic of wrongly written character text structure is passed to wrongly written character characteristic extracting module 2.Wrongly written character suspended time editing module 5, by selecting the wrongly written character of specifying, is again called after wrongly written character font editor module 1 carries out edit and storage again, is stored by the wrongly written character in document.
Utilize above-mentioned wrongly written character font editor, the wrongly written character font editor of coding and input system, coding and input method, it is characterized in that, comprise the steps:
A. wrongly written character font storehouse editor module 1 is utilized to create wrongly written character font storehouse: in wrongly written character font storehouse, to store correct Chinese character and the wrongly written character corresponding to each correct Chinese character;
The wrongly written character of input is needed by drawing and copy compiles user, the stroke structure of wrongly written character carried out visual amendment and combination, is included in hand-written increase wrongly written character in wrongly written character font storehouse, copy amendment wrongly written character, select copying object, increase wrongly written character stroke, mobile stroke position, delete stroke, increase stroke reference mark, delete stroke reference mark, preserve editor after wrongly written character, wrongly written character parts and stroke copy into background transparent degree selection, wrongly written character parts and stroke is copied, wrongly written character stroke changes thickness and store the wrongly written character font of edit-modify.
B. by the characteristic extract minutiae information of wrongly written character font in wrongly written character characteristic extracting module 2 pairs of wrongly written character font storehouses;
Wrongly written character characteristic extracting module 2 adopts wrongly written character feature extraction algorithm to extract the characteristic point information of wrongly written character, wrongly written character feature extraction algorithm adopts the pen unit of definition wrongly written character and the method extract minutiae information of unique point and man-machine interaction, pen unit is adopted to define wrongly written character stroke: the stroke structure that pen unit one of being made up of one or more oriented pen section is complete, if a pen unit is made up of n oriented pen section, the oriented pen section in pen unit is called the characteristic of wrongly written character font; Pen unit is described as: SS
n={ BS
1, BS
2, BS
3..., BS
nor SS
n={ (X
i1, Y
i1) | (X
j1, Y
j1), (X
i2, Y
i2) | (X
j2, Y
j2) ..., (X
in, Y
in) | (X
jn, Y
jn); BS
nrepresent the n-th oriented pen section; (X
in, Y
in) represent the starting point coordinate of the n-th oriented pen section, be called for short gesture point; (X
jn, Y
jn) represent the end point coordinate of the n-th oriented pen section, be called for short stationary point; The initial boundary point of pen unit is called beginning circle point, and the termination circle point of pen unit is called whole boundary point, and all gesture points in wrongly written character pen unit and stationary point are called the unique point of wrongly written character.
C. wrongly written character coding module 3 pairs of wrongly written character codings are utilized: the characteristic point information according to wrongly written character font is encoded to wrongly written character, creates key;
Adopt wrongly written character dynamic coding algorithm to be encoded with the coordinate of be expert at sequence number and each unique point of wrongly written character by wrongly written character font, establishment one simultaneously take line number as the key of index.
The algorithm steps of wrongly written character dynamic coding algorithm is as follows:
Step 1: set up or open wrongly written character font storehouse, and initializing variable;
Variable initializer show will describe storehouse ZXDATA (i) to separation D, beginning circle point H, whole boundary point T, pen unit number ele_num and font and carry out initialization operation, and separation is used for adjacent two pen units to separate;
Open ZXscript//open font to describe storehouse
INT ele_num←0,m;
POINT D←(m,0),H←(m,0),D←(m,m);
ZXDATA (i) ← and m, 0, m, m} // library initialization is described
Step 2: select action type: if action type is " Ins ", then go to step 2.1; If action type is " Mov ", then go to step 2.2; If action type is " Del ", then go to step 2.3; If action type is " Edit ", then turn to step 2.4; If action type is " NoOper ", then turn to step 3;
Step 2.1: insert pen unit;
Inserting the first En of the pen with n pen section is that pen section by inserting this unit one by one realizes, if insertion position is pos:
Step 2.1.1 inserts a separation (m, 0) in insertion position; Pen section counting variable i is put 1; Insertion position pos is from adding 1;
Step 2.1.2 inserts i-th pen section of pen unit En in insertion position, that is: B [i] .x, B [i] .y, Z [i] .x and Z [i] .y; B [i] and Z [i] is respectively gesture point and the stationary point of i-th pen section; Setting-out section between B [i] and Z [i]; Insertion position pos is from adding 2; Hop count i is from adding 1;
If step 2.1.3 i < is n, go to step 2.1.2; Otherwise pen unit number ele_num, from adding 1, goes to step 2;
Step 2.2: move integrally pen unit;
Move integrally pen unit to be realized by the coordinate that in amendment pen unit, each is put except beginning circle Dian Hezhong circle point, if Vertex [i] is i-th point in pen unit to be moved, dx and dy is horizontal increment and vertical increment respectively, and VerCount is counting in pen unit to be moved except beginning circle Dian Hezhong circle point:
It is 1 that step 2.2.1 puts i;
Step 2.2.2Vertex [i] .x and Vertex [i] .y increases dx and dy respectively; I is from adding 1;
If step 2.2.3 i < is VerCount, go to step 2.2.2; Otherwise, go to step 2;
Step 2.3: delete pen unit;
Delete pen unit to be realized by each point of deletion pen unit; If Vertex [i] is i-th point in pen unit to be moved, VerCount is counting except beginning circle Dian Hezhong circle point in pen unit to be deleted;
Step 2.3.1 deletes a separation (m, 0); Putting i is 1;
Step 2.3.2 deletes Vertex [i]; I is from adding 1;
If step 2.2.3 i < is VerCount, go to step 2.3.2; Otherwise, go to step 2;
Step 2.4: editor's pen unit;
Editor's pen unit mainly refers to certain section in mobile pen unit, and this gesture point mainly through mobile corresponding pen section or stationary point realize; If the gesture point of pen section to be moved or stationary point are Vertex [i], dx and dy is horizontal increment and vertical increment respectively, the method for this point mobile is:
Vertex[i].x=Vertex[i].x+dx;
Vertex[i].y=Vertex[i].y+dy;
Go to step 2;
Step 3: preserve amendment, closes font and describes storehouse.
D. realized the input of wrongly written character font by wrongly written character load module 4: according to the correct Chinese character of input, in wrongly written character font storehouse, found the wrongly written character corresponding to correct Chinese character of input by key, select the wrongly written character font needed, wrongly written character font can be inputted.User inputs correct Chinese character in editing machine, is found the row at wrongly written character place by key, and all wrongly written character list displays of being expert at by wrongly written character, user selects and used a wrong word, and can input wrongly written character font.
The present invention can carry out the input operation of wrongly written character, thus solves the difficulty of the wrongly written character input existed for many years in puzzlement wrongly written character printing and digitizing Chinese teaching; In addition, the structure taking full advantage of modern Chinese character is changeable, the characteristic of font complexity, the imitation of the editor in wrongly written character storehouse and amendment and Chinese character is organically combined, ensure that when not changing original character form structure, the wrongly written character font of dynamic making various ways, obtains source for digitized Chinese teaching and wrongly written character print publishing provide a kind of wrongly written character, is a kind of simple and convenient and wrongly written character input method efficiently.
Above-described embodiment is only for the invention example is clearly described, and the restriction not to the invention embodiment.For those of ordinary skill in the field, can also make other changes in different forms on the basis of the above description.Here exhaustive without the need to also giving all embodiments.And thus the apparent change of extending out or variation be still among the protection domain of the invention claim.