United States Patent6438566
Okuno , ; et al.August 20, 2002

Title

Document processing method and apparatus which can add comment data added to an original document to a revised document

Abstract

A comment added to a certain portion in a first document can be automatically re-added to an equivalent position in a second document, and comment transfer processing between documents is automatically performed. Position information of a comment with respect to an old document obtained from an old document comment file is stored in a position information area, and comment contents also obtained from the old document comment file are stored in a comment content area. A character string corresponding to the position information is extracted from an old document file, and is stored in a character string area. A new document file is searched on the basis of the character string stored in the character string area, and position information of the detected character string is stored in a candidate area. One of position information stored in the candidate area is selected according to a predetermined rule, and the selected position information is stored in a new position information area. The comment contents stored in the comment content area, and the position information stored in the new position information area are written in a new document comment file.


Inventors:Okuno; Yasuhiro (Kawasaki, JP), Yamakawa; Tadashi  (Yokohama, JP), Nagashima; Masaaki  (Kawasaki, JP), Sasaki; Takayuki  (Chikushino, JP)
Assignee:Canon Kabushiki Kaisha (Tokyo, JP)
Appl. No.:734308
Filed:October 21, 1996
Foreign Application Priority Data

Jun 30, 1993 [JP] 5-161382
Jun 30, 1993 [JP] 5-162780
Jun 30, 1993 [JP] 5-162781
Jun 30, 1993 [JP] 5-162782
Nov 30, 1993 [JP] 5-299297

Current U.S. Class:715/512 715/530 715/511 
Current International Class:G06F 17/30 (20060101)
Field of Search:395/762,766,772,773,774,776,792,793,802,336,337,338,347,601,619 707/501,505,511,512,513,514,530,100,203 345/336,337,338,347

U.S. Patent Documents
4667228May 1987Kawamura et al.
4789962December 1988Berry et al.
5144555September 1992Takadachi et al.
5146552September 1992Cassorla et al.
5159669October 1992Trigg et al.
5179650January 1993Fukui et al.
5253362October 1993Nolan et al.
5297027March 1994Morimoto et al.
5325297June 1994Bird et al.
5355472October 1994Lewis
5367621November 1994Cohen et al.
5371675December 1994Greif et al.
5428733June 1995Carr
5493658February 1996Chiang et al.
5557722September 1996DeRose
5564046October 1996Nemoto et al.
5574898November 1996Leblang et al.
Foreign Patent Documents
0314183May., 1989EP
0437159Jul., 1991EP
Primary Examiner: Hong; Stephen S.
Attorney, Agent or Firm:Fitzpatrick, Cella, Harper & Scinto

Parent Case Text



This application is a continuation of application Ser. No. 08/267,717 filed Jun. 29, 1994, now abandoned.

Claims


What is claimed is:
1. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string extracted from the old document by said extraction means; determination mans for determining a range of the same character string detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means.

2. The apparatus according to claim 1, further comprising: selection means for, when a plurality of equivalent portions are detected by said search means, selecting the equivalent portion at a position closest to the addition position indicated by the old position information, and wherein said second memory means stores the plurality of the equivalent portions detected by said search means or the equivalent portion selected by said selection means as the new position information representing the addition position of the comment data in the new document, in correspondence with the comment data.

3. The apparatus according to claim 1, wherein each of the old position information and the new position information designates start and end positions of the addition position of the comment data by the numbers of characters from the beginning of a corresponding one of the new and old documents.

4. The apparatus according to claim 1, wherein each of the old position information and the new position information designates the addition position by the number of lines from the beginning of a corresponding one of the old and new documents.

5. A document processing apparatus comprising: first document memory means for storing an old document to be updated and constituted by a plurality of document elements based on a predetermined logical structure; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string, and extracting element information for specifying a document element including the old addition range as search key information; second document memory means for storing a new document obtained by updating the old document; first search means for searching the new document for a document element specified by the search key information; second search means for searching the document element detected by said first search means for the same character string as the search key character string extracted from the old document by said extraction means; determination means for determining a range of the same character string detected by said second search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means.

6. The apparatus according to claim 5, wherein the predetermined logic structure has a header area for storing a character string representing contents of a document stored in the document element, in a start portion of each document element, said extraction means extracts, as the search information, the information associated with the addition position in the old document, and the character string stored in the header area of the document element including the addition position, and said first search means searches the new document for a document element including a header area having the same character string as the extracted character string.

7. The apparatus according to claim 6, wherein the predetermined logic structure includes a section having one or a plurality of paragraphs as the document element, and the section has a header area for storing a title thereof.

8. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string having a predetermined number of characters from the old addition range of the old document as a search key character string; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string extracted by said extraction means; determination means for determining a range including the same character string detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means.

9. The apparatus according to claim 8, wherein the addition range is expressed in units of lines divided by new line codes, and said second memory means determines a line including the equivalent portion detected by said search means as the addition range of the comment data in the new document, and stores the determined addition range as the new position information in correspondence with the comment data.

10. The apparatus according to claim 8, wherein said extraction means extracts the character string including the predetermined number of characters from the beginning of a range designated as the addition range of the old document on the basis of the old position information.

11. The apparatus according to claim 8, wherein said extraction means extracts the character string including the predetermined number of characters from the end of a range designated as the additional range of the old document on the basis of the old position information.

12. The apparatus according to claim 8, wherein said extraction means extracts the character string including the predetermined number of characters from each of the beginning and the end of a range designated as the addition range of the old document on the basis of the old position information.

13. The apparatus according to claim 8, further comprising: setting means for setting the number of characters of the character string to be extracted by said extraction means to be a desired value.

14. The apparatus according to claim 13, further comprising: change means for changing the number of characters of the character string to be extracted by said extraction means on the basis of a result of a search by said search means.

15. A document processing apparatus comprising: first document memory means for storing an old document to be updated and constituted by a plurality of document elements on a basis of a predetermined logic structure; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extracting means for extracting a character string including a predetermined number of characters in the old addition range of the old document as a search key character string, and extracting information for specifying a document including the old additional range as search key information; second document memory means for storing a new document obtained by updating the old document; first search means for searching the new document for a document element specified by the search key information; second search means for searching the document element of the new document detected by said first search means for the same character string as the search key character string; determination means for determining a range including the same character string detected by said second search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new additional range determined by said determination means.

16. The apparatus according to claim 15, wherein each of the document elements has one or a plurality of paragraphs in the predetermined logic structure, the addition range is expressed in units of paragraphs, and said second comment data memory means determines a paragraph including the equivalent portion detected by said second search means as the addition range of the comment data in the new document, and stores the determined addition range as the new position information in correspondence with the comment data.

17. The apparatus according to claim 15, further comprising: setting means for setting the number of characters of the character string to be extracted by said extraction means to be a desired value.

18. The apparatus according to claim 15, further comprising: change means for changing the number of characters of the character string to be extracted by said extraction means on the basis of a result of a search by said search means.

19. A document processing apparatus comprising: first document memory means for strong an old document data to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old additional range of a character string to which the comment data is added in the old document; extracting means for extracting words included in the old addition range in the old document; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same words as the words extracted by said extraction means; determination means for determining a range in which an amount of the words detected by said search means beyond a predetermined amount, in the new document, as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means.

20. The apparatus according to claim 19, wherein the addition range is expressed in units of lines divided by new line codes, said search means searches the new document obtained by modifying the old document for, as the equivalent range, a line in which the words extracted by said extraction means occur at a predetermined rate.

21. The apparatus according to claim 19, further comprising: setting means for setting a value of the predetermined rate used in said search means to be a desired value.

22. The apparatus according to claim 19, further comprising: change means for changing a value of the predetermined rate used in said search means on the basis of a search state of the equivalent range by said search means.

23. A document processing apparatus comprising: first document memory means for storing an old document data to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range in the old document as a search key character string; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string extracted by said extraction means; determining means for determining a range of the same character string detected by said search means in the new document as a new addition range of the comment data in the new document; second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determining means; and third comment data memory means for, when said search means does not detect the character string, storing the comment data in a different format from the comment data stored in said second comment data memory means.

