Method and apparatus for formatting document

Abstract: A method for formatting document in which document data and format data are given independently and in which these data can be managed very efficiently. The method includes the steps of (a) entering document data representing a document to be formatted having a title; (b) identifying a subject field to which the document belongs by searching a key word characterizing the subject field; and (c) formatting the document in one of plurality of different types of format prescribed in accordance with the identified subject field. An apparatus for performing this method is also disclosed, which includes input means (1) for allowing a user to enter document data representing a document to be formatted having a title: and means (4) for formatting the document; means (6) for identifying a subject field to which the document belongs by searching a key word characterizing the subject field; and wherein the formatting means (4) formats the document in one of a pluraliy of different types of format prescribed in accordance with the identified subject field.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a method and an apparatus for formatting document according to the preamble of independent claims 6 and 1, respectively. Such a method and an apparatus are known from Computer, Volume 21, number 1, January 1988, pages 15-31, IEEE, NY, "Multiple Representation Document Development" by B. Chen et al.. In Computer, Volume 21, number 1, January 1988, pages 15-31, IEEE, NY, "Multiple Representation Document Development", edited by Pehong Chen and Michael Harrison, there is provided a list of several classes of tasks that an effective document development environment must be able to accomplish. One of these classes of tasks relates to formatting a document in order to manipulate document appearance. According to this class formatting includes the layout of specific pages. Since certain types of documents must obey certain styles, this reference suggests to provide some default styles to cover a wide range of commonly used documents. Either the system or the user should be able to control the placement of objects within a page. Even though it is known from this reference to provide default styles for formatting the document, it is definitely not known from this reference to format the document in accordance with a defined subject field. More specifically, this reference concerns the manner of mixed using both the source language representation and direct manipulation technique. The document semantics described in this portion of this reference refers to the operator such as the page layout attributes for specifying the desired format which are employed in the direct manipulation technique, and therefore they have nothing to do with the subject field of the document to be formatted. Description of the Background Art There are known methods of formatting document data such as 'Roff' in which format data necessary for carrying out formatting are incorporated in the document data. In such a method, it is necessary to change the format data incorporated in the document data in order, for example, to change the number of the blank lines between headings and paragraphs that follows. This means such a change in the format data have to be made at the each appearance of the heading, so that the correction of this kind can become very time-consuming and the inconsistency due to overlooking happens very often. To cope with this situation, the formatting system 'Scribe' has been proposed in which the document data and the format data are given independently, so that a single change in the format data concerning the spacing between the headings and the paragraphs suffices for this type of corrections to be made over the entire document. Also, by using different types of format data, the same document can be formatted in various different manners in this formatting system 'Scribe'. However, in an formatting of this kind, the management of data becomes complicated because of the fact that the document data and format data are independently given. Namely, which one of various format data has been used in formatting particular document data easily be forgotten by the time corrections have to be made, so that it becomes necessary to try out each of the various format data one by one in order to find the right one. SUMMARY OF THE INVENTION It is therefore an object of the present invention to provide a method and an apparatus for formatting document in which document data and format data are given independently and in which these data can be managed more efficiently. According to the present invention there is provided an apparatus for formatting document of the initially defined type having the characterizing features of claim 1. According to the present invention there is provided a method for formatting document of the initially defined type having the characterizing features of claim 6. Preferred embodiments are listed in the respective dependent claims. Other features and advantages of the present invention will become apparent from the following description taken in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a schematic block diagram of a document formatting apparatus according to the present invention. Fig. 2 is a main flow chart for the operation of the document formatting apparatus shown in Fig. 1. Fig. 3 is an illustration of an example of a document to be formatted used in the explanation of the operation of the document formatting apparatus shown in Fig. 1. Fig. 4 is is an illustration of an initial display by the display unit of the document formatting apparatus shown in Fig. 1. Fig. 5 is a diagrammatic illustration of a key word dictionary to be utilized by a field identifying unit of the document formatting apparatus shown in Fig. 1. Fig. 6 is a flow chart for the operation of the field identifying unit of the document formatting apparatus shown in Fig. 1. Fig. 7 (A) and (8) are diagrammatic illustration of format data stored in a format memory unit of the document formatting apparatus shown in Fig. 1. Fig. 8 is an illustration of a formatted output resulting from the document shown in Fig. 3. Fig. 9 is a diagrammatic illustration of header data to be attached to document data by the document formatting apparatus shown in Fig. 1. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Referring now to Fig. 1, there is shown one embodiment of a document formatting system according to the present invention. This document formatting system comprises an input unit 1 from which document data to be formatted and various commands for formatting are entered by a user, a document memory unit 2 for memorizing the document data entered at the input unit 1 as well as formatted document data after the formatting process is done, a format memory unit 3 for memorizing various format with which the formatting of the document is to be carried out, an formatting unit 4 for performing the formatting of the document, an analyzing unit 5 for analyzing structures of the document, a field identifying unit 6 for automatically identifying a subject field to which the document belongs, a document structure memory unit 7 for memorizing structures of the document obtained by the analyzing unit 5, a display unit 8 for showing the document being formatted, and a CPU 9 for interconnecting and controlling all components of this document formatting system. Referring now to Fig. 2, the operation of this document formatting system will be explained, using an example of formatting a particular document, with subsidiary references to Figs. 3 to 9. At the step 101, the document data of a document 'DOCUMENT A' shown in Fig. 3 are entered at the input unit 1, and are stored in the document memory unit 2. Next, at the step 102, commands for formatting the document data are entered at the input unit 1 by the user. This is done as follows. An initial display by the display unit 8 appears as shown in Fig. 4. The user is asked to enter a title of the document to be formatted into spaces 31 and 32, labels of graphics to be incorporated in the document into spaces 33 to 35, and a type of format with which the document is to be formatted into a space 36. The format type can be selected automatically by the document formatting system at the beginning of the formatting, in accordance with the subject field identified by the field identifying unit 6, when the space 36 is left blank. Then at the step 103, the CPU 9 reads out the document data of the document 'DOCUMENT A' from the document memory unit 2, in accordance with the commands shown in Fig. 4, and give them to the field identifying unit 6. At the step 104, a subject field to which the document belongs is automatically identified by the field identifying unit 6. The field identifying unit 6 accomplish this task by searching a word in the document that is listed in a key word dictionary shown in Fig. 5 which enumerate various terms that can serve as a key word for different subject fields, installed in the field identifying unit 6 itself. Thus, 'DOCUMENT A' of Fig. 3 will be identified as a technical document because of the presence of a word 'introduction' which is one of key words for technical documents according to the key word dictionary of Fig. 5. This process is shown in a flow chart of Fig. 6. Namely, at the step 201 a business counter C b is set equal to zero, at the step 202 a technical counter C t is set equal to zero, and at the step 203 a paragraph number i is set equal to zero. Then at the step 204, the paragraph number i is made to be equal to (i+1), and at the step 205, an i-th paragraph of the document is searched. When the i-th paragraph exists, the process proceeds to the step 206, whereas when the i-th paragraph does not exist, the process proceeds to the step 212. In the former case, the i-th paragraph is read out at the step 206, and whether it is a heading is determined at the step 207. When the i-th paragraph is a heading the process proceeds to the step 208, whereas otherwise the process returns to the step 204 and the steps following that step are repeated. In the former case, the presence in the i-th paragraph of any one of business key words listed in the key word dictionary of Fig. 5 is detected. When such a business key word is present in the i-th paragraph, the process proceeds to the step 209 in which the business counter C b is made to be equal to (C b +1) and then the process returns to the step 204 and the steps following that step are repeated, whereas otherwise the process proceeds to the step 210. In the latter case, at the step 210 the presence in the i-th paragraph of any one of technical key words listed in the key word dictionary of Fig. 5 is detected. When such a technical key word is present in the i-th paragraph, the process proceeds to the step 211 in which the technical counter C t is made to be equal to (C t +1) and then the process returns to the step 204 and the steps following that step are repeated. On the other hand, when the i-th paragraph is found to be absent at the step 205, the process proceeds to the step 212 in which the number indicated by the business counter C b is compared with a prescribed business threshold number j b . When the number indicated by the business counter C b is greater than the prescribed business threshold number j b , the process proceeds to the step 213 in which the document is identified as a business document, and the process terminates. Otherwise, the process proceeds to the step 214 in which the number indicated by the technical counter C t is compared with a prescribed technical threshold number j t . When the number indicated by the technical counter C t is greater than the prescribed technical threshold number j t , the process proceeds to the step 215 in which the document is identified as a technical document and the process terminates, whereas otherwise the process proceeds to the step 216 in which the document is identified as a standard document and the process terminates. Next, at the step 105, the analyzing unit 5 analyzes the structure of the document in accordance with the identified subject field of the document, by utilizing possible document structures pertinent to this subject field. This can be accomplish in a known method such as that disclosed in U.S. Pat. Serial No. 897,930, in which the detail explanation can be found. The result of this analysis is stored in the document structure memory unit 7. Then, at the step 106, the document data are formatted in accordance with the analyzed structure of the document stored in the document structure memory unit 7, using a format data from the format memory unit 3 corresponding to the type of format specified at the step 102. In this embodiment, the format memory unit 3 has format data for a technical document data shown in Fig. 7(A) which will be referred as a format 'CONFERENCE A' in the following and format data for a business document data shown in Fig. 7(B). In both of these, the format data is comprised of two sections. A frame section has a plurality of entries called frames, one for each element constituting the document, and contains information regarding layout of the different elements of the document in terms of output position, x-width, y-width, and attribute. Here, the output position indicates a starting point of each element, x- and y- width indicate spatial extension required by each element in x- and y- directions, respectively, and attribute indicates a classifying name given to each element according to its structural function. A data section has a plurality of entries also called frames, one for each classifying name, and contains indications of appropriate format each element is to be laid out. The document 'DOCUMENT A' will be formatted according to the format 'CONFERENCE A' of Fig. 7(A), as it is a technical document. The resulting document which appears as shown in Fig. 8 is then displayed by the display unit 8, and the formatted document data are stored back in the document memory unit 2 at the step 107. Next, at the step 108, the CPU 9 creates a header data containing the document title, the relevant graphic labels, and the format type used, as shown in Fig. 9, and attach this header data to the original document data stored in the document memory unit 2 as a header of the document data. As a result, next time the command for formatting the document 'DOCUMENT A' is given by the user, information concerning the format with which the document had formatted last time as well as the relevant graphic labels can be instantaneously recalled from the header data attached to the document data for 'DOCUMENT A', so that the user can be relieved not only from remembering such information but also from giving the same command over and over again. It is to be noted that the header data shown in Fig. 9 may have either a fixed number of entries or a variable number of entries which can be varied in accordance with necessity. It is also to be noted that although in the above embodiment the header data are attached to the original document data, it may be attached to the formatted document data without losing the distinct advantages of the present invention. Besides these, many modifications and variations of this embodiment may be made without departing from the novel and advantageous features of the present invention. Accordingly, all such modifications and variations are intended to be included within the scope of the appended claims.

