Document edit method and device
Technical field
The application is related to field of computer technology, more particularly to a kind of document edit method and device.
Background technology
In correlation technique, use plain textization management usual to document data.However, for software product class document, skill
For art class document, generally there are the data that largely can mutually quote, associate in these documents, when modifying and adjust to document
When whole, generally require to assess influence repeatedly, and repeat to change the similar content positioned at diverse location, considerably increase document
The difficulty and workload of maintenance.
The content of the invention
In view of this, the application provides a kind of document edit method and device.
Specifically, the application is achieved by the following technical solution:
A kind of document edit method, methods described includes:
The structured data of user's input is received, and determines that the structured data is corresponding and quotes coding;
Preserve the structured data and the corresponding relation for quoting coding;
When editing document, for the structured data preserved, the corresponding reference coding of user's input is received;
When receiving document display or export instruction, search and the corresponding structured data of coding is quoted in the document;
Reference coding in the document is replaced with and shows or exports after corresponding structured data.
A kind of document editing device, described device includes:
Data receipt unit, receives the structured data of user's input, and determines the corresponding reference of the structured data
Coding;
Data saving unit, preserves the structured data and the corresponding relation for quoting coding;
Documents editing unit, when editing document, for the structured data preserved, receives the corresponding of user's input
Quote coding;
Data searching unit, when receiving document display or export instruction, searches and coding correspondence is quoted in the document
Structured data;
Data replacement unit, the reference coding in the document is replaced with and shows or leads after corresponding structured data
Go out.
Can individually it be preserved after the structured data of user's input is received by the application it can be seen from above description
Structured data quotes the corresponding relation of coding with it, document preparation personnel when editing document, can using quote encode come
The structured data preserved is quoted, when checking or exporting document, the reference coding in document can be replaced with corresponding
Structured data, without updating structured data repeatedly, reduces the workload of document preparation.In addition, to knot
When structure volume data is modified or adjusted, the structured data that modification or adjustment are preserved, it is to avoid repetition to document
Modification, reduces the difficulty and workload of document maintenance.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of document edit method shown in the exemplary embodiment of the application one.
Fig. 2 is a kind of schematic diagram for enumerating form shown in the exemplary embodiment of the application one.
Fig. 3 is a kind of schematic diagram of document edit method shown in the exemplary embodiment of the application one.
Fig. 4 is a kind of structure chart for document editing device shown in the exemplary embodiment of the application one.
Fig. 5 is a kind of document editing device block diagram shown in the exemplary embodiment of the application one.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to
During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment
Described in embodiment do not represent all embodiments consistent with the application.On the contrary, they be only with it is such as appended
The example of the consistent apparatus and method of some aspects be described in detail in claims, the application.
It is the purpose only merely for description specific embodiment in term used in this application, and is not intended to be limiting the application.
" one kind ", " described " and "the" of singulative used in the application and appended claims are also intended to including majority
Form, unless context clearly shows that other implications.It is also understood that term "and/or" used herein refers to and wrapped
It may be combined containing one or more associated any or all of project listed.
It will be appreciated that though various information, but this may be described using term first, second, third, etc. in the application
A little information should not necessarily be limited by these terms.These terms are only used for same type of information being distinguished from each other out.For example, not departing from
In the case of the application scope, the first information can also be referred to as the second information, similarly, and the second information can also be referred to as
One information.Depending on linguistic context, word as used in this " if " can be construed to " ... when " or " when ...
When " or " in response to determining ".
In correlation technique, by taking software product class document as an example, software product class document is generally in software analysis and research and development
Starting stage, developer has carried out substantial amounts of analysis and combed and preparation, and forms software product class document, for compiling
Code personnel write the code of correlation.Because the complexity of large software is high, modules association is more, during analyzing and being related to
Abstract and refinement degree is higher, causes document complicated, and mass data is mutually quoted, associated in document.When needing the portion to document
Point content modify adjustment when, it is necessary to assess influence repeatedly, and repeat to change the similar content positioned at diverse location, increase
The difficulty and workload for having added document to safeguard.
Still by taking software product class document as an example, due to there are a large amount of data that are basic, having certain structure in document, this
A little data may be used repeatedly in the different chapters and sections of document, or part is used, therefore the application is proposed this basis
Property, the structured data that has certain structure and may be quoted repeatedly be kept separately developer when editing document, can be with
The structured data preserved is quoted using coding is quoted, when checking or exporting document, the reference in document can be compiled
Code replaces with corresponding structured data, without updating structured data repeatedly, reduces the work of document preparation
Amount.In addition, when modifying or adjusting to structured data, the structured data that modification or adjustment are preserved, it is to avoid
Repetition to document is changed, and reduces the difficulty and workload of document maintenance.
The implementation process of the application is described with reference to specific embodiment.
Fig. 1 is a kind of schematic flow sheet of document edit method shown in the exemplary embodiment of the application one.
Fig. 1 is refer to, the document edit method can be applied in document editor, and the document editor can be filled
It is loaded in the intelligent electronic devices such as PC, mobile phone, PDA (Personal Digital Assistant, palm PC).The text
Shelves edit methods include following steps:
Step 101, the structured data of user's input is received, and determines that the structured data is corresponding and quotes coding.
Step 102, the structured data and the corresponding relation for quoting coding are preserved.
Step 103, when editing document, for the structured data preserved, the corresponding reference of user's input is received
Coding.
In the present embodiment, still by taking software product class document as an example, the writer of document first can exist developer
The structured data that the initial stage of research and development of software is set individually is preserved.Specifically, the document editor, which can be provided, " compiles
The option of volume structured data ", the writer of document can trigger the option, to enter structured data editing interface, and
Based on the structured data editing interface input structure volume data.
In the present embodiment, document editor can also determine the reference coding of the structured data, and preserve described
Structured data quotes the corresponding relation of coding with it.In one example, the reference coding can be by document preparation personnel
Input, such as:Document preparation personnel can set a corresponding name when writing structured data for each structured data
Claim, using the reference coding as the structured data.In another example, the reference coding can also be by documents editing
Device is automatically generated, such as:After the structured data of document preparation personnel input is received, document editor can be the knot
Structure volume data genesis sequence number, is encoded, relatively simple, will can be inputted for document preparation personnel first as described quote
Coding 1 is quoted in individual structured data generation, is that coding 2 etc. is quoted in second structured data generation of document preparation personnel input
Deng.Certainly, in this implementation, the reference coding of generation can be showed document preparation personnel by document editor, for text
Shelves writer subsequently quotes to the structured data.
In the present embodiment, the structured data has been generally included:Enumerate class data, form class data, key assignments class number
According to, attachment data etc..Wherein, the form that shows for enumerating class data can be form, or other forms, refer to
Fig. 2, Fig. 2 show that one kind enumerates form, and this enumerates the entitled of form:AAA, the i.e. reference for enumerating form are encoded to AAA.
In the present embodiment, the structured data based on preservation and quote encode, document preparation personnel when writing document,
The structured data preserved is quoted if desired, and document preparation personnel can edit corresponding reference coding in a document i.e.
Can, to replace the structured data, write without re-starting again.Wherein, the coding for quoting coding has spy
Fixed form, can be recognized, such as by document editor:The specific form can be started with " # ", and be ended up with " # ", institute
Reference coding is stated to be located in the middle of two " # ".
Still by shown in Fig. 2 enumerate form exemplified by, this enumerate form it is corresponding quote coding can be:AAA, documents editing
Device preserves this and enumerates form and AAA corresponding relation.When document preparation personnel think to insert the form shown in Fig. 2 in a document,
Document preparation personnel can input " #AAA# " in corresponding position.In another example, when the structured data is form
During the data of class, the partial data in the form can also be quoted, now, the reference of document preparation personnel input is compiled
The row information and column information of the form can be also carried in code.Still by taking Fig. 2 as an example, when document preparation personnel want to quote Fig. 2 institutes
When showing the first row and the third line of form, document preparation personnel can corresponding position input " #AAA [1,3] # ", wherein, side
The row information for the form AAA that digitized representation in bracket is quoted.When document preparation personnel want to quote first of form shown in Fig. 2
Row, the first row and secondary series of the third line when, document preparation personnel can corresponding position input " #AAA [1,3] (1,
2) # ", wherein, the column information for the form AAA that the digitized representation in round parentheses is quoted.It is described to quote coding in another example
In can also include the type of structured data, still by shown in Fig. 2 enumerate form exemplified by, reference coding for enumerating form can
Think that " character enumerated behind the type that the character before/AAA ", oblique line is structured data, oblique line is structured data
Title.Certainly, above-mentioned reference encodes exemplary only explanation, during practical application, and the reference coding can also
For extended formatting, the application is not particularly limited to this.
In one example, document editor is during documents editing, if received for specified format data
Edit instruction, then can be with the prompt message of output edit structured data.Wherein, the edit instruction of the specified format data
It can include:Form inserting instruction, annex inserting instruction etc..The prompt message can for " whether using the form/annex as
Structured data is individually preserved”.If after receiving the confirmation instruction that user inputs for the prompt message, documents editing
The data of the specified format can be defined as structured data by device, and determine the reference coding of the structured data, protect
Deposit the structured data and the corresponding relation for quoting coding.Such as:The form or annex are quoted into coding with it
Corresponding relation be stored in the position specified, the position specified is position independently of store the document data.
In another example, after document preparation personnel preserve document, document editor can also be automatically in the text
It look for quoting the structured data of coding form editor in shelves.Such as:Document editor is being found not to quote volume
After the structured data of code form editor, all structured datas found can be shown, to ask the user whether to preserve
These structured datas, document preparation personnel can according to actual needs select to preserve the entire infrastructure volume data found, protect
File for reference the part-structure volume data found, or do not preserve any structured data found, and input the knot for needing to preserve
The reference coding of structure volume data, the corresponding relation encoded with structured data is quoted so that document editor is preserved.
Step 104, when receiving document display or export instruction, search and the corresponding structure of coding is quoted in the document
Volume data.
In the present embodiment, document editor can travel through corresponding text when receiving document display or export instruction
Shelves, search the reference coding that the document includes, such as:Search and started in the document with " # ", and with drawing that " # " ends up
With coding.After reference coding is found, each quote can also be searched and encode corresponding structured data.
Step 105, the reference coding in the document is replaced with and shows or export after corresponding structured data.
, can be by the document after the corresponding structured data of the reference coding is found based on abovementioned steps 104
In reference coding replace with corresponding structured data, then show or export the document.
Still by shown in Fig. 2 enumerate form exemplified by, can be by the # in document if the reference in document is encoded to AAA
AAA# is replaced with and is enumerated form shown in Fig. 2., then can be by the # in document if the reference in document is encoded to AAA [1,3]
AAA [1,3] # replaces with the first row and the third line that form is enumerated shown in Fig. 2.
In the present embodiment, replace it is described quote coding when, for the presentation parameter of structured data, such as:Font,
Font size etc., can keep the original presentation parameter of the structured data, can also be adapted to the displaying ginseng of the data of other in document
Number, the application is not particularly limited to this.
Can individually it be preserved after the structured data of user's input is received by the application it can be seen from above description
Structured data quotes the corresponding relation of coding with it, document preparation personnel when editing document, can using quote encode come
The structured data preserved is quoted, when checking or exporting document, the reference coding in document can be replaced with corresponding
Structured data, without updating structured data repeatedly, reduces the workload of document preparation.In addition, to knot
When structure volume data is modified or adjusted, the structured data that modification or adjustment are preserved, it is to avoid repetition to document
Modification, reduces the difficulty and workload of document maintenance.
Optionally, in the application another example, still by taking software product class document as an example, due to substantial amounts of knot in document
Structure volume data is mutually quoted, associated, and to understand some influence of modification to entire chapter document, is changed in the structured data of preservation
When, document editor can mark the structured data of modification in displaying or derived document, such as:In highlighted form
Mark the structured data changed, or the structure changed with the parameter display different from other data exhibiting parameters
Data etc., so that related personnel refers to, assistant analysis assesses the brought influence of modification.
On the other hand, the technical scheme provided using the application, independent storage configuration volume data, documents editing instrument can be with
Expansion interface is easily provided to realize the functions such as extraction, conversion to these structured datas.Structured data can also be related
Instrument is generated as corresponding code, configuration, database structure category information, can easily realize that these structured datas are real to software
Automation generation, comparison of code, configuration, database structure category information during applying etc., reduce and manually implement into
This, reduces the probability of error.For example, based on the Code Generator developed in advance, correspondence can be automatically generated described
The software code of structured data, without coder's manual compiling, reduces the probability of error, improves the effect of written in code
Rate.
The implementation process of the application described below in conjunction with the accompanying drawings.
Fig. 3 is a kind of schematic diagram of document edit method shown in the exemplary embodiment of the application one.
In step 301, document editor receives the structured data that user inputs in structured data editing interface
Encoded with quoting, and storage configuration volume data and the corresponding relation for quoting coding.
In step 302, user, for the structured data preserved, is encoded when editing document with corresponding quote
Editor, without writing complete structured data again.After user preserves the document editted, document editor can
To preserve the document.
In the present embodiment, as seen from Figure 3, the storage of document and structured data is separate, wherein, document
Storage can use the textual storage in correlation technique, and the application is not particularly limited to this.
In step 303, in document display or export, it can search and the corresponding structure of coding is quoted in the document
Data, and the reference coding in the document is replaced with into displaying or export after corresponding structured data.
In step 304, when the structured data of preservation is changed, modification is marked in displaying or derived document
Structured data.
In the present embodiment, can be structured data addition modification mark when the structured data of preservation is changed
Note.So, when user's displaying or derived document, after the corresponding structured data of coding is quoted in searching the document,
If there is the structured data modification to mark, structured data is marked in document that can be after replacement, for analysis
The modification is to global influence.
In step 305, structured data can be generated as corresponding code, configuration, database structure by related tool.
Embodiment with afore-mentioned document edit methods is corresponding, and present invention also provides the embodiment of document editing device.
The embodiment of the application document editing device, which can be applied, to be mounted with the electronic equipment of document editor.Device
Embodiment can be realized by software, can also be realized by way of hardware or software and hardware combining.Exemplified by implemented in software,
As the device on a logical meaning, being will be corresponding in nonvolatile memory by the processor of electronic equipment where it
Computer program instructions read what operation in internal memory was formed.For hardware view, as shown in figure 4, being compiled for the application document
A kind of hardware structure diagram of electronic equipment where volume device, except the processor shown in Fig. 4, internal memory, network interface and it is non-easily
Outside the property lost memory, electronic equipment in embodiment where device, can be with generally according to the actual functional capability of the electronic equipment
Including other hardware, this is repeated no more.
Fig. 5 is a kind of document editing device block diagram shown in the exemplary embodiment of the application one.
Fig. 5 is refer to, the document editing device 400 can apply the document loaded in the electronic equipment shown in Fig. 4
In editing machine, include:Data receipt unit 401, data saving unit 402, documents editing unit 403, data searching unit
404th, data replacement unit 405 and data markers unit 406.
Wherein, data receipt unit 401, receive the structured data of user's input, and determine the structured data pair
The reference coding answered;
Data saving unit 402, preserves the structured data and the corresponding relation for quoting coding;
Documents editing unit 403, when editing document, for the structured data preserved, receives pair of user's input
The reference coding answered;
Data searching unit 404, when receiving document display or export instruction, searches and coding pair is quoted in the document
The structured data answered;
Data replacement unit 405, by the reference coding in the document replace with after corresponding structured data displaying or
Export.
Data markers unit 406, when the structured data of preservation is changed, in displaying or the acceptance of the bid of derived document
Remember the structured data for modification.
Optionally, the data receipt unit 401, during documents editing, if received for specified format
The prompt message of the edit instruction of data, then output edit structured data, it is defeated for the prompt message when receiving user
After the confirmation instruction entered, it is the structured data that user inputs to determine the specified format data.
Optionally, the data receipt unit 401, receives the structure that user inputs in structured data editing interface
Data.
Optionally, the structured data includes:Enumerate class data, form class data, key assignments class data or attachment data.
Optionally, the coding of quoting has specific form, includes the title of counter structure volume data.
Optionally, when the structured data is form class data, the reference coding also includes the row of correspondence form
Information and column information.
Optionally, the structured data can be generated as corresponding code, configuration, database structure class letter by related tool
Breath.
The function of unit and the implementation process of effect specifically refer to correspondence step in the above method in said apparatus
Implementation process, will not be repeated here.
For device embodiment, because it corresponds essentially to embodiment of the method, so related part is real referring to method
Apply the part explanation of example.Device embodiment described above is only schematical, wherein described be used as separating component
The unit of explanation can be or may not be physically separate, and the part shown as unit can be or can also
It is not physical location, you can with positioned at a place, or can also be distributed on multiple NEs.Can be according to reality
Selection some or all of module therein is needed to realize the purpose of application scheme.Those of ordinary skill in the art are not paying
In the case of going out creative work, you can to understand and implement.
The preferred embodiment of the application is the foregoing is only, not to limit the application, all essences in the application
God is with principle, and any modification, equivalent substitution and improvements done etc. should be included within the scope of the application protection.