24. The apparatus according to claim 23, wherein said third comment data memory means creates a file for storing the comment data for which an equivalent portion is not detected by said search means, and stores the comment data, for which an equivalent portion is not detected, in the created file.

25. The apparatus according to claim 24, wherein said third comment data means stores the comment data and the old position information in the special-purpose file when said search means does not detect an equivalent portion.

26. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old additional range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range in the old document as a search key character string; second document memory means for storing a new document by updating the old document; search means for searching the new document for the same character string as the search key character string; determination means for determining a range of the corresponding character string detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for, when said search means detects the character string, storing the comment data in correspondence with the new addition range determined by said determination means; and third comment data memory means for extracting comment data which is not stored in said second comment data memory means from the comment data stored in said first comment data memory means, and storing the extracted comment data.

27. The apparatus according to claim 26, wherein said third comment data memory means creates a specific file for storing comment data for which said search means does not detect an equivalent portion, extracts additional data which is not stored in said second comment data memory means from the comment data stored in said first comment data memory means, and stores the extracted comment data in the specific file.

28. The apparatus according to claim 27, wherein said third comment data memory means extracts comment data which is not stored in said second comment data memory means from the comment data stored in said first comment data memory means, and old position information corresponding to the extracted comment data, and stores the comment data and old position data in the specific file.

29. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string on a basis of the old range information; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string; determination means for determining a range of the same character string detected by said search means in the new document as a new addition range in the new document; second comment data memory means for, when said search means detects the character string, storing, in a data file, the comment data in correspondence with the new addition range determined by said determination means; and third comment data memory means for, when said search means does not detect the character string, storing the comment data in the data file to be identifiable from the comment data stored in said second comment data memory means.

30. The apparatus according to claim 29, wherein said third comment data memory means stores the comment data and the corresponding old position data in the data file to be identifiable from the comment data stored in said second comment data memory means when said search means does not detect an equivalent portion.

31. The apparatus according to claim 29, further comprising: storage means for, when said search means does not detect an equivalent portion, temporarily storing the comment data, and wherein said third comment data memory means collectively stores the comment data stored in said storage means in a predetermined area of the data file.

32. The apparatus according to claim 29, wherein said third comment data memory means stores the comment data in the data file together with predetermined identification information when said search means does not detect an equivalent portion.

33. The apparatus according to claim 29, wherein said third comment data memory means determines data, which cannot exist as an addition position, as the new position information, and stores the comment data in the data file together with the new addition information when said search mens does not detect an equivalent portion.

34. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string extracted by said extraction means; determination means for determining a range of the same character string detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for, when said search means detects the character string, storing the comment data in correspondence with the new addition range determined by said determination means; and third comment data memory means for, when said search means does not detect the character string, storing the comment data; and display means for identifiably displaying the comment data stored in said second comment data memory means and the comment data stored in said third comment data memory means upon display of the new document.

35. The apparatus according to claim 34, wherein, upon display of the new document, said display means always displays the comment data stored in said third comment data memory means at a predetermined position of a display screen, and displays the comment data stored in said second comment data memory means by connecting a line between the comment data and the addition position of the comment data in the new document.

36. The apparatus according to claim 34, wherein said third comment data memory means stores the comment data and the corresponding old position data when said search means does not detect an equivalent portion, said display means displays the addition position of the comment data in a display region of the new document on the basis of the position information stored in said second and third comment data memory means, and displays a correspondence with the corresponding addition position upon display of the comment data, and the display of the addition position by said display means allows identification as to whether the displayed addition position is stored in the second or third comment data memory means.

37. The apparatus according to claim 34, wherein said display means displays the addition position in a display region of the new document on the basis of the position information stored in said second and third comment data memory means, and displays the comment data corresponding to the displayed addition position to allow identification as to whether the comment data is one stored in said second or third comment data memory means.

38. The apparatus according to claim 34, wherein the display of the comment data by said display means distinguishes the comment data stored in said second comment data memory means from that stored in said third comment data memory means by a line type of a line segment connecting the addition position and the comment data.

39. The apparatus according to claim 34, wherein the display of the comment data by said display means distinguishes the comment data stored in said second comment data memory means from that stored in said third comment data memory means by a normal display or a reversal display.

40. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string; determination means for determining a range of the same character string determined by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means; and third comment data memory means for, when said search means does not detect the character string, storing range information indicating a range near the addition range represented by the old addition range information as new range information representing the addition range of the comment data in the new document in correspondence with the comment data.

41. The apparatus according to claim 40, wherein the old position information represents and addition range to which the comment data is to be added, and the new position information in said third comment data memory means is determined to represent a range for one start character of the addition range represented by the old position information.

42. A document processing apparatus comprising: first document memory means for storing an old document to be updated constituted by a plurality of document elements; first comment data memory means for storing comment data to be added to the old document, in correspondence with a document element to which the comment data is added; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for a document element equivalent to the document element specified by old range information; determination means for determining range information specifying the document element detected by said search means in the new document as new range information; second comment data memory means for storing the comment data in correspondence with the new range information determined by said determination means; and third comment data memory means for, when said search means does not detect an equivalent document element, selecting a document element near a range corresponding to the document element specified by the old range information the new document, and storing new range information specifying the selected document element in correspondence with the comment data.

43. The apparatus according to claim 42, wherein each of the old and new documents has a hierarchical structure, and when said search means does not detect an equivalent document element, said third comment data memory means selects a higher-level document element including a document element near a position corresponding to the document element represented by the old position information in the new document, and stores new position information representing the selected document element in correspondence with the comment data.

44. A document processing apparatus comprising: first document memory means for storing an old document to be updated constituted by a plurality of document elements; first comment data memory means for storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range from the old document as a search key character string on a basis of the old addition range information; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string extracted by said extraction means; determination means for determining a range of the same character string detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determination means; and third comment data memory means for, when said search means does not detect the character string, selecting a document element including the range, represented by the old addition range information, in the new document, and storing information representing the selected document element as the new range information in correspondence with the comment data.

45. The apparatus according to claim 44, wherein each of the old and new documents has a hierarchical structure of document elements, and when said search means does not detect an equivalent document element, said third comment data memory means selects a document element in a lowermost layer including the entire position, represented by the old position information in the new information, in the new position, and stores information representing the selected document element as the new position information in correspondence with the comment data.

46. A document processing apparatus comprising: first document memory means for storing an old document to be updated; first comment data memory means for storing comment data to be added to the old document in correspondence with an old addition range of a character string to which the comment data is added in the old document; extraction means for extracting a character string within the old addition range in the old document as a search key character string on a basis of the old range information; second document memory means for storing a new document obtained by updating the old document; search means for searching the new document for the same character string as the search key character string; determination means for determining a range of the same character detected by said search means in the new document as a new addition range of the comment data in the new document; and second comment data memory means for storing the comment data in correspondence with the new addition range determined by said determining means; and storage means for, when said search means does not detect an equivalent character string, storing the comment data in a predetermined area of the new document.

47. The apparatus according to claim 46, further comprising: temporary memory means for, when said search means does not detect an equivalent portion, temporarily storing the comment data, and wherein said storage means collectively stores comment data, for which an equivalent portion is not searched for in the new document, in the predetermined area of the new document.

48. The apparatus according to claim 46, wherein said storage means stores the comment data in the new document together with predetermined identification information when said search means does not detect an equivalent portion.

49. The apparatus according to claim 1, further comprising: first display means for displaying a certain range of the document data of the old document or the new document and document data to be added thereto; discrimination means for discriminating whether or not the addition range of the displayed comment data is present within a range of the document data currently displayed by said first display means; second display means for, when said discrimination means discriminates that the addition range is present within the currently displayed range of the document data, displaying a first graphic symbol representing a correspondence between the displayed comment data and the addition range; and third display means for, when said discrimination means discriminates that the addition range is not present within the currently displayed range of the document data, displaying a second graphic symbol identifiably representing that the addition range falls outside the currently displayed range, and a correspondence between the document data and the displayed comment data.

