JP2015069393A - Document data comparison method, document data comparison apparatus, and document data comparison program - Google Patents

Document data comparison method, document data comparison apparatus, and document data comparison program Download PDF

Info

Publication number
JP2015069393A
JP2015069393A JP2013202798A JP2013202798A JP2015069393A JP 2015069393 A JP2015069393 A JP 2015069393A JP 2013202798 A JP2013202798 A JP 2013202798A JP 2013202798 A JP2013202798 A JP 2013202798A JP 2015069393 A JP2015069393 A JP 2015069393A
Authority
JP
Japan
Prior art keywords
character string
document data
character
comparison
similarity metric
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013202798A
Other languages
Japanese (ja)
Inventor
美緒 倉谷
Mio Kuratani
美緒 倉谷
亜津子 戸田
Atsuko Toda
亜津子 戸田
アントニウス アンディ
Antonius Andy
アントニウス アンディ
経夫 渡邉
Norio Watanabe
経夫 渡邉
繁 持地
Shigeru Mochiji
繁 持地
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2013202798A priority Critical patent/JP2015069393A/en
Publication of JP2015069393A publication Critical patent/JP2015069393A/en
Pending legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a document data comparison method, a document data comparison apparatus, and a document data comparison program in which conversion into character codes and calculation of metric values are contrived to allow utilization of attribute information other than character codes.SOLUTION: A document data comparison apparatus 1 comprises: a character string/attribute extraction unit 2 which divides document data composed of sets of character string fragments into character string fragments and extracts attribute information representing the status of the character string fragments in the document; a metric calculation unit 3 which converts the characters contained in the character string fragments into the corresponding character codes to extract character code sequences, and calculates the similarity metric of the character string fragments; and a comparison unit 3 which searches the document data for sets of character string fragments having a ratio of similarity metric being within a numerical range A and matched attribute information, and which when the ratio of similarity metric is within a numerical range B, determines that the contents of the sets of character string fragments match and outputs the determination as a comparison result. This allows the contents of the document data to be compared in the form character codes.

Description

本発明の実施形態は、文書データの内容を文字コードで比較する方法を用いた文書データ比較装置、及びそれをコンピュータで実行するための文書比較プログラムに関する。   Embodiments described herein relate generally to a document data comparison apparatus using a method for comparing contents of document data with character codes, and a document comparison program for executing the same on a computer.

文書データの比較を行う場合に、文書を構成する文字の完全一致ではなく、文書の意味を比較する方法がある。文書の意味を比較する方法では、文字列データの集合についての類似度を用いて比較する方法がある。   When comparing document data, there is a method for comparing the meanings of the documents, not the exact match of the characters constituting the documents. As a method of comparing the meanings of documents, there is a method of comparing using the similarity of a set of character string data.

文字列データの集合について類似度を測る技術は、文字コードを用いて実現できる。この技術はフィールドマッチングを目的としている。表形式のデータに含まれる同じ属性をもつデータのかたまりをフィールドと呼ぶ。   A technique for measuring the similarity of a set of character string data can be realized using a character code. This technology is aimed at field matching. A group of data having the same attribute included in tabular data is called a field.

フィールドマッチングとは、表形式のデータにおけるフィールドを紐づける操作である。例えば、2つの表にそれぞれ「名前」と「氏名」という名のついた同一のフィールドがあり、それらが同じフィールドであると判断することである。   Field matching is an operation for associating fields in tabular data. For example, two tables have the same fields named “name” and “name”, respectively, and it is determined that they are the same field.

その手順は、まず、フィールドを構成する各要素の文字を文字コードに変換し、要素ごとに加算する。次に、各フィールドについて、加算値の平均値と分散または偏差値を算出する。さらに、フィールドを、平均値の分散または偏差値で構成される2次元以上の写像空間上の点として表す。最後に、比較対象のフィールドに対応した2点の距離を演算し、その値を類似度として用いる。(例えば、特許文献1参照)。   In the procedure, first, the characters of each element constituting the field are converted into character codes and added for each element. Next, for each field, the average value and variance or deviation value of the added values are calculated. Further, the field is represented as a point on a mapping space of two or more dimensions composed of the variance or deviation value of the average value. Finally, the distance between the two points corresponding to the field to be compared is calculated and the value is used as the similarity. (For example, refer to Patent Document 1).

特開2004-227037号公報JP 2004-227037 A

従来の文字コードを用いて類似度を測る技術は、フィールドマッチングを目的としていて、文書データの比較に適さない。文章データの内容比較に必要なのは、それぞれの文書のどの部分を比較するかを検索し、この検索で紐づいた文字列の内容を比較することである。つまり、文書データの比較では、ある1つの文字列と同じパターンの文字列を、パターンの異なる文字列の集合から1つだけ検索し、それらの内容を比較する。   Conventional techniques for measuring similarity using character codes are intended for field matching and are not suitable for comparing document data. What is necessary for comparing the contents of text data is to search which part of each document is compared, and to compare the contents of the character strings linked in this search. That is, in the comparison of document data, only one character string having the same pattern as a certain character string is searched from a set of character strings having different patterns, and their contents are compared.

一方で、フィールドマッチングは、同じパターンをもつ複数の文字列の集合同士を紐づける。   On the other hand, field matching links a set of a plurality of character strings having the same pattern.

このように、文書データの比較は単体の文字列を対象とするため、フィールドマッチングよりも文字列から得られる情報が少ない。1つの文字列から、類似度の判断基準をより多く抽出することが課題であった。   As described above, since comparison of document data is for a single character string, less information is obtained from the character string than field matching. It has been a problem to extract more criteria for determining similarity from one character string.

本発明の実施形態は、上記のような従来技術の問題点を解決するために提案されたもので、文字コードへの変換とメトリックの算出を工夫し、文字コード以外の属性情報も利用した文書データ比較方法、文書データ比較装置、及び文書データ比較プログラムを提供することである。   Embodiments of the present invention have been proposed to solve the above-described problems of the prior art, and are documents that devise conversion to character codes and calculation of metrics and use attribute information other than character codes. A data comparison method, a document data comparison device, and a document data comparison program are provided.

上記の目的を達成するために、本実施形態の文書データ比較方法は、文書データの内容を文字コードで比較する文書データ比較装置による文書データ比較方法であって、文書データを文字列断片に分割し、前記文字列断片の文書中における位置づけを表す属性情報を抽出する文字列・属性抽出ステップと、前記文字列断片に含まれる文字を対応する文字コードに変換して文字コード数列を抽出し、前記文字列断片の類似度メトリックを算出するメトリック算出ステップと、前記類似度メトリックの比がある数値範囲A内であり、かつ、前記属性情報が一致する前記文字列断片の組を、前記文書データから検索し、前記類似度メトリックの比がある数値範囲B内である場合に、前記文字列断片の組の内容が一致すると判定し、比較結果として出力する比較ステップと、を含むことを特徴とする。   In order to achieve the above object, the document data comparison method of the present embodiment is a document data comparison method by a document data comparison device that compares the contents of document data with character codes, and divides the document data into character string fragments. A character string / attribute extraction step for extracting attribute information indicating the position of the character string fragment in the document, and converting a character included in the character string fragment into a corresponding character code to extract a character code number sequence, A metric calculation step for calculating a similarity metric of the character string fragment, and a set of the character string fragments that have a ratio of the similarity metric within a certain numerical range A and match the attribute information, are the document data When the ratio of the similarity metric is within a certain numerical range B, it is determined that the contents of the set of character string fragments match, and the comparison result is output. Characterized in that it comprises a comparison step of the.

また、上記の文書データ比較方法を用いた文書データ比較装置、及び文書データ比較装置による文書比較プログラムも本発明の一態様である。   A document data comparison apparatus using the document data comparison method and a document comparison program using the document data comparison apparatus are also one aspect of the present invention.