Claims: An apparatus for formatting a document, comprising: input means (1) for allowing a user to enter document data representing a document to be formatted; and means (4) for formatting the document in one of a plurality of different prescribed format types; characterized by further comprising: means (6) for identifying a subject field to which the document belongs by searching a key word in the document which is listed in a key word dictionary means as a word characterizing the subject field; wherein the formatting means (4) formats the document in accordance with the identified subject field. The apparatus of claim 1, further comprising means (9) for attaching information containing the title of the document and the type of format with which the document is formatted by the formatting means, to the document data. The apparatus of claim 2, wherein the input means (1) also allows the user to enter a command which specify the type of format with which the document is to be formatted, and wherein the formatting means (4) formats the document using the format specified by the command. The apparaus of claim 3, wherein the formatting means (4) selects an appropriate format with which to format the document in accordance with the subject field identified by the identifying means (6) when the command is not entered by the user. The apparatus of claim 2, further comprising means (5) for analyzing logical structure of the document in terms of logical functions of different parts of the document in accordance with the subject field identified by the identifying means (6), and wherein the formatting means (4) formats the document in accordance with the analyzed logical structure. A method of formatting a document, comprising the steps of: (a) entering (101) document data representing a document to be formatted having a title; and (b) formatting (106) the document in one of plurality of different prescribed format types; characterized by further comprising the step of: (c) identifying (104) a subject field to which the document belongs by searching a key word in the document which is listed in a key word dictionary means as a word characterizing the subject field; and wherein at the step (b) the document is formatted in accordance with the identified subject field. The method of claim 6, further comprising the step of (d) attaching (108) information containing the title of the document and the type of format with which the document is formatted at the step (b), to the document data. The method of claim 7, wherein at the step (a) a command which specify the type of format with which the document is to be formatted is also to be entered, and wherein at the step (b) the document is formatted by using the format specified by the command. The method of claim 8, wherein at the step (b) an appropriate format with which to format the document is selected in accordance with the subject field identified at the step (d) when the command is not entered at the step (a). The method of claim 7, further comprising the step of (e) analyzing logical structure of the document in terms of logical functions of different parts of the document in accordance with the subject field identified at the step (d), and wherein at the step (b) the document is formatted in accordance with the analyzed logical structure.

Inventors: DOI MIWAKO, FUKUI MIKA, IWAI ISAMU, TAKEBAYASHI YOICHI, YAMAGUCHI KOJI, DOI, MIWAKO, FUKUI, MIKA, IWAI, ISAMU, TAKEBAYASHI, YOICHI, YAMAGUCHI, KOJI
Applicants: TOSHIBA KK, KABUSHIKI KAISHA TOSHIBA
Application year: 1989
Main classification: G06F17
IPC codes: G06F17