50. The apparatus according to claim 49, wherein said second display means displays the correspondence between the comment data and the addition position using a line segment indicating a line where the addition position is present in the displayed range of the document data and a display of the comment data, and said third display means displays the correspondence between the document data and the comment data by connecting a predetermined position of a display region of the document data and a display region of the comment data using a line segment.

51. The apparatus according to claim 49, further comprising: change means for changing line types of the line segments used by said second and third display means depending on whether the line segment is used by said second or third display means.

52. The apparatus according to claim 49, further comprising: calculation means for, when said discrimination means discriminates that the addition position is not present within the currently displayed range of the document data, calculating an amount on the basis of a distance between the currently displayed range and the addition position, and wherein said third display means changes the correspondence display between the currently displayed document data and the comment data on the basis of the amount calculated by said calculation means.

53. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range from the old document as a search key character string; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string extracted from the old document by said extraction step; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step.

54. A document processing method comprising: a first document memory step of storing an old document to be updated which is constituted by a plurality of document elements based on a predetermined logic structure; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of the a character string to which comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string, and extracting information for specifying a document element including the old addition range as search key information; a second document memory step of storing a new document obtained by updating the old document; a first search step of searching the new document for a document element specified by the search key information; a second search step of searching the document element detected in the first search step for the same character string as the search key character string extracted from the old document by said extraction step; a determination step of determining a range of the same character string detected by said second search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with new range information representing the new addition range.

55. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string having a predetermined number of characters within the old addition range of the old document as a search key character string; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string extracted by said extraction step; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step.

56. A document processing method comprising: a first document memory step of storing an old document to be updated which is constituted by a plurality of document elements on a basis of a predetermined logic structure; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string including a predetermined number of characters in the old addition range of the old document as a search key character string, and extracting information for specifying a document element including the old addition range as search key information; a second document memory step of storing a new document obtained by updating the old document; a first search step of searching the new document for a document element specified by the search key information; a second search step of searching the document element of the new document detected in the first search step for the same character string as the search key character string; a determination step of determining a range of the same character string detected by said second search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with new range information representing the new addition range determined by said determination step.

57. A document processing method comprising: a first document memory step of storing an old document data to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting words included in a character string in the old addition range in the old document; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same words as the words extracted in the extraction step; a determination step of determining a range in which an amount of the words detected by said search step beyond a predetermine amount, in the new document, as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with new range information representing the new addition range determined by said determination step.

58. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string on a basis of the old range information; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string extracted by said extraction step; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step, in correspondence with the comment data in the new document; and a third comment data memory step of storing the comment data in a different format from the comment data stored in the second comment data memory step when the character string is not detected in the search step.

59. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step, when the equivalent character string is detected in the search step; and a third memory step of extracting comment data which is not stored in the first comment data memory step, and storing the extracted comment data.

60. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing commend data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; a second comment data memory step of storing, in a data file the comment data in correspondence with the new addition position determined by said determination step, when the character string is detected in the search step; and a third comment data memory step of storing the comment data in the data file to be identifiable from the comment data stored in the second comment data memory step when the character string is not detected in the search step.

61. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string on a basis of the old range information; a second document memory step of storing a new document by updating the old document; a search step of searching the new document for the same character string as the search key character string extracted by said extraction step; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step when the character string is detected in the search step; a third comment data memory step of storing the comment data when the character string is not detected in the search step; and a display step of identifiably displaying the comment data stored in the second comment data memory step and the comment data stored in the third comment data memory step upon display of the new document.

62. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range from the old document as a search key character string on a basis of the first range information; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step; and a third comment data memory step of storing range information indicating a range near the addition range represented by the old range information as new range information representing the addition range of the comment data in the new document in correspondence with the comment data, when the character string is not detected in the search step.

63. A document processing method comprising: a first document memory step of storing an old document to be updated, which is constituted by a plurality of document elements; a first comment data memory step of storing comment data to be added to the old document constituted by a plurality of document elements, in correspondence with a document element to which the comment data is added; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for a document element equivalent to the document element specified by the old position information; a determination step of determining range information specifying the document element detected by said search step in the new document as new range information; a second comment data memory step of storing the comment data in correspondence with the equivalent document element, detected in the search step in the new document; and a third comment data memory step of selecting a document element near a position corresponding to the document element specified by the old position information in the new document, and storing new position information specifying the selected document element in correspondence with the comment data, when an equivalent document element is not detected in the search step.

64. A document processing method comprising: a first document memory step of storing an old document to be updated, which is constituted by a plurality of document elements; a first comment data memory step of storing comment data to be added to the old document constituted by a plurality of document elements, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range from the old document as a search key character string on a basis of the old range information; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the character string as the search key character string extracted by said extraction step; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step; and a third comment data memory step of selecting a document element including the old range, represented by the old range information, in the new document, and storing information representing the selected document element as the new range information in correspondence with the comment data, when the character string is not detected in the search step.

65. A document processing method comprising: a first document memory step of storing an old document to be updated; a first comment data memory step of storing comment data to be added to the old document, in correspondence with an old addition range of a character string to which the comment data is added in the old document; an extraction step of extracting a character string within the old addition range in the old document as a search key character string on a basis of the old range information; a second document memory step of storing a new document obtained by updating the old document; a search step of searching the new document for the same character string as the search key character string; a determination step of determining a range of the same character string detected by said search step in the new document as a new addition range of the comment data in the new document; and a second comment data memory step of storing the comment data in correspondence with the new addition range determined by said determination step; and a storage step of storing the comment data in a predetermined area of the new document when an equivalent character string is not detected in the search step.

66. The method according to claim 53, further comprising: a first display step of displaying a certain range of the document data of the old document or the new document and comment data to be added thereto; a discrimination step of discriminating whether or not the addition range of the displayed comment data is present within a range of the document data currently displayed in the first display step; a second display step of displaying a first graphic symbol representing a correspondence between the displayed comment data and the addition range when it is discriminated in the discrimination step that the addition range is present within the currently displayed range of the document data; and a third display step of displaying a second graphic symbol identifiably representing that the addition range falls outside the currently displayed range, and a correspondence between the document data and the displayed comment data when it is discriminated in the discrimination step that the addition range is not present within the currently displayed range of the document data.

Description

BACKGROUND OF THE INVENTION

The present invention relates to a document processing method and apparatus, which can add additional data such as a comment to a document.

A document processing apparatus, with which a user can add some comments to a portion of a document (e.g., a manual) stored in, e.g., a floppy disk, is known. FIG. 102 shows an example of a document (to be referred to as an original document hereinafter) furnished with a comment, and the display state of the comment. On a CRT screen 120, two windows are displayed. An original document is displayed on a text window 111, and a comment is displayed on a comment window 112. Therefore, the original document and the comment are displayed on different windows, and the position of the original document where the comment is added is represented by a line 113 connecting the two windows.

In this case, as a method of adding a comment to an original document, a special code as link information may be embedded in original document data. The comment is linked with the original document by the link information embedded in the original document, and the comment can be displayed by following the link information. Therefore, in the method of embedding the link information in the original document, a user who adds a comment must have an authority for embedding link information in an original document. In such an original document file, the same comment is displayed for any users who open the file. If another user added a comment, then the added comment is displayed. The contents (sentences) of the comment and the original document may be stored in the same file or in different files.

As a method of adding a comment for a user who cannot modify an original document, an original document and a comment are stored in different files (an original document file and a comment file), and when the comment and the original document are to be displayed, a system is started by inputting IDs (e.g., file names) of the two files, so as to link and display these data. In this case, information indicating a correspondence between the comment and the position of the original document is possessed by the comment file. For example, the comment file has position information indicating a correspondence between a comment and the ordinal number of the character in question from the beginning of the original document file.

In this method, each user can independently have a comment file, respectively, and the original document file is shared by all users. For this reason, no authority of modifying the original document file is required, and a user can display a document while displaying his or her own comment, without displaying comments added by other users. If the system arrangement allows to display comments added by other users, a user can display a document while displaying such comments, as a matter of course.

