Document processing apparatus

Abstract: A document processing apparatus includes a designation unit for designating divisions of items of document information, a detection unit for detecting a maximum width in each item designated by the designation unit, an assignment unit for substantially equally dividing and assigning a space portion obtained by subtracting a total of the maximum widths from a maximum document region in a line direction to the items, and a table making unit for forming ruled line information consisting of vertical lines passing through substantially centers of the divided space portions and horizontal lines defining lines with reference to the divided space portions and the maximum widths of the items.

Description: BACKGROUND OF THE INVENTION Field of the Invention The present invention relates to a document processing apparatus having a table making function. Related Background Art In a conventional apparatus, when document information is input by executing table making processing, an operator estimates or assumes a format suitable for input data beforehand, and then inputs document information. Upon estimation of the format, document data of a reference line, e.g., a longest line is input, and the format is determined according to the content of the line. Therefore, in order to determine the format in this manner, the operator must check the entire table document, search a reference document line from the document information, and estimate the format from the searched line, resulting a heavy load on the operator. When the document information of the reference line is changed, the entire format must be changed, and the format must be determined again for making a table. During input of table data, when the table data has a size exceeding a predetermined margin position, the operator must input the table data after he or she changes the margin position, and, hence, must interrupt a series of table data input processing. Furthermore, when document information is input according to table data after the table data is input, if tab positions are set according to input positions in the table, the document information can be efficiently input. However, the operator must set these tab positions. EP-A-0075734 describes an interactive wordprocessing system which provides a multitext column layout formatting by example function providing an opportunity for an operator to specify all of the attributes of a column table format so as to permit implementing column functions such as delete, move, copy and revise. In this method table formatting during creation of a new table or revising of an existing table is executed by way of an operator keying repeated text characters and controls as an example. The "example line" is then encoded and saved. If the table is to be revised, then the "column example line" is displayed in accordance with the previously saved encoded information and the operator can then key in revisions by way of example. The system formats the table by determining the amount of unoccupied line width between column entries made by the user, divides the unoccupied line width by the number of gutters and then inserts space characters so that the gutters between adjacent columns are even. The English language abstract for JP-A-63305454 describes a character processor in which a vertical column line is set after the maximum number of digits after the decimal point. IBM Technical Disclosure Bulletin Vol. 25, No. 2, July 1982 at page 677 describes logic for centring column headings with a word processor in which column heading tab stops are automatically set at positions corresponding to the centre of the longest text entry for each column. EP-A-0298166 describes a data processing machine in which an input table is combined by a logical OR operation with a mask blank to find the locations of numbers. Vertical rivers in the data are treated as column boundaries. EP-A-066045 describes a method for automatically expanding the displayed width of a selected field in a text processing system by comparing during input of the data the current position of the end of the data with a right hand boundary of the data entry field. According to one aspect of the present invention there is provided a document processing apparatus having the features recited in claim 1. Apparatus embodying the present invention provides a document processing apparatus which can automatically form table data corresponding to document information. The present invention also provides a method of processing document information using document processing apparatus as recited in claim 11. An embodiment of the present invention provides a document processing apparatus which can automatically discriminate a tab sort on the basis of document information of each item. An embodiment of the present invention provides a document processing apparatus which can automatically move a margin position in a release direction in correspondence with input of table information. An embodiment of the present invention provides a document processing apparatus comprising designation means for designating divisions of items in document information, detection means for detecting a maximum width in each item designated by the designation means, assignment means for substantially equally assigning a space portion obtained by subtracting a total of the maximum widths from a maximum document region in a line direction to each item, and table making means for referring to the divided space portions and the maximum widths of the items, and generating ruled line information consisting of vertical lines passing through substantially the centers of the space portions, and horizontal lines defining lines. In an embodiment of the present invention, a maximum width in each item designated by the designation means for designating divisions of items in document information is detected, a space portion obtained by subtracting a total of the maximum widths corresponding to items from a maximum document region in a line direction is substantially equally divided, the divided space portions are assigned to the items, and ruled line information consisting of vertical lines passing substantially the centers of the space portions assigned to the items and horizontal lines defining lines is formed with reference to the divided space portions and the maximum widths of the items. Embodiments of the present invention will now be described, by way of example, with reference to the accompanying drawings, in which: Fig. 1 is a schematic block diagram showing an arrangement of an English word processor according to an embodiment of the present invention; Fig. 2 is a view showing a keyboard matrix of the word processor of the embodiment shown in Fig. 1; Fig. 3 shows a data format of a RAM; Fig. 4 shows a data format of a work data area of the RAM; Fig. 5 shows a data format of a text buffer; Figs. 6A and 6B show data formats of a format information area; Fig. 6C is a table showing codes indicating sorts of tabs; Fig. 7 shows a data format of frame information; Figs. 8A to 10C and Figs. 12A to 12C show input data and formed tables; Fig. 11 shows frame information of Figs. 8C, 9C, and 10C; Fig. 13 shows document information stored in the text buffer and corresponding to Figs. 12A to 12C; Fig. 14 shows frame information of Fig. 12C; Figs. 15A to 15C show a case wherein a right margin position is moved to the right according to input information; Figs. 16A to 16C are views for explaining character position information; Figs. 17A to 17D respectively show position information of document information corresponding to Figs. 8A to 10C and Figs. 12A to 12C; Figs. 18A to 18D respectively show format information corresponding to Fig. 8B, 12B, 10B, or 9B: Fig. 19 is a flow chart showing a text editing process in the word processor of the embodiment shown in Fig. 1; and Figs. 20 to 26 are flow charts showing a table input process in step S4 in Fig. 19. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT A preferred embodiment of the present invention will now be described in detail with reference to the accompanying drawings. [Description of Word Processor (Figs. 1 to 3)] Fig. 1 is a schematic block diagram showing an arrangement of a control unit of an English word processor according to an embodiment of the present invention. In Fig. 1, a keyboard (KB) 1 is connected to a keyboard interface (KB I/F) 2. As shown in Fig. 2, alphanumeric keys, symbol keys, and various function keys are arrayed on the KB 1. The KB I/F 2 receives a key code from the KB 1, and outputs it onto a CPU bus 7. The CPU bus 7 is connected to a program ROM 3, a dictionary ROM 4, a dictionary RAM 5, and a CPU 6. The program ROM 3 stores control programs for the CPU 6, various data, and the like. The dictionary ROM 4 stores a spelling check word dictionary. The dictionary RAM 5 is used by a user to register, as a dictionary, character strings, e.g., person's names which may be found to require correction during spelling checking. The CPU 6 executes various control process operations according to the control programs stored in the program ROM 3. The CPU bus 7 includes an address bus, a data bus, and a control bus. The CPU bus 7 is also connected to a CRT controller (CRTC) 8 and a RAM 9. The CRTC 8 is connected to a display (CRT) 13. The CRTC 8 causes the CRT 13 to display bit map data stored in the RAM 9 in accordance with an instruction from the CPU 6. The RAM 9 stores document information input from the KB 1, and also stores display information to be displayed on the CRT 13 in the bit map format. The CRT 13 displays display information from the RAM 9 under the control of the CRTC 8. The CRTC 8 is also connected to a CRT interface (CRT I/F) 14. The CRT I/F 14 receives signals from the CRTC 8 and the RAM 9, and displays them on the CRT 13. An external storage 15 such as a hard disc or floppy disc unit stores input document information through a disc interface (DISC I/F) 10, and reads out corresponding document information according to an instruction from the CPU 6. The CPU bus 7 is also connected to a printer interface (I/F) 11 and a modem interface (I/F) 12. The printer I/F 11 executes data I/O control between a printer (not shown) and the CPU bus. The modem I/F 12 can transmit or receive information through a telephone network. Fig. 3 shows a data format of the RAM 9 of the word processor of the embodiment shown in Fig. 1. As shown in Fig. 3, the RAM 9 includes a CRT bit map area 20 for storing image data to be displayed on the CRT 13 in the bit map format, a work data area 21, used during a control operation of the CPU 6, for temporarily storing various data, a text buffer 22 for storing document information, table information, and the like in the code or data format, and a print data buffer 23 for storing data to be output to and printed by the printer. Fig. 4 partially shows a data format of the work data area 21 of the RAM 9. As shown in Fig. 4, the work data area 21 includes an area 30 for storing the maximum number of digits, i.e., the maximum number of digits of items in table data, areas 31 and 32 for respectively storing start and end addresses of table data (document information included in a frame) in the text buffer 22, N to WPF areas 33 which are used as work registers (to be described later), and an area 34 for storing the number of lines of input (formed) table data. [Description of Text Data (Figs. 5 to 7)] Fig. 5 shows a data format of the text buffer 22. A format information area 40 stores information associated with a format of text data. A text data area 41 stores document information, table data, and the like consisting of code information. A frame data area 42 stores frame data generated by a frame process of this embodiment. Figs. 7 shows a data format of the frame data area 42 of this embodiment. Fig. 6A shows a data format of the format information area. An area 50 stores left margin position information, and an area 51 stores right margin information. A tab information area 52 stores tab sort information TABI indicating a sort of tab, and tab position (number of digits) information TABP. The area 52 can store a total of n pieces of tab position information. Fig. 6B shows an example of the format information. In Fig. 6B, the left margin position is set to be "1", and the right margin position is set to be "48". Since the tab information area stores all "0"s, no tab positions are set. Fig. 6C is a table for explaining tab sort information (TABI). "1" designates a standard tab; "2", a decimal tab; "3", a centering tab; and "4", a right alignment (justification) tab. Fig. 7 shows a data format of the frame data area 42 of the text buffer 22. The frame data area 42 stores frame data 60 of one line. The frame data 60 consists of x-coordinate data 61 of a frame start position, y-coordinate data 62 of the frame start position, frame length information 63, and frame direction data 64. When the frame direction data is "1", it indicates a lateral direction (horizontal direction); when it is "2", it indicates a longitudinal direction (vertical direction). [Examples of Document information (Figs. 8 to 14)] Figs. 8A to 11 show examples of input document information. Figs. 8A, 9A, and 10A show input examples of document information. In Figs. 8A, 9A, and 10A, reference numeral 70 designates a format line; L, a left margin position; and R, a right margin position. A point designated by reference numeral 72 indicates a column position (digit position) at which a character is displayed, and the margin positions and tab positions are determined on the basis of the column positions. Reference numeral 74 designates a tab code input by a tab key (25 in Fig. 2); and 75, a return code input by a return key (26 in Fig. 2). Fig. 8B shows a display example of document data input, as shown in Fig. 8A, when tabs are set at columns positions indicated by "t". Similarly, Fig. 9B shows a state when right alignment tabs are set at column positions indicated by "r". Fig. 10B shows a state wherein centering tabs are set at column positions indicated by "c". Figs. 8C to 10C show table data automatically generated in correspondence with Figs. 8B to 10B according to this embodiment. In Figs. 8C to 10C, "+" indicates a column position where table data is present. Fig. 11 shows detailed data of the frame data area 42. In this case, Fig. 11 shows frame data of Figs. 8C to 10C. In Fig. 11, frame data 112 represents a vertical line 77 of a frame. According to the data 112, the vertical line 77 has a start position (3, 1), and a vertical length of "5". In this coordinate position, an x-position is indicated by a column position, and a y-position is indicated by a line position. Frame data 113 represents a vertical line 78, frame data 114 represents a vertical line 79, and frame data 115 represents a vertical line 80. In this manner, data 110 represents vertical lines of the frame data. Data 111 represents horizontal lines of frame data. The data 111 consists of a total of six horizontal lines (length = 43). For example, data 116 represents a horizontal line 81. As designated by reference numeral 117, all "0"s are set in the last four data. Figs. 12A to 12C show an input example of document information using decimal tabs. Fig. 12A shows input document information, and the same reference numerals in Fig. 12A denote the same parts as in Figs. 8A to 10A. Fig. 13 shows the content of the text data area 41 at that time. The start address area 31 designates the start address of document information, and the end address area 32 designates the end address of the document information. Note that in Fig. 13, "→" indicates a tab code, and "¶" indicates a return code. Fig. 12B shows a display example determined by selecting tab information corresponding to tab codes set on the basis of the document information shown in Fig. 13. In Fig. 12B, "t" indicates a standard tab set position, and "d" indicates a decimal tab set position. Fig. 12C shows a frame at that time. This frame data is automatically generated by a process to be described later. Fig. 14 shows frame data at that time. In Fig. 14, 140 designates four vertical line data in Fig. 12C, and 141 designates four horizontal line data in Fig. 12C. [Change Right Margin Position (Figs. 15A to 15C)] Figs. 15A, 15B, and 15C are views for explaining an automatic changing operation of a right margin upon input of table data. In Fig. 15A, a document (numerals) is input up to a right margin position indicated by "R", and an input operation is made to a position indicated by a cursor 151 in Fig. 15A. Fig. 15B shows a case wherein numerals are input in the same line. In this case, the right margin position is moved to the right in correspondence with the input position. Fig. 15C shows a case wherein numerals are kept input in the same line. In this case, the right margin is moved to a maximum allowable range (position of "R") of one line. In this manner, when a document is input while exceeding the right margin position, the right margin position is moved in correspondence with an input of the document information. Figs. 16A to 16C show a data format of the work area 33 (Fig. 4) in the work data area 21. [Description of Position Information and Format Information (Figs. 16A to 18D)] Fig. 16A shows a table for holding position information used for determining a tab position. This table can store (N-1) pieces of item information per line. Of the data of this table, wP n represents the number of digits of numerals on the left-hand side of a decimal point, and wS n represents the number of digits (including the decimal point) of numerals on the right-hand side of the decimal point. wT n is given by wT n = wP n + wS n . Therefore, as shown in Fig. 16B, as for "1234.00", since wP n = 4 and wS n = 3, wT n = 7. The table shown in Fig. 16A is generated when data in table data are checked, and maximum numbers in items are set. Fig. 16C shows values determined by the second line in Fig. 9C including maximum items. In this case, maximum item lengths wT 1 , wT 2 , and wT 3 are determined, and the lengths of space portions assigned on both sides of these items are indicated by w 1 to w 3 . Note that w n in Fig. 16A corresponds to w 1 to w 4 in Fig. 16C. Figs. 17A to 17D show position information of these data. For example, Fig. 17A corresponds to position information of Fig. 8B. This position information is set for a line (second line) in which items have maximum numbers of digits. More specifically, the number of digits w 1 of a left-end space is set to be "5", and the number of characters wP 1 of the first item is "10". Since this value does not include digits below the decimal point, wT 1 is also set to be "10". Spaces w 2 and w 3 between the first and second items and between the second and third items are set to be "4". The number of digits w 4 of a right-end space is set to be "5". Similarly, Fig. 17 B shows position information of Fig. 9B, Fig. 17C shows position information of Fig. 10B, and Fig. 17D shows position information of Fig. 12B. In Fig. 17D, w 1 = 7, wP 1 represents 8 digits of "clothing", wP 2 is "3" on the basis of the number of digits higher than the decimal point of a number "100.00" of the second item, and wS 2 represents 3 digits including the decimal point. As a result, wT 2 is "6". Then, w 2 is obtained as "6" based on a space between the last character position of characters "clothing" having the maximum number of digits in the first item, and the start position of a the number "100.00" having the maximum number of digits in the second item. Similarly, wP 3 = 5, wS 3 = 3, and wT 3 = 6 based on the number "1,200.00" in the third item. Figs. 18A to 18D show an example of format information shown in detail in Figs. 16A to 16C. Fig. 18A shows format information of Fig. 8B. In this case, the left margin position is set to be "1", and the right margin position is set to be "48". Standard tabs are set at three tab positions (indicated by "t"), i.e., 6th, 20th, and 34th columns. Fig. 18B shows format information of Fig. 12B. A standard tab is set at an 8th column, and decimal tabs (d) are set at 25th and 40th columns. Similarly, Fig. 18C shows format information of Fig. 10B Centering tabs (c) are set at 10th, 24th, and 38th columns. Fig. 18D shows format information of Fig. 9B. In Fig. 18D, right alignment (justification) tabs are set at 15th, 29th, and 43rd columns. A method of obtaining a tab position will be explained below based on the above description. (1) Standard Tab (T m : a tab position for an mth item) A standard tab position can be computed by the following equation: Note that wT 0 = 0. When tab positions are computed based on the values in Fig. 17A using this equation, T 1 = = w 1 + 1 = 6, T 2 = (5 + 4 + 10) + 1 = 20, T 3 = (5 + 4 + 10 + 4 + 10) + 1 = 34. These values correspond to tab positions shown in Fig. 8B. (2) Right Alignment Tab (RT m ) A right alignment tab of an mth item can be obtained by the following equation: When the right alignment tab positions are obtained based on the values in Fig. 17B, RT 1 = 5 + 10 = 15, RT 2 = 5 + 10 + 4 + 10 = 29, and RT 3 = 5 + 10 + 4 + 10 + 4 + 10 = 43. These values correspond to tab positions in Fig. 9B. (3) Centering Tab (CT m ) When the centering tab positions are obtained based on the values in Fig. 17C, CT 1 = 5 + 10/2 = 10, CT 2 = (5 + 4 + 10) + 10/2 = 24, and CT 3 = (5 + 4 + 10 + 4 + 10) + 10/2 = 38. These centering tab positions correspond to positions in Fig. 9B. When wT n /2 does not yield an integer, a value of (wT n + 1)/2 is adopted. (4) Decimal Tab (DT m ) When decimal tab positions are obtained based on the values in Fig. 17D, DT 2 = (7 + 6 + 8) + 3 = 24, and DT 3 = (7 + 6 + 8 + 6 + 6) + 5 = 38. These decimal tab positions correspond to those in Fig. 12B. A method of obtaining position information of a frame based on information of these positions will be described below. A column position (F m ) of each frame is given by: When m = the maximum number of digits, we have: Note that w 0 = wT 0 = 0. When w n /2 cannot yield an integer, [w n /2] ([] are Gaussian symbols) is employed. For example, frame information of Fig. 12C is obtained based on the values in Fig. 17D. More specifically, F 1 = 7/2 + 1 = 4, F 2 = 7 + 8 + 6/2 + 1 = 19, F 3 = 7 + 8 + 6 + 6 + 6/2 + 1 = 31, and F 4 = 7 + 8 + 6 + 6 + 6 + 8 + 6/2 = 44, thus obtaining column position information of the frame information shown in Fig. 12C. [Description of Operation (Figs. 19 to 26)] Figs. 19 to 26 are flow charts showing processes in this English word processor. The control programs for executing these control operations are stored in the program ROM 3. The operations of this embodiment will be described below with reference to these flow charts and the drawings mentioned above. Fig. 19 shows a text editing process of the word processor of this embodiment. This process is started when document information is input from the KB 1. In step S2, a key input process of a key code input from the KB 1 is executed. In step S3, it is checked if the input key is a table making key for starting a table process. If YES in step S3, the flow advances to step S4, and the table input process is executed. If NO in step S3, the flow advances to a corresponding process routine. For example, in step S5, a text input process by character keys is executed. The table process as the characteristic feature of this embodiment will be described below. Fig. 20 is a flow chart showing the table input process in step S4 in Fig. 19. In step S10, an input process of a key code input from the KB 1 is executed, and it is checked in step S11 if a table input end key is depressed. If YES in step S11, the flow advances to step S12, and table format information is formed. This process will be described later with reference to Fig. 22 and subsequent drawings. The flow then advances to step S13 to check if a frame making process is instructed. If YES in step S13, the flow advances to step S14, and frame information is formed. The frame information making process will be described in detail later with reference to Fig. 26. The flow then advances to step S15, and a text display process of a text including table information is executed. If it is determined in step S11 that the table input end key is not depressed, the flow advances to step S17 to check if an editing key is depressed. If YES in step S17, the flow advances to step S18, and a table making & editing process is executed. Thereafter, the flow advances to the text display process in step S23. If NO in step S17, however, the flow advances to step S19 to check if an input character code is on the right margin position. If YES in step S19, the flow advances to step S20 to execute a right margin release process. In step S22, a cursor movement process upon input of a function key or a character key is executed. The flow then advances to step S23, and a text display process is executed. Of steps S17 to S23, process routines excluding step S20 are known to those who are skilled in the art, and a description thereof will not be particularly made here. Fig. 21 is a flow chart showing the right margin release process in step S20 in Fig. 20. It is checked in step S30 if the right margin position is a maximum (right end) position. If YES in step S30, since the right margin position can no longer be moved to the right, the flow returns to the main routine in step S33. If NO in step S30, the flow advances to step S31, and the right margin position is incremented by one in a column direction. In step S32, the mark "R" is displayed at a position, corresponding to the right margin position, on the format line 70, as shown in Fig. 8, and the like. The right margin release process is executed, as shown in Figs. 15A to 15C. As described above, the right margin is moved from a state shown in Fig. 15A to a state shown in Fig. 15B upon an input of a character key, and is released up to the right end position, as shown in Fig. 15C. Fig. 22 is a flow chart showing the table format making process in step S12 shown in Fig. 20. When the end of a table making operation is instructed, the flow advances to step S40, and a widest column search process is executed. The flow then advances to step S41, and w n is computed. In step S42, it is checked if it is impossible to compute w n . If it is determined in step S42 that it is impossible to compute w n , the flow returns to the main routine in step S43; otherwise, the flow advances to step S44 to execute a format change process. Figs. 23A and 23B are flow charts showing the widest column search process in step S40 shown in Fig. 22. This process will be explained below. In step S51, the start address 31 of the text information is set in an address pointer P of the work data area 21, and "0" is set in the area 30 for the maximum numbers of digits, CLM, WP, WS, LF, WPF, and the area 34 for the number of lines. The area 30 for the maximum number of digits stores the maximum number of digits of items in one line, the area CLM stores a maximum item count, and the areas WP and WS store the maximum widths in the items, as described above. LF is a flag indicating whether or not a return operation is performed. If the flag LF is "0", it indicates that the pointer P is located at a position immediately after the return operation. WPF is a flag for indicating whether the value of the maximum width is set in WP or WS. If the flag WPF is "0", the value is set in WP; otherwise, the value is set in WS. It is checked in step S52 if the pointer P coincides with the end address of a text. If YES in step S52, the flow returns to the main routine in step S53. It is checked in step S54 if data (*P) of an address indicated by the pointer P is a tab code. If YES in step S54, the flow advances to step S55. It is checked in step S55 if the flag LF is "0". If YES in step S55, since this means that the line starts from a tab code, and the number of characters need not be checked, the flow advances to step S56, and "1" is set in the flag LF. The flow then advances to step S63. If NO in step S55, the flow advances to step S57, CLM is incremented by one to increment the item count by one. In step S58, the value of wP CLM in an item indicated by CLM is compared with the value of WP. If it is determined in step S58 that WP is larger than wP CLM , the flow advances to step S59, and the value of WP is set in wP CLM . Similarly, the value of wS CLM in an item indicated by CLM is compared with the value of WS in step S60. If it is determined in step S60 that WS is larger than wS CLM , the flow advances to step S61, and the value of WS is set in wS CLM . In step S62, (wP CLM + wS CLM ) is set in wT CLM . Thus, the maximum number of characters of an item is set in wT CLM . In step S63, WP, WS, and WPF are all cleared to "0". In step S64, the address pointer P is incremented by one, and the flow advances to step S52. Thus, the maximum WP CLM and WS CLM corresponding to each item are set (CLM = 1 to m). If it is determined in step S54, the data *P is not a tab code (→), the flow advances to step S65 to check if a return code (¶) is set at an address of the text buffer 22 indicated by the pointer P. If YES in step S65, the flow advances to step S66, and the item count CLM is incremented by one. It is checked in step S67 if the number of characters wP is larger than the number of characters WP CLM (or the number of characters above the decimal point) of the item. If YES in step S67, the value of wP is set in WP CLM in step S68. Similarly, if it is determined that wS is larger than WS CLM , the flow advances to step S70, and the value of WS is set in WS CLM . Thus, the flow advances to step S71, and (WP CLM + WS CLM ) is set in WT CLM . In this manner, the number of columns indicating the maximum width of an item indicated by CLM is set in WT CLM . In step S72, WP, WS, and WPF are cleared to "0", and in step S73, the pointer P is incremented by one. It is checked in step S74 if the number of columns (number of digits) exceeds the maximum number of digits. If YES in step S74, the value of CLM is set as the maximum number of digits in step S75. In step S76, the flag LF is set to be "0", and the line counter 34 is incremented by one in step S77. In step S77a, CLM is cleared to "0", and the flow advances to step S52. If it is determined in step S65 that no return code is set, the flow advances to step S78 to check if the data *P is a decimal point code. If YES in step S78, the flow advances to steps S79 and S80, and the flag WPF is set to be "1". In steps S81 to S83, WS or WP is incremented by one in correspondence with the value of the flag WPF. This operation is to count a number after it is divided into integer and decimal parts at the decimal point. In this manner, in step S84, the pointer P is incremented by one, and the flow advances to step S52. When the value of the pointer P reaches the end address, the flow advances from step S52 to step S53 to end the process. Thus, the maximum column width WT CLM (CLM: 1 to m, m is the maximum column count) is set in WT CLM in correspondence with each item. In this manner, the maximum column width for each item of document information is obtained. The flow then advances to step S41 (Fig. 22), and a space amount (w n ) corresponding to each item is computed. This process will be described below with reference to the flow chart of Fig. 24. In step S90, the number of columns between the right and left margin positions is computed, and a character portion is subtracted from the computed value, thus computing a total of space amounts in one line. This equation is given by: where m is the maximum item count. If it is determined in step S91 that W TOTAL is not a negative value, the flow advances to step S93, and an average space interval is computed by W TOTAL /m. The computed average space interval is set in each space region. If a remainder is detected in steps S95 to S101, the remainder is sequentially distributed from the first item. It is checked in step S98 if N is an odd number. If YES in step S98, the flow advances to step S99. For example, if N = 1, 1 is added to w 1 to increase the first space length. N is then incremented by one, and the flow returns to step S96 to check if the remainder is absorbed. If it is determined in step S96 that the remainder is absorbed and N is larger than the remainder, the flow returns to the main routine in step S97. However, if it is determined in step S96 that N (= 2) is smaller than the remainder, the flow advances to step S100. In step S100, the rightmost space width (w m-N/2+1 ) is incremented by one, and the flow advances to the next process. In this manner, the loop of steps S96 to S100 is repeated until the remainder of the division computed in step S94 is distributed to the spaces. Fig. 25 is a flow chart showing the format change process in step S44 shown in Fig. 22. In step S110, N = 1 is set, and it is checked in step S111 if N is larger than the maximum item count. If YES in step S111, the process is ended. In step S113, wS n corresponding to a certain item is checked. If wS n = "0", the flow advances to step S114, and decimal tabs are computed by the above-mentioned equation. It is checked in step S115 if right alignment tabs are to be set. If YES in step S115, the flow advances to step S116, and tab positions are computed based on the above-mentioned equation. If it is determined in step S117 that centering tabs are to be set, the flow advances to step S118, and centering tab positions are computed on the basis of the above-mentioned equation. However, if NO in step S117, the flow advances to step S119, and standard tab positions are computed on the basis of the above-mentioned equation. Note that as w n , wT n , and wP n used in these equations, the values computed in step S40 are used. The flow then advances to step S120, and a sort of tab and a tab position corresponding to an Nth item are set in the format information area 40 (Fig. 6) of the text buffer 22. The flow then advances to step S121 to increment N by one, and the flow then returns to step S111. Fig. 26 is a flow chart showing the frame information making process in step S14 of Fig. 20. In step S130, the pointer N is set to be "1". If it is determined in step S131 that N is smaller than (m + 1: m is the maximum item count), the flow advances to step S139, a y-position is set to be "1" (first line). The flow then advances to step S140, and the horizontal column position is computed by the above-mentioned equation (Σ(w n-1 + wT n-1 ) + w n /2) for computing a horizontal position of a frame. The flow then advances to step S141, and the number of lines is set in a vertical length. In step S142, vertical line data is set. Thus, for example, data of the vertical line 77 shown in Fig. 8C is obtained, and frame data designated by reference numeral 140a in Fig. 14 is stored. The flow then advances to step S143 to increment N by one, and the flow returns to step S131. In this manner, after vertical line data are formed in steps S131 to S143, the flow advances to step S132, and the pointer N is set to be "1". In step S132a, the y-position is set to indicate the first line. The flow then advances to step S133, and an x-position is computed by the above-mentioned equation for computing a frame position in correspondence with N = 1. If it is determined in step S134 that N is smaller than (the number of lines + 1), the flow advances to step S136, and the line position in the y-direction is incremented by one. The flow advances to step S137, and a distance in the x-direction between N = m + 1 and N = 1 is computed by the above-mentioned equation for computing the frame position. In step S138, horizontal line data is set. The flow then advances to step S138a to increment N by one, and the flow advances to step S134. Thus, horizontal table data is formed, as designated by reference numeral 141 in Fig. 14. In the above embodiment, position information as a reference for frame or format data is determined on the basis of a character (column) or line position. However, the present invention is not limited to this. In this embodiment, when table data is input, one sort of tab code is input, and a sort of tab is determined in such a manner that if a decimal point is included, a decimal tab is set upon making of a table format. However, a predetermined sort of tab may be input upon an input of a tab code. The table data making process in step S12 of Fig. 20 has been described with reference to a case of setting standard tabs. However, the present invention is not limited to this. Alternatively, right alignment tabs (Fig. 9), centering tabs (Fig. 10), or decimal tabs (Fig. 12) may be set, as a matter of course. In this embodiment, divisions of items are designated by the tab key. However, the present invention is not limited to this. The divisions of items may be designated by another function key. As described above, according to the present invention, an optimal format can be automatically selected to make table data on the basis of document information input as table data. According to this embodiment, a sort of tab code is automatically determined in accordance with the content of table data, thereby determining a format of table data. When document information or the like is input to exceed a predetermined margin position, the margin position can be automatically moved in a release direction, thus facilitating an input process. As described above, according to the present invention, table data corresponding to document information can be automatically formed. A sort of tab can be automatically determined according to document information of each item. Furthermore, a margin position can be automatically moved in a release direction in correspondence with an input of table information.