第1の実施形態に係る文書データ比較装置の構成を示すブロック図である。It is a block diagram which shows the structure of the document data comparison apparatus which concerns on 1st Embodiment. 第1の実施形態の文字列・属性抽出部の構成を示すブロック図である。It is a block diagram which shows the structure of the character string and attribute extraction part of 1st Embodiment. 第1の実施形態のメトリック算出部の構成を示すブロック図である。It is a block diagram which shows the structure of the metric calculation part of 1st Embodiment. 第1の実施形態の比較部の構成を示すブロック図である。It is a block diagram which shows the structure of the comparison part of 1st Embodiment. 第1の実施形態の出力部の構成を示すブロック図である。It is a block diagram which shows the structure of the output part of 1st Embodiment. 第1の実施形態で比較を行う文書データA,Bの一例を示す図である。It is a figure which shows an example of the document data A and B which are compared in 1st Embodiment. 第1の実施形態の文書データAにおける文字列断片の属性を示す図である。It is a figure which shows the attribute of the character string fragment | piece in the document data A of 1st Embodiment. 第1の実施形態の比較データ用A,Bの一例を示す図である。It is a figure which shows an example of A and B for comparison data of 1st Embodiment. 第1の実施形態の文字列断片を文字コード数列に変換した一例を示す図である。It is a figure which shows an example which converted the character string fragment of 1st Embodiment into the character code number sequence. 第1の実施形態の比較データ用A1,B2の一例を示す図である。It is a figure which shows an example of A1 and B2 for comparison data of 1st Embodiment. 第1の実施形態の比較結果リストの一例を示す図である。It is a figure which shows an example of the comparison result list | wrist of 1st Embodiment. 第1の実施形態の比較結果反映文書データの一例を示す図である。It is a figure which shows an example of the comparison result reflection document data of 1st Embodiment. 他の実施形態の数列作成方法で作成した文字コード数列を示す図である。It is a figure which shows the character code number sequence created with the number sequence creation method of other embodiments.

[第1の実施形態]
以下、本発明に係る文書データ比較装置の実施形態について図面を参照しつつ詳細に説明する。なお、各図を通して同一部分には同一符号を付けることにより重複した説明は適宜省略する。
[First Embodiment]
Embodiments of a document data comparison apparatus according to the present invention will be described below in detail with reference to the drawings. In addition, the overlapping description is abbreviate | omitted suitably by attaching | subjecting the same code | symbol to the same part through each figure.

本実施形態の文書データ比較装置1では、文書データ比較装置に文書データ100を入力し、文書データ100内の文書データAと文書データBとの比較を行う。文書データ比較装置1は、対象となる文書データAと文書データBを、次の(1)〜(5)の工程により、比較する。
(1)文書データA,Bを文字列断片に分割し、ぞれぞれの文字列断片の文書中における位置づけを表す属性情報を抽出する文字列・属性抽出工程。
(2)文字列断片から文字コード数列を抽出し、文字列断片ごとの類似度メトリックを抽出するメトリック算出工程。
(3)文書データAと文書データBから、類似度メトリックの比、及び、属性情報に基づいて文字列断片の組を検出し、この文字列断片の組の内容が一致するか否かで比較を行う比較工程。
(4)比較工程の結果に基づいて比較結果リスト、および、元の文書データに比較結果を反映した比較結果反映文書データを出力する出力工程。
(5)比較結果リスト上の文字列断片を選択すると、対応した文字列断片を比較結果を反映した文書データから検索して表示する表示工程。
In the document data comparison apparatus 1 of this embodiment, the document data 100 is input to the document data comparison apparatus, and the document data A and the document data B in the document data 100 are compared. The document data comparison apparatus 1 compares the target document data A and document data B by the following steps (1) to (5).
(1) A character string / attribute extracting step of dividing the document data A and B into character string fragments and extracting attribute information indicating the position of each character string fragment in the document.
(2) A metric calculation step of extracting a character code number sequence from a character string fragment and extracting a similarity metric for each character string fragment.
(3) A set of character string fragments is detected from the document data A and the document data B based on the ratio of similarity metrics and attribute information, and the comparison is made based on whether the contents of the character string fragment sets match. A comparison process.
(4) An output step of outputting a comparison result list and comparison result reflecting document data reflecting the comparison result in the original document data based on the result of the comparison step.
(5) A display step in which, when a character string fragment on the comparison result list is selected, a corresponding character string fragment is retrieved from document data reflecting the comparison result and displayed.

[1−1.構成]
図1は、本実施形態の文書データ比較装置1の構成を示すブロック図である。本実施形態は、(1)〜(5)の工程で比較を行うために、文字列・属性抽出部2、メトリック算出部3、比較部4、出力部5、表示部6、ユーザーインターフェース7とを備える。また、文書データ比較装置において、文書比較に必要な比較用データを記憶する比較用データ記憶部101を備える。
[1-1. Constitution]
FIG. 1 is a block diagram illustrating a configuration of a document data comparison apparatus 1 according to the present embodiment. In this embodiment, in order to perform comparison in the steps (1) to (5), a character string / attribute extraction unit 2, a metric calculation unit 3, a comparison unit 4, an output unit 5, a display unit 6, a user interface 7 and Is provided. The document data comparison apparatus further includes a comparison data storage unit 101 that stores comparison data necessary for document comparison.

(文字列・属性抽出部2)
文字列・属性抽出部2では、文書データ100の中の比較対象となる文書データA及び文書データBを読み込んで、比較用データに変換し、出力する。文字列・属性抽出部2は、図2に示すように、文書データの読み込み部20、文書データ分割部21、属性情報抽出部22、比較用データ出力部23とを備える。
(Character string / attribute extraction unit 2)
The character string / attribute extraction unit 2 reads the document data A and document data B to be compared in the document data 100, converts them into comparison data, and outputs them. As shown in FIG. 2, the character string / attribute extraction unit 2 includes a document data reading unit 20, a document data division unit 21, an attribute information extraction unit 22, and a comparison data output unit 23.

文書データの読み込み部20では、比較対象となる文書データA及び文書データBとを読み込む。文書データA,Bは互いに独立した文書データであり、それぞれ任意の文字列断片の集合である。本実施形態では、文書を構成する文字列の1つを文字列断片とし、文書データAを構成する文字列断片のグループを文字列a1とする。   The document data reading unit 20 reads the document data A and document data B to be compared. Document data A and B are independent document data, each of which is a set of arbitrary character string fragments. In the present embodiment, one of the character strings constituting the document is a character string fragment, and the group of character string fragments constituting the document data A is a character string a1.

文書データ分割部21では、文書データの読み込み部20で読み込んだ文書データAを、複数の文字列断片に分断し、その集合を文字列a1とする。本実施形態では、文書データAを、章、改行、及び句点で区切り文字列断片に分割し、その集合を文字列a1とする。同様に、文書データBを、複数の文字列断片に分断し、その集合を文字列b1とする。   The document data dividing unit 21 divides the document data A read by the document data reading unit 20 into a plurality of character string fragments, and sets the set as a character string a1. In this embodiment, the document data A is divided into delimited character string fragments by chapters, line breaks, and punctuation points, and the set is defined as a character string a1. Similarly, the document data B is divided into a plurality of character string fragments, and the set is defined as a character string b1.

属性情報抽出部22では、文字列a1,b1を構成する文字列断片の属性情報を抽出する。文書A,Bには、文字列a1,b1以外に、文字列a1,b1を構成する文字列断片の属性を示す属性情報が記憶されている。属性情報とは、例えば、ヘッダー、フッター、本文、表などの種類や見出し情報などがある。   The attribute information extraction unit 22 extracts attribute information of character string fragments constituting the character strings a1 and b1. In the documents A and B, attribute information indicating attributes of character string fragments constituting the character strings a1 and b1 is stored in addition to the character strings a1 and b1. The attribute information includes, for example, types such as headers, footers, texts, tables, and heading information.

比較用データ出力部23では、文字列a1,b1について、文字列a1,b1を構成する文字列断片の属性情報から比較用データA,Bを作成し、この比較用データA,Bを比較用データ記憶部101に対して出力する。   The comparison data output unit 23 creates comparison data A and B for the character strings a1 and b1 from the attribute information of the character string fragments constituting the character strings a1 and b1, and uses the comparison data A and B for comparison. The data is output to the data storage unit 101.

(メトリック算出部3)
メトリック算出部3では、比較用データ記憶部101に記憶された比較用データA,比較用データBを読み込んで、比較基準となる類似度メトリックを算出する。メトリック算出部3では、図3に示すように文字コード数列作成部30、類似度メトリック算出部31、比較用データ出力部23とを備える。
(Metric calculation unit 3)
The metric calculation unit 3 reads the comparison data A and the comparison data B stored in the comparison data storage unit 101, and calculates a similarity metric as a comparison reference. As shown in FIG. 3, the metric calculation unit 3 includes a character code number sequence creation unit 30, a similarity metric calculation unit 31, and a comparison data output unit 23.