In the above-mentioned example, the number of characters from the beginning of the original document file or a special code embedded in original document data is used as position information indicating the adding position of a comment in the original document. Therefore, the position information of the comment and the state of the original document file are closely related to each other. For this reason, when the original document is partially modified to be a new version, and becomes a quite different document in terms of data, all comments added so far become meaningless even if the documents of old and new versions have similar contents.

For example, when a comment is added using link information, if a modified document (new document) is provided as a new document file, since no link information is embedded in the provided new document file, a special code as the link information must be re-embedded. When the number of characters from the beginning of a document is used as comment position information, if the number of characters in the provided new document is locally larger/smaller than that in an old document, a position (the number of characters from the beginning) where a comment is to be added changes even if the following contents remain the same. For this reason, a comment cannot be added at a correct position of a new document with the use of position information in a comment file for an unmodified document (old document). Therefore, in this case as well, the position information of a comment must be changed.

In particular, in the case of manuals whose versions are updated by adding some minor revisions or some sentences, the contents of a new document (new version) are not largely different from those of an old document (old version). Therefore, most of comments are still relevant to the new document. However, in the above-mentioned technique, since data of an original document is rewritten, old comments cannot often be utilized. When comments for an old document are to be utilized for a new document, the above-mentioned operation for transferring the comments is required, and such an operation is very troublesome.

SUMMARY OF THE INVENTION

It is an object of the present invention to provide a document processing method and apparatus, which can easily re-add additional data added to a certain portion of a first document to an equivalent position in a second document, and can transfer a comment from one document to another efficiently.

It is another object of the present invention to provide a document processing method and apparatus, which, when additional data added to a first document is re-added to an equivalent portion of a second document, can extract a portion having the same character string as that included at the addition position of the additional data in the first document from the second document, and can determine the portion as the equivalent portion.

It is still another object of the present invention to provide a document processing method and apparatus, which, when additional data added to a first document is re-added to an equivalent portion of a second document, can extract a portion having a predetermined similarity or higher to the addition position of the additional data in the first document from the second document as the equivalent portion.

It is still another object of the present invention to provide a document processing method and apparatus, which can extract a portion having a character string, which coincides with a character string of a predetermined number of characters included at the addition position of additional data in a first document, from a second document as an equivalent portion (note that the predetermined number of characters serves as the similarity).

It is still another object of the present invention to provide a document processing method and apparatus, which can extract a portion including a predetermined amount or more of words included at the addition position of additional data in a first document from a second document as an equivalent portion (note that a value for designating the predetermined amount serves as the similarity).

It is still another object of the present invention to provide a document processing method and apparatus, which can desirably set the above-mentioned similarity, and can flexibly extract the equivalent portion.

It is still another object of the present invention to provide a document processing method and apparatus, which can vary the above-mentioned similarity on the basis of a search state of an equivalent portion, and can detect the equivalent portion using an optimal similarity.

It is still another object of the present invention to provide a document processing method and apparatus, which, upon transfer or copy of additional data between first and second documents having a predetermined logical structure, can extract a portion equivalent to the addition position of the additional data in the first document from the second document by utilizing the logical structure.

It is still another object of the present invention to provide a document processing method and apparatus, which, upon efficient transfer of additional data between documents, can store additional data, which could not be transferred, to be distinguished from additional data which could be successfully transferred, and can prevent loss of comments upon transfer of the comments.

It is still another object of the present invention to provide a document processing method and apparatus, which can display additional data which could be successfully transferred to be distinguished from additional data which could not be transferred.

It is still another object of the present invention to provide a document processing method and apparatus, which can identify a correspondence between displayed additional data and a document even when the addition position of the displayed additional data falls outside the current document display range.

Other features and advantages of the present invention will be apparent from the following description taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.

FIG. 1 is a schematic block diagram showing the arrangement of a document processing apparatus of the first embodiment;

FIG. 2 is a perspective view for explaining the device arrangement of a console;

FIG. 3 is an explanatory view of an original document file in the first embodiment;

FIG. 4 is an explanatory view of a data structure of a comment file in the first embodiment;

FIG. 5 is a view showing the screen display state of comments in the first embodiment;

FIG. 6 is a view showing an example of a new document file in the first embodiment;

FIG. 7 is a flow chart showing the processing sequence for creating a comment file for a new document in the first embodiment;

FIG. 8 is a view showing an example of a comment file for a new document in the first embodiment;

FIG. 9 is a schematic block diagram showing the arrangement of a document processing apparatus of the second embodiment;

FIG. 10 is an explanatory view of a document structure in the second embodiment;

FIG. 11 is an explanatory view of a data structure of a document file in the second embodiment;

FIG. 12 is an explanatory view of a data structure of a comment file in the second embodiment;

FIG. 13 is a flow chart showing the processing sequence for creating a comment file for a new document in the second embodiment;

FIG. 14 is a view showing a new document file in the second embodiment;

FIG. 15 is a view showing a comment file for a new document in the second embodiment;

FIG. 16 is a schematic block diagram showing the arrangement of a document processing apparatus of the third embodiment;

FIG. 17 is an explanatory view showing an example of a document file in the third embodiment;

FIG. 18 is an explanatory view of a data structure of a comment file in the third embodiment;

FIG. 19 is a view showing an example of a comment display screen in the third embodiment;

FIG. 20 is a view showing an example of a new document file in the third embodiment;

FIG. 21A is a flow chart showing the processing sequence for creating a comment file for a new document in the third embodiment;

FIG. 21B is a flow chart showing processing for changing a similarity;

FIG. 22 is a view showing an example of a comment file for a new document in the third embodiment;

FIG. 23 is a schematic block diagram showing the arrangement of a document processing apparatus of the fourth embodiment;

FIG. 24 is an explanatory view of a data structure of a comment file in the fourth embodiment;

FIG. 25 is a flow chart showing the processing sequence for generating a file for a new document in the fourth embodiment;

FIG. 26A is a view showing an example of a new document file in the fourth embodiment;

FIG. 26B is a view showing an example of a comment file for a new document in the fourth embodiment;

FIG. 27 is a schematic block diagram showing the arrangement of a document processing apparatus of the fifth embodiment;

FIG. 28 is a flow chart showing the processing sequence for creating a file for a new document in the fifth embodiment;

FIG. 29 is a schematic block diagram showing the arrangement of a document processing apparatus of the sixth embodiment;

FIG. 30 is a flow chart showing the processing sequence for transferring a comment in the document processing apparatus in the sixth embodiment;

FIG. 31 is a view showing the contents of a new document file in the sixth embodiment;

FIG. 32 is a view showing the contents of a comment file for a new document in the sixth embodiment;

FIG. 33 is a view showing the contents of a dropout comment file in the sixth embodiment;

FIG. 34 is a flow chart showing the processing sequence for transferring a comment in a document processing apparatus of the seventh embodiment;

FIG. 35 is a flow chart showing the sequence for creating a dropout comment file in the document processing apparatus of the seventh embodiment;

FIG. 36 is a schematic block diagram showing the arrangement of a document processing apparatus of the eighth embodiment;

FIG. 37 is a flow chart showing the sequence of comment transfer processing in the document processing apparatus of the eighth embodiment;

FIG. 38 is a view showing the contents of a comment file for a new document as a result of execution of the comment transfer processing by the document processing apparatus of the eighth embodiment;

FIG. 39 is a view showing a comment file for a new document file, in which comments are distinguished from each other on the basis of position information;

FIG. 40 is a schematic block diagram showing the arrangement of a document processing apparatus of the ninth embodiment;

FIG. 41 is a view showing an example of a display state of an original document and comments;

FIG. 42 is a view showing an example of an original document file (old document) in the ninth embodiment;

FIG. 43 is a view showing an example of a comment file (for an old document) corresponding to the document shown in FIG. 42;

FIG. 44 is a flow chart showing the sequence for creating a dropout comment file in the ninth embodiment;

FIG. 45 is a flow chart showing the comment display sequence in the ninth embodiment;

FIG. 46 is a view showing an example of a modified new document file in the ninth embodiment;

FIG. 47 is a view showing an example of a comment file for a new document in the ninth embodiment;