Claims: A document information processing apparatus comprising: user operable designating means (25) for enabling a user to input a division code between items of information input by the user as a list; memory means (9) for storing the list of items of information separated by the designated division codes; input means (1) for enabling the user to input an instruction to arrange the stored list of items of information in a table; and means (6) for identifying the designated division codes and for causing, in response to an instruction input by the user using the input means (1), the list of items of information to be rearranged to form a table having columns defined in accordance with the designated division codes so that items separated by a division code are in successive different columns. Apparatus according to claim 1, further comprising means (6) for detecting the longest one of items of information stored in the memory means (9), the rearranging means (1,6) being arranged to determine the width of a column in accordance with the longest one of the items of information in the column. Apparatus according to claim 1 or 2, wherein the user operable designating means (25) for designating divisions between items of information comprises means for inserting a tab code as a designated division code between the items of information and the rearranging means (6) comprises means for selecting the type of tab code for each item of information in accordance with the type of item of information. Apparatus according to claim 1 or 2, wherein the rearranging means (6) is arranged to left-align the items of information in a column of the table. An apparatus according to claim 1 or 2, wherein the rearranging means (6) is arranged to right-align the items of information in a column of the table. Apparatus according to claim 1 or 2, wherein the rearranging means (6) is arranged to centre-align the items of information in a column of the table. Apparatus according to any one of the preceding claims, wherein the rearranging means (6) is operable to arrange the items of information according to the width of adjacent items of information (Figure 16). An apparatus according to any one of the preceding claims, further comprising means (6) for defining lines separating columns and/or rows of items of information in a table. An apparatus according to any one of the preceding claims, further comprising means (13) for displaying a table formed by the arranging means (6). An apparatus according to any one of the preceding claims, further comprising margin setting means (1) for setting a margin and control means (6) for causing the margin position to be moved in a margin release direction when information is input extending beyond the set margin position. A method of processing document information using document information processing apparatus, which method comprises designating division codes between items of information input as a list by a user in response to user-operable designating means (25); storing in memory means (9) the list of items of information separated by the designated division codes; inputting using input means (1) an instruction for arranging the stored list of items of information in a table; and causing the items of information to be rearranged to form a table having columns defined in accordance with the designated division codes so that items separated by a division code are in successive different columns. A method according to claim 11, further comprising detecting the longest one of items of information stored in the memory means (9) and determining the width of a column in accordance with the longest one of the items of information in the column. A method according to claim 11 or 12, which comprises designating divisions between items of information by inserting a tab code as a designated division code between the items of information and rearranging the items of information by selecting the type of tab code for each item of information in accordance with the type of item of information. A method according to claim 11 or 12, which comprises rearranging the items of information by left-aligning the items of information in a column of the table. A method according to claim 11 or 12, which comprises rearranging the items of information by right-aligning the items of information in a column of the table. A method according to claim 11 or 12, which comprises rearranging the items of information by centre-aligning the items of information in a column of the table. A method according to any one of claims 11 to 16, which comprises rearranging the items of information according to the width of adjacent items of information. A method according to any one of claims 11 to 17, further comprising defining lines separating columns and/or rows of items of information in a table. A method according to any one of claims 11 to 18, further comprising displaying a formed table. A method according to any one of claims 11 to 19, further comprising setting a margin and causing the margin position to be moved in a margin release direction when information is input extending beyond the set margin position.

Inventors: FUKUNAGA KOJI, FUKUNAGA, KOJI
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1990
Main classification: G06F17
IPC codes: G06F17, G06Q10