文字コード数列作成部30では、比較用データの文字列a1,b1を文字コードから成る文字コード数列a2,b2に変換する。文字コード数列の作成方法は、文字列a1,b1を構成する文字列断片に含まれるすべての文字を対応する文字コードに変換して文字コード数列を抽出する。文字コード数列は、各文字列断片に基づく数列である。そのため、文字列a1が5つの文字列断片の集合である場合は、文字列a1からは、文字コード数列a2が5つ作成される。   The character code number sequence creating unit 30 converts the character strings a1 and b1 of the comparison data into character code number sequences a2 and b2 composed of character codes. The character code number sequence is generated by converting all characters included in the character string fragments constituting the character strings a1 and b1 into corresponding character codes and extracting the character code number sequence. The character code number sequence is a number sequence based on each character string fragment. Therefore, if the character string a1 is a set of five character string fragments, five character code number sequences a2 are created from the character string a1.

類似度メトリック算出部31は、文字コード数列作成部30で作成した文字コード数列a2,b2から、比較データ用Aと比較データBとを評価するための評価基準となる類似度メトリックを算出する。この類似度メトリックは、各文字コード数列の文字コードの合計値である。   The similarity metric calculation unit 31 calculates a similarity metric that serves as an evaluation criterion for evaluating the comparison data A and the comparison data B from the character code number sequences a2 and b2 created by the character code number sequence creation unit 30. This similarity metric is the total value of the character codes of each character code number sequence.

比較用データ出力部23では、文字列a1,b1について、文字列a1,b1を構成する文字列断片の属性情報と、文字列a1,b1を構成する文字列断片の類似度メトリックとから比較用データA1,B2を作成し、比較用データ記憶部101に対して出力する。   The comparison data output unit 23 compares the character strings a1 and b1 based on the attribute information of the character string fragments constituting the character strings a1 and b1 and the similarity metric of the character string fragments constituting the character strings a1 and b1. Data A1 and B2 are created and output to the comparison data storage unit 101.

(比較部4)
比較部4は、比較用データ記憶部101を参照し、文書データAと文書データBとの比較を行う。比較部4での比較には、比較用データA1,B2の類似度メトリックを用いる。比較部4は、図4に示すように、比較対象検索部40、内容判定部41、比較結果出力部42を備える。
(Comparison part 4)
The comparison unit 4 refers to the comparison data storage unit 101 and compares the document data A and the document data B. For comparison in the comparison unit 4, the similarity metric of the comparison data A1 and B2 is used. As illustrated in FIG. 4, the comparison unit 4 includes a comparison target search unit 40, a content determination unit 41, and a comparison result output unit 42.

比較対象検索部40では、文字列a1内のある文字列断片を、比較対象となる文書データBの文字列b1内のどの文字列断片と比較するかの検索を行う。比較対象の検索基準は、文字列断片の内容を評価する類似度メトリックによる基準と、文書内での位置づけと前後関係を評価する属性情報による基準の2つに分かれる。2つの基準の両方を満たす文字列断片の組を比較対象とする。   The comparison target search unit 40 searches for a character string fragment in the character string b1 of the document data B to be compared with a character string fragment in the character string a1. There are two types of search criteria for comparison: criteria based on a similarity metric that evaluates the contents of character string fragments, and criteria based on attribute information that evaluates positioning and context in the document. A set of character string fragments that satisfy both of the two criteria is used as a comparison target.

類似度メトリックによる基準は、比較する2つの文字列断片に対応したそれぞれの類似度メトリックの比をとり、その比が数値範囲A以内であることである。数値範囲Aとは、任意の実数Xを用いて1.0±Xで表される1に近い値である。Xは、文書データ100に合わせて適当な値を選択する。また、属性情報による基準は、文字列・属性抽出部2の属性情報の抽出22にて得た属性情報が2つの文字列断片の間で一致することである。   The criterion based on the similarity metric is that the ratio of the similarity metric corresponding to the two character string fragments to be compared is taken and the ratio is within the numerical range A. The numerical value range A is a value close to 1 represented by 1.0 ± X using an arbitrary real number X. X selects an appropriate value according to the document data 100. The criterion based on the attribute information is that the attribute information obtained by the attribute information extraction 22 of the character string / attribute extraction unit 2 matches between the two character string fragments.

内容判定部41では、比較対象の比較対象検索部40で検索した2つの文字列断片の内容が一致しているかを判定する。一致の基準は、類似度メトリックによる基準と同様に類似度メトリックの比が数範囲B以内であるかで判定を行う。数値範囲Bは、数値範囲Aと独立で、任意の実数Yを用いて1.0±Yで表される1に近い値である。Yは、文書データ100に合わせて適当な値を選択する。   The content determination unit 41 determines whether the contents of the two character string fragments searched by the comparison target search unit 40 to be compared match. The matching criterion is determined based on whether the ratio of the similarity metric is within several ranges B as in the criterion based on the similarity metric. The numerical range B is independent of the numerical range A and is a value close to 1 represented by 1.0 ± Y using an arbitrary real number Y. Y selects an appropriate value according to the document data 100.

比較結果出力部では、比較結果を比較用データ101に出力する。比較結果は、文書データAの文字列の各文字列断片について、比較対象を見つけられたか、内容が一致するかどうかを示す。   The comparison result output unit outputs the comparison result to the comparison data 101. The comparison result indicates whether a comparison target is found for each character string fragment of the character string of the document data A or whether the contents match.

(出力部5)
出力部5は、比較用データ記憶部101を参照し、比較部4で得た比較結果を比較結果リスト102、および、元の文書データに比較結果を反映した比較結果反映文書データ103として出力する。出力部5は、図5に示すように、比較結果リスト作成部50と、比較結果反映文書データ作成部51とを備える。
(Output unit 5)
The output unit 5 refers to the comparison data storage unit 101 and outputs the comparison result obtained by the comparison unit 4 as the comparison result list 102 and the comparison result reflecting document data 103 reflecting the comparison result in the original document data. . As shown in FIG. 5, the output unit 5 includes a comparison result list creation unit 50 and a comparison result reflected document data creation unit 51.

比較結果リスト作成部50は、各文字列断片の属性と比較結果を併記したリストを作成する。また、比較結果反映文書データ作成部51は、比較結果を文書データ100に反映した比較結果反映文書データ103を出力する。文書データAに基づく比較結果反映文書データ103は、比較結果反映文書データ103Aとして、文書データBに基づく比較結果反映文書データは比較結果反映文書データ103Bとして、作成される。   The comparison result list creation unit 50 creates a list in which the attribute of each character string fragment and the comparison result are written. In addition, the comparison result reflecting document data creating unit 51 outputs comparison result reflecting document data 103 in which the comparison result is reflected in the document data 100. The comparison result reflecting document data 103 based on the document data A is created as comparison result reflecting document data 103A, and the comparison result reflecting document data based on the document data B is created as comparison result reflecting document data 103B.

(表示部6)
表示部6では、出力部5で得た比較結果リスト102と比較結果反映文書データ103を連動させて表示する。比較結果リスト102のある文字列断片を選択すると、それに対応した文字列断片が比較結果反映文書データ103上でハイライトされて表示される。
(Display unit 6)
The display unit 6 displays the comparison result list 102 obtained by the output unit 5 and the comparison result reflecting document data 103 in conjunction with each other. When a character string fragment in the comparison result list 102 is selected, the corresponding character string fragment is highlighted on the comparison result reflecting document data 103 and displayed.

(ユーザーインターフェース部7)
ユーザーインターフェース部7は、文字列・属性抽出部2、比較部4、出力部5、および、表示部6を制御する。ユーザーが実行する手段を選択し、その手段を実行するのに必要な入力データと出力データを設定するものとする。
(User interface part 7)
The user interface unit 7 controls the character string / attribute extraction unit 2, the comparison unit 4, the output unit 5, and the display unit 6. It is assumed that the user selects a means to execute and sets input data and output data necessary to execute the means.

[1−2.作用]
次に、本実施形態の文書データ比較装置1の文書比較方法について図6乃至12を参照して説明する。本実施形態では、以下の工程により文書データの比較を行う。
[1-2. Action]
Next, a document comparison method of the document data comparison apparatus 1 according to the present embodiment will be described with reference to FIGS. In the present embodiment, document data is compared through the following steps.

(文字列・属性抽出工程)
文字列・属性抽出工程では、文書データA,Bを文字列断片に分割し、ぞれぞれの文字列断片の文書中における位置づけを表す属性情報を抽出する。
(String / attribute extraction process)
In the character string / attribute extraction step, the document data A and B are divided into character string fragments, and attribute information representing the position of each character string fragment in the document is extracted.