FIG. 48 is a view showing an example of a dropout comment file in the ninth embodiment;

FIG. 49 is a view showing a display example of a comment and a dropout comment in the ninth embodiment;

FIG. 50 is a schematic block diagram showing the arrangement of a document processing apparatus of the 10th embodiment;

FIG. 51 is a view showing an example of a comment file for a new document in the 10th embodiment;

FIG. 52 is a flow chart showing the sequence for creating a comment file in the 10th embodiment;

FIG. 53 is a flow chart showing the comment display sequence in the 10th embodiment;

FIG. 54 is a view showing a display example of a comment added to a new document in the 10th embodiment;

FIG. 55 is a view showing an example of a comment file for a new document of the 11th embodiment;

FIG. 56 is a flow chart showing the comment display sequence in the 11th embodiment;

FIG. 57 is a view showing a display example of a comment and a dropout comment in the 11th embodiment;

FIG. 58 is a view showing a display example of a comment and a dropout comment in the 12th embodiment;

FIG. 59 is a view showing a display example of a comment and a dropout comment in the 13th embodiment;

FIG. 60 is a view showing an example of a comment file for an old document in the 14th embodiment;

FIG. 61 is a view showing a display example of a text window and a comment window in the 14th embodiment;

FIG. 62 is a view showing an example of a new document file in the 14th embodiment;

FIG. 63 is a view showing an example of the contents of a comment file for a new document file in the 14th embodiment;

FIG. 64 is a view showing a display example of a text window and a comment window after a new document file is created in the 14th embodiment;

FIG. 65 is a flow chart showing the sequence for generating a comment for a new document in the 14th embodiment;

FIG. 66 is a view showing an example of a comment file for a new document in the 14th embodiment;

FIG. 67 is a schematic block diagram showing the arrangement of a document processing apparatus of the 15th embodiment;

FIG. 68 is a flow chart showing the sequence for generating a comment for a new document in the 15th embodiment;

FIG. 69 is a view showing an example of an old document file in the 15th embodiment;

FIG. 70 is a view showing an example of a comment file for an old document in the 15th embodiment;

FIG. 71 is a view showing an example of a new document file in the 16th embodiment;

FIG. 72 is a view showing an example of a comment file for a new document in the 15th embodiment;

FIG. 73 is a view showing a display example of a new document file and its comment in the 15th embodiment;

FIG. 74 is a view showing an example of a comment file for a new document in the 15th embodiment;

FIG. 75 is a view showing an example of a comment file for a new document in the 16th embodiment;

FIG. 76 is a block diagram showing the arrangement of a document processing apparatus of the 17th embodiment;

FIG. 77 is a view showing an example of an old document file in the 17th embodiment;

FIG. 78 is a view showing an example of a comment file for an old document in the 17th embodiment;

FIG. 79 is a view showing a display example of a new document file and its comment in the 17th embodiment;

FIG. 80 is a flow chart showing the sequence for creating a comment for a new document in the 17th embodiment;

FIG. 81 is a view showing an example of a comment file for a new document in the 17th embodiment;

FIG. 82 is a view showing the state of stacks in a document element name area in the 17th embodiment;

FIG. 83 is a schematic block diagram showing the arrangement of a document processing apparatus of the 18th embodiment;

FIG. 84 is a flow chart showing the sequence for creating a comment for a new document in the 18th embodiment;

FIG. 85 is a view showing an example of a new document file in the 18th embodiment;

FIG. 86 is a view showing an example of a comment file for a new document in the 18th embodiment;

FIG. 87 is a schematic block diagram showing the arrangement of a document processing apparatus of the 19th embodiment;

FIG. 88 is a flow chart showing the sequence for creating a comment for a new document in the 19th embodiment;

FIG. 89 is a view showing an example of a comment information list in the 19th embodiment;

FIG. 90 is a view showing an example of a new document file in the 19th embodiment;

FIG. 91 is a view showing an example of a comment file for a new document in the 19th embodiment;

FIG. 92 is a schematic block diagram showing the arrangement of a document processing apparatus of the 20th embodiment;

FIG. 93 is a view showing a display state of a document and comments;

FIG. 94 is a view showing the format of a document file;

FIG. 95 is a view showing the format of a comment file in the 20th embodiment;

FIG. 96 is a flow chart showing the sequence of correspondence display processing in the 20th embodiment;

FIG. 97 is a flow chart showing the sequence of correspondence display change processing in the 20th embodiment;

FIG. 98 is an explanatory view of a method of calculating position information for achieving a correspondence display;

FIG. 99 is a view showing the screen display state obtained when a comment added position is displayed in a text window;

FIG. 100 is a view showing the screen display state obtained when no comment added position is displayed in the text window;

FIG. 101 is a flow chart showing the sequence of correspondence display change processing in the 22nd embodiment;

FIG. 102 is a view showing the display method of a document and a comment in a conventional document processing apparatus; and

FIG. 103 is a view showing the display tracing state when a text or comment window is moved.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The preferred embodiments of the present invention will be described hereinafter with reference to the accompanying drawings.

<First Embodiment>

FIG. 1 is a schematic block diagram showing the arrangement of a document processing apparatus of the first embodiment.

Referring to FIG. 1, a console 1 comprises input devices such as a keyboard, a mouse, and the like, and a screen display device such as a CRT. FIG. 2 is a perspective view for explaining the arrangement of the console 1, and illustrates a CRT la, a keyboard 1b, and a pointing device 1c. A CPU 2 controls the overall document processing apparatus of this embodiment. A ROM 3 stores programs used by the CPU 2 for executing various kinds of processing.

Various work areas necessary for transferring a comment are assured on a work memory 4. A position information area 41 is an area for storing position information of a comment read out from a comment file for an old document (to be referred to as an old document comment file hereinafter). A comment content area 42 is an area for storing a character string of the contents of a comment read out from the old document comment file. A character string area 43 is an area for storing a character string of a portion extracted from an old document file and corresponding to position information of a comment. A candidate area 44 is an area for, when the character string stored in the character string area 43 is searched from a new document file, and the same character string is found, storing the position information of the found character string in the new document file. A new position information area 45 is an area for storing one position information selected from those in the candidate area
44.

Reference numeral 5 denotes a file memory for storing document files and comment files. An old document file 51 is an unmodified file to which a comment has already been added. An old document comment file 52 is a comment file corresponding to the old document file 51. A new document file 53 is a document file which is obtained by modifying, e.g., an old document file, and to which no comment is yet added. A new document comment file 54 is a comment file which corresponds to the new document file 53, and in which no comment information is yet stored.

The above-mentioned units are connected to a bus 6. Note that the above-mentioned work memory 4 and file memory 5 are realized by RAMs, a hard disk, or the like.

A method of adding a comment to an original document will be described below.

In this embodiment, assume that one comment file corresponds to one document. The document herein is a normal text file, and is not a specific one. A correspondence between a document file and a comment file can be realized by adding some extension to a document file name as a comment file name. For example, a comment file corresponding to a document "doc1" can be named as "doc1.comment". The contents of the comment file include a plurality of pieces of comment information each consisting of a pair of position information and a comment content character string for each comment.

FIG. 3 shows an example of an original document stored in a document file. FIG. 4 shows the data structure of a comment file. A comment is added by designating a predetermined range in an original document. This range is designated using the number of characters from the beginning of an original document file. For example, when a comment "aabbc" is added to a portion "fghij" and a comment "wwxxy" is added to a portion "klmno" in the original document shown in FIG. 3, the contents of the comment file are as shown in FIG. 4.

One comment information consisting of position information and a comment content character string is sandwiched between character strings <comment> and </comment>. The position information (the number of characters from the beginning of a document file) sandwiched between <place> and </place> and a comment content text (comment itself) sandwiched between <content> and </content> are inserted between <comment> and </comment>.

In the case of the comment file shown in FIG. 4, the first comment information indicates that a comment "aabbc" is added to a character string ("fghij") from the seventh to 11th characters from the beginning of the document file shown in FIG. 3, and the second comment information indicates that a comment "wwxxy" is added to a character string ("klmno") from the 13th to 17th characters from the beginning of the document file.

