DOCUMENT PROCESSING APPARATUS

Abstract: A document processing apparatus comprises an input device for inputting document data, a heading candidate extraction section for extracting, as a heading candi­ date, the word corresponding to the heading stored in a heading dictionary from the document data input at the input section, a heading decision section for checking the heading candidate extracted by the heading candidate extraction section according to the heading rule stored in a heading rule dictionary and for deciding whether the heading candidate is a heading, and a document architecture decision section for checking the heading decided by the heading decision section according to document architecture rules stored in a document archi­ tecture rule dictionary, and for determining the heading as satisfying the document architecture rule as a true heading, and the heading not satisfying the document architecture rule as being a false heading.

Description: The present invention relates to a document processing apparatus and, more particularly, to a document processing apparatus for processing a document having a hierarchical logical architecture. A general document is divided into a plurality of blocks, and headings are assigned to the respective blocks. Each block is further divided into subblocks and subheadings are assigned to the respective subblocks. Headings and subheadings are constituted by short sentences such as "abstract" or "summary". In addition, heading symbols are often added to these introductory portions, such as "Chapter 1" or "Section 3", respectively. If document data having the hierarchical architecture described above is processed by a computer, the following problem is posed. Document data is processed in units of frames of the display or of pages of the printing sheets. According to this document data processing system, both the start and end positions of the document data for a chapter to be moved elsewhere must be designated when requesting the replacing of a given chapter with another. In this case, if the document data of the given chapter is long, the screen must be scrolled many times from the designation of the start position to the end position to be designated. Screen scrolling is cumbersome and tends to result in operational errors. When an operator drafts a document, he often wishes to refer to the previous sentences. For example, he wishes to check the contents of the previous sentences and the kinds of the previous heading symbols. In this case, he must guess the page and the position of the line which include the sentence and heading symbol to be checked, and then search the desired sentence and heading symbol. The search operation is cumbersome and document drafting efficiency is greatly degraded. The document identified as "IEEE Transactions on Software Engineering, Vo. SE-12, No. 3, March 1986, pages 417-435, IEEE, New York, USA" discloses a document processing apparatus which handles documents in units of items by utilizing a hierarchy of document objects when processing a document. However, the user of the apparatus has to define and edit the logical document architecture. It is an object of the present invention to mitigate the disadvantages which arise from the requirement for the user to define and edit manually the logical document architecture. According to the present invention, a document processing apparatus which handles documents in units of items by utilizing a hierarchy of document objects and processing them, comprising means for inputting document data, and characterised by: heading dictionary storing means for storing in respective categories words, numerals and symbols frequently used in a heading; heading candidate extraction means for extracting, as a heading candidate, the word, numeral and/or symbol corresponding to the heading stored in said heading dictionary storing means from the document data input at said input means; heading rule dictionary means for storing rules for defining the headings; heading deciding means for checking the heading candidate, extracted by said heading candidate extracting means, against the heading rules stored in said heading rule dictionary means, and for deciding whether the heading candidate is a heading; document architecture rule dictionary means for storing rules defining document logical architectures in terms of blocks with headings and sub-blocks; and document architecture deciding means for checking the document logical architecture, of a heading decided by said heading deciding means and a sentence decided as a non-heading, against the document architecture rules stored in said document architecture rule dictionary means. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 is a block diagram of a document processing apparatus according to an embodiment of the present invention; Fig. 2 is an input sentence having a hierarchy logical architecture; Fig. 3 is a table showing a rule of a heading word dictionary; Figs. 4A to 4D are diagrams showing heading rules, respectively; Fig. 5 is a flow chart for explaining the operation of the document processing apparatus; Figs. 6A to 6E are tables showing document architecture rules, respectively; Figs. 7A to 7C are diagrams for analyzing document rules, respectively; Fig. 8 is a block diagram of a heading extraction section; and Fig. 9 is a block diagram of a heading decision section. Document processor 1 is connected to input device 2 including a keyboard to perform centralized handling and processing of input documents. Document processor 1 is also connected to original document storage 3 for storing input original documents and to display controller 4 for causing display 5 to display the input original document read out from storage 3. Document processor 1 is further connected to heading extractor 6, heading decision section 8, document architecture decision section 9, and logical architecture storage 10. Heading extractor 6 is connected to heading word dictionary 7 for storing many types of words representative of headings. Heading decision section 8 includes heading rule dictionary 8a. Document architecture decision section 9 includes document architecture rule dictionary 9a. Document processor 1 sequentially detects document data segmentation codes stored in storage 3, for example, a line return code, and extracts sentences segmented by the segmentation code. In this case, processor 1 measures each sentence length. The extracted sentences are sequentially sent to extractor 6. Extractor 6 decides the heading word from comparison of the input sentence with heading words stored in heading word dictionary 7, and the sentence length. Heading word dictionary 7 stores frequently used words, phrases and symbols, all of which are defined as heading words. The words, phrases and symbols are classified into categories, as shown in Fig. 3, and are registered in advance in dictionary 7. Words such as "introduction" and "abstract" are registered in a category of "reserved heading word". In addition, frequently used numerals and symbols are also registered as heading words in the respective categories. Heading extractor 6 decides whether the number of characters of an extracted sentence is less than a predetermined number. In other words, extraction section 6 decides whether a heading reserved word (a word and/or phrase, and/or numeral and/or symbol represented as a code string) corresponds to a word registered in dictionary 7. If a correspondence is detected, the extracted word is recognized as the corresponding heading word. The extracted words decided by extractor 6 as being the heading word are input, one by one, to heading rule dictionary 8a, under the control of processor 1. Decision section 8 decides, according to the heading rules (Figs. 4A to 4D) stored in dictionary 8a, whether the reserved heading word is a heading word or another word. The word discriminated as the heading word or any other word by heading decision section 8 is input to document architecture decision section 9 under the control of processor 1. Architecture decision section 9 decides whether the sentence or word from heading decision section 8 is a chapter heading, a section heading, or a paragraph, according to the document architecture rules (shown below) stored in dictionary 9a: Paragraph Associated Format Condition 1-1 does not include a heading. (Result) indicates a paragraph. Conjunction Associated Format Condition 1-1 a paragraph. Condition 2-1 the previous sentence is not an itemized pattern formula. (Result) indicates that the level of the current heading is set to be the same as one of the previous sentence. Condition 1-1, Condition 2-2 the previous sentence is pattern formula. (Result) sets the level as [(level of the previous sentence) - 1]. The logical architecture of a sentence or word, as determined by decision section 9 according to the above rules, is stored in logical architecture storage 10. Display controller 4 controls display 5 to display the document data according to the document logical architecture stored in logical architecture storage 10. The operation of the document processing apparatus will now be described with reference to the flow chart in Fig. 5. When document data is input at input device 2 (step a), input document data is sequentially stored in document storage 3. At the same time, the input document data is segmented into a plurality of blocks by document processor 1, as shown in Fig. 2. In segmentation processing, a line return code and a space code or segmentation symbol such as "...", ";", ",", or ":" are determined as segmentation codes. The input document data is segmented in units of blocks at the segmentation codes. In this case, the segmentation sentence length is measured by counting characters. If the measured value falls within a predetermined value (e.g., 40 characters), the sentence is determined as having the possibility of being a heading sentence. If the segmented sentence is determined as having the possibility of being a heading sentence according to the measured number of characters, heading extractor 6 decides whether a character string (words, phrases, or symbols) constituting the segmented sentence is registered in heading dictionary 7 (step b). For example, when sentence "1. Introduction" in the input document data is extracted, it is checked as to whether it is registered in heading dictionary 7. In this case, "1" and "Introduction" are retrieved from heading dictionary 7, and the sentence is determined as being heading candidate A (step c). When heading candidate decision is performed, heading decision section 8 accesses heading rule dictionary 8a to determine whether candidate A is a heading word (step d). If candidate A is defined by any one of the rules in Figs. 4A to 4D, candidate A is determined as being heading word B (step e). In this case, the type of heading word is determined according to the applied heading rule. If the sentence segmented by document processor 1 does not correspond to any heading word registered in dictionary 7, or if the segmented sentence does not coincide with any heading rule although it is determined as being a heading candidate word, the segmented sentence is determined as being a sentence rule not included in the heading word rules (step f). The sentence determined as being a heading word, and the sentence determined as not being a heading word are input to document architecture decision section 9 in order to determine their document architecture. When the document architecture is determined, decision section 9 determines whether the sentence architectures correspond to document architecture rules (Tables 1 to 4) stored in rule dictionary 9a (step g). If the architecture of the input document is defined by one of the document architecture rules, document architecture data corresponding to the determined rule is stored in storage 10 (steps h and i). However, if not, an error is present in the document architecture. As a result, error processing for the sentence, for example, correction of document data, is performed (step j). In the segmented words in Fig. 2, the sentence of the first line, i.e., "document understanding system", and the sentence of the second line, i.e., "Okawa Taro" are not stored in dictionary 7. These sentences are decided by extractor 6 not to be heading words. However, the sentence of the first line is defined by a rule representing a noun phrase appearing at the head of the document, and decision section 9 decides that "document understanding system" is a title. The sentence of the second line, "Okawa Taro" is a proper noun representing a male name. Since the male name follows the title, the name is determined as being an author's name. The results obtained by the document architecture decision described above are stored in the form, as shown in Fig. 6A, in logical architecture storage 10. In the sentence of the third line, i.e., "1. Foreword", three words, i.e., "1", ".", and "Introduction" are stored in dictionary 7. Therefore, this sentence is determined as being heading candidate sentence A1. At the same time, the categories constituting this sentence are recognized as a numeric portion, a tail portion, and a heading candidate word, respectively. Heading decision section 8 accesses rule dictionary 8a to determine whether the sentence determined as being heading candidate A1 is defined by the heading rules. In this case, the order of the categories constituting candidate word A1 is analyzed. Decision section 8 determines whether the order satisfies any one of the conditions in Figs. 4A to 4D. The first numeral "1" defined by the rule in Fig. 4D. The numeral "1" and tail portion "." are defined by the rule in Fig. 4B. Therefore, "1." is determined as being a heading symbol according to the rule in Fig. 4B. "Introduction" is defined by the rule in Fig. 4C, and is determined as being a heading word. The relationship between the heading symbol and the heading word is defined by the rule in Fig. 4A. Heading candidate A1 is thus decided as heading B1. The above decision process is shown in Fig. 7A. In the above decision process, if the categories are not defined by the rules in Figs. 4A to 4D, heading candidate A1 is determined as not being a heading word. Document architecture decision section 9 determines the document architecture of heading B1 according to the rules in Tables 1 to 4. In this case, the logical architecture of the analyzed sentence is stored in storage 10, as shown in Fig. 6B. No chapter heading is indicated in the stored logical architectures. Heading B1, i.e., "1. Introduction" is defined by conditions (1), (1-1), (1-1-1), and (1-1-1-1) in Table 1 so that "1. Introduction" is determined constituting chapter heading C1. According to this decision, the logical architecture containing the chapter heading is stored in logical architecture storage 10, as shown in Fig. 6B. Since the number of characters of the sentence of the fourth and fifth lines exceeds the number for determining the possibility of a sentence being a heading word, this sentence is therefore determined as being other than a heading. As defined by the rule in Table 3, the sentence of the fourth and fifth lines is determined as being a sentence constituting a paragraph. The sentence of the sixth line is recognized as heading candidate A2 in the same procedures as for heading candidate A1. In this case, the sentence of the sixth line is analyzed by the steps in Fig. 7B and is determined as being heading B2. The chapter heading data in Fig. 6B is stored in storage 10. Heading B2 is compared with the rules in Table 2 to determine it coincides with a specific one of the rules. Heading B2 is defined by conditions (1-1), (2-1), (3-1), and (4-1), and is determined as having the possibility of being of the same level as that of chapter heading C1. In this way, it is determined whether heading B2 is defined by the rules in Table 1. In other words, "2. Features of System" satisfies conditions (1), (1-1), (1-1-2), and (1-1-2-2-1), and thus, heading word B2 is determined as constituting chapter heading C2. The resultant logical architecture data is stored in storage 10 as shown in Fig. 6C. The same processing as described above is performed for the sentences of the seventh and subsequent lines, and the document architectures of these sentences are stored in storage 10, as shown in Figs. 6D and 6E. More specifically, for the sentence of the seventh line, heading candidate A3 is analyzed, as shown in Fig. 7C, and then is determined as being heading B3 according to the rules in Figs. 4A to 4D. In document architecture decision section 9 heading B3 is compared with the rules in Table 2. Since the pattern of heading B2 does not previously appear, matching is unsuccessful. As a result, heading B3 is determined as being a heading having a level different from those of the previous headings. Heading B3 is checked according to document architecture rules in Table 1 and is found to coincide with conditions (1), (1-1), (1-1-2), (1-1-2-2), and (1-1-2-2-2-1). Therefore, heading B3 is determined as being itemizing heading C3. Similarly, since the sentence of the eighth line satisfies conditions (1-1), (2-1), (3-1), and (4-1), the level of the heading corresponding to the sentence of the eighth line is determined as being possibly the same as that of the itemized heading. The sentence of the eighth line is determined as satisfying conditions (1), (1-1), (1-1-2), (1-1-2-2), (1-1-2-2-2), (1-1-2-2-2-2), and (1-1-2-2-2-2-1) in Table 1. If a paragraph is detected, the correspondence between the paragraph and the level of the heading must be determined. By referring to the rule in Table 4, the conjunctional relationship between the paragraph and the heading is determined so that the paragraph level can be decided. If the sentence of the fourth line is input, the sentence immediately preceding the paragraph is a chapter heading and satisfies conditions (1-1) and (2-1) in Table 4. The level of this sentence is set to be the same (level 1) as the chapter heading, as shown in Fig. 6C. For the sentence of the ninth line, a paragraph is found next to the itemized heading. The sentence of the ninth line satisfies conditions (1-1) and (2-2) in Table 4. Therefore, its level is set, as shown in Fig. 6E. As described above, the input document data is segmented in units of sentences, and it is determined whether each sentence constitutes a heading. At the same time, the document rule of each sentence is decided. Therefore, the input document data can be effectively processed according to the logical document architectures. The document processing described above is performed effectively. In other words, the heading, the level (hierarchical level) of the heading in the document, and the document architecture, such as the paragraphs preceded by the heading, are obtained effectively according to the input document data. It is thus possible to process the document in units of chapters or sections according to the logical architectures thereby greatly improving and simplifying document processing. Fig. 8 shows a block diagram of the heading extractor 6. In this circuit, document data is sequentially input from original document storage 3 to comparator 81 in response to a readout position signal from readout position designation section 80. In this case, the position of each character in the document is stored in address memory 82. Comparator 81 compares input sentence data with a line return code stored in register 83. The input sentence data is input to line buffer 19 and stored in line buffer 84 in response to a position signal from readout position control section 80. The number of the characters stored in line buffer 84 is counted by counter 85 in response to the signal from control section 80. If a line return code appears in the character data, the count of counter 85 is compared, by comparator 87, with a value stored in register 86. Data representing a predetermined one-line sentence, for example, 40 characters, is stored in register 86. If the count of counter 85 coincides with the reference value of register 86, an output from comparator 87 is input to decision section 88. If the output from comparator 87 is supplied together with the line return code from comparator 81 to decision section 88, or the line return code is supplied thereto prior to the output from comparator 87, decision section 88 determines the input sentence data as being a heading candidate. Decision section 88 supplies a signal based on this decision to line buffer 84. Line buffer 84 stores the input sentence data as heading candidate data in heading candidate data memory 89, in response to the decision signal from decision section 88. In this case, the count of counter 85 is subtracted by operation section 23 from the content of address memory 82. The resultant difference derives a start address of line buffer 84. The start address is input to heading candidate data start position memory 91. In this case, line buffer 84 and counter 85 are reset to the initial state. Therefore, heading extractor 6 is set to the initial state 20 as to extract the next sentence. If a coincidence between the count of counter 85 and the reference value of register 86 occurs prior to generation of the line return code, the data stored in line buffer 84 is determined as not being a heading word. Line buffer 84 and counter 85 are reset to the initial state. In this state, the extraction operation for the next input sentence data can be performed. If document data has been completely processed during the heading extraction routine, the heading decision routine is executed by heading decision section 8. This routine is performed by a circuit in Fig. 9. The heading candidate data from heading candidate data memory 89 is input to comparator 92 and is sequentially compared with the decision rules stored in heading rule dictionary 8a. The comparison results of comparator 92 are sequentially input to decision section 93. Decision section 93 determines conditions for defining heading candidate data as true heading words. If decision section 93 determines that heading candidate data satisfies all conditions, heading rule application control section 94 determines that the candidate data is a true heading word. By this decision, heading candidate data memory 89 reads out the candidate word data decided as the true heading word and supplies it to heading data cell-shaping section 96. Shaping section 96 forms a heading cell every heading decision. If numerals or letters are determined as being a heading, the numerals are ordered according to their values, or the letters are ordered alphabetically. For example, if a heading symbol is "Chapter 2", its ordinariness is 2. The data cell obtained in the manner described above is stored in heading data cell memory 97. According to the present invention, the logical architectures such as chapters, sections, items, and paragraphs are obtained from the input document data. Therefore, document processing can be performed effectively according to these logical architectures.