初めに、文書データの読み込み部20では、比較対象となる文書データA及び文書データBとを読み込む。図6は、文書データAと文書データBの一例を示す図であり、文書データAには、「文書データの比較について」「第一章」「○●○●。」「装置Aでデータを変換する。」「●○●。」という文字列断片が存在する。一方、文書データBには、「類似度メトリックによる比較」「1.初めに」「◆◇◆◇。」「装置Aでデータを変換する。」「◆◇◆。」という文字列断片が存在する。   First, the document data reading unit 20 reads the document data A and document data B to be compared. FIG. 6 is a diagram showing an example of document data A and document data B. In document data A, “Comparison of document data”, “Chapter 1”, “○○○ ●.” There is a character string fragment "". On the other hand, in the document data B, there are character string fragments of “comparison based on similarity metric”, “1. Introduction”, “◆ ◇ ◆ ◇”, “convert data by device A”, “◆ ◇ ◆.”. To do.

文書データA及び文書データBとを読み込み後、文書データA,Bを文字列断片に分割する。図6においては、文書データAを「文書データの比較について」「第一章」「○●○●。」「装置Aでデータを変換する。」「●○●。」と分断し、5つの文字列断片とする。同様に、文書データBを「類似度メトリックによる比較」「1.初めに」「◆◇◆◇。」「装置Aでデータを変換する。」「◆◇◆。」と分断し、文字列断片とする。   After reading the document data A and the document data B, the document data A and B are divided into character string fragments. In FIG. 6, the document data A is divided into “About comparison of document data”, “Chapter 1”, “○○○ ●.”, “Data is converted by the device A”, and “● ○ ●.”. Let it be a string fragment. Similarly, the document data B is divided into “comparison based on similarity metric”, “1. Introduction”, “◆ ◇ ◆ ◇”, “convert data with device A”, “◆ ◇ ◆”, and character string fragments. And

その後、ぞれぞれの文字列断片の文書中における位置づけを表す属性情報を抽出する。文書データA,Bおける文字列断片の属性情報を抽出する。図7においては、文書データAの「文書データの比較について」という文字列断片には「題名」という属性情報が、「第一章」という文字列断片には「見出し」という属性情報が、「装置Aでデータを変換する。」という文字列断片には「本文」という属性情報が記憶されている。この属性情報を抽出し比較用データを作成する。   Thereafter, attribute information indicating the position of each character string fragment in the document is extracted. The attribute information of the character string fragment in the document data A and B is extracted. In FIG. 7, the attribute information “title” is included in the character string fragment “document data comparison” of the document data A, and the attribute information “heading” is included in the character string fragment “first chapter”. The attribute information “text” is stored in the character string fragment “data is converted by the device A”. This attribute information is extracted to create comparison data.

図8は、文書データA、Bから作成した比較用データA,Bである。例えば、比較用データAは、文字列a1及び文字列a1を構成する文字列断片の属性情報を対応付けて作成される。文書データAは、5の文字列からなるので、各文字列断片に対して番号#が付されるので、比較用データAでは、文字列a1を構成する文字列断片には#1、#2、#3、#4、#5の番号が付される。   FIG. 8 shows comparison data A and B created from document data A and B. FIG. For example, the comparison data A is created by associating the character string a1 and the attribute information of the character string fragments constituting the character string a1. Since the document data A is composed of 5 character strings, each character string fragment is assigned a number #. Therefore, in the comparison data A, the character string fragments constituting the character string a1 are # 1, # 2. , # 3, # 4, and # 5 are assigned.

(メトリック算出工程)
メトリック算出工程では、文字列断片から文字コード数列を抽出し、文字列断片ごとの類似度メトリックを抽出する。
(Metric calculation process)
In the metric calculation step, a character code number sequence is extracted from the character string fragment, and a similarity metric for each character string fragment is extracted.

初めに、文字コード数列作成部30では、比較用データの文字列a1,b1を文字コードから成る文字コード数列a2,b2を作成する。図9は、文字列a1を構成する文字列断面から作成した文字コード数列を示す。図9に示すように、「装置Aでデータを変換する。」という文字列断片a1#4は、「装」「置」「A」「で」・・・・と分割される。そして、「装」をシフトJSコード「9195」に変換する。同様に「置」を「9275」に、「A」を「8260」に、「で」を「82C5」に変換する。これにより、「装置Aでデータを変換する。」という文字列断片a1#4は、「9195」「9275」「8260」「82C5」・・・・という文字コード数列a2#4で表わされる。このように、文字列a1を構成する他の文字列断片についても文字コード数列a2を作成することで、文字列断片a1#1〜#5から文字コード数列a2#1〜#5を作成する。同様に、文字列断片b1#1〜#5から数列b2#1〜#5を作成する。   First, the character code number sequence creating unit 30 creates character code number sequences a2 and b2 composed of character codes from the character strings a1 and b1 of the comparison data. FIG. 9 shows a character code number sequence created from the character string cross-section constituting the character string a1. As shown in FIG. 9, the character string fragment a1 # 4 “Convert data with device A” is divided into “device”, “device”, “A”, “de”,. Then, the “pack” is converted into a shift JS code “9195”. Similarly, “place” is converted to “9275”, “A” is converted to “8260”, and “de” is converted to “82C5”. As a result, the character string fragment a1 # 4 “Convert data by apparatus A” is represented by the character code number sequence a2 # 4 “9195” “9275” “8260” “82C5”. In this manner, the character code number sequence a2 # 1 to # 5 is created from the character string fragments a1 # 1 to # 5 by creating the character code number sequence a2 for the other character string fragments constituting the character string a1. Similarly, numerical sequences b2 # 1 to # 5 are created from the character string fragments b1 # 1 to # 5.

文字列a1,b1から文字コード数列a2,b2を作成後、文字列a1,b1を構成する文字列断片ごとの類似度メトリックを抽出する。類似度メトリックは、文字コード数列a2,b2の合計値であり、例えば、「装置Aでデータを変換する。」という文字列断片a1#4は、「9195」「9275」「8260」「82C5」・・・・を合計した「6DBA6」となる。このように、文字列a1を構成する他の文字列断片についても対応する文字コード数列a2を合計することで、類似度メトリックを抽出することができる。   After creating the character code number sequences a2 and b2 from the character strings a1 and b1, the similarity metric for each character string fragment constituting the character strings a1 and b1 is extracted. The similarity metric is a total value of the character code number sequences a2 and b2. For example, the character string fragment a1 # 4 “convert data by device A” is “9195”, “9275”, “8260”, “82C5”.・ The total is "6DBA6". As described above, the similarity metric can be extracted by summing up the corresponding character code number sequence a2 for other character string fragments constituting the character string a1.

図10は、文書データA、Bから作成した比較用データA1,B2である。例えば、比較用データA1は、文字列断片a1#1〜#5、及び文字列断片a1#1〜#5の属性情報に類似度メトリックを対応付けて作成される。   FIG. 10 shows comparison data A1 and B2 created from document data A and B. For example, the comparison data A1 is created by associating the similarity information with the attribute information of the character string fragments a1 # 1 to # 5 and the character string fragments a1 # 1 to # 5.

(比較工程)
比較工程では、文書データAと文書データBから、類似度メトリックの比、及び、属性情報に基づいて文字列断片の組を検出し、この文字列断片の組の内容が一致するか否かで比較を行う。文字列断片の組の検出では、類似度メトリックの比をとり、その比が数値範囲A以内、且つ属性情報が同一な組合わせを検出する。類似度メトリックの比を利用し、検出を行っているため、文字列断片の内容と文書内での位置づけがほぼ一致する文字列断片の組み合わせの検索が可能である。例えば、文書データAの文字列断片a1#4と比較する文字列断片を文書データB内の文字列断片から検出する場合、文字列断片b1#4は、類似度メトリックが同じ値であり、属性情報も同一であるため、比較対象として検出する。
(Comparison process)
In the comparison step, a set of character string fragments is detected from the document data A and the document data B based on the similarity metric ratio and the attribute information, and whether or not the contents of the character string fragment sets match. Make a comparison. In the detection of a pair of character string fragments, a similarity metric ratio is taken, and a combination in which the ratio is within the numerical range A and the attribute information is the same is detected. Since the detection is performed using the ratio of similarity metrics, it is possible to search for combinations of character string fragments whose contents in the character string fragment and the position in the document substantially match. For example, when a character string fragment to be compared with the character string fragment a1 # 4 of the document data A is detected from the character string fragment in the document data B, the character string fragment b1 # 4 has the same similarity metric, and the attribute Since the information is also the same, it is detected as a comparison target.