A display shown in FIG. 5 is made on the display screen of the CRT 1a of the console 1 using the above-mentioned document file and comment file.

FIG. 5 shows the display state on the display screen of the CRT 1a. A display based on the document file 51 shown in FIG. 3 is made on a text window 511. Also, displays based on the contents of the comment file are made on comment windows 512
and 513. Furthermore, lines 514 and 515 connecting the text window and the comment windows are displayed on the basis of position information in the comment file.

As described above, assume that the old document file 51 is present as an original document of the first version, and a comment file corresponding to this document is created as the old document comment file 52. Then, assume that the original document of the first version is modified, and an original document (new document file 53) of a new version is provided, as shown in FIG. 6. At this time, if the old document comment file 52 (FIG. 4) corresponding to the document file (old document file
51) of the first version is used without any modifications, comments cannot be normally displayed in correspondence with the new document file 53 to and from which characters have already been added and deleted. Thus, a method of modifying a comment file corresponding to an old document to one corresponding to a new document will be described below.

A document of the first version is assumed to be the old document file 51, and a document of the second version is assumed to be the new document file 53. Also, comment files corresponding to the documents of different versions are respectively assumed to be the old document comment file 52 and the new document comment file 54. Furthermore, these files (51 to 54) are assumed to be stored in the file memory 5.

In this embodiment, as a means for detecting a portion, to which a comment is to be added, in the new document file 53, the following means is used. More specifically, when the same character string as that to which a comment is added in the old document file 51 is detected from the new document file 53, the detected character string is determined to be a portion, to which a comment is to be added, in the new document file 53. When a plurality of such character strings are detected, the one closest to a position (the number of characters from the beginning), where a comment is attached, in the old document file 51 is selected.

FIG. 7 is a flow chart for creating the new document comment file for adding comments to the new document file 53. Note that FIG. 7 also illustrates the storage locations of various data or memory areas to be looked up in the corresponding steps of the flow chart.

In step S11, position information (the number of characters from the beginning of the document) indicating the position where a comment is added, and the contents of the comment are read out from the old document file 52, and are respectively stored in the position information area 41 and the comment content area 42 in the memory 4.

Furthermore, in step S12, a character string, to which each comment is added, in the old document file 51 is extracted. In this case, the character string need only be extracted from the old document file 51, as indicated by position information in each comment information. The extracted character string is stored in the character string area 43 in the work memory 4.

In step S13, the new document file 53 is searched for the same character string as that extracted in step S11. If the same character string is found, the numbers of characters indicating the start and end positions of the found character string in the new document file 53 are calculated, and a set of the two numbers are stored as a candidate position in the candidate area 44 of the work memory 4. This search operation is executed for all the sentences in the new document file 53, and if a plurality of character strings satisfying the search condition are found, a plurality of candidates are stored in the candidate area 44.

In step S14, it is checked if a candidate is present as a search result. If YES in step S14, the flow advances to step S15.

In step S15, a candidate which is determined to be closest to the position (stored in the position information area 41) of the comment added to the old document file 51 is selected from those in the candidate area 44, and the selected candidate is stored as new position information in the new position information area 45 of the work memory 4.

As the discrimination criterion for the closeness, a candidate numerically closest to the information in the position information area 41 of the old document file 51 is selected in this embodiment. For example, when a candidate from "the 45th to
52nd characters" and a candidate from "the 105th to 112th characters" are found as candidates for a comment added from "the 35th to 42nd characters" of the old document file 51, the candidate from "the 45th to 52nd characters" is selected. More specifically, the numbers of characters from the beginning of the document, which numbers represent the start positions of candidates, are simply compared with each other, and a candidate closest to the comment-added position in the old document file is selected. When a plurality of candidates equally close to the comment-added position in the old document file are found, a candidate having a smaller numerical value (closer to the beginning of the document) is selected.

In step S16, information stored in the new position information area 45 and the contents stored in the comment content area 42 are read out, and are written in the new document comment file 54 in the format of the comment file, as shown in FIG.
4.

If no candidate is found as a result of the search processing in step S13, the flow advances from step S14 to step S17. Therefore, if no candidate is detected in step S13, no data is output to the new document comment file 54.

The new document comment file 54 is assumed to have a file name obtained by adding a specific extension to the file name of the new document file 53 in this embodiment. If a file having such a name is not present, a new file of that name is created, and comment information is written in the new file. On the other hand, if a file having such a name has already been present, comment information is added to the file.

In step S17, it is checked if the above-mentioned processing is completed for all the comments stored in the old document comment file 52. If YES in step S17, this processing ends. However, if non-processed comment information remains, the flow returns to step S11 to repeat the above-mentioned processing.

With the above-mentioned processing, the new document comment file 54 corresponding to the new document file 53 can be generated based on the old document file 51 and the corresponding old document comment file-52.

For example, when a document file shown in FIG. 3 is presented as the old document file 51, and a document file shown in FIG. 6 is presented as the new document file 53, the new document comment file 54 shown in FIG. 8 is generated based on the old document comment file 52 shown in FIG. 4.

The above-mentioned comment file updating method is particularly effective since a comment for an old document can be reflected when the modification of a document is not of a large scale, the position of a comment added to an old document is substantially the same as that of a comment added to a new document, and the contents of a text to which the comment is added do not change.

In place of adding a comment to a desired range of an original document as in the first embodiment, a document may be considered as data strings divided by newline codes, and comments may be added in units of lines. In this case, position information is the line number (only one numerical value) indicating the addition position of a comment in the document. As a method of detecting a portion to which a comment is added, all character strings of lines to which comments are added are extracted from an old document file using the position information (the numbers of lines from the beginning of the document). Then, lines having the same contents are detected from a new document file, and corresponding comments are added to the lines. When a plurality of lines having the same contents are detected, a line closest to the position (the number of lines) of a comment added in the old document file can be selected. With this means, search processing can be simplified, and high-speed processing can be realized. Note that the method of designating a comment-added position using the number of lines will be described in detail in the third embodiment later.

<Second Embodiment>

The second embodiment will be described below.

In the first embodiment, a document file is a simple text file. However, in the second embodiment, a document is assumed to have a predetermined structure. A document is assumed to be divided into elements (document elements) constituting the document in accordance with the predetermined structure.

FIG. 9 is a schematic block diagram showing the arrangement of a document processing apparatus of the second embodiment.

In this embodiment, a document (doc) is assumed to be constituted by the following document elements, for the sake of simplicity. More specifically, a document (doc) is defined to be constituted by a plurality of chapters or sections (sec), and each sec is constituted by one heading (heading) and a plurality of paragraphs (par).

The same reference numerals in FIG. 9 denote the same parts as in the arrangement of the first embodiment (FIG. 1), and a detailed description thereof will be omitted.

Referring to FIG. 9, a heading area 146 stores character strings representing the headings of sections, to which comments are added, in an old document.

FIG. 10 shows an example of the arrangement of document element of a document in the second embodiment. In this case, one document has two sections (81, 82). In the section 81, a heading 811 is "ABCD", and two paragraphs (812, 813) "abcde" and "fghij" are present.

In the case of the document with the above-mentioned structure, a description in a document file is as shown in FIG. 11. That is, the entire document is sandwiched between <doc> and </doc>. Each section is sandwiched between <sec> and </sec>. A heading is sandwiched between <heading> and </heading>, and each paragraph is sandwiched between <par> and </par>. In the above-mentioned format, a structure is provided to a document. (1) A character string described in a portion sandwiched between "<" and ">" represents a structure of a document, and will be referred to as a document element name hereinafter. (2) A character string consisting of "<", a document character name, and ">" represents the start of a document element, and will be referred to as a document element start symbol hereinafter. (3) A character string consisting of "<", "/", a document character name, and ">" represents the end of a document element, and will be referred to as a document element end symbol hereinafter. (4) The contents of a document element are described in a portion sandwiched between the document element start symbol and the document element end symbol.