Claims: A document processing apparatus which handles documents in units of items by utilizing a hierarchy of document objects and processing them, comprising means (2) for inputting document data, and characterised by: heading dictionary storing means (7) for storing in respective categories words, numerals and symbols frequently used in a heading; heading candidate extraction means (3,6,80-91) for extracting, as a heading candidate, the word, numeral and/or symbol corresponding to the heading stored in said heading dictionary storing means (7) from the document data input at said input means; heading rule dictionary means (8a) for storing rules for defining the headings; heading deciding means (8,92,93,94) for checking the heading candidate, extracted by said heading candidate extracting means, against the heading rules stored in said heading rule dictionary means (8a), and for deciding whether the heading candidate is a heading; document architecture rule dictionary means (9a) for storing rules defining document logical architectures in terms of blocks with headings and sub-blocks; and document architecture deciding means (9) for checking the document logical architecture, of a heading decided by said heading deciding means (8) and a sentence decided as a non-heading, against the document architecture rules stored in said document architecture rule dictionary means (9a). An apparatus according to claim 1, characterized in that said document architecture rule dictionary means (9a) comprises a memory for storing document logical architecture rules in units of document fields of interest. An apparatus according to claim 1, characterized in that said document architecture rule dictionary means (9a) comprises means for storing a plurality of rules representing hierarchical document logical architectures such as a chapter, a section, an itemized sentence, and a paragraph. An apparatus according to claim 1, characterized in that said heading candidate extraction means comprises document memory means (3) for storing all document data input at said input means (2), and means (80-91) for detecting segmentation codes from the document data stored in said document memory means (3) and extracting the document data in units of segmentation codes. An apparatus according to claim 4, characterized in that said heading candidate extraction means (6) comprises counting means (85) for counting the length of the document, read out from said document memory means (3), and means (86-90) for extracting the document data having a predetermined length counted by said counting means (85), as the heading candidate. An apparatus according to claim 1, characterized in that said document architecture deciding means (9) is means for deciding the heading decided by said heading deciding means (8) as a chapter heading and an itemizing. An apparatus according to claim 6, characterized in that said document architecture decision means (9) includes means for determining a level of the chapter heading and itemizing decided. An apparatus according to claim 1, characterized in that said document architecture deciding means (9) includes means for determining a noun phrase appearing at the head of the document as a title. An apparatus according to claim 8, characterized in that said document architecture deciding means (9) includes means for determining a male name following the title as an author's name. An apparatus according to claim 1, characterized in that said document architecture deciding means (9) includes means for determining a sentence having no heading as a paragraph. An apparatus according to claim 7, characterized in that said document architecture deciding means (9) includes means for determining the conjunctional relationship between the paragraph and the heading, and for determining a paragraph level on the basis of the heading level. An apparatus according to claim 10, characterized in that said document architecture deciding means (9) includes means for determining the conjunctional relationship between the paragraph and the heading and for determining a paragraph level on the basis of the heading level.

Inventors: DOI, MIWAKO C/O PATENT DIVISION, IWAI, ISAMU C/O PATENT DIVISION, OKAMOTO, TOSHIO C/O PATENT DIVISION
Applicants: KABUSHIKI KAISHA TOSHIBA
Application year: 1986
Main classification: G06F15
IPC codes: G06F17