そして、比較対象として検出した文字列断片の組み合わせについて、内容が一致しているかの判定を行う。判定では、互いのメトリック値の比が数値範囲B以内である組合わせについて、内容が一致していると判定する。これにより、内容についても完全一致ではなく、ほぼ一致を含めて内容の比較が可能である。例えば、文字列断片a1#4と、文字列断片a2#4とは、類似度メトリックが同じ値であるため、内容が一致していると判定する。   Then, it is determined whether or not the contents of the combinations of character string fragments detected as comparison targets match. In the determination, it is determined that the contents of the combinations in which the ratio of the metric values is within the numerical range B are the same. As a result, the contents are not completely matched, and the contents can be compared including almost the same. For example, since the character string fragment a1 # 4 and the character string fragment a2 # 4 have the same similarity metric, it is determined that the contents match.

(出力工程)
出力工程では、比較結果に基づいて比較結果リスト102、および、元の文書データに比較結果を反映した比較結果反映文書データ103を出力する。図11は、比較結果リスト102の一例を示した図である。比較結果リスト102は、それぞれの文書の文字列断片に属するファイル名、ページ数、文字列と、それらの比較結果を一行にまとめ、文書の冒頭から順番に並べたものが挙げられる。比較結果は、一致か不一致を「○」または「×」で表わす。図11においては、文書データA内のファイル名「01.txt」の1ページに記載された「装置Aでデータを変換する。」という文字列断片が、文書データB内のファイル名「02.txt」の1ページに記載された「装置Aでデータを変換する。」という文字列断片と一致することがわかる。
(Output process)
In the output step, the comparison result list 102 and the comparison result reflecting document data 103 reflecting the comparison result in the original document data are output based on the comparison result. FIG. 11 is a diagram illustrating an example of the comparison result list 102. The comparison result list 102 includes a list of file names, page numbers, and character strings that belong to character string fragments of each document, and their comparison results in one line, arranged in order from the beginning of the document. In the comparison result, “O” or “X” is used to indicate a match or mismatch. In FIG. 11, the character string fragment “Convert data by device A” described on page 1 of the file name “01.txt” in document data A is the file name “02.txt” in document data B. It can be seen that it matches the character string fragment “Convert data with device A” described on page 1 of “txt”.

(表示工程)
表示工程では、比較結果反映文書データ103を表示する。比較結果反映文書データ103は、比較対象となる文書データA,Bの何れかの文書データを基に作成される。比較結果反映文書データ103は、比較結果リスト102と連動しており、比較結果リスト102のある文字列断片を選択すると、それに対応した文字列断片が比較結果反映文書データ103上でハイライトされて表示される。例えば、図12は、文書データAに基づいて作成された文書データAと文書データBの比較結果反映文書データ103である。図12の比較結果反映文書データ103は、図11の比較結果リスト102と連動しており、図11の比較結果リスト102で文字列断片「装置Aでデータを変換する。」を選択すると、それに対応した文字列断片「装置Aでデータを変換する。」とが比較結果反映文書データ103上でハイライトされて表示される。
(Display process)
In the display step, the comparison result reflecting document data 103 is displayed. The comparison result reflecting document data 103 is created based on the document data A or B to be compared. The comparison result reflecting document data 103 is linked to the comparison result list 102. When a character string fragment in the comparison result list 102 is selected, the corresponding character string fragment is highlighted on the comparison result reflecting document data 103. Is displayed. For example, FIG. 12 shows the comparison result reflecting document data 103 between the document data A and the document data B created based on the document data A. The comparison result reflecting document data 103 in FIG. 12 is linked to the comparison result list 102 in FIG. 11. When the character string fragment “Convert data with device A” is selected in the comparison result list 102 in FIG. The corresponding character string fragment “Convert data with device A” is highlighted on the comparison result reflecting document data 103 and displayed.

また、表示工程では比較結果反映文書データ103の文字列断片を、予め比較結果に基づいて、色分けすることも可能である。例えば、一致した文字列断片にはシアン、不一致の文字列断片には黄のマーカーで塗りつぶし、比較対象が見つからなかった断片は塗りつぶさずに出力する。   In the display step, the character string fragment of the comparison result reflecting document data 103 can be color-coded based on the comparison result in advance. For example, a matched character string fragment is filled with cyan, and a mismatched character string fragment is filled with a yellow marker, and a fragment for which no comparison target is found is output without being painted.

[1−3.効果]
以上のような本実施形態の文書データ比較装置では、以下のような効果を奏することが可能である。
[1-3. effect]
The document data comparison apparatus according to the present embodiment as described above can achieve the following effects.

(1)文字コード数列による文書の内容比較
文字コード数列を用いて文書データを比較することで、文書の完全一致ではなく内容の一致を精度よく判定できる。
(1) Document Content Comparison Using Character Code Number Sequences By comparing document data using a character code number sequence, it is possible to accurately determine content matches, not complete document matches.

文字を文字コードに変換することで、文字列断片の比較を文字コード数列の比較に変えた。文字コードを構成する数字は、文字と異なり、演算することで1つの数値にまとめることができる。そのため、文字列断片に含まれる全文字に依存する数値で、文字列断片を表現できる。その数値が、本実施形態で用いた類似度メトリックである。   By converting characters into character codes, the comparison of character string fragments was changed to the comparison of character code sequences. Unlike the characters, the numbers constituting the character code can be combined into one numerical value by calculation. Therefore, the character string fragment can be expressed by a numerical value depending on all characters included in the character string fragment. The numerical value is the similarity metric used in this embodiment.

要素数以外の類似度メトリックは、一文字でも入れ替わると値が変化する。要素数と合計値は、文字列断片の長さに依存する。また、平均値と分散と偏差値は文字列断片に含まれる文字種を表す。これは、文字種によって文字コードの数値範囲が区切られているからである。よって、類似度メトリックは文字列断片全体の性質を表す。   The similarity metric other than the number of elements changes in value when even one character is replaced. The number of elements and the total value depend on the length of the character string fragment. The average value, variance, and deviation value represent the character type included in the character string fragment. This is because the numerical range of the character code is delimited by the character type. Therefore, the similarity metric represents the property of the entire character string fragment.

類似度メトリックは、文字列断片の順番に依存しない。語順は文字列断片の意味に与える影響が小さいため、似た意味をもつ文字列断片の類似度メトリックは、同程度の値となる。また、一般的に、平仮名は、単語をつなぐ助詞や語尾に用い、文書の意味に与える影響が小さい。同時に、平仮名は文字コードも小さいため、平仮名の差は、類似度メトリックへの寄与が小さい。よって、類似度メトリックを用いた比較は、内容の差も判断できる。   The similarity metric does not depend on the order of the character string fragments. Since the word order has little influence on the meaning of the character string fragment, the similarity metric of character string fragments having similar meanings has the same value. In general, hiragana is used for particles and endings that connect words and has little effect on the meaning of a document. At the same time, hiragana also has a small character code, so the difference in hiragana contributes little to the similarity metric. Therefore, the comparison using the similarity metric can also determine the content difference.

このように有用な類似度メトリックの比をとり、この比を類似度と定義すると、文字列断片の内容が似ている場合に1に近づくパラメタが得られる。   When the ratio of useful similarity metrics is taken in this way and this ratio is defined as similarity, a parameter approaching 1 is obtained when the contents of character string fragments are similar.

このように、文字コード数列で文書の内容を評価することで、比較部4における比較対象の検索で文書間の文字列断片を正確に紐づけ、内容一致の判定で文字列間の意味の違いを精度よく認識できる。したがって、文字コードにより、文書データの完全一致ではなく内容の一致を正確に判定できる。   In this way, by evaluating the contents of the document with the character code number sequence, the character string fragments between the documents are accurately linked by the comparison target search in the comparison unit 4, and the difference in meaning between the character strings is determined by the content match determination. Can be recognized accurately. Therefore, it is possible to accurately determine the content match rather than the complete match of the document data by the character code.