In the second embodiment, a document and a comment are stored in different files. Unlike in the first embodiment, the contents of a document file are described by a method specifying the structure of a document, as shown in FIG. 11. A comment file has information consisting a set of position information represented by the number of characters from the beginning of a document file, and comment contents as in the first embodiment, but the comment addition range is inhibited from extending over two or more document elements in a document file.

For example, in a document file shown in FIG. 11, when a comment "FGHIJ" is added to a character string "fghij" present in a section "ABCD", and a comment "KLMNO" is added to a character string "klmno" present in a section "XYZUVW", a comment file is as shown in FIG. 12. In this case, upon counting of the number of characters from the beginning of the document file, character strings used for document element start and end symbols are not counted.

In this embodiment, a means for detecting the addition position of a comment in a new document file is as follows. More specifically, when it is detected that a new document has a portion having the same heading as information of a portion starting from <heading> (information of a heading) in ma comment file corresponding to an old document, and the portion includes a character string having the same contents as those of a character string to which a comment is added, the portion is determined to be the addition position of the comment in the new document.

The detection of the addition position of a comment will be described below with reference to the flow chart in FIG. 13. FIG. 13 is a flow chart showing processing for generating a new document comment file in the second embodiment. Note that FIG. 13 also illustrates the storage locations of various data or memory areas to be looked up in the corresponding steps of the flow chart.

In step S21, position information (the number of characters from the beginning of a document) of a comment and the contents of the comment are read out from the old document comment file 52, and are respectively stored in the position information area 41 and the comment content area 42 in the work memory 4.

In step S22, a character string, corresponding to the comment, in the old document file 51, and a heading of a section including the comment-added portion are extracted. The extracted character string and heading are respectively stored in the character string area 43 and the heading area 146 in the work memory 4.

In step S23, the headings in the new document file 53 are searched for the same heading as that stored in the heading area 146. If the same heading is present, whether or not the same character string as that stored in the character string area
43 is present in the section is examined. If the same character string is found, the numbers of characters indicating the start and end positions of the character string in the new document file 53 are calculated, and are stored as new position information in the new position information area 45 in the work memory 4. Note that the examination ends at the first hit position.

In step S24, it is checked if the search processing of the heading and character string in steps S22 and S23 has succeeded. If YES in step S24, the flow advances to step S25.

In step S25, the information stored in the new position information area 45 and the contents stored in the comment content area 42 are read out, and are written in the new document comment file 54 in the format of the comment file, as shown in FIG. 12.

On the other hand, if the search processing in steps S22 and S23 has not succeeded, the flow advances from step S24 to step S26. Therefore, when the search processing is not successful in step S23, no information is output to the new document comment file 54.

In step S26, it is checked if processing is completed for all the comments in the old document comment file 52. If non-processed comment information still remains, the flow returns to step S21 to repeat the above-mentioned processing. However, if processing is completed for all the comment information, this routine ends.

With the above-mentioned processing, the comment file 54 corresponding to the new document file 53 can be created based on the old document file 51 and the corresponding comment file 52.

For example, when a document file shown in FIG. 11 is presented as the old document file 51, and a document file shown in FIG. 14 is presented as the new document file 53, the new document comment file 54 shown in FIG. 15 is created based on the old document comment file 52 shown in FIG. 12.

Since the document structure does not largely change between old and new documents, portions having the same character strings in the ranges of the same sections probably have the same contents or meanings between the old and new documents. As described above, since the second embodiment utilizes the document structure, reliability of transfer of comments can be improved. In addition, since the first search processing is performed in units of headings, search efficiency can also be improved.

Note that the method of designating the comment position in the second embodiment is not limited to a method using the number of characters from the beginning of a document. For example, a designation method in units of lines described in the modification of the first embodiment may be used. Furthermore, the comment position may be designated using the number of characters or lines from the beginning of each heading.

As described above, according to the above-mentioned embodiments, the same character string as that included in a comment-added portion in an old document is searched from a new document, and a corresponding comment of the old document can be easily added to the searched character string in the new document. For example, a comment transfer operation performed every time the document version is updated can be efficiently realized.

<Third Embodiment>

FIG. 16 is a schematic block diagram showing the arrangement of a document processing apparatus of the third embodiment. The same reference numerals in FIG. 16 denote the same parts as in the first embodiment (FIG. 1), and a detailed description thereof will be omitted. A ROM 3 stores control programs used by the CPU 2 to execute various kinds of processing. Note that the ROM 3 stores a comment addition program 31 which is represented by a flow chart to be described later.

In the work memory 4, a similarity area 46 is an area for storing a designated similarity (to be described later). A start character string area 47 is an area for storing a character string in the old document file 51, which string is extracted based on position information stored in the position information area 41 and a similarity stored in the similarity area 46.

A method of adding a comment to an original document in the third embodiment will be described below. Note that a "document" indicates a document to which a comment is added.

One comment file corresponds to one document. A document is a normal text file, and is not a specific one. A correspondence between a document file and a comment file can be realized by adding some extension to a document file name as a comment file name. For example, a comment file corresponding to a document "doc1" can be named as "doc1.comment". One comment information consists of a pair of position information and comment contents. The contents of the comment file include a plurality of pieces of comment information.

In the third embodiment, a document is considered as data strings divided or delimited by newline codes, and comments are added in units of lines. A line to which a comment is added is designated by the number of lines from the beginning of a document file. For example, when a comment "aabbc" is added to a line starting from "abcde" (first line) and a comment "ffghi" is added to a line starting from "pqrst" (second line) in a document shown in FIG. 17, the contents of the comment file are as shown in FIG. 18.

In the comment file, one comment information is sandwiched between character strings <comment> and </comment>. In this information, position information (a line number indicating the number of lines from the beginning of a document file) is sandwiched between <place> and </place>, and comment contents (comment itself) are sandwiched between <content> and </content> are inserted. In the case of comment information in the comment file shown in FIG. 18, the first comment information indicates that a comment "aabbc" is added to the first line from the beginning of the document file shown in FIG. 17. The second comment information indicates that a comment "ffghi" is added to the second line from the beginning of the document file shown in FIG. 17.

When the document file and comment file prepared as described above are present, these document and comments are displayed on the display screen of the CRT 1a, as shown in FIG. 19. In FIG. 19, a window 500 displays the document, and a window 501
displays the first comment. Also, a window 502 displays the second comment.

Assume that a document file of the first version is present, and a corresponding comment file is generated, as described above. Then, assume that the document file is modified to the second version, and the modified document file is presented to a user. At this time, if the comment file created for the document file of the first version is used without any modifications, comments cannot be normally displayed in correspondence with the document of the second version, in which characters have already been replaced.

For example, when the document file shown in FIG. 17 is assumed to be a document of the first version, and this document is modified, as shown in FIG. 20, to obtain a document file of the second version, the comment-added positions shift to different positions if the comment file shown in FIG. 18 is used.

A method of modifying the comment file corresponding to the first version to one corresponding to the document of the second version will be described below. Note that a document of the first version is assumed to be the old document file 51, a comment file corresponding to the document of the first version is assumed to be the old document comment file 52, and a document of the second version is assumed to be the new document file 53. Furthermore, a comment file to be created in correspondence with the document of the second version is assumed to be the new document comment file 54.

In the third embodiment, as a means for searching a portion similar to or coinciding with a portion added with a comment in an old document from a new document, a means based on "n-character coincidence" is used. With the "n-character coincidence" means, first n characters of a portion added with a comment in an old document are extracted, and whether or not a character string starting from the extracted n characters is present in data units (e.g., in units of lines, in units of characters, or the like) to which comments are to be added in a new document is used as a discrimination criterion for the similarity or coincidence.

For example, assuming that a document is considered as data strings divided by newline codes, and comments are added in units of lines as data units, the "n-character coincidence" means will be described below.

For example, a line "abcde, fghij, klmno" in an old document is modified to a line "abcdpqrstghij, klmno" to obtain a new document. In this case, upon execution of the "n-character coincidence" means of "n=4", since a coincidence is determined using first four characters "abcd" in the line "abcd, fghij, . . . ", it is determined that the line "abcdpqrstghij, klmno" is similar to that in the old document. However, upon execution of the "n-character coincidence" means of "n=5", since a coincidence is determined using first five characters "abcde", it is determined that the line "abcdpqrstghij, klmno" is not similar to that in the old document.

