Compiling and writing module supporting multinational languages, compiling and writing method thereof
One, technical field
The present invention relates to a kind of data processing technique, especially a kind ofly write interface, the character string information of being imported is carried out the method for corresponding processing process by what the inner contained editing machine of electronic information aid provided.
Two, background technology
Flourish along with coming of electronic commerce and Information technology, individual and incorporated business use all types of electronic information aids day by day to popularize as the situation of data processing tools, by the data editor that electronic information aid had, the accuracy height that functions such as processing and electronic information aid itself are had, characteristics such as data processing speed is fast, replace the work of carrying out with the manual mode of operation originally that data quantity is big and repeatability is high, to increase work efficiency, reduce the time consumption that caused because of artificial careless mistake and cost allowance etc. and be unfavorable for factors such as enterprise operation, along with the frequency of utilization and the range of application of electronic information aid increases day by day, each electronic information aid manufacturer drops into a large amount of time invariably, money and manpower are in work such as research and development manufacturing, in the hope of releasing the electronic information aid that can satisfy consumer demand and can obtain vast favorable comment, and because the electronic information aid major part is global consumer products, therefore if a certain type electronic information aid partly is being on sale throughout the regional good sales achievement that obtains, the manufacturer that then produces this electronic information aid certainly will transfer the electronic information aid of same type to other area and sell, to obtain maximum commercial interest, therefore, the chance that transnational cooperation and sale path are sought by each electronic information aid manufacturer is tending towards intensive, and as a manufacturer that develops electronic information aid, on existing technical foundation, the probability of the electronic information aid of the client of the suitable different country origins of exploitation or support client belonging country language is also quite frequent.
The major function of the inner contained editing machine of electronic information aid be for can receiving, handle and show character string information that the user imports etc., but the used language characteristic of various countries' interzone, usage has nothing in common with each other, and is to vary; As with regard to the coded system of character, Arabic and English etc. are to belong to byte (Byte) coding, promptly with English alphabet " A ", its shared space is 1 byte, the coded system of Chinese and Korean etc. then belongs to double-byte encodings, promptly a Chinese words is made up of 2 bytes, though and Tai Wen encodes in the byte mode, but a safe literal mother at most also can be made of three bytes, with regard to the demonstration aspect, Arabic is to show from right to left, and Chinese, Korean and safe Wen Ze show from left to right, because there is above-mentioned kind of species diversity in various countries' language, the data that causes editing machine can not be common between various countries' language is write operation.
Each electronic information aid manufacturer is for can expand international business, so need develop the electronic information aid that is applicable to more multilingual use, at this purpose, the existing way of each electronic information aid manufacturer is to serve as that a new editing machine (hereinafter referred to as the B editing machine) is developed on the basis more separately by application software engineering teacher with existing editing machine (hereinafter referred to as the A editing machine), if when being C state language development one its electronic information aid that is suitable for again later, must on the basis of A editing machine or B editing machine, develop a C editing machine in addition again, the rest may be inferred, constantly repeat above-mentioned editing machine performance history, in the course of time, then make the have nothing for it but work of exploitation editing machine of each electronic information aid manufacturer drop into more time, manpower and money, be used for safeguarding these numerous different editing machine versions, in addition, if application software engineering Shi Xiugai A, mistake (Bug) on B or the C editing machine, then can't revise the editing machine of all versions simultaneously, promptly be difficult to reach all purpose of upgrading simultaneously of all editing machine versions, therefore how develop and the present problem demanding prompt solution of editing machine development technique that can be common between various countries' language.
Three, summary of the invention
The present invention is for solving the above-mentioned technical matters that exists in the background technology, and provide a kind of multi-lingual write method of supporting, utilize the present invention can make application software engineering teacher be developed the editing machine of supporting multilingual processing easily, make that contained editing machine can provide the shown content of user's editing application software interface of country variant in the electronic information aid, and can reduce electronic information aid manufacturer at time of developing required input on the editing machine again and cost.
Technical solution of the present invention is: the present invention is a kind of multi-lingual module of writing of supporting that is used on the electronic information aid, comprise editing machine 2, its special character is: this is write module and also includes and write interface 10, character space determination module 20 and data outputting module 30, write interface 10 and mainly be made of processing module 11, input type judge module 12 and linguistic property and function storage unit 13, input type judge module 12 and linguistic property and function storage unit 13 join with processing module 11 respectively; Editing machine 2 with write interface 10 and join, character space determination module 20 joins with the processing module 11 of writing in the interface 10, data outputting module 30 is joined with space discrimination module 20.
Above-mentioned electronic information aid is PDA (Personal Digital Assistant), mobile phone or palmtop computer.
A kind ofly utilize the above-mentioned multi-lingual method that module is write of writing of supporting that is used on the electronic information aid, its special character is: this method may further comprise the steps:
S1) at first 2 planning can provide under the input type of institute's input character and the character message such as country origin and can infinitely expand the standard of handling function and write interface 10 according to input method and editing machine, and editing machine 2 all types of processing functions of required reference in the string data processing procedure are left in linguistic property and the function storage unit 13 in advance, then proceed to step S2);
S2) user is by input mode that input method provided, import one group of character string information to editing machine 2 contained writing of forming by a plurality of character by operation-interface set on the electronic information aid and carry out the work that data is write in the interface 10, then proceed to step S3);
S3) input to when writing in the interface 10 when this character string information, differentiate by 11 pairs of projects that this character string information is desired to handle of processing module; If this character string information is desired to carry out branch process and is then proceeded to step S4), then directly proceed to step S7 if the processing project of this character string information is generally operated routinely for execution deletion, insertion and demonstration etc.);
S4) processing module 11 is retrieved in linguistic property and function storage unit 13 according to the contained significant character of this character string information, to judge the national classification under this character string information; Also the significant character of this character string information being offered input type determination module 12 with post-processing module 11 differentiates, with this input type of judging this character string information is to belong to produce a fresh character or replace institute's input character also or serve as replacement institute's input character and produce the wherein a kind of of a fresh character, then proceeds to step S5);
S5) processing module 11 is according to information such as this character string information belonging country classification of judging gained among the step S4 and input types, with the standard of writing interface 10 that application software engineering teacher was planned is framework, write out a branch process program, make corresponding processing mode at different input types whereby, then proceed to step S6);
S6) processing module 11 is retrieved in linguistic property and function storage unit 13 according to this character string information belonging country classification of being judged before earlier, national code with the significant character representative that determines this character string information separately then proceeds to step S6-1);
S6-1) the editing machine 2 branch process program of being write is that the input type of being differentiated via input type determination module 11 is carried out corresponding processing, if input type is for producing a fresh character, then carry out step S6-11), if replace institute's input character, then carry out step S6-12), if replace institute's input character and produce a fresh character, proceed to step S6-13 then) carry out, if other more newtypes then carry out step S6-14).
S6-11) the branch process program produces a fresh character from editing machine 2, and this fresh character is provided with the country origin attribute flags, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9);
S6-12) the branch process program is replaced institute's input character from editing machine 2, and after replacing, a country origin attribute flags is set, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9);
S6-13) the branch process program is replaced institute's input character and is produced a fresh character from editing machine 2, and this fresh character is provided with the country origin attribute flags, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9;
S6-14) the branch process program is provided with the country origin attribute flags in editing machine 2 to other more newtype fresh characters, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9;
S7) processing module 11 is according to the processing type under this character string information, to this character string information delete, operations routinely such as insertion and moving cursor, then proceed to step S8);
S8) this processing module 11 makes character space determination module 20 thoroughly handle contained discriminant function in the function in linguistic property and the function storage unit 13 according to before writing and leave in via application software engineering teacher, differentiate at the shared byte of each character of forming this string data, and the result that will judge offers editing machine 2, for editing machine 2 when showing this character string information, can learn the byte number that each character is shared according to this differentiation, the correct input that shows the user then proceeds to step S9);
S9) editing machine 2 by processing module 11 with handle and judge that the result who finishes is gathered arrangement, then proceed to step S10);
S10) this processing module 11 makes data outputting module 30 according to the contained country origin attribute flags of this string data, differentiate the correct display direction of this string data, wait data output module 30 differentiate finish after, editing machine 2 is shown the character string information that the user imported by data output module 30.
The present invention is combination various different languages contained characteristics out of the ordinary in the world, and on editing machine, define a standard and can infinitely expand the interface of writing of handling function, and this interface for messages such as input type that institute's input character can be provided and country origin to editing machine, make editing machine can according to this one planned write interface standard, obtain the input type of institute's input character and country origin etc. with reference to message, editing machine can be write the branch process program with reference to message according to this then, so that different input types is carried out corresponding processing mode; In procedure for displaying, editing machine also can define discriminant function in advance and be used for judging the direction of desiring the display string data of importing, the display direction of the character string information that makes editing machine correctly show the user according to the result that this discriminant function is judged being imported; On the other hand, for handling operations routinely such as deletion, insertion and moving cursor, editing machine needs then that the compilation operation function is to judge institute's shared byte number of input character separately, and editing machine then can correctly respond user's operational order by the byte number of being judged; Therefore utilize method provided by the present invention can make application software engineering teacher develop a kind of editing machine of supporting multi-lingual processing easily, with solve can't be general between the used editing machine of each language defective and the problem that can't upgrade synchronously of all different editions editing machines, again develop the required people who pays of editing machine to exempt, material resources, and then make the exploitation of editing machine and follow-up management work also can carry out in a simplified manner, simultaneously can make the processing function call of the used editing machine of electronic information aid with unlimited expansion, to make the editing machine can be according to the input of the various different situations of processing function branch process of being write, increase the elasticity that editing machine is write content modification, reduce because of safeguarding the manpower and the material resources of the required input of editing machine version.
Four, drawing explanation
The inner editing machine structured flowchart of digital assistant machine when Fig. 1 uses for the present invention;
Fig. 2-3 is a method flow diagram of the present invention.
Five, embodiment
Being applied on the PDA (Personal Digital Assistant) with the present invention below is example, and the specific embodiment of the present invention is described in further detail:
Referring to Fig. 1, the present invention is applied in the inner contained editing machine of a PDA (Personal Digital Assistant) (PDA), during application, the present invention includes editing machine 2, write interface 10, character space determination module 20 and data outputting module 30, wherein this is write interface 10 and mainly is made of processing module 11, input type judge module 12 and linguistic property and function storage unit 13.
Editing machine 2 is the media of user and 1 communication of PDA (Personal Digital Assistant), be used for utilizing this PDA (Personal Digital Assistant) 1 to finish certain some particular job for the user, as the application software interface displayed content (as literal, content such as symbol and view data) editor, insert, deletion, and change capable number etc., in this editing machine 2, at first plan a standard and can infinitely expand handle function write interface 10, and in writing interface 10, deposit in the future and can write references and relevant processing functions such as required character input type of operation process and the corresponding country origin of character in the execution data for editing machine 2 in contained linguistic property and the function storage unit 13, be able to the smooth and easy operation that multi-lingual input is handled of carrying out in order to editing machine 2; The operation-interface that utilizes a number assistant machine 1 to be set up as the user import one group by a plurality of characters (as literal, numeral and symbol etc.) character string information formed is during to editing machine 2, earlier analyze and handle by writing interface 10 contained 11 pairs of character string informations that the user imported of processing module, whether make editing machine 2 that this character string information is carried out branch process or carries out deletion with decision, general operation such as insertion and demonstration, if decision makes editing machine 2 carry out branch process to this character string information, then processing module 11 makes input type judge module 12 judge that the input type system of this character string information belongs to the generation fresh character or is replacement institute input character, also or for replacing institute's input character and producing wherein one of new character etc. separately, subsequently, editing machine 2 can be write the branch process program by processing module 11 according to above-mentioned planning standard of writing interface 10, so that carry out corresponding work of treatment at above-mentioned various input type.
In addition, because of the language under each country, the area all has its characteristics separately, with regard to regard to coded system, the coded system of Arabic is an identical element common people unit group coding, promptly a character uses a byte, and the coded system of Korean and Chinese etc. then is a dibit common people tuple; And with regard to demonstration, Arabic is to export demonstration from right to left, Korean and Chinese then are to show from left to right, so be the correct character string information that shows that the user imported, after the work that 2 desires of decision editing machine are carried out, must retrieve in linguistic property and function storage unit 13 according to significant character contained in this character string information by processing module 11 immediately, determine country origin under this character string information with this, the display direction that can make editing machine 2 determine the coded system of these character string informations to reach last character string data has a clear and definite reference frame, then, data processing module 11 provides one from before being deposited in the character space determination module 20 by the discriminant function that application software engineering teacher write that language attribute and function storage unit 13 hunt out, this discriminant function is to be based upon on the basis of each language grammar characteristic of analysis-by-synthesis, making this character space determination module 20 can be individual character unit to contained character in institute's input character string data shared figure place and employed coded system thereof, also or for other coded system (as Arabic is the identical element coding to the double word symbol, Chinese is dibit encoding etc.) differentiate, the correct byte numerical value that editing machine 2 can be determined according to this character space determination module 20 is so that make just deletion of editing machine 2, the execution purpose of the correct customer in response of operation routinely such as insertion and moving cursor.
In this simultaneously, processing module 11 also can be passed through character space determination module 20, one explicit function that is write in data outputting module 30 in advance by application software engineering teacher is provided, this explicit function be used for differentiating import desire the display direction of character display string data, this explicit function also need be based upon analysis-by-synthesis to be desired on the basis of display string characteristics, as: this string data is with Arabic character beginning, then character string system is write from right to left, if Chinese, English, Korean and safe literary composition etc., character string is to arrange from a left side from right, subsequently, the character string information direction that can be imported according to the correct explicit user of display direction that data output module 30 is judged of editing machine 2.
Referring to Fig. 2-3, idiographic flow was as follows when the inventive method was applied on the PDA (Personal Digital Assistant):
S1) at first, message such as country origin can be provided under the input type (as producing a fresh character, replacing institute's input character and replace institute's input character and produce a fresh character etc.) of institute's input character and the character at input method and editing machine 2 planning one by application software engineering teacher earlier and can infinitely expand the standard of handling function and write interface 10, and editing machine all types of processing functions of required reference in the string data processing procedure are left in linguistic property and the function storage unit 13 in advance, subsequently and proceed to step S2);
S2) user is by input mode that input method provided, import one group of character string information to editing machine 2 contained writing of forming by a plurality of character by the set operation-interface of personal digital assistant and carry out the work that data is write in the interface 10, subsequently and proceed to step S3);
S3) input to when writing in the interface 10 when this character string information, differentiate by 11 pairs of projects that this character string information is desired to handle of processing module, to determine next step required program of carrying out, if this character string information is desired to carry out branch process and is then proceeded to step S4), then directly proceed to step S7 if the processing project of this character string information is generally operated routinely for execution deletion, insertion and demonstration etc.);
S4) processing module 11 is promptly retrieved in linguistic property and function storage unit 13 according to the contained significant character of this character string information, to judge the national classification under this character string information, also the significant character of this character string information being offered input type determination module 11 with post-processing module 11 differentiates, with this input type of judging this character string information is to belong to produce a fresh character or replace institute's input character also or serve as replacement institute's input character and produce the wherein a kind of of a fresh character, subsequently and proceed to step S5);
S5) processing module 11 is according to information such as this character string information belonging country classification of judging gained among the step S4 and input types, with the standard of writing interface 10 that application software engineering teacher was planned is framework, write out a branch process program, make corresponding processing mode at different input types whereby, subsequently and proceed to step S6).
S6) processing module 11 is retrieved in linguistic property and function storage unit 13 according to this character string information belonging country classification of being judged before earlier, with the national code of the significant character representative that determines this character string information separately (for example differentiate the result, CC country code under this character string information is a Korea S), satisfy subsequently and proceed to step S6-1).
S6-1) the editing machine 2 branch process program of being write is that the input type of being differentiated via input type determination module 11 is carried out corresponding processing, if input type is for producing a fresh character, then carry out step S6-11), if replace institute's input character, then carry out step S6-12), if replace institute's input character and produce a fresh character, proceed to step S6-13 then) carry out, if other more newtypes then carry out step S6-14).
S6-11) the branch process program produces a fresh character from editing machine 2, and this fresh character is provided with the country origin attribute flags, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9);
S6-12) the branch process program is replaced institute's input character from editing machine 2, and after replacing, a country origin attribute flags is set, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9);
S6-13) the branch process program is replaced institute's input character and is produced a fresh character from editing machine 2, and this fresh character is provided with the country origin attribute flags, can be in order to demonstration operation subsequently according to this country origin attribute flags, to meet the picture output of this country origin literal display direction, then proceed to step S9);
S6-14) the branch process program is provided with the country origin attribute flags in editing machine 2 to other more newtype fresh characters, can export with the picture that meets this country origin literal display direction according to this country origin attribute flags in order to demonstration operation subsequently, then proceed to step S9);
S7) processing module 11 is according to the processing type under this character string information, to this character string information delete, operations routinely such as insertion and moving cursor, subsequently and proceed to step S8);
S8) this processing module 11 makes character space determination module 20 thoroughly handle contained discriminant function in the function in linguistic property and the function storage unit 13 according to before writing and leave in via application software engineering teacher, differentiate at the shared byte of each character of forming this string data, and the result that will judge offers editing machine 2, for editing machine 2 when showing this character string information, can learn the byte number that each character is shared according to this differentiation, the correct input that shows the user, subsequently and proceed to step S9);
S9) editing machine 2 by processing module 11 with handle and judge that the result who finishes is gathered arrangement, subsequently and proceed to step S10);
S10) this processing module 11 makes data outputting module 30 according to the contained country origin attribute flags of this string data, differentiate the correct display direction of this string data, wait data output module 30 differentiate finish after, editing machine 2 is shown in the character string information that the user imported on the set display of PDA (Personal Digital Assistant) 1 by data output module 30.
But in the editing machine performance history of the present invention applicable to the electronic information aid of any display text and image information, portable electronic information aid particularly is as mobile phone, palmtop computer (Pocket PC) etc.