(2)出力・表示機能による分かりやすい比較結果
出力部5と表示部6により、ユーザーに分かりやすい比較結果を提供できる。まず、比較結果リスト102は、1画面あたりの情報量が多いため、大量の比較結果をまとめて参照でき、目的の比較結果をより早く確認できる。次に、結果反映文書データ103は、元の文書データと同じフォーマットで比較結果が確認できるため、文書の一致/不一致箇所を視覚的に理解しやすい。最後に、比較結果リスト102と結果反映文書データ103を連動させることで、比較結果リスト102で目的の文字列断片を見つけ、結果反映文書データ103で比較結果を理解するという作業の効率を上げることができる。
(2) Easy-to-understand comparison result by output / display function The output unit 5 and the display unit 6 can provide a user-friendly comparison result. First, since the comparison result list 102 has a large amount of information per screen, a large amount of comparison results can be referred to collectively, and the target comparison result can be confirmed earlier. Next, since the result reflection document data 103 can confirm the comparison result in the same format as the original document data, it is easy to visually understand the coincidence / non-coincidence part of the document. Finally, by linking the comparison result list 102 and the result reflection document data 103, the target character string fragment is found in the comparison result list 102 and the result of understanding the comparison result in the result reflection document data 103 is increased. Can do.

(3)複数データに分かれた長い文書の比較実現
文字列・属性抽出部2の文書データの読み込み部20において、複数に分かれた文書が比較可能であるため、複数のデータに分割された長い文書も比較できる。
(3) Realization of comparison of a long document divided into a plurality of data Since the document data reading unit 20 of the character string / attribute extraction unit 2 can compare a plurality of divided documents, a long document divided into a plurality of data Can also be compared.

(4)処理時間の抑制
ユーザーインターフェース部7において、実行する手段を選択可能にして、過去のデータを流用することで、実行時間を短縮できる。すなわち、属性情報、メトリック値、比較結果を文書データを比較する毎に求めるのではなく、以前に比較した際のデータを記憶部に記憶しておき、そのデータを基に比較を行っても良い。
(4) Suppression of processing time In the user interface unit 7, by making it possible to select a means to execute and diverting past data, the execution time can be shortened. That is, the attribute information, the metric value, and the comparison result are not obtained every time the document data are compared, but the data at the time of the previous comparison may be stored in the storage unit and the comparison may be performed based on the data. .

(5)本実施形態では、具体例を挙げ説明したが以下の様な変更を行うこともできる。 (5) In the present embodiment, a specific example has been described. However, the following modifications can be made.

(a)本実施形態では、任意の文字列断片が集合したものを文書データとし、文書データAと文書データBは、それぞれ独立した文書データとした。この文書データa1、文書データa2は、1区切りの文書ではなく、複数の文書からなるものでも良い。また、文書データA,Bの形式は、特に限定するものではないが、それぞれの文書データをコンピュータの記憶装置上におけるデータオブジェクトとして保存したものを使用することができる。 (a) In this embodiment, a set of arbitrary character string fragments is used as document data, and document data A and document data B are used as independent document data. The document data a1 and document data a2 may be composed of a plurality of documents instead of a single segment document. The format of the document data A and B is not particularly limited, but it is possible to use a document object in which each document data is saved as a data object on a computer storage device.

(b)文書データAと文書データBは、1つの文書データとしたが、複数の文書データからなるものでも良い。すなわち、任意の文字列断片が集合である文書データa1と、それとは異なる文字列断片が集合である文書データa2とを1つの文書データAとしても良い。この場合、文書データAと文書データBとの比較の際には、文書データa1と文書データa2とを統合し、1つの文書データとして扱うことで、文書データa1及び文書データa2内のすべての文字列断片を文書データB内の文字列断片と比較することもできる。 (b) Although the document data A and the document data B are one document data, they may be composed of a plurality of document data. That is, document data a1 in which arbitrary character string fragments are a set and document data a2 in which different character string fragments are a set may be set as one document data A. In this case, when comparing the document data A and the document data B, the document data a1 and the document data a2 are integrated and handled as one document data, so that all of the document data a1 and the document data a2 are all processed. The character string fragment can be compared with the character string fragment in the document data B.

(c)文書データA,Bを、章、改行、句点を区切り文字列断片としたが、文字列断片とは、文字を並べたものであり、分断の仕方は任意に決定することもできる。例えば、章、改行、句点、表の場合はセルなどで区切ることが挙げられる。 (c) The document data A and B are delimited character string fragments with chapters, line breaks, and punctuation marks. The character string fragments are characters arranged in order, and the division method can be arbitrarily determined. For example, in the case of chapters, line breaks, punctuation marks, and tables, it can be separated by cells.

(d) 文字列の類似度メトリックは、文字列断片をそれぞれ文字コードからなる数列に変換し、各数列の合計値として求めたが、文字列断片を変換した文字コードの組み合わせにより求めることができる。一例としては、文字列断片を構成する数列の要素数、平均値、分散値、偏差値があげられる。 (d) The character string similarity metric is obtained by converting each character string fragment into a number sequence consisting of character codes and calculating the total value of each number sequence. However, the character string similarity metric can be obtained by a combination of character codes obtained by converting character string fragments. . As an example, there are the number of elements, average value, variance value, and deviation value of the number sequence constituting the character string fragment.

(e)出力部5では、比較結果を比較結果リスト102、または、比較結果反映文書データ103として出力したが、これら2つの形式を必ず出力するのではなく、ユーザーが出力形式を選択できるものとしても良い。 (e) The output unit 5 outputs the comparison result as the comparison result list 102 or the comparison result reflecting document data 103. However, the output unit 5 does not necessarily output these two formats, but the user can select the output format. Also good.

(f)文字コード数列は、文字列断片の全ての文字を文字コードに変換したが、全ての文字を文字コードに変換するのではなく以下の方法を利用することができる。 (f) In the character code sequence, all characters of the character string fragment are converted into character codes. Instead of converting all characters into character codes, the following method can be used.

図13の数列作成方法71のように、文書の内容に影響ある文字種のみを数列に変換すれば、類似度メトリックへの文書内容の依存度が大きくなり、評価の精度が向上する。例えば、「装置Aでデータを変換する。」と「装置Aによってデータが変換される。」と「装置Aがデータ変換します。」は、表現方法が異なるが、同義である。これらの文字列断片について、平仮名と記号以外の文字種を数列化して比較すれば、これらの文字列断片はすべて「装置Aデータ変換」で成る数列に変換され、文字列断片の内容一致が簡単に判断できる。   If only the character type that affects the contents of the document is converted into a number sequence as in the sequence creating method 71 in FIG. 13, the dependence of the document content on the similarity metric increases, and the accuracy of the evaluation is improved. For example, “the data is converted by the device A”, “the data is converted by the device A”, and “the data is converted by the device A” are synonymous with different expressions. For these character string fragments, if character types other than hiragana and symbols are digitized and compared, all of these character string fragments are converted to a numerical sequence consisting of “device A data conversion”, and content matching of the character string fragments can be easily performed. I can judge.

数列作成方法72では、文字種により大きさの異なる重みを付加できるため、文書内容への影響の大きい文字種の差異を強調できる。例えば、一般に、片仮名や数字は、文書の意味に寄与する場合が多い一方、文字コードが小さく、類似度メトリックへの依存が小さい。そこで、片仮名と数字に大きな重みを設定すれば、類似度をより精度よく求められる。   In the numerical sequence creation method 72, weights having different sizes can be added depending on the character type, so that the difference between the character types having a large influence on the document content can be emphasized. For example, in general, katakana and numbers often contribute to the meaning of a document, while the character code is small and the dependence on the similarity metric is small. Therefore, if a large weight is set for Katakana and numbers, the similarity can be obtained with higher accuracy.

数列作成方法73では、連続した同じ文字種の文字ごとに区切られるため、単語単位で数列を抽出可能である。よって、単語の違いがより顕著に類似度メトリックに反映され、文字列断片の内容を正確に比較できる。   In the numerical sequence creation method 73, since the characters are separated for each consecutive character of the same character type, the numerical sequence can be extracted in units of words. Therefore, the difference in words is more remarkably reflected in the similarity metric, and the contents of the character string fragments can be accurately compared.

数列作成方法71〜73のように、数列の作り方を工夫することで、文字列断片の類似度をより正確に評価できる。   The degree of similarity of character string fragments can be more accurately evaluated by devising how to create a number sequence as in the number sequence creation methods 71-73.

(g)比較対象検索部40では、文字列a1内のある文字列断片を、比較対象となる文書データBの文字列b1内の文字列断片と比較し比較対象の検索を行ったが、この際、文字列断片同士を直接比較するだけではなく、当該断片の前あるいは後の文字列断片の類似度メトリックを比較対象の検索に利用することもできる。これにより、断片に含まれる文字数が少ないときに、当該断片の類似度メトリックだけでは誤った判断をすることを回避し、比較対象の検索の精度向上を図ることが出来る。 (g) In the comparison target search unit 40, a character string fragment in the character string a1 is compared with a character string fragment in the character string b1 of the document data B to be compared. At this time, not only the character string fragments are directly compared but also the similarity metric of the character string fragments before or after the fragments can be used for the comparison target search. As a result, when the number of characters included in the fragment is small, it is possible to avoid making an erroneous determination only with the similarity metric of the fragment, and to improve the accuracy of the comparison target search.