In this manner, since the degree of similarity can be changed by changing the value n, a similarity or coincidence can be flexibly determined. In this embodiment, the value n will be called a "similarity".

In the third embodiment, a portion (line) to which a comment is to be added in the new document file 53 is discriminated using the above-mentioned "n-character coincidence" means as a similar portion search means. In this case, when a plurality of corresponding portions (lines) are detected, a portion closest to the comment-added position (a line number indicating the number of lines from the beginning) in the old document is selected.

FIG. 21A is a flow chart for explaining the processing sequence for creating the new document comment file 54 by the document processing apparatus of the third embodiment. Note that FIG. 21A also illustrates the storage locations of various data or memory areas to be looked up in the corresponding steps of the flow chart.

In step S31, a similarity (numerical value) is input using the input device of the console 1. The input similarity is stored in the similarity area 46 in the work memory 4.

In step S32, position information (line number) here a comment is added and the contents of the comment are read out from the old document comment file 52, and are respectively stored in the position information area 41 and the comment content area 42 in the work memory 4.

In step S33, characters, the number of which is designated by the similarity, are extracted from the beginning of a line to which the comment is added in the old document file 51 on the basis of the position information and similarity stored in the position information area 41 and the similarity area 46. The extracted character string is stored in the start character string area 47 in the work memory 4.

In step S34, the new document file 53 is searched for a line starting from the start character string stored in the start character string area 47. If such a line is found, the position (line number) of the found line is calculated, and this value is stored as a candidate in the candidate area 44 in the work memory 4. This search processing is executed for all the lines in the new document file 53, and if a plurality of lines satisfying the search condition are detected from the new document file 53, a plurality of candidates are stored in the candidate area 44.

In step S35, it is checked if a candidate is detected in step S34. If YES in step S35, the flow advances to step S36.

In step S36, a candidate closest to the position (stored in the position information area 41) of the comment added in the old document file 51 is selected from the stored candidates, and the position of the selected candidate is stored as new position information in the new position information area 45.

As the criterion for the closeness, in the third embodiment, a candidate numerically closest to the position stored in the position information area 41 is selected. For example, when a comment is added to the "second line" in the old document file 51, and the "third line" and "fourth line" are detected as candidates, the "third line" is selected as the new position information. In this case, the line numbers can be simply compared with each other, and a candidate closer to the position in the old document file can be selected. If candidates are equally close to the position in the old document file, a candidate having a smaller line number (closer to the beginning of a document) is selected.

In step S37, the information stored in the new position information area 45 and the contents stored in the comment content area 42 are written in the new document comment file 54 according to the format of the comment file shown in FIG. 18.

If no candidate is detected in step S35, the flow advances to step S38. Therefore, no data is written in the new document comment file 54. The new document comment file 54 is assumed to have a file name obtained by adding a specific extension to the file name of the new document file 53. If a file having such a name is not created yet, a new file is created, and comment information is written in the new file. On the other hand, if a file having such a name has already been created, comment information is added to the file.

In step S38, it is checked if processing is completed for all the comment information in the old document comment file 52. If non-processed comment information still remains, the flow returns to step S32 to repeat the above-mentioned processing; otherwise, this routine ends.

With the above-mentioned processing, the new document comment file 54 can be created based on the old document file 51 and the corresponding old document comment file 52.

For example, when a document file shown in FIG. 17 is presented as the old document file 51, and a document file shown in FIG. 20 is presented as the new document file 53, the new document comment file 54 shown in FIG. 22 is created based on the old document comment file 52 shown in FIG. 18.

As described above, according to the document processing apparatus of the third embodiment, a comment added to a certain portion in an old document can be automatically re-added to a position, corresponding to that in the old document, in a new document.

Note that comment transfer processing can be optimized by changing n, i.e., the similarity. For example, when comment transfer processing fails by the "n-character coincidence" means of "n=5", n is changed to "n=4". More specifically, if a candidate is detected by decreasing the similarity, it can be determined that an optimal value of the similarity is "n=4". When a plurality of comment transfer candidates are detected by the "n-character coincidence" means of "n=5", and the number of candidates can be decreased by changing n to "n=6", i.e., increasing the similarity, since "n=6" is a proper value in view of similarity, it can be determined that an optimal value is "n=6". More specifically, an optimal value of similarity in comment transfer processing can be obtained by changing the similarity.

Therefore, when a plurality of candidates are obtained in the search processing in step S34 of the third embodiment, the number of candidates can be decreased by increasing the similarity by one. Contrary to this, when no candidate is detected, the search processing may be executed again by decreasing the similarity by one.

FIG. 21B shows the above-mentioned updating method of the similarity. FIG. 21B shows a flow to be inserted between steps S34 and S35 in FIG. 21A. It is checked if a candidate is detected in the search processing in step S34 above. If no candidate is detected, the similarity (i.e., the value n) is decreased by one (steps S1001 and S1002). In steps S1003 and S1004, extraction of a character string, and search processing of a similar portion (the same processing as in steps S33 and S34
above) are performed using the changed similarity. On the other hand, if it is determined in step S1001 that a candidate is detected, the flow advances to step S1005 to check if a plurality of candidates are detected. If the number of candidates is one, the flow directly advances to step S35. However, if a plurality of candidates is detected, the flow advances to step S1006, and the similarity is increased by one. In steps S1007 and S1008, extraction of a character string, and search processing of a similar portion (the same processing as in steps S33 and S34 above) are performed using the changed similarity. Then, the flow returns to step S1001.

The "n-character coincidence" means is particularly effective when the start characters of a portion added with a comment do not change when a new character string is inserted in the portion added with the comment.

In place of applying the "n-character coincidence means" to a start character string of a portion added with a comment as in this embodiment, the means may be applied to an end character string of a portion added with a comment. In this case, processing can be realized by substantially the same means as in the third embodiment. That is, processing based on the "start character string" can be replaced by that based on the "end character string". Thus, the same effect as in the third embodiment can be obtained.

When the "n-character coincidence means" is simultaneously applied to both the start and end character strings, search processing with higher precision can be realized.

In the third embodiment, a line including a start character string coinciding with that in an old document file is searched from a new document file in the search processing in step S34. However, the present invention is not limited to this. For example, a line including a coinciding character string somewhere in the line may be determined to be a candidate.

<Fourth Embodiment>

The fourth embodiment will be described below.

In the third embodiment, a document file is a simple text file. In the fourth embodiment, a case will be described below wherein a document has a predetermined structure like in the second embodiment.

FIG. 23 is a schematic block diagram showing the arrangement of a document processing apparatus of the fourth embodiment. The same reference numerals in FIG. 23 denote the same parts as in FIG. 16, and a detailed description thereof will be omitted. Therefore, only different portions from FIG. 16 will be described below. The work memory 4 includes a heading area 146 which stores headings (heading) of sections (sec) where comments are located. Also, the ROM 3 stores a comment addition program 32 which describes processing shown in the flow chart in FIG. 25 (to be described later).

In the fourth embodiment as well, a document and comments are stored in different files. A document file is described by the method specifying the structure of a document, as shown in FIG. 11, like in the second embodiment. On the other hand, comments are added in units of paragraphs (a document element starting from <par> and closed by </par>) unlike in the second embodiment. Therefore, as shown in FIG. 24, a comment file has information consisting of a pair of position information (paragraph number) indicating the number of paragraphs from the beginning of a document file, and comment contents. Note that the comment addition range is inhibited from extending over two or more document elements in a document file.

For example, in a document file shown in FIG. 11, when a comment "FGHIJ" is added to a paragraph "fghij" present in a section "ABCD", and a comment "KLMNO" is added to a paragraph "klmno" present in a section "XYZUVW", a comment file is as shown in FIG. 24.

In the fourth embodiment, similar portion search processing is executed as follows. A section having the same heading as information (heading information) of a portion starting from <heading> in a section including a paragraph added with a comment in an old document is obtained from a new document. In th