GB2245400A - Document layout processing - Google Patents

Document layout processing Download PDF

Info

Publication number
GB2245400A
GB2245400A GB9112589A GB9112589A GB2245400A GB 2245400 A GB2245400 A GB 2245400A GB 9112589 A GB9112589 A GB 9112589A GB 9112589 A GB9112589 A GB 9112589A GB 2245400 A GB2245400 A GB 2245400A
Authority
GB
United Kingdom
Prior art keywords
layout
data structure
intermediate data
node
document
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.)
Granted
Application number
GB9112589A
Other versions
GB2245400B (en
GB9112589D0 (en
Inventor
Kazou Saito
Naoki Hayashi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Priority claimed from JP2157067A external-priority patent/JP3023690B2/en
Priority claimed from JP2157068A external-priority patent/JP2855797B2/en
Application filed by Fuji Xerox Co Ltd filed Critical Fuji Xerox Co Ltd
Publication of GB9112589D0 publication Critical patent/GB9112589D0/en
Publication of GB2245400A publication Critical patent/GB2245400A/en
Application granted granted Critical
Publication of GB2245400B publication Critical patent/GB2245400B/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents

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)
  • Document Processing Apparatus (AREA)

Abstract

When the layout structure of a specific document based on a limitation of a layout structure common to a plurality of documents is to be generated, an intermediate data structure generating unit (2) generates an intermediate data structure indicating a data structure related to a layout which represents a minimum layout structure common to all specific layout structures which can be generated from the common layout structure and information about a manipulation indicating whether addition or deletion of a specific structure to or from the minimum layout structure is possible. In document processing, an intermediate data structure altering unit (3) alters the intermediate data structure which is held in a holding unit (8), on the basis of the content of a specific document to be laid out and the information about the manipulation which is included in the intermediate data structure itself held in the holding unit (8). A specific layout structure extracting unit (4) extracts a layout structure corresponding to the specific document to be laid out, from a newest intermediate data structure held. <IMAGE>

Description

1 k cl - - s 4 5:., - - 1 '.C-- DOCUMENT LAYOUT PROCESSING METHOD AND
DEVICE FOR CARRYING OUT THE SAME The present invention relates to a document layout processing method for generating a specific layout structure on the basis of a generic layout structure and the content of a specific document to be laid out, and to a device for carrying out such a method.
In recent years, it has been proposed to perform layout of a document (document processing) on the basis of the concept of a so-called structured document according to which one document is handled as a combination of a logical structure based on its sections and paragraphs and a layout structure which represents how the content of the document is to be actually arranged.
One example of document layout processing has recently been realized which is based on an office document architecture (hereinafter referred to as the "ODA") (ODA=ISO 8613: Information Processing-Text and Office System-Office Document Architecture (ODA) and Interchange Format (1989)) which belongs to the system of OSI (open System Interconnection) proposed by the ISO (international Standards organization).
According to the ODA, one document has, in addition to its layout structure, a logical structure which represents a structure obtained by logically grasping sections, paragraphs and the like. The content of a specific document 1 is linked to logical objects positioned at the lowest level of a specific logical structure. Fig. 11 shows the relation between the specific logical structure and the document content linked thereto. in Fig. 11, the upper and lower portions with respect to the chain line indicated by an arrow A correspond to the specific logical structure and the document content, respectively.
The ODA enables automatic layout processing which automatically generates a specific layout structure permitted by a generic layout structure, according to document contents linked to a specific logical structure, and links the specific logical structure to the specific layout structure via the document contents. To automatically generate the specific layout structure according to the document contents linked to the specific logical structure indicates a series of manipulations, for example, a process in which if a certain document content is not completely laid out in a subordinate structure of a certain page object, a new page object is automatically generated and the overflown document content is laid out in the new page object.
Fig. 12 shows an example of a structure in which a document corresponding to the specific logical structure shown irf Fig. 11 is laid out. In Fig. 12, the upper portion with respect to the chain line indicated by the arrow A corresponds to the specific logical structure, while the lower portion with respect to the chain line indicated by an arrow B corresponds to the specific layout structure. The example of Fig. 12 shows a case where although the content of 1 -3Paragraph 2.1 of Section 2 is to be laid out on a first page, the content is too long to be laid out within the first page so that the content of Paragraph 2.1 of Section 2 is divided into halves and the latter half is laid out on a second page.
It is to be noted that, according to the ODA, each layout object class in the generic layout structure has an expression called a structure expression as an attribute "generator for subordinates" (hereinafter referred to as a "GFS") to represent a specific layout structure which can be generated. The structure expression is an expression representative of limitations of a structure immediately subordinate to a layout object belonging to a corresponding layout object class. The structure expression consists of a combination of a term SEQ, AGG, CHO, REP and-an object class identifier (hereinafter referred to as a "class ID").
The meaning of each of the terms will be described below.
It is assumed here that "a" and "b" indicate layout objects belonging to classes identified by the class IDS "A" and 11B11,, respectively.
(1) The class ID is a symbol for primarily identifying each class within the generic layout strucure.
- (2) If a structure expression containing the class ID term is evaluated, one layout object belonging to a layout object class indicated by the class ID is generated as the evaluation result of the class ID term.
(3) If a structure expression containing the term SEQ is evaluated, the evaluation result of terms which follow - 1+ - the term SEQ indicates that the evaluated terms are linked in that order.
For example, the evaluation result of the structure expression (SEQ A B) is (a b).
(4) if a structure expression containing the term AGG is evaluated, the evaluation result of terms which follow the term AGG indicates that the evaluated terms are linked in arbitrary order.
For example, the evaluation result of the structure expression (AGG A B) Is (a b) or (b a).
(5) If a structure expression containing the term CHO is evaluated, the evaluation result of terms which follow the term CHO indicates that any one of the evaluated terms is selected.
For example, the evaluation result of the structure expression (CHO A B) is (a) or (b).
(6) If a structure expression containing the term OPT is evaluated,.the evaluation result is either an evaluated term which follows the term OPT or nothing.
For example, the evaluation result of the structure expression (OPT A) is (a) or "nothing".
(7) If a structure expression containing thb term REP is evaluated, the evaluation result indicates that an evaluated term which follows the term REP is repeated once or an arbitrary number of times more than once.
For example, the evaluation result of the structure expression (REP A) is (a), (a a), (a a a),..., or (a a... a).
In addition, such a structure expression can be 1 represented as a combination of terms selected from the aforesaid terms, for example, in the form of (SEQ(CHO A B)(OPT C)). The evaluation result of the structure expression (SEQ(CHO A B)(OPT C)) is (a), (a c), (b) and (b c). Each layout object class in the generic layout structure has any of the above-described structure expressions in its GFS.
Regarding the kind of immediately subordinate object which can be linked to a layout object belonging to a certain class, the layout object is limited by the structure expression contained in the GFS of the certain class. In other words, an object corresponding to any of the evaluation results of the structure expression can only be immediately linked to the layout object as a subordinate object. For example, if a layout object class whose class ID is 'W' has the structure expression (SEQ(CHO A B)(OPT C)) in its GFS, the object a can be immediately linked to an object x which belongs to the layout object class having the class ID "X", but it is impossible to link both of the objects a and b to the same.
As described above, the generic layout structure is represented by a combination of a subordinate-element generator and a frame class representing the template of an actual frame. Fig. 13 shows one example of the generic layout structure, and Fig. 14 shows a layout image represented by the generic layout structure.
As a related art concerning document processing (hereinafter referred as ',layout processing") which utilizes - 6 a generic structure and a specific structure to generate a specific layout structure on the basis of a document content and a generic layout structure, there is a method of sequentially generating the specific layout structure by sequentially trying a plurality of choices related to structure generation which are described in the generic layout structure. In such a method, a desired part of a document content is laid out in accordance with one choice selected from among the choices in a predetermined order. Layout processing is achieved, for example, by performing sequential selection from the plurality of choices related to the structure generation of each class on the basis of leftdepth-first- search.
Fig. 16(a) shows one example of a specific layout structure corresponding to the generic layout structure shown in Fig. 15. The shown specific layout structure is obtained by performing selection from the choices of the generic layout structure on the basis of left-depth-first-search.
It is assumed here that a, b, c, d, e and f respectively denote layout objects belonging to individual object classes whose class IDs are R, A, BF C, D, E and F. Since the object classes individually serve as choices they are hereinafter referred to as choices R, A, B, C, D, E and F, respectively.
When the specific layout structure (refer to Fig. 16(a)) is generated, information is stored into a stack which information indicates that a certain layout object class was selected at the time when a specific choice among the - 'I plurality of choices was processed. Fig. 16(b) shows the content of the stack obtained when the specific layout structure shown in Fig. 16(a) is generated. In Fig. 16(b), "A", "C,,'W' and 11E11 respectively denote information indicating that the choices A, C, B and E have been selected.
If the layout fails, the next choice is selected in a predetermined order (the uppermost information in the stack shown in Fig. 16(b) is restored and another choice is selected), thereby again carrying out layout processing. At this time, to cancel the specific layout structure generated according to the immediately previous choice, generation and deletion of layout objects are performed so as to match the state of the layout to the new choice.
In the above-described conventional layout method. however, when the specific layout structure is generated, the information must be stored into the stack which information indicates that the certain layout object class was selected at the time when the specific choice among the plurality of choices was processed. If the layout fails, it is necessary to perform a retry of a new layout by restoring the uppermost information in the stack and selecting another choice.
The following description is made of a retry'of layout which is performed when the layout of the choice C has failed, for example, in the specific layout structure shown in Fig. 16(a).
The state of the stack before the retry is as shown in Fig. 16(b). Therefore, the uppermost information "E" is first obtained, then the stack is restored to the state 1 wherein it was placed before the choice E was laid out, on the basis of the information "E", and then the choice F is selected instead of the choice E, whereby a new specific layout structure can be obtained. Fig. 17(a) shows the specific layout structure obtained by performing such a retry. Fig. 17(b) shows the state of the stack obtained by performing the retry. In Fig. 17(b), "F" represents information indicating that the choice F has been selected. In this cade as well, however, the layout fails since an alternative candidate (the choice D) for the choice C has not been selected.
Subsequently, the uppermost information "F,, is obtained by further making reference to the content of the stack shown in Fig. 17(b), then the stack is restored to the state wherein it was placed before the choice F was laid out, on the basis of the information IF" (in this case, the stack is restored to the state wherein it was placed when the choice A was.laid out, due to limitations of the generic layout structure), and then the choice D is selected instead of the choice C. whereby a new specific layout structure can be obtained. Fig. 17(c) shows the specific layout structure obtained by performing such a retry. Fig. 17(d) shows.the state ofthe stack obtained by performing the retry. In Fig. 17(d),, "D" represents information indicating that the choice D has been selected.
As is apparent from the foregoing description, according to the conventional layout method, to cancel a specific layout structure generated according to an immediately previous choice, it is necessary to frequently perform generation and deletion of layout objects so as to match the state of a layout to a new choice. As a result, it is difficult to achieve layout processing with high efficiency.
A document layout processing device having the arrangement shown in Fig. 18 has been proposed as a document layout processing device which is intended to restrain generation and deletion of unnecessary layout objects and improve the efficiency of layout processing.
The device according to the embodiment shown in Fig. 18 is a device for performing document layout processing based on the above-described ODA (office document architecture). In Fig. 18, the document layout processing device comprises a controller 1807 and a memory 1812. The controller 1807 includes a reader 1801 and a specific layout structure generator 1806 for generating a specific layout structure on the basis of the content of a document and a generic layout structure. The specific structure generator 1806 includes a generator generating unit 1802, a generator managing unit 1803, a generator selecting unit 1804 and a specific layout structure converter 1805. The memory 1812 includes-a document content storing unit 1808 for storing the content of the document, a generic layout structure storing unit 1809 for storing the generic layout structure, a generator storing unit 1810 for storing a generator which will be described later, and a specific layout structure storing unit 1811 for storing the specific layout structure.
- to- The controller 1807 is constituted by a central processing unit and the like, and the memory 1812 is constituted by a main memory, a hard disk and the like.
The reader 1801 reads a generic layout structure from the generic layout structure storing unit 1809 and outputs the generic layout structure to the generator generating unit 1802. The reader 1801 also reads the content of a document to be laid out from the document content storing unit 1808 and outputs the document content to the generator selecting unit 1804.
The generator generating unit 1802 has the functions of the generating means described previously, and generates a data structure representative of both the selection history of a subordinate structure and information about the generation of the subordinate structure in association with a superior element having the subordinate structure as a subordinate structure which can be generated in a generic layout structure.
In this embodiment, it is assumed that the data structure is defined as a generator. As described in detail later, the generator necessarily accompanies a layout object having a subordinate structure, and is generated in association with the layout object having the subordinate structure. The layout object corresponds to a page or a frame.
Fig. 19 is a diagram showing one example of the internal structure of a generator in which a layout object class corresponding to a layout object (element) having a 1..
- 11 subordinate structure which can be generated has the structure expression (SEQ (CHO A B) C (OPT D)) in its GFS.
In the structure expression (SEO (CHO A B) C (OPT D)), A, B, C and D represent object classes, respectively. In this case, the kinds of specific layout structures permitted as a whole are (A C),, (B C)r (A C D) and (B C D).
In Fig. 19, a generator related to generation of the subordinate structure of a layout object 1910 is composed of constituent elements, i. e., generators 1920 to 1980 which are functional units. In this example, the hierarchy of the generators has a three-level structure, and the Class 1950, 1960 and 1980 indicate layout class generators 19400 objects, respectively.
Incidentally, to discriminate between the generator related to the generation of the subordinate structure and the generators (constituent elements) which constitute the former generator. the generators serving as the constituent elements are hereinafter called "element generators".
The generator managing unit 1803 stores a generator generated by the generator generating unit 1802 into the generator storing unit 1810, and reads a generator from the generator storing unit 1810 and temporarily memorizes the read generator.
The generator selecting unit 1804 has the function of the selecting means described previously, and selects element generators from among the generators memorized in the generator managing unit 1803 in accordance with the content of a document.to be laid out. From among the element 1.1 -12 generators selected by the generator selecting unit 1804, a Class generator generates a desired layout object.
The specific layout structure converter 1805 temporarily memorizes the layout objects generated by the generator selecting unit 1804, and stores the memorized final specific layout structure into the specific layout structure storing unit-1811.
The internal structure of the generator will be described below in detail.
The generator, which necessarily accompanies an object having a subordinate structure, has a complicated structure and is structured according to a structure expression. The structure expression determines what layout object or what combination of layout objects is possible at a level subordinate to a specific layout object. The subordinate-element generator is represented as an expression (structure expression) using a combination of a layout object class representing the template of an actual frame and one or more of six subordinate-element generators including SEQ, AGG, OPT, REP, OPTREP and CHO. Each of the subordinateelement generators is defined as follows.
SEQ... A plurality of elements (layout objects) which follow this subordinate-element generator must exist in a specified order.
AGG... A plurality of elements (layout objects) which follow this subordinate-element generator must exist in an arbitrary order.
CHO... From among a plurality of elements (layout 'I 1 1 - 13 objects) which follow this subordinate-element generator, one arbitrary element must exist.
OPT... One element (layout object) which follows this subordinate-element generator may or may not exist.
REP... One element (layout object) which follows this subordinate-element generator must be repeated once or more times.
OPTREP... One element (layout object) which follows this subordinateelement generator must be repeated zero or more times.
Accordingly, the aforesaid six kinds of subordinate-element generators SEQ,AGG, OPT, REP, OPTREP and CHO as well as a Class type representative of a layout object class, that is, a total of seven kinds of element generators which constitutes the generator, are prepared.
The element generators serving as the respective subordinate-element generators have a substantially identical internal construction. For example, the SEQ generator 1920 shown in Fig. 19 includes a subordinateelement holding unit (hereinafter referred to as "elements") 1920a, a generation history holding unit (hereinafter referred to as a I'lastElement") 1920b, and a not shown superior generator (hereinafter referred to as a "superior"). The "elements" 1920a hold element information indicative of the immediately subordinate element generator of the element generator of their own. The I'lastElement" 1920b holds element information indicative of a currently selected element (subordinateelement generator) from among the element information held in' i 1 - li- - the "elements" 1920a. The nsuperiorw holds information indicative of the inmodiately superior element generator of the element generator of its own.
The AGG generator has,, in addition to the aforesaid construction, a selected-ele nt holding unit (hereinafter referred to as OselectedEle ntsw) for holding information indicative of a selected el nt. if the pattern of array of element information within the welements,' is,, for example.. (a,, b,. c)# the elements a. b and c can be combined in a number of ways such as (a. b. c). (a. c. b). (b. a, c),,,, Prom among such combination patterns, a tried pattern is held in the wselectedElementsw.
The Class type has an internal construction such as that of the Class generator 1940 shown in Fig. 19. The Class generator 1940 includes a layout object class holding unit (hereinafter referred to as a wclassObject") 1940a for holding a layout object class and an instance holding unit (hereinafter referred to as an winstanceobject,') 1940b for holding an instance.
Each of the above-described element generators is constructed to have two major functions:
1) the function of generating a new layout object subordinate to a certain layout object (hereinafter reterred to as a!generate (function)m); and II) the function of generating an object alternative to a certain layout object which has been generated at a level subordinate to a certain layout object (hereinafter referred to as an "alternative (function)".
1..
The processing algorithm of each of the element generators will be described below in connection with each of the generate function and the alternative function.
[Generate Function] Basically, the generate function generates a layout object one by one at a level subordinate to its corresponding layout object. If the generation succeeds, each generated layout object is returned as a returned value. If the generation fails (in a case where all layout objects have completely been generated). failure information indicative of the failure (hereinafter referred to as "failure") is returned as a returned value.
The generate function of each of the element generators will be described below.
1: SEQ generator 1) If no evaluation has yet been executed, first information in the array of element information held in the "elements" is set in the 11lastElement11, and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
2) If element information has been set in the 11lastElement11. the generate function is transferred to an element generator corresponding to the element information. If the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails, element information next to immediately previous element information in the array i of element information held in the "elements" is set in the IllastElement", and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value. If the element information set in the I'lastElement,' is the last element information in the array of element information held in the "elements", no further generation is possible and "failure" is returned as a returned value.
2: AGG generator 1) If no evaluation has yet been executed, first information in the array of element information held in the "elements" is set in the 'llastElementll, and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
2) If element information has been set in the "lastElement", the generate function is transferred to an element generator corresponding to the element information. If the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails, element information next to immediately previous element information in the array of element information held in the "elements" is set in the I'lastElement11, and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value. If the element information set in the "lastElement" is the last element information in the array of element information held 1 -17in the "elements", no further generation is possible and "failure" is returned as a returned value.
3: CHO generator 1) If no evaluation has yet been executed, first information in the array of element information held in the "elements" is set in the ulastElement", and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
2) If element information has been set in the IllastElement", the generate function is transferred to an element generator corresponding to the element information, and the obtained result is returned as a returned value.
4:0PT generator 1) If no evaluation has yet been executed, first information in the array of element information held in the "elements" is set in the ulastElement", and the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
2) If element information has been set in the "lastElement". the generate function is transferred to.an element generator corresponding to the element information, and the obtained result is returned as a returned value.
5: REP generator 1) if no evaluation has yet been executed, first information in the array of element information held in the "elements" is set in the 11lastElement11, and a new element 1 c - 12? generator is created (a copy is produced of an element generator corresponding to initial element information in the array of element information in the "elements"). Element information indicative of the new element generator is supplied to the "elements". Subsequently, the generate function is transferred to an element generator corresponding to the element information set in the fflastElementll, and the obtained result is returned as a returned value.
2) If element information has been set in the I'lastElement". the generate function is transferred to an element generator corresponding to the element information. if the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails,, the last element information in the array of element information held in the "elements" is set in the I'lastElement1. Then, a new element generator is created (a copy is produced of an element generator corresponding to initial element information in the array of element information in the "elements"). Element information indicative of the new element generator is supplied to the "elements". Subsequently, the generate function is transferred to an element generator corresp onding to the element information set in the "lastElement", and the obtained result is returned as a returned value.
6: OPTREP generator The OPTREP generator performs the same processing as the REP generator does.
7: Class generator f 1) If no evaluation has yet been executed, an. instance is generated from a layout object class held in the 11classobject,' and this instance is set in the "instanceobject". The instance is returned as a returned value.
2) If evaluation has already been executed, "failure" is returned.
[Alternative Function] Basically, the alternative function generates a layout object alternative to a specified layout object which has been generated at a level subordinate to a certain layout object. The generated subordinate layout object is passed as an argument and a candidate for this layout object is searched. If the generation of a layout object succeeds, the generated layout object is retur ned as a returned value. If the generation of the layout object fails, "failure" is returned as a returned value. In a case where no alternative candidate is found within the element generator but a superior element generator may be able to find the candidate, information,obscurity,, indicative of an obscure state (hereinafter referred to as,obscurity") is returned as a returned value.
Basically, the Class generator performs the following processing.
I) Restoration Processing... The internal state of the generator is restored to the state wherein the generator was placed immediately after a layout object passed as an argument of the "alternative" had been generated. -.20 - Referring to the outline of the restoration algorithm of the
restoration processing, a Class generator which has generated the layout object passed by the "alternative" is-searched and information is sequentially reset while reference is being made to the inside of "elements" while tracing "superiors" to the root element generator of the Class generator (element generator). The resetting is performed only in the case of SEQ, AGG, REPr OPT,, OPTREP and Class, and an element generator containing a found Class generator in its subordinate structure and the succeeding generators within the "elements" are restored to their non-evaluated states. An element generator (CHO) other than the aforesaid types does not need a special operation for resetting..
II) Alternative Object Generation Processing... After the restoration processing, a candidate alternative to the layout object is generated.
The outline of the alternative object generation algorithm of the alternative object generation processing is to generate a layout object instead of the last generated layout object.
The alternative function of each of the element generators will be described below.
1: SEQ generator The alternative function is transferred to an element generator corresponding to element information set in the I'lastElement". If the generation of a layout object succeeds, the generated layout object is returned as a 1.
returned value. If the generation of the layout object fails, "failure" is returned as a returned value. If the result is "obscurity",, element information next to the element information set in the "lastElement" is selected from the array of element information held in the "elements". Subsequently, the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
2: AGG generator The current pattern set in the "elements" and the information set in the "lastElement" are memorized in the "selectedElements" so as not to again select the same pattern. The array of elements within the "elements" which includes an element corresponding to the information of the "lastElement" and the succeeding elements is altered to generate a new pattern. The new pattern needs to be a pattern which is not recorded in the "selectedElements". The new pattern is set in the "elements", new information is set in the I'lastElement", and an "alternative" message is sent to the I'lastElement". If the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails, a-further new pattern is generated and, subsequently, similar processing is performed. If no new pattern is generated,, "failure" is returned as a returned value.
3: CHO generator The alternative function is transferred to an element generator corresponding to element information set in f the "lastElement". If the generation of a layout object succeeds, the generated layout object is returned as a returned value. if the generation of the layout object fails, element information next to immediately previous element information in the array of element information held in the "elements" is selected and set in the "lastElement". Subsequently, the generate function is transferred to an element generator corresponding to the element information. The obtained result is returned as a returned value.
4: OPT generator The alternative function is transferred to an element generator corresponding to element information set in the 11lastElement11. If the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails, "obscurity" is returned as a returned value.
5: REP generator The alternative function is transferred to an element generator corresponding to element information set in the lllastElementllIf the generation of a layout object succeeds, the generated layout object is returned as a returned value. In a case where the generation of the. layout object fails, if at least one element (layout object) is generated, 'obscurity" is returned as a returned value. Otherwise,, "failure" is returned as a returned value.
6: OPTREP generator The alternative function is transferred to an element generator corresponding to element information set in A i 1 - 2S- the "lastElement". If the generation of a layout object succeeds, the generated layout object is returned as a returned value. If the generation of the layout object fails, "failure" is returned as a returned value.
7: Class generator "Failure" is returned as a returned value.
The following description is made in connection with a generation processing operation for generating a specific layout structure from a generic layout structure by using the generators each having the aforesaid generate and alternative functions.
Referring to the outline of generation processing for a specific layout structure, the generator managing unit 1803 reads, for example, the generator shown in Fig. 19 from the generator storing unit 1810 and temporarily holds it. The generator selecting unit 1804 passes an argument to the generator held in the generator managing unit 1803, and passes a returned value (layout object) to the specific layout structure converter 1805.
It is assumed here that element information indicative of each of the element generators shown in Fig. 19, is defined as follows:
SEQ generator 1920 = 11192011 CHO generator 1930 = "1930" OPT generator 1970 = "1970" Class generator 1940 = "1940" Class generator 1950 = "1950" Class generator 1960 = "1960" A Class generator 1980 = 1119801, Accordingly, "1930",, "1950" and 111970" are set in the "elements" of the SEQ generator 1920,, "1940" and '1196011 in the "elements" of the CHO generator 1930, and "1980" in the "elements" of the OPT generator 1970.
The operation of the generate function will now be described with. reference to the diagram of Fig. 20.
In Fig. 20, symbols a to i correspond to symbols a to i which are used to denote steps which will be described below.
Step a: An instruction indicative of "generate" is sent from the generator selecting unit 1804 to the SEQ generator 1920.
Step b: Since no information has yet been set in the I'lastElement" of the SEQ generator 1920,, the initial element information set in the "elements" of the SEQ generator 1920, i.e., "1930", Is set in the I'lastElement".
Step c: An instruction indicative of "generate" is sent from the SEQ generator 1920 to the CHO generator 1930.
Step d: Since no information has yet been set in the I'lastElement" of the CHO generator 1930 either, the CHO generator 1930 sets the initial element information s4t; in its "elements", i.e., 11194011, in its I'lastElement".
Step e: The CHO generator 1930 sends an instruction indicative of "generate" to the Class generator 1940.
Step f: Since no object has yet been set in the "instanceObject" of the Class generator 1940, the Class generator 1940 generates a new instance, i.e,. a layout i -25object a, from its "ClassObject" and sets the layout object a in its "instanceobject".
Step g: The Class generator 1940 returns its instance as a returned value to the CHO generator 1930.
Step h: The CHO generator 1930 returns the received instance to the SEQ generator 1920 as a returned value.
Step i: The SEQ generator 1920 returns the received instance to the generator selecting unit 1804 as a returned value.
An operation for further executing "generate,, in the above-described state (in the state wherein the layout object a has been generated) will be described below with reference to the diagram of Fig. 21.
In Fig. 21, symbols a to j correspond to symbols a to j which are used to denote steps which will be described below.
Step a: An instruction indicative of "generate" is sent from the generator selecting unit 1804 to the SEQ generator 1920.
Step b: Since the element generator set in the "lastElement" of the SEQ generator-1920 indicates the CHO generator 1930, the SEQ generator 1920 sends an instruction indicative of "generate" to the CHO generator 1930.
Step c: Since the element generator set in the I'lastElement" of the CHO generator 1930 indicates the Class generator 1940, the CHO generator 1930 sends an instruction indicative of "generate" to the Class generator 1940.
Step d: Since the "instanceobject" of the Class generator 1940 has been set, the Class generator 1940 returns "failure" to the CHO generator 1930 as a returned value.
Step e: The CHO generator 1930 which has received the result also returns "failure" to the SEQ generator 1920 as a returned value.
Step f: The SEQ generator 1920 which has received the result selects 11195011, i.e., element information next to the element information ("193011) set in the "lastElemento, from the 11!lements", and sets 11195011 in the OlastElement".
Step g: The SEQ generator 1920 sends an instruction indicative of "generate" to the Class generator 1950 corresponding to 11195011.
Step h: Since the I'instanceobject,' of the Class generator 1950 has not yet been set, the Classgenerator 1950 generates a new instance, i.e., a layout object c, from its '9ClassObjectO and sets the layout object c in the "instanceObject".
Steps i to j: The instance (layout object c) is returned as a returned value from the Class generator 1950 to the generator selecting unit 1804 through the SEQ generator 1920.
The processing operation of the generator which generates an object alternative to the layout object a in the above-described state (the state where the layout objects a and c have been generated) will be described below with reference to the diagram of Fig. 22.
In Fig. 22, symbols a to k correspond to symbols a to k which are used to denote steps which will be described 1 below.
Step a: An instruction indicative of "alternative" (the layout object a as an argument) is sent from the generator selecting unit 1804 to the SEQ generator 1920.
Step b: The Class generator 1940 which has generated the layout object a is searched in the subordinate structure (subordinate element generators) of the SEQ generator 1920.
Step c: "Superiors" are traced from the Class generator 1940 to the generator 1920 positioned at the root, and the Class generator 1940 is restored to the state wherein it was placed immediately after it had been evaluated.
During the above-described restoration, cl) Neither the Class generator 1940 nor the CHO generator 1930 perform anything.
c2) Since 1119201, indicates the SEQ generator 1920, 1119301, is set in the "lastElement" of the generator 1920 and the internal states (lastElement) of a generator corresponding to "1930" and succeeding generators in the "elements" are restored to their non-evaluated states.
In other words, the internal state of a generator corresponding to each element information "1950" and "1970" in the "elements" is reset. In Fig. 22, since the internal state of the Class generator 1950 has been reset, the layout object c generated by the Class generator 1950 is deleted.
Step d: The SEQ generator 1920 sends an instruction indicative of "alternative', to the CHO generator 1930 corresponding to 11193011 set in the "lastElement" of the SEQ 1 1 1 i generator 1920.
Step e: The CHO generator 1930 sends an instruction indicative of "alternative" to the Class generator 1940 corresponding to 11194011 set in the "lastElement" of the CHO generator 1930.
Step f: Since the Class generator 1940 cannot generate a different candidate, it returns "failure" to the CHO generator 1930 as a returned value.
Step g: The CHO generator 1930, which has received "failure", generates a different candidate.
During the generation of this different candidate, gl) The CHO generator 1930 selects element information "1960" set in the "lastElement" from its "elements" and sets this "196011 in the "lastElement".
g2) The CHO generator 1930 sends an instruction indicative of "generate" to the Class generator 1960.
Step h: Since the "instanceObject" of the Class generator 1960 has not yet been set, the Class generator 1960 generates a new instance, i.e., the layout object b, from its "ClassObject" and sets the layout object b in the "instanceobject".
Steps i to k: The instance (layout object by-is returnedas a returned value from the Class generator 1960 to the generator selecting unit 1804 through the CHO generator 1930 and the SEQ generator 1920.
The aforesaid steps a to c constitute a restoration algorithm, and the aforesaid steps d to k constitute an alternative-object generation algorithm.
v 1 9 A generation processing for an alternative object will be described below with reference to another example.
The following description is given of processing which is executed to obtain the specific layout structure shown in Fig. 17 (c) instead of the specific layout structure of Fig. 16(a) which was obtained on trial on the basis of the limi ations of the generic layout structure shown in Fig. 15 but which failed to be laid out.
in the case of a failure in the layout of the layout object c of the specific layout structure shown in Fig. 16(a). the controller 1807 recognizes the layout object a positioned at a level superior to the failed layout object c. The GFS of the layout object a contains the structure expression (CHO C D).
The controller 1807 generates a generator on the basis of the structure expression (CHO C D) and determines whether there is a subordinatestructure (layout object) which can be generated in association with the layout object a on the basis of the generator. In this case, since the layout object d can be generated instead of the layout object c (refer to Fig. 15), the layout object c is deleted to generate the layout object d.
Accordingly, in this example, the specific layout structure shown in Fig. 17(c) is obtained instead of the specific layout structure shown in Fig. 16(a), and the generation of the specific layout structure shown in Fig. 17(a) can be omitted.
As described above, the efficiency of layout -30processing can be improved by restraining generation and deletion of unnecessary layout objects.
In the above-described conventional document layout processing device, it is possible to determine what layout object can be linked to a certain element (layout object) as an immediately subordinate object. However, since a layout object other than an element subordinate to the certain layout object is added, it is impossible to determine what layout object is to be generated or deleted, with the result that it is necessary to generate a subordinate structure of each layout object while repeating trial and error. In consequence, since generation and deletion of unnecessary layout objects are performed, it has been difficult to improve the efficiency of layout processing.
Referring to, for example. the generic layout. structure shown in Fig. 131 if a frame C and a frame D are needed, it is necessary to initially generate a data structure corresponding to the subordinate structure of a layout root, select a page A on the basis of the data structure, then generate a data structure corresponding to the subordinate structure of the page A. and subsequently select the frames A and B on the basis of. the data structure. Since such selection results in a layout failure, it is then determined whether a subordinate element which can be generated except for the aforesaid elements is present on the page A, by making reference to a data structure (a previously generated data structure) subordinate to the page A superior to the frame B which has caused the failure. In this case, - 111 since no subordinate element which can be generated is. present, a data structure corresponding to the subordinate structure of a superior layout root associated with the page A is generated and the page B is selected on the basis of the data structure. Then, a data structure corresponding to the subordinate structure of the page B is selected and the frames C and D are selected on the basis of the data structure. At this time. the page A. the frame A and the frame B are deleted. Although the layout obtained in this case is successful. it is necessary to perform generation and deletion of the unnecessary layout objects for the page A and the frames A and B. Accordingly, it is apparent that the efficiency of the conventional layout processing is not sufficiently high.
It is, therefore, an object of the present invention to provide a document layout processing method and a device for carrying out the same, both of which can reliably and rapidly effect layout processing.
It is another object of the present invention is to provide a document layout processing method and a device for carrying out the same, both of which can reduce an overhead by restraining generation and deletion of unnecessary layout objects.
It is another object of the present invention to provide a document layout processing method and a device for carrying out the same, both of which can rapidly effect generation and editing of a document according to a preset format.
To achieve the above objects, in accordance with a first aspect of the present invention, a data structure corresponding to at least a partial structure of a layout structure common to a plurality of documents is generated, and the data structure is manipulated to generate a layout structure corresponding to a document to be laid out.
In accordance with the first aspect of the present invention, when layout processing is to be executed,, the data structure corresponding to at least a partial structure of the layout structure common to the plurality of documents is generated. and the data structure is manipulated to generate the layout structure corresponding to the document to be laid out. Accordingly, during the layout processing, it is sufficient to alter the generated data structure in accordance with the content of the document to be laid out, whereby the layout processing can be rapidly effected.
In accordance with a second aspect of the present invention, there is a document layout processing device which comprises: intermediate data structure generating means for generating an intermediate data structure indicating a data structure related to a layout which represents a minimum layout structure common to all specific layout structures which can be generated from a layout structure common to a plurality of documents and information about a manipulation indicating whether addition or deletion of a specific structure to or from the minimum layout structure is possible; intermediate-data structure holding means for 1 1 - 33 holding the intermediate data structure generated by the intermediate data structure generating means; intermediate data structure altering means for altering the intermediate data structure held in the intermediate data structure holding means. on the basis of a document content to be laid out and the information about the manipulation which is included in the intermediate dAta structure itself held in the intermediate data structure holding means; and specific layout structure extracting means for extracting a layout structure corresponding to the document content to be laid out, from a newest intermediate data structure held in the intermediate data structure holding means. in accordance with the second aspect of the present invention, prior to layout processing for a layout structure relative to a specific document to be laid out, the intermediate data structure generating means generates the intermediate data structure, and the intermediate data structure is held. Then, the specific structure relative to the minimum layout structure, which is included in the held intermediate data structure. is deleted or added on the basis of the content of the specific document to be laid out and the information about the aforesaid manipulation whic h is included-in the intermediate data structure itself. The layout structure corresponding to the specific document to be laid out is extracted from the finally obtained intermediate data structure. Accordingly, when the content of the specific document is to be laid outt it is sufficient to alter the minimum layout structure in the intermediate data r i - 3 t+ structure by making reference to the information about the manipulation within the intermediate data structure. Accordingly, it is possible to restrain generation and deletion of unnecessary structures (layout objects).
The other objects, features and advantages of the present invention willbecome apparent from the following detailed description taken in conjunction with the accompanying drawings.
Fig. 1 is a block diagram schematically showing one embodiment of a document layout processing device according to the present invention; Fig. 2 is a flowchart showing the outline of a document layout processing operation; Fig. 3 is a flowchart showing a processing operation for generating a minimum layout-enable tree structure; Fig. 4 is a flowchart showing a processing operation for altering the minimum layout-enable tree structure; Fig. 5 is a flowchart showing a processing operation for generating a specific layout structure; Figs. 6(a) and 6(b) are diagrams schematically showing one embodiment of the layout-enable tree structure; Fig. 7(a) to 7(d) are diagrams schematically showing another embodiment of the layout-enable tree structure; Fig. 8 is a diagram schematically showing one 41, example of a specific logical structure; Fig. 9 is a view showing one example of a layout image represented by a generic layout structure in the specific logical structure shown in Fig. 8; Fig. 10 is a structure diagram of one variation of the layout-enable tree structure shown in Figs. 7(a),to 7(d); Fig. 11 is a diagram for explaining a specific logical structure in the ODA (office document architecture); Fig. 12 is a diagram for explaining the relation between the specific logical structure and a specific layout structure in the ODA; Fig. 13 is a view showing one example of a generic layout structure in the ODA; Fig. 14 is a view showing one example of a layout image represented by the generic layout structure shown in Fig. 13; Figs. 15 to 17(d) are views for explaining conventional document layout processing; Fig. 18 is a block diagram showing the arrangement of a conventional document layout processing device; Fig. 19 is a structure diagram showing one example of a data structure representing a minimum layout structure generated by the conventional document layout processing device; and Figs. 20 to 22 are diagrams for explaining the sequence of processing for generating a specific layout structure from the data structure shown in Fig. 19.
-3c - Preferred embodiments of the present invention will be described below with reference to Figs. 1 to 10.
Fig. 1 is a block diagram showing one embodiment of a document layout processing device according to the present invention. The device according to the embodiment shown in Fig. 1 can be applied to an apparatus for performing document layout processing based on the above- described ODA (office document architecture).
Referring to Fig. 1, the document layout processing device comprises a controller 5 and a memory 10. The controller 5 includes a reader 1, a layout intermediate data structure generating unit 2, a layout intermediate data structure altering unit 3 and a specific layout structure extracting unit 4. The memory 10 includes a document content storing unit 6 for storing the content of a document, a generic layout structure storing unit 7 for storing a generic layout structure, a layout intermediate data structure holding unit 8 for holding an intermediate layout structure which will be described later, and a specific layout structure storing unit 9 for storing a specific layout structure.
The reader 1 reads the content of a documentto be laid out-from the document content storing unit 6, and outputs the document content to the layout intermediate data structure altering unit 3. The reader 1 also reads a generic layout structure from the generic layout structure storing unit 7 and outputs it to the intermediate data structure generating unit 2. - The layout intermediate data structure generating unit 2 generates both a minimum layout structure common to all specific layout structures which can be generated from the generic layout structure and a layout intermediate data structure representative of information which indicates what portion of the minimum layout structure can be manipulated to add or delete another structure. The layout intermediate data structure generating unit 2 holds these structures in the layout intermediate data structure holding unit 8.
The layout intermediate data structure altering unit 3 alters the held layout intermediate data structure on the basis of the content of the document to be laid out and the information included in the layout intermediate data structure itself held in the layout intermediate data structure holding unit 8. When the alteration is completed, the layout intermediate data structure altering unit 3 sends information to that effect to the specific layout structure extracting unit 4.
The specific layout structure extracting unit 4 extracts a specific layout structure from the layout intermediate data structure held in the layout intermediate data structure holding unit 8, on the basis of the information indicative of the completion of the alteration which has been sent from the layout intermediate data structure altering unit 3, and stores the specific layout structure in the specific layout structure storing unit 9.
It is to be noted that in this embodiment a tree structure is adopted as the layout intermediate data i structure.
For example, if a layout root class R has the structure expression (SEQ(CHO A B)(OPT C)) in its GFS (attribute: Generator for subordinates),, a minimum layoutenable tree structure (hereinafter referred to as a "layoutenable tree") becomes a structure such as that shown in Fig. 6. In the structure expression,, SEQr CHO and OPT are subordinate-element generators, while A,, B and C are object class identifiers (hereinafter referred to as "class IDs"). The subordinate-element generators includes AGG and REP in addition to the above noted SEQ, CHO and OPT, and these subordinate-element generators have definitions similar to those of the respective subordinate-element generators SEQ, CHO,, OPT,, AGG and REP explained above in the description of the related art. In Fig. 6, the shown tree structure in which nodes SO to S6 are linked by solid-line edges in accordance with a predetermined superior-subordinate relation represents the above-described minimum layout structure, and the internal state of each of the nodes represents information indicating what portion of the aforesaid minimum layout structure can be manipulated to add or delete another structure.
The kinds and content of nodes of the layout-enable tree will be described below.
The nodes of the layout-enable tree are classified into six kinds which correspond to terms expressed in different structure expressions, that is, an SEQ node, a CHO node, an AGG node, an OPT node, an REP node and a class ID i 1 node. The nodes have their internal states which are classified into a first group of internal states of the kind common to some of the nodes and a second group of internal states of the kinds unique to the respective nodes. None of the internal states has a value when their nodes are generated.
The internal states of the kinds common to the six nodes are ModeID11,, NSupl, and "Subs". A symbol string for primarily identifying a node is substituted into the "NodeID" of the node. and the 0NodeIDII of a node positioned at a level immediately superior to the node is substituted into the "Sup" of the latter node. The "Sup" has only one value. The I'NodeW' of a node positioned at a level immediately subordinate to the node is substituted into the "SubC of the latter node. The "SubC may have aplurality of values. Accordingly, for example, an edge between two nodes N1 and N2 is formed if the 11HodelDII of the node N2 exists in the "Subs" of the node N1 and the uNodeID" of the node N1 exists in the "Sup" of the node N2. Therefore, to form an edge between the node N1 and the node N2 indicates the manipulation of adding the "NodeID" of the node N2 to the "SubC of the node N1 and replacing the value of the "Sup" of the node N2 with the content of the "NodeIW' of the node N1. To cut the edge between the node N1 and the node N2 indicates the manipulation of deleting the I'NodeIW' of the node N2 from the "Subs" of the node N1 and deleting the value of the "Sup" of the node N2.
The SEQ node, the AGG node and the REP node have 1 -+0 "Order" as their unique internal states. The "Order" indicates the order of a subordinate node of a node having the internal state "Order", and the order of "NodelDs" in the "Subs" of the node having the internal state "Order" is substituted as the value of the "Order". In the case of the SEQ node, the manner of ordering the "NodeIDs" depends on the SEQ term of a corresponding structure expression and does not change during layout processing. In the case of the AGG node, the manner of ordering the "NodelDs" can be varied during layout processing because it is possible that permutation of subordinate nodes will occur. In the case of the REP node, the manner of ordering the "NodeIDs" can be varied during layout processing, depending on an increase or a decrease in the number of subordinate nodes.
The CHO node and the OPT node have "Selection" as their unique internal states. The "Selection" indicates which of the subordinate structures of nodes having such states is selected for layout processing. The CHO node has any one of the "NodeIDs" of the "Subs" of the corresponding node as the value of the "Selection". This indicates that the node indicated by the value of the "Selection" has been selected from among the choices of the CHO node and a' structure (selected choice) subordinate to the CHO node has been used for layout. The OPT node has a symbol T or F indicative of a true or false value as the value of the "Selection". The symbol T indicates that a subordinate structure is laid out at the OPT node, while the symbol F indicates that no subordinate structure is laid out at the OPT node.
The class ID node has wClassObjecto and "InstanceObject" as Its unique internal states. A class ID corresponding to the class ID node is substituted into the "Classobject", and a layout object class belonging to the layout object class indicated by the "Classobjecto is substituted into the "InstanceObject". The "InstanceObject" has only one value.
A processing operation for generating a specific layout structure will be described below with reference to the flowcharts of Figs. 2 to 5.
Initially,, the outline of processing executed by the controller 5 for generating a specific layout structure will be described below with reference to Fig. 2.
The controller 5 generates a minimum layout-enable tree while reading a generic layout structure stored in the generic layout structure storing unit 7,, and holds the layout-enable tree in the layout intermediate data structure holding unit 8 (Step 101). The controller 5 then alters the layout-enable tree held in the layout intermediate data structure holding unit 8 while reading the content of a docil nt stored in the docil nt content storing unit 6, thereby causing the layout-enable tree to correspond to -the document content (Step 102). Then. the controller 5 converts into a specific layout structure the final layout-enable tree held in the layout intermediate data structure holding unit 8, and writes the specific layout structure into the specific layout structure storing unit 9 (Step 103).
k -+I - Processing executed by the controller 5 for generating the minimum layout- enable tree will be described below with reference to the flowchart of Fig. 3.
The controller 5 reads a generic layout root class from the generic layout structure storing unit 7 (Step 201), and generates a class ID node corresponding to the read class and holds the class ID node in the layout intermediate data structure storing unit 8 (Step 202). it is determined whether class ID nodes whose corresponding classes have GFSs and to which no subordinate nodes are linked are present among the class ID nodes stored in the layout intermediate data structure storing unit 8 (Step 203).
If such class ID nodes are present, the controller 5 selects one class ID node therefrom (Step 204), and reads the GFS of a class corresponding to the selected class ID node from the generic layout structure storing unit 7. The controller 5 generates a node for each term of the structure expression described in the read GFS and stores the node into the layout intermediate data structure storing unit 8 (Step 205).
The controller 5 links each of the nodes generated in Step 205 to an associated node by an edge in a superiorsubordinate relation based on the hierarchal structure described in their GFSs, and links the highest-level node of the linked nodes to the class ID node selected in Step 205 (Step 206). After Step 206 has been completed, the process returns to Step 203, and the operation starting with Step 203 is repeated.
1.
1 J( z -,3 - If no desired class ID node is present in Step 203, processing for altering the layout-enable tree is executed.
Processing executed by the controller 5 for generating the layout-enable tree will be described below with reference to the flowchart of Fig. 4.
Initially, the controller 5 reads a group of attributes related to the layout of a specific layout root from the document content storing unit 6 (Step 301), and determines whether an attribute value has been designated for the group of attributes (Step 302).
If it is determined that any attribute value has been designated, it is determined whether a class ID node which satisfies a condition I which will be described later is present in the layout-enable tree (Step 303).
it is assumed here that the condition I indicates that if the attribute value has been designated, the designated attribute value must be satisfied without altering the values of any nodes stored in the layout intermediate data structure holding unit 8.
If it is determined in Step 303 that there is no class ID node which satisfies the condition 1, it is determined whether a class ID exists which satisfies a. condition II which will be described later (Step 304).
It is assumed here that the condition II indicates that a designated attribute value must be satisfied by altering the value of a certain node of a held layout-enable tree.
If no class ID which satisfies the condition II is - J -If - obtained in Step 304. the flow is brought to an abnormal end. If such a class ID is obtained. it is determined whether alteration of the value of the class ID node found in Step 304 influences other contents which have previously been laid out (Step 305). If it is determined in Step 305 that the other contents are not influenced, the layout-enable tree held in the layout intermediate data structure holding unit 8 is altered so as to satisfy the condition 11 of Step 304 (Step 306), If Step 306 is completed or it is determined in Step 303 that the class ID node which satisfies the condition 1 exists, the controller 5 determines whether the attribute which has just been processed is an attribute related to the lowest-level logical object of a specific logical structure (Step 307). If it is determined that the attribute is that of the lowest-level logical object. a document content which is to be linked to the lowest-level logical object but has not yet been laid out is laid out in the "Instanceobject" of the lowest-level class ID node of the class ID nodes which satisfy the attribute value designated in Step 302 (Step 308).
After Step 308 has been completed, the controller 5 determinbs whether all the contents laid out by the execution of Step 308 have been accommodated in the 11Instanceobject" (Step 309). If it is determined that all the contents have been accommodated in the "InstanceObject,', it is determined whether the logical object processed in Step 307 is the last object in logical order (Step 310). If it is determined that 1 %I it is the last object in logical order, the controller 5 proceeds to processing for generating a specific layout structure.
If it is determined in Step 310 that the logical object processed in Step 307 is not the last object in logical order. if it is determined in Step 302 that no attribute value has been designated for the group of attributes, or if it is determined in step 307 that it is not the lowestlevel logical object. the controller 5 searches in the document content storing unit 6 a logical object which follows in logical order the logical object which has just been selected as a target to be processed. and reads a group of attributes related to the layout of the searched logical object from the document content storing unit 6 (Step 311). Thereafter, the flow returns to Step 302, and Step 302 and the following steps are executed.
If it is determined in Step 305 that the content which has previously been laid out is influenced and if it is determined in Step 309 that all the contents are not accomodated in the "Instanceobject", the controller 5 searches a logical object appropriate for layout retry and reads an attribute value related to the searched logical object (Step 312). Thereafter, the flow returns to Step 302, and Step 302 and the following steps are executed.
A processing operation to be next executed for generating a specific layout structure if it is determined in Step 310 that the lowest-level logical object is the last object in logical order, will be explained below with reference to Fig. 5.
The controller 5 first selects the highest-level class ID node from among the class ID nodes of the layoutenable tree stored in the layout intermediate data structure holding unit 8 (Step 401), and searches a class ID node next to a class ID node which has presently been selected, on the basis of left-depth-first-search with an exception (Step 402). The exception is that it is determined that only an edge leading to a contact indicated by the "SelectioC of a CHO node exits at a level subordinate to the CHO node and if the "SelectioC of an OPT node indicates "F", it is determined that no edge exists at a level subordinate to the OPT node.
The controller 5 links the "InstanceObject'.' of the searched class ID node to that of a superior class ID node closest thereto on the basis of the superior-subordinate relation between the nodes. At this time, if the superior "InstanceObject" has already had a subordinate object, the controller 5 links them so that the superior "Instanceobject" is placed in the last position in the relation of order indicated by the subordinate object (Step 403).
Then, the controller 5 determines whether the class ID node searched in Step 402 is a right-side deepest class ID node under a condition similar to the exception explained in connection with Step 402 (Step 404).
If the class ID node searched in Step 402 is not the right-side deepest class ID node, the controller 5 selects the searched class ID node (Step 405) and causes the h - +_7 - flow to return to Step 402, thus executing Step 402 and the following steps. In the case of the right-side deepest class ID node, the controller 5 selects the highest-level class ID node from among the class ID nodes and writes into the specific layout structure storing unit 9 the 11InstanceObjectl' (layout object) of the highest-level class ID node and its subordinate structure (the structure between layout objects) (Step 406).
Then, a processing operation for generating a specific layout structure will be described with reference to a specific example.
For example, itIs assumed that the layout root class R has the structure expression (SEQ(CHO A B)(OPT C)) in its GFS.
Initially, the controller 5 generates one class ID node SO corresponding to the layout root class R and holds the class ID node SO in the layout intermediate data structure holding unit 8. Then, the controller 5 reads the structure expression written in the GFS of the layout root class R, i. e., (SEQ(CHO A B)(OPT C)), from the generic layout structure storing unit 7. and generates one node corresponding to each term of the read structure expression.
It is assumed here that. as the nodes corresponding to the respective terms of the structure expression, an SEQ node S1 is generated for the SEQ termf a CHO node S2 for the CHO node, an OPT node S3 for the OPT term, and class ID nodes S4 to S6 for the respective A, B and C terms.
The controller 5 links the nodes generated in 1 t +9 accordance with the structure expression via edges, and holds the result in the layout intermediate data structure holding unit 8. The controller 5 also links via a new edge a node (the SEO node S1) corresponding to the apex of the hierarchy of the interior of the structure expression to a node corresponding to the layout root class (the class ID node SO). Incidentally. when the controller 5 is to link the nodes in accordance with the structure expression, it sets values related to internal states ("NodeID",, "Sup" and "Subs") common to the nodes as well as values related to unique internal states according to the kinds of nodes.
In the case of the values related to the unique internal states according to the kinds of nodes, the.following values are set.
(a) If there is an SEQ node among the generated nodes, values indicative of the nodes are substituted into the "Order" of the SEO node in accordance with the permutation of elements in the SEQ term corresponding to the SEQ node.
(b) If there is an AGG node among the generated nodes. values indicative of the nodes according to a combination of values in its "Subs" are substituted into the "Order" of the AGG node.
(c) If there is a CHO node among the generated nodes, an appropriate value is selected from its "Subs" and substituted into the "Selection" of the CHO node.
(d) If there is a class ID node among the generated nodes, a newly generated layout object is 1 k -1- substituted into the OinstanceObject" of the class ID node.
By the above-described processing, a layout-enable tree which is immediately subordinate to the layout root is generated.
Fig. 6 shows the structure of a layout-enable tree immediately subordinate to a layout root r having the structure expression (SEQ(CHO A B)(OPT C)) in its GFS.
Subsequently. the controller 5 selects one class ID node from among the nodes (refer to Fig. 6) of the layoutenable tree immediately subordinate to the layout root which has just been generated. More specifically, the controller 5 selects one from the class ID nodes S4, S5 and S6 of the layout-enable tree shown in Fig. 6. If a structure expression is specified in the GFS of the class of the selected class ID node, the controller 5 reads a corresponding structure expression from the generic layout structure storing unit 7, generates a layout-enable tree immediately subordinate to the selected class ID node, links this layout-enable tree to the selected class ID node, and holds the result in the layout intermediate data structure holding unit 8. If no structure expression is specified in the GFS of the class of the selected class ID node, itis determined that the manipulation required for the class ID node has been completed.
The above-described manipulation for the class ID node is performed for all the class ID nodes. When the manipulation for all the class ID nodes is completed, the layout-enable tree held in the layoutIntermediate data 1 f 1 -50structure holding unit 8 is obtained as the minimum layoutenable tree. Accordingly, if no structure expression is specified in the GFS of any of the class ID nodes S4, S5 and S6 of the layout-enable tree shown in Fig. 6,, the layoutenable tree shown in Fig. 6 becomes the minimum layout- enable tree.
If a certain class ID node appears twice or more times, a class ID node is generated each time, except for a cyclic structure in which the structure of a superior class appears in the structure expression of a subordinate class.
Then, a specific layout structure is generated on the basis of the abovedescribed minimum layout-enable tree.
initially, a document content in a specific logical structure is made to correspond to the minimum layout-enable tree. Immediately subordinate structures which permit such correspondence differ with the kinds of nodes, and are as follows: all immediately subordinate structures, in the case of the SEQ node, AGG node and the class ID node; an immediately subordinate node whose "Selection" has the value "NodeID", in the case of the CHO node; and an immediately subordinate node whose "Selection has the value "T", in the case of the OPT node. For example, referring to the minimum layout-ehable tree shown in Fig. 6, a node immediately subordinate to the SEQ node (the SEQ node Sl) whose "NodeID" is 11111 can be laid out. However, since the value of the "Selection" of the CHO node (the CHO node S2) whose "NodeID" is 1121, is "4" and the value of the "Selection" of the OPT node (the OPT node S3) whose "NodeID" is 11311 is "F", an 4 4.
1k 0- -5) - object which is subordinate to the layout root r and which can be laid out is the layout object a alone.
if it has been impossible to adequately lay out the document content in the minimum layout-enable tree, processing for altering the internal state of each node is executed.
The internal states which can be altered are the "Order" of the AGG node, the "Subs" and "Order" of the REP node. the "Selection" of the CHO node,, and the "Selection" of the OPT node. By altering the internal states. the pattern of a layout object into which to flow the document content is changed so that it is possible to achieve a structure in which the document content can be adequately laid out.
For example, if the value of the "Selection" of the OPT node (the OPT node S3) whose "NodeID" is 11311 is altered from 'IF" to "T" the layout object a and the layout object c are selected as layout objects which are subordinate to the layout root r and which can be laid out.
In this case, class ID nodes are found in the minimum layout-enable tree shown in Fig. 6, and a class ID node of "Class Object: W (in this example, the class ID node. S6) is selected from the class ID nodes. The processing proceedsto a node (in this example, the OPT node S3) superior to the selected class ID node (in this example, the class ID node S6), and the value of the "Selection" of the OPT node S3 is altered from "F" to "T".
Accordingly, if the document content is not accommodated in the layout object a only, a layout-enable t area is increased by altering the value of the "Selection" of the OPT node S3 into "T",, and the layout may succeed. In other words, even if the document content is not accommodated in the layout object a and a certain part overflows, a successful layout may be achieved by laying out the overflown part in the layout object c.
As described abave,, since the minimum layout-enable tree represents all specific layout structures which can be laid out,, it can be determined what structure can be generated at a level subordinate to the subordinateelement generator CHO or OPT or what stz tures can be generated by the subordinate-element generator REP. Accordingly,. when it is necessary to lay out a document content in an object belonging to a specific class, it can be readily determined what structure must be generated at a leiel subordinate to which object.
To obtain this kind pf informationr however, it has conventionally been necessary to repeat retry of layout objects. It follows that generation and deletion of unnecessary layout objects are frequently performed to impair the efficiency of layout processing.
It is assumed that,, for example, the layout object class A has the structure expression (CEO B D) as its GFS,, the lay6ut object class B the structure expression (SEQ C) as its GFSr and the. layout object class D the structure expression (SEQ E) as its GFS. The obtained minimum layoutenable tree is shown in Fig. 7. In the case of the minimum layoutenable tree,, since the value of the "Selection" of the 1 0 -53CHO node whose "NodeID" is I'll" is "1211,, a specific layout structure is obtained in which the layout object b is linked to the layout object a as a subordinate object. In the ODA (office document architecture), an event often occurs which requires a layout object e to be selected in the abovedescribed state.
The concept "category" used in the ODA is one example of a cause which gives rise to such an event. The "category" is defined such that, if a logical object and a frame object have the same category identifier, the logical object is laid out to the frame object. The "category" is utilized in, for example, a bilingual document prepared in Japanese and English. The specific logical structure of the bilingual document is shown in Fig. 8.
It is assumed that a logical object having a content written in Japanes e has a category identifier #JPN as its attribute "layout category" and that a logical object having a.content written in English has a category identifier #ENG as its attribute "layout category". it is also assumed that the document consists of two columns and that a frame object class constituting the left column has the category identifier #JPN as its attribute "permitted categories-", while a frame object class constituting the right column has the category identifier #ENG as its attribute "permitted categories". A layout example of such a generic layout structure is shown in Fig. 9. In the layout example, if layout processing is executed, the Japanese and English contents are automatically laid out in-the left and right 1 -51+ - columns,, respectively.
In the minimum layout-enable tree shown in Fig. 7, it is assumed that "B", i.e., the "Class Object" of a class ID node S12. and "D". i.e., the "Class Object" of a class ID node S13. indicate page object classes and that "C", i.e., the "Class Object" of a class ID node S14. and "E", i.e.,, the "Class Object" of a class ID node S15.. indicate frame object classes. it is also assumed that the frame object class C has a category identifier XT as its attribute "permitted categories" and the frame object class E has a category identifier #FIG as its attribute "permitted categories". It is further assumed that the category identifier #TEXT is a category representative of a document, while the category identifier #FIG is a category representative of a figure. Accordingly, the page object class B is the class of a page on which only a document is laid out, while the page object class D is the class of a page on which only a figure is laid out.
if there is a logical object having the category identifier #FIG in a specific logical structure, this indicates that no document content is laid out in the frame object c. Therefore, a different candidate must be sea rched. To search the different candidate. since the minimum layoutenable tree has been generated, by making reference to the minimum layout-enable tree, it is determined what portion the object class E having the category identifier #FIG as its attribute "permitted categories" is to be linked to. More specifically, class ID nodes are found in the minimum layout- enable tree shown in Fig. 7, and the class ID node of the "Class Object: E" is selected. The processing proceeds from the selected class ID node S15 to superior class ID nodes, i.e., to the class ID node S11 through the class ID node S13. The superior nodes can be traced by making reference to the "Sup" of each of the nodes. The value of the "Selection" of the CHO node S11 which has thus been reached may be altered from "12" to "13". The layout-enable tree obtained after the value of the "Selection" of the CHO node S11 has been altered to 11131, is shown in Fig. 10.
In accordance with the above-described present embodiment, unlike the conventional example, it is not necessary to generate layout objects while repeating trial and error even if the range of selection from structures is wide, that is, even if a large number of terms follow the CHO or OPT term, or even if the class of a layout object to be searched is present at a structurally deep level, that is, even if a tree has a considerable height as written in the form of a layout-enable tree. Accordingly, it is possible to substantially restrain processing for generation and deletion of unnecessary layout objects. It is, therefore, possible to rapidly effect processing for layout retry, whereby an. overhead,can be reduced. In consequence, it is possible to rapidly effect processing for generating a layout structure corresponding to a specific document.
Although in the above-described embodiment the document layout processing device according to the present invention is applied to an apparatus for performing layout 1 I( 1 processing based on the ODA, the present invention is not limited to such an apparatus and is also applicable to other kinds of apparatus.
The present invention is applicable to,, for example, a document processing apparatus, a word processor, a form processing apparatus, a data base system or the like.
More specifically, the document layout processing device according to the present invention can be applied to a document processing apparatus or a word processor which receives an input document (the logical structure and content thereof), lays out the document content and outputs the laid out document to an output device such as a display or a printer in accordance with the operation of an input device such as a keyboard or a mouse by a user or a system. It is, therefore, possible to rapidly effect processing for laying out the document content inputted by the user and converting it into information which can be visualized.
The document layout processing device according to the present invention can also be applied to the form processing apparatus having the function of processing data stored in the apparatus or data received by data communication, automatically formulating a new form, laying out the form in a predetermined layout form, and displaying it on the display screen of a display unit or printing it on paper by a printer. It is, therefore, possible to rapidly effect processing for laying out the processed form content and converting it into information which can be visualized.
The document layout processing device according to - Z57 - the present invention can also be applied to the data base system which executes a search in response to an inquiry inputted by the operation of a terminal by a user and displays the search result on the display screen of a display unit or prints it on a paper by a printer. It is, therefore, possible to rapidly effect processing for laying out the content of the search result and converting it into information which can be visualized.
As described above, in accordance with the present invention, a layout intermediate data structure is initially generated which represents a minimum layout structure and attribute information, and a specific layout structure is then generated by altering the minimum layout structure on the basis of a document-to be laid out and the attribute information. Accordingly, it is sufficient to perform processing for generating and deleting a minimum required structure (object), whereby it is possible to improve the efficiency of layout processing.
Various modifications may be made without departing from the true scope and spirit of the present invention, and the foregoing description of the embodiments is solely for the purpose of illustration and is not to be construedas limiting- the scope of the present invention. The scope of the present invention is defined by the appended claims and is not limited by the description hereof. To the contrary, the present invention is intended to cover all various modifications and equivalent variations includedwithin the scope of the appended claims.
- 5? -

Claims (14)

1. A document layout processing method for generating a layout structure corresponding to a document to be laid out from a layout structure common to a plurality of documents, characterized by the steps of: generating a data structure corresponding to at least a partial structure of the layout structure common to the plurality of documents; and manipulating the data structure to generate a layout structure corresponding to the document to be laid out.
2. A document layout processing method according to claim 1, characterized in that the layout structure common to the plurality of documents is a hierarchal structure which represents a positional relation between document parts corresponding to the content of the document as viewed from a layout of the document.
3. A document layout processing method according to claim 1,, characterized in that the data structure is a_ hierarchal structure which represents a layout structure common to all specific layout structures which can be generated on the basis of a limitation of the layout structure common to the plurality of documents.
4. A document layout processing method according to 1 1 - -1 claim 3, characterized in that the data structure is a hierarchal structure in which each node constituting the hierarchal structure holds identification information indicating the node itself, identification information indicating an immediately superior node, and identification information indicating an immediately subordinate node.
5. A document layout processing device for generating a layout structure corresponding to a document to be laid out from a layout structure common to a plurality of documents, characterized by: intermediate data structure generating means for generating an intermediate data structure indicating a data structure related to a layout which represents a minimum layout structure common to all specific layout structures which can be generated from the layout structure common to the plurality of documents and information about a manipulation indicating whether addition or deletion of a specific structure to or from the minimum layout structure is possible; intermediate data structure holding means for holding the intermediate data structure generated by said intermediate data structure generating means; intermediate data altering means for altering the intermediate data structure held in said intermediate data structure holding means, on the basis of a document content to be laid out and the information about the manipulation which is included in the intermediate data structure itself 1 held in said intermediate data structure holding means; and specific layout structure extracting means for extracting a layout structure corresponding to the document content to be laid out,, from a newest intermediate data structure held in said intermediate data structure generating means.
6. A document layout processing device according to claim 5,, characterized in that said intermediate data structure generating means generates the intermediate data structure in which the minimum layout structure is represented as a hierarchal structure.
7. A document layout processing device according to claim 5, characterized in that said intermediate data holding means includes a memory which stores the minimum layout structure, a history of the minimum layout structure, and information about the manipulation.
8. A document layout processing device according to claim 6, characterized in that said intermediate data structure generating means generates the intermediate-data structure in which each of nodes constituting the hierarchal structure holds information common to the nodes and information unique to each individual node as information about the manipulation.
9. A document layout processing device according to 1.
- 61 claim 8. characterized in that said intermediate data structure generating means generates the intermediate data structure in which identification information indicating each of the nodes, identification information indicating an immediately superior node and identification information indicating an immediately subordinate node are held as information common to the nodes.
10. A document layout processing device according to claim 8. characterized in that the intermediate structure generating means generates the intermediate data structure in which information indicative of an order of a node subordinate to each of SEQ, AGG and REP nodes which respectively correspond to subordinate-element generators SEQ, AGG and REP is held as information unique to each of the SEQ, AGG and REP nodes.
11. A document layout processing device according to claim 8, characterized in that the intermediate structure generating means generates the intermediate data structure in which identification information indicative of a presently selected node, which is selected from among identification information indicative of an immediately subordinate node held in a CHO node corresponding to a subordinateelement generator CHO, is held as information unique to the CHO node, and also in which identification information indicating whether a node immediately subordinate to an OPT node corresponding to a subordinateelement generator OPT has been 1 '. -1 1 4 selected is held as information unique to the OPT node.
12. A document layout processing device for generating a layout structure corresponding to a document to be laid out from a layout structure common to a plurality of documents, characterized by: intermediate data structure generating means for generating an intermediate data structure indicating a data structure related to a layout which represents a minimum layout structure common to all specific layout structures which can be generated from the layout structure common to the plurality of documents, a hierarchal structure representing the minimum layout structure, and information common to nodes constituting the hierarchal structure and information unique to each of the nodes; intermediate data structure holding means for holding the intermediate data structure generated by said intermediate data structure generating means; intermediate data altering means for altering the intermediate data structure held in said intermediate data structure holding means, on the basis of a document content to be laid out and the information common to the nodes and information unique to each of the nodes; and specific layout structure extracting means for extracting a layout structure corresponding to the document content to be laid out, from a newest intermediate data structure held in said intermediate data structure generating means.
A 1
13. A document layout processing method substantially as herein described with reference to Figures 1 to 10 of the accompanying drawings.
14. A document layout processing device substantially as herein described with reference to Figures 1 to 10 of the accompanying drawings.
Published 1991 at The Patent Office. Concept House, Cardiff Road, Newport. Gwent NP9 I RH. Further copies may be obtained from Sales Branch. Unit 6. Nine Mile Point Cwmfclinfach. Cross Keys. Newport, NPI 7HZ. Printed by Multiplex techniques ltd. St Mary Cray. Kent
GB9112589A 1990-06-15 1991-06-11 Document layout processing Expired - Lifetime GB2245400B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2157067A JP3023690B2 (en) 1990-06-15 1990-06-15 Document processing apparatus and method
JP2157068A JP2855797B2 (en) 1990-06-15 1990-06-15 Document processing device

Publications (3)

Publication Number Publication Date
GB9112589D0 GB9112589D0 (en) 1991-07-31
GB2245400A true GB2245400A (en) 1992-01-02
GB2245400B GB2245400B (en) 1994-04-13

Family

ID=26484643

Family Applications (1)

Application Number Title Priority Date Filing Date
GB9112589A Expired - Lifetime GB2245400B (en) 1990-06-15 1991-06-11 Document layout processing

Country Status (2)

Country Link
DE (1) DE4119717C2 (en)
GB (1) GB2245400B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2373085A (en) * 2001-03-08 2002-09-11 Ibm Method, computer program and system for style sheet generation.
EP1315101A2 (en) * 2001-11-20 2003-05-28 Hewlett-Packard Company Method and apparatus of generating platform-dependent data suitable for transmission
US7634723B2 (en) 2003-08-29 2009-12-15 Hewlett-Packard Development Company, L.P. Constrained document layout

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2637679B2 (en) * 1992-08-21 1997-08-06 ゼロックス コーポレイション How to automatically change text properties by rearranging word images

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01205260A (en) * 1988-02-12 1989-08-17 Toshiba Corp Document shaping device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2373085A (en) * 2001-03-08 2002-09-11 Ibm Method, computer program and system for style sheet generation.
GB2373085B (en) * 2001-03-08 2004-10-06 Ibm Method, computer program and system for style sheet generation
EP1315101A2 (en) * 2001-11-20 2003-05-28 Hewlett-Packard Company Method and apparatus of generating platform-dependent data suitable for transmission
EP1315101A3 (en) * 2001-11-20 2003-12-17 Hewlett-Packard Company Method and apparatus of generating platform-dependent data suitable for transmission
US7634723B2 (en) 2003-08-29 2009-12-15 Hewlett-Packard Development Company, L.P. Constrained document layout

Also Published As

Publication number Publication date
DE4119717A1 (en) 1991-12-19
GB2245400B (en) 1994-04-13
DE4119717C2 (en) 1998-01-29
GB9112589D0 (en) 1991-07-31

Similar Documents

Publication Publication Date Title
US5323312A (en) Specific layout structure generating method and structured document layout processing and device for carrying out the same
US5434962A (en) Method and system for automatically generating logical structures of electronic documents
JP4997749B2 (en) Document processing method, program, and system
US6377946B1 (en) Document search method and apparatus and portable medium used therefor
US5627748A (en) Method of identifying pattern matches in parameterized strings and square matrices
US4969093A (en) Method of data stream construct management utilizing format shells and shell fragments
EP0196064B1 (en) System for information storage and retrieval
KR101095377B1 (en) Layout generation method, information processing device, and program
JPH0452856A (en) Method and device for allocating processing of document
JP4377704B2 (en) Flow data generation method and flow data generation apparatus
JP3028738B2 (en) Document common logical information editing device
KR20090003542A (en) Information processing system, information processing apparatus, and storage medium
US5628008A (en) Structured document search formula generation assisting system
GB2245400A (en) Document layout processing
US5765177A (en) Document processing method and apparatus for searching documents having a graph based document logic structure
JPS63500547A (en) Circular context addressable memory
JPH03147059A (en) Method and device for processing document
JP4957618B2 (en) Information processing apparatus and information processing program
EP0501753A2 (en) System for and method of generating a data structure
KR20140065389A (en) Module structural analysis supporting device and program
US5157600A (en) System for numerical description of computer program logic
JP5169505B2 (en) Document composition system and program
WO2021025091A2 (en) Information management device and file management method
JP4189461B2 (en) File management program, computer-readable recording medium storing file management program, file management apparatus, and file management method
JP3395362B2 (en) Document processing device

Legal Events

Date Code Title Description
PE20 Patent expired after termination of 20 years

Expiry date: 20110610