(h)また、比較対象検索部40での比較対象の検索の際に、文字列断片同士を直接比較するだけではなく、当該断片と前あるいは後の文字列断とを組み合わせ、その組み合わせの類似度メトリック比較対象の検索に利用することもできる。例えば、本来は同じ文字列断片「AABBCC」から成る文書データA、文書データBを比較するとき、改行位置などの違いから、文書データAの文字列断片が「AABB」と、文書データBの文字列断片が「AA」「BB」と分割される可能性がある。この場合に、文書データBの文字列断片「AA」「BB」とを組み合わせ1つの文字列断片「AABB」として扱うことで、文書データAの文字列断片と「AABB」と比較することが可能となる。これにより、文字列の分割が原因による誤った判断をすることを回避し、比較対象の検索の精度向上を図ることが出来る。 (h) In addition, when searching for a comparison target in the comparison target search unit 40, not only the character string fragments are directly compared with each other, but the fragment and the preceding or following character string break are combined, and the combinations are similar. It can also be used to search for metric comparison targets. For example, when comparing document data A and document data B that originally consist of the same character string fragment “AABBCC”, the character string fragment of document data A is “AABB” and the character of document data B There is a possibility that the column fragment is divided into “AA” and “BB”. In this case, by combining the character string fragments “AA” and “BB” of the document data B and treating them as one character string fragment “AABB”, it is possible to compare the character string fragment of the document data A with “AABB”. It becomes. Thereby, it is possible to avoid making an erroneous determination due to the division of the character string, and to improve the accuracy of the comparison target search.

(i)類似度メトリック算出部31では、1つの文字列断片から1つの類似度メトリックを算出したが、1つの文字列断片から複数の類似度メトリックを算出することもできる。例えば、ある文字列断片において、文字コード数列の合計値を類似度メトリックXとし、文字コード数列の分散値を類似度メトリックYとし、文字コード数列の偏差値を類似度メトリックZとする。このようにすることで、1つの文字列断片から3つの類似度メトリックX,Y,Zを算出可能である。そして、文字列断片の組の抽出、または抽出した文字列断片を比較するときには、それぞれの類似度メトリックの比を求め、その比の平均値を使用する。つまり、文字列断片a1#3と、文字列断片b1#3との比較では、各文字列断片の類似度メトリックXの比、類似度メトリックYの比、類似度メトリックZの比を求め、その3つの類似度メトリックの比の平均値を算出し、使用する。 (i) Although the similarity metric calculation unit 31 calculates one similarity metric from one character string fragment, it can also calculate a plurality of similarity metrics from one character string fragment. For example, in a certain character string fragment, the total value of the character code number sequence is the similarity metric X, the variance value of the character code number sequence is the similarity metric Y, and the deviation value of the character code number sequence is the similarity metric Z. In this way, three similarity metrics X, Y, Z can be calculated from one character string fragment. Then, when extracting a set of character string fragments or comparing extracted character string fragments, a ratio of the respective similarity metrics is obtained, and an average value of the ratios is used. That is, in the comparison between the character string fragment a1 # 3 and the character string fragment b1 # 3, the ratio of the similarity metric X of each character string fragment, the ratio of the similarity metric Y, and the ratio of the similarity metric Z are obtained. The average value of the ratios of the three similarity metrics is calculated and used.

[2.他の実施形態]
本明細書においては、本発明に係る複数の実施形態を説明したが、これらの実施形態は例として提示したものであって、発明の範囲を限定することを意図していない。具体的には、第1の実施形態は、その他の様々な形態で実施されることが可能であり、発明の範囲を逸脱しない範囲で、種々の省略や置き換え、変更を行うことができる。これらの実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。
[2. Other Embodiments]
In the present specification, a plurality of embodiments according to the present invention have been described. However, these embodiments are presented as examples and are not intended to limit the scope of the invention. Specifically, the first embodiment can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the invention described in the claims and equivalents thereof as well as included in the scope and gist of the invention.

また、第1の実施形態について具体例を挙げ説明したが、各条件などについては記載した数値に限定するものではない。また、前述した課題解決手段に記載した範囲の中で変更しても同様の効果が得られる。   Moreover, although the specific example was given and demonstrated about 1st Embodiment, each condition etc. are not limited to the numerical value described. Moreover, even if it changes within the range described in the problem-solving means mentioned above, the same effect is acquired.

1 :文書データ比較装置
2 :文字列・属性抽出部
20:文書データの読み込み部
21:文書データ分割部
22:属性情報抽出部
23:比較用データ出力部
3 :メトリック算出部
30:文字コード数列作成部
31:類似度メトリック算出部
32:比較用データ出力部
4 :比較部
40:比較対象検出部
41:内容判定部
42:比較結果の出力部
5 :出力部
51:比較結果リスト作成部
52:比較反映結果作成部
6 :表示部
7 :ユーザインターフェイス
100:文書データ、
100A:比較結果反映文書データ
100B:比較結果反映文書データ
101:比較用データ記憶部
102:比較結果リスト
103:比較結果反映文書データ
1: Document data comparison device 2: Character string / attribute extraction unit 20: Document data reading unit 21: Document data division unit 22: Attribute information extraction unit 23: Comparison data output unit 3: Metric calculation unit 30: Character code sequence Creation unit 31: Similarity metric calculation unit 32: Comparison data output unit 4: Comparison unit 40: Comparison target detection unit 41: Content determination unit 42: Comparison result output unit 5: Output unit 51: Comparison result list creation unit 52 : Comparison reflection result creation unit 6: Display unit 7: User interface 100: Document data,
100A: Comparison result reflected document data 100B: Comparison result reflected document data 101: Comparison data storage unit 102: Comparison result list 103: Comparison result reflected document data

Claims (9)

文書データの内容を文字コードで比較する文書データ比較装置による文書データ比較方法であって、
文書データを文字列断片に分割し、前記文字列断片の文書中における位置づけを表す属性情報を抽出する文字列・属性抽出ステップと、
前記文字列断片に含まれる文字を対応する文字コードに変換して文字コード数列を抽出し、前記文字列断片の類似度メトリックを算出するメトリック算出ステップと、
前記類似度メトリックの比がある数値範囲A内であり、かつ、前記属性情報が一致する前記文字列断片の組を、前記文書データから検索し、前記類似度メトリックの比がある数値範囲B内である場合に、前記文字列断片の組の内容が一致すると判定し、比較結果として出力する比較ステップと、
を含むことを特徴とする文書データ比較方法。
A document data comparison method by a document data comparison device for comparing the contents of document data with character codes,
A character string / attribute extraction step for dividing the document data into character string fragments and extracting attribute information representing the position of the character string fragments in the document;
A metric calculation step of converting a character included in the character string fragment into a corresponding character code, extracting a character code number sequence, and calculating a similarity metric of the character string fragment;
A search is made for the set of character string fragments in which the ratio of the similarity metric is within a certain numerical range A and the attribute information matches, and the range of the similarity metric is within a numerical range B having the ratio of the similarity metric. A comparison step of determining that the contents of the set of character string fragments match and outputting as a comparison result;
A document data comparison method comprising:
前記メトリック算出ステップは、
前記文字列断片に含まれる文字のうち特定の文字のみを文字コードに変換した文字コード数列を抽出することを特徴とする請求項1記載の文書データ比較方法。
The metric calculation step includes
2. The document data comparison method according to claim 1, wherein a character code number sequence obtained by converting only a specific character into a character code among characters included in the character string fragment is extracted.
前記メトリック算出ステップは、
変換した前記文字コードに対して重みを掛け合わせた文字コード数列を抽出することを特徴とすることを特徴とする請求項1または請求項2に記載の文書データ比較方法。
The metric calculation step includes
3. The document data comparison method according to claim 1, wherein a character code number sequence obtained by multiplying the converted character code by a weight is extracted.
前記メトリック算出ステップは、
前記文字列断片に含まれる文字のうち連続した同じ前記文字種に属する文字の文字コードの合計値を要素とする文字コード数列を抽出することを特徴とする請求項1乃至3の何れか1項に記載の文書データ比較方法。
The metric calculation step includes
4. The character code number sequence having a total value of character codes of characters belonging to the same character type among the characters included in the character string fragment as an element is extracted. 5. The document data comparison method described.
前記文字列・属性抽出ステップは、
複数に分割されている前記文書データを統合しながら読み込み、前記属性情報を抽出することを特徴とする請求項1乃至4の何れか1項に記載の文書データ比較方法。
The character string / attribute extraction step includes:
5. The document data comparison method according to claim 1, wherein the attribute data is extracted by integrating the document data divided into a plurality of parts and extracted.
前記文書データ比較装置は、前記文字列断片ごとの属性情報、前記文字列断片ごとの前記類似度メトリック、前記比較結果を記憶する記憶部を備え、
比較ステップは、文書データを比較する際に、前記記憶部に記憶された前記属性情報、前記類似度メトリック、前記比較結果のいずれかを参照することを特徴とする1乃至5の何れか1項に記載の文書データ比較方法。
The document data comparison device includes a storage unit that stores attribute information for each character string fragment, the similarity metric for each character string fragment, and the comparison result.
The comparison step refers to any one of the attribute information, the similarity metric, and the comparison result stored in the storage unit when comparing document data. Document data comparison method described in 1.
前記比較結果と前記文字列断片と前記属性情報を並列した比較結果リスト、及び、元の文書データに比較結果を反映した比較結果反映文書データを出力する出力ステップと、
前記比較結果リスト上の前記文字列断片を選択すると、それに対応した文字列断片を、前記比較結果反映文書データから検索して表示する表示ステップと、
を含むことを特徴とする請求項7に記載の文書データ比較方法。
A comparison result list in which the comparison result, the character string fragment and the attribute information are paralleled, and an output step of outputting comparison result reflecting document data reflecting the comparison result in the original document data;
When the character string fragment on the comparison result list is selected, a character string fragment corresponding to the selected character string fragment is searched from the comparison result reflecting document data and displayed.
The document data comparison method according to claim 7, further comprising:
文書データの内容を文字コードで比較する文書データ比較装置であって、
文書データを文字列断片に分割し、前記文字列断片の文書中における位置づけを表す属性情報を抽出する文字列・属性抽出部と、
前記文字列断片に含まれる文字を対応する文字コードに変換して文字コード数列を抽出し、前記文字列断片の類似度メトリックを算出するメトリック算出部と、
前記類似度メトリックの比がある数値範囲A内であり、かつ、前記属性情報が一致する前記文字列断片の組を、前記文書データから検索し、前記類似度メトリックの比がある数値範囲B内である場合に、前記文字列断片の組の内容が一致すると判定し、比較結果として出力する比較部と、
を備えることを特徴とする文書データ比較装置。
A document data comparison device for comparing the contents of document data with character codes,
A character string / attribute extraction unit that divides document data into character string fragments and extracts attribute information indicating the position of the character string fragments in the document;
A metric calculation unit for converting a character included in the character string fragment into a corresponding character code, extracting a character code number sequence, and calculating a similarity metric of the character string fragment;
A search is made for the set of character string fragments in which the ratio of the similarity metric is within a certain numerical range A and the attribute information matches, and the range of the similarity metric is within a numerical range B having the ratio of the similarity metric. A comparison unit that determines that the contents of the set of character string fragments match, and outputs a comparison result;
A document data comparison device comprising:
文書データの内容を文字コードで比較する文書データ比較装置による文書データ比較プログラムであって、
前記プログラムはコンピュータに、
文書データを文字列断片に分割し、前記文字列断片の文書中における位置づけを表す属性情報を抽出する文字列・属性抽出ステップと、
前記文字列断片に含まれる文字を対応する文字コードに変換して文字コード数列を抽出し、前記文字列断片の類似度メトリックを算出するメトリック算出ステップと、
前記類似度メトリックの比がある数値範囲A内であり、かつ、前記属性情報が一致する前記文字列断片の組を、前記文書データから検索し、前記類似度メトリックの比がある数値範囲B内である場合に、前記文字列断片の組の内容が一致すると判定し、比較結果として出力する比較ステップと、
を実行させることを特徴とする文書データ比較プログラム。
A document data comparison program by a document data comparison device for comparing the contents of document data with character codes,
The program is stored in a computer
A character string / attribute extraction step for dividing the document data into character string fragments and extracting attribute information representing the position of the character string fragments in the document;
A metric calculation step of converting a character included in the character string fragment into a corresponding character code, extracting a character code number sequence, and calculating a similarity metric of the character string fragment;
A search is made for the set of character string fragments in which the ratio of the similarity metric is within a certain numerical range A and the attribute information matches, and the range of the similarity metric is within a numerical range B having the ratio of the similarity metric. A comparison step of determining that the contents of the set of character string fragments match and outputting as a comparison result;
A document data comparison program characterized in that
JP2013202798A 2013-09-27 2013-09-27 Document data comparison method, document data comparison apparatus, and document data comparison program Pending JP2015069393A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013202798A JP2015069393A (en) 2013-09-27 2013-09-27 Document data comparison method, document data comparison apparatus, and document data comparison program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013202798A JP2015069393A (en) 2013-09-27 2013-09-27 Document data comparison method, document data comparison apparatus, and document data comparison program

Publications (1)

Publication Number Publication Date
JP2015069393A true JP2015069393A (en) 2015-04-13

Family

ID=52835995

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013202798A Pending JP2015069393A (en) 2013-09-27 2013-09-27 Document data comparison method, document data comparison apparatus, and document data comparison program

Country Status (1)

Country Link
JP (1) JP2015069393A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018036744A (en) * 2016-08-30 2018-03-08 株式会社パスコ Similar character string detector, method for detecting similar character string, and similar character string detection program
CN112416431A (en) * 2020-11-23 2021-02-26 南京航空航天大学 Source code segment pair comparison method based on coding sequence representation
CN115374320A (en) * 2022-10-25 2022-11-22 北京国电通网络技术有限公司 Text matching method, text matching device, electronic equipment, computer medium and program product

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2018036744A (en) * 2016-08-30 2018-03-08 株式会社パスコ Similar character string detector, method for detecting similar character string, and similar character string detection program
JP7007793B2 (en) 2016-08-30 2022-01-25 株式会社パスコ Similar character string detection device, similar character string detection method, and similar character string detection program
CN112416431A (en) * 2020-11-23 2021-02-26 南京航空航天大学 Source code segment pair comparison method based on coding sequence representation
CN112416431B (en) * 2020-11-23 2023-02-14 南京航空航天大学 Source code segment pair comparison method based on coding sequence representation
CN115374320A (en) * 2022-10-25 2022-11-22 北京国电通网络技术有限公司 Text matching method, text matching device, electronic equipment, computer medium and program product

Similar Documents

Publication Publication Date Title
CN103324609A (en) Text proofreading apparatus and text proofreading method
KR20150070171A (en) Ranking for inductive synthesis of string transformations
EP2963575B1 (en) Data analysis device and method therefor
US10031839B2 (en) Constraint extraction from natural language text for test data generation
US10628139B2 (en) Analysis apparatus, analysis method and recording medium on which analysis program is recorded
JP2007226797A (en) Rapid similarity links computation for table of contents determination
KR102148984B1 (en) System and method for processing data
JPWO2011129198A1 (en) Inconsistency detection system, method, and program
JP2015069393A (en) Document data comparison method, document data comparison apparatus, and document data comparison program
JPWO2016056236A1 (en) Information processing apparatus, information processing method, and program
JP5875961B2 (en) Source code similarity evaluation program, source code similarity evaluation apparatus, and computer-readable storage medium
JP5252596B2 (en) Character recognition device, character recognition method and program
WO2017038952A1 (en) Character recognition device, character recognition method, and program
JP5075695B2 (en) Property description coverage measuring apparatus and program
JP2016057715A (en) Graphic type program analyzer
JP2013069182A (en) Information processing device and information processing program
JP2014067303A (en) Character recognition device and method and program
JP2008243074A (en) Device, method, and program for retrieving document
WO2016013157A1 (en) Text processing system, text processing method, and text processing program
JPWO2018096686A1 (en) Verification program, verification apparatus, verification method, index generation program, index generation apparatus, and index generation method
JP6572190B2 (en) Software verification system and software verification method
JP6502807B2 (en) Information extraction apparatus, information extraction method and information extraction program
KR101350384B1 (en) Stepwise method for comparing systematic similarity of digital document content
CN108089900A (en) A kind of character string processing method and device
JPWO2012124301A1 (en) Related specification mapping system, related specification mapping method and program