JP3617192B2 - Document structure conversion apparatus and document structure conversion method - Google Patents

Document structure conversion apparatus and document structure conversion method Download PDF

Info

Publication number
JP3617192B2
JP3617192B2 JP16563696A JP16563696A JP3617192B2 JP 3617192 B2 JP3617192 B2 JP 3617192B2 JP 16563696 A JP16563696 A JP 16563696A JP 16563696 A JP16563696 A JP 16563696A JP 3617192 B2 JP3617192 B2 JP 3617192B2
Authority
JP
Japan
Prior art keywords
document
node
conversion
document structure
connection position
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.)
Expired - Fee Related
Application number
JP16563696A
Other languages
Japanese (ja)
Other versions
JPH1011442A (en
Inventor
仁樹 京嶋
和也 千葉
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.)
Fujifilm Business Innovation Corp
Original Assignee
Fuji Xerox Co Ltd
Fujifilm Business Innovation 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 Fuji Xerox Co Ltd, Fujifilm Business Innovation Corp filed Critical Fuji Xerox Co Ltd
Priority to JP16563696A priority Critical patent/JP3617192B2/en
Publication of JPH1011442A publication Critical patent/JPH1011442A/en
Application granted granted Critical
Publication of JP3617192B2 publication Critical patent/JP3617192B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、文書構造を作成する文書構造変換装置及び文書構造変換方法に関し、特に所定の文書クラスの構造制約を満たした文書構造を作成する文書構造変換装置及び文書構造変換方法に関する。
【0002】
【従来の技術】
構成要素として章、節、項などに代表される論理的な構造を持つ文書を構造化文書と呼ぶが、この文書の構造の統一を図ることで、文書の共有や変換が容易となることが知られている。SGML(Standard Generalized Markup Language)や、ODA(Office Document Architecture)などの国際規格の普及もあり、構造化文書は電子的な文書の主流となりつつある。
【0003】
この構造化文書は通常、文書の構造及び構成要素を定義した文書クラスと呼ばれる分類に従って構造化されている。ODAでは共通論理構造が文書クラスに該当し、SGMLではDTD(Data Type Definition)が文書クラスの役割を担っている。
【0004】
構造化文書において文書構造が文書クラスの制約に従っていることには、重要な意味がある。例えば、構造化文書をレイアウトするための規則は、文書構造やその構成要素が特定の文書クラスの制約を満たしていることを前提に決められることが多い。そのため、文書構造が文書クラスの制約から逸脱している場合には正しいレイアウトでの出力ができない。
【0005】
また、報告書群からの抄録リスト作成のような、多くの構造化文書を処理するためのプログラムには、対象となる文書が特定の文書クラスに従って作成されていることを利用したものが多い。このようなプログラムを利用する際、所定の文書クラスに従わない文書の存在は、プログラム実行の障害となり得る。さらに、構造化文書を対象にしたデータベースでは文書クラスをスキーマとして利用することが多く、スキーマから逸脱したデータの存在はデータベースの信頼性を大きく損なうこととなる。
【0006】
したがって、ある文書クラスBにしたがっている文書向けに用意された各種処理プログラムを、別の文書クラスAの文書に対して適用するためには、文書クラスAにしたがった文書構造を別の文書クラスBにしたがった文書構造に変換しなければならない。
【0007】
上記の問題を解決するために、文書クラスA中のタイプaのノードが、変換によって文書クラスB中のタイプbのノードに変換されるといった、ノードの1:1の関係を定義した規則を用意しておき、文書構造の変換時に前記規則を利用して、文書クラスAに従った文書構造中の各ノードが、文書クラスB中でどのタイプのノードになるかを決定することによって、文書構造変換を行うものがある。
【0008】
例えば、Fred Cole, Heather Brown著のEditing Structured Documents − Problem and solutions (Electronic Publishing , vol.5, No.4, pp. 209−216) に記載されている「fall back class」の概念を応用して、文書クラスA中で規定されたノードのタイプに対して、そのタイプのノードが変換後に、文書クラスBで規定されたどのタイプのノードになるかを規則として定義しておき、文書クラスAにしたがった文書構造の各ノードを、予め定義された規則にしたがって変換する方法は容易に考えられる。
【0009】
また、特開平7−28817号公報には、文書クラスAにしたがった文書構造を別の文書クラスBにしたがった文書構造に変換する場合に、文書クラスを構成するタイプ間の1対1の対応関係をユーザが定義し、その対応関係を使って文書の構造変換を行う文書変換方法が開示されている。
【0010】
【発明が解決しようとする課題】
しかし、変換後の文書クラスに必要なノードや部分木に対応するノードが、変換前の文書クラスの構造制約に含まれていない場合がある。この場合、従来の技術では、不足分を補った文書構造変換を行うことが困難であるという問題点があった。
【0011】
すなわち、作成された文書構造中のノードは、変換前の文書構造中に対応するノードが存在するものだけであり、対応するもののないノードは不足したままである。このようにして作成された文書構造は、文書クラスBの制約を完全に満たすことはできない。
【0012】
本発明はこのような点に鑑みてなされたものであり、第1の文書クラスの文書構造を第2の文書クラスに適合するように変換する場合に、必要なノードを容易に補うことができる文書構造作成装置を提供することを目的とする。
【0013】
また、本発明の他の目的は、第1の文書クラスの文書構造を第2の文書クラスに適合するように変換する場合に、必要なノードを容易に補うことができる文書構造作成方法を提供することである。
【0014】
【課題を解決するための手段】
本発明では上記課題を解決するために、第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換する文書構造変換装置において、前記第1の文書タイプに従った文書構造中のどのノードに適用されるのかを示す適用条件と、前記適用条件を満たしたノードがどういう木構造の列によって表される部分構造に変換されるかを示す変換パターンと、の組からなる規則要素を有する変換規則を管理する変換規則管理手段と、前記第1の文書タイプに従った第1の文書構造が入力されると、前記第1の文書構造中のノードを所定の順番で選択し、選択したノードを前記変換規則中の適用条件と対比することにより、前記選択したノードに適用すべき規則要素を決定する規則要素決定手段と、前記規則要素決定手段により決定された規則要素の変換パターンに従って、選択されたノードの部分構造を作成する部分構造作成手段と、作成過程の文書構造の中から、前記部分構造作成手段で作成された部分構造の接続位置を決定する接続位置決定手段と、前記接続位置決定手段で決定された作成過程の文書構造上の接続位置に、前記部分構造作成手段で作成された部分構造を接続する部分構造接続手段と、を有することを特徴する文書構造変換装置が提供される。
【0015】
このような文書構造変換装置によれば、第1の文書構造が入力されると、規則要素決定手段により、各ノードの規則要素が決定される。この規則要素の変換パターンに従って、部分構造作成手段により、各ノードの部分構造が作成される。すると、接続位置決定手段により、各部分構造の接続位置が決定され、部分構造接続手段が、該当する部分構造を決定された位置に接続する。これにより、変換パターンとして、複数のノードが生成されるように定義しておけば、第1の文書構造に不足しているノードを補って、第2の文書構造を作成することができる。
【0016】
また、第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換する文書構造変換方法であって、前記第1の文書タイプに従った第1の文書構造が入力されると、前記第1の文書構造中のノードを所定の順番で規則要素決定手段により選択し、どういう木構造の列によって表される部分構造に変換されるかを示す変換パターンを、前記第1の文書タイプに従った文書構造中のどのノードに適用されるのかを示す適用条件と、選択したノードとを対比することにより、前記選択したノードに適用すべき変換パターンを規則要素決定手段により決定し、決定した変換パターンに従って、前記第1の文書構造中の各ノードの部分構造を部分構造作成手段により作成し、作成過程の文書構造上の所定の定義に従った接続位置に、作成された部分構造を接続する、ことを特徴する分文書構造変換方法が提供される。
【0017】
この文書構造変換方法によれば、変換パターンとして、複数のノードが生成されるように定義しておくことにより、入力された第1の文書構造に不足しているノードを補った第2の文書構造が生成される。
【0018】
【発明の実施の形態】
以下、本発明の実施の形態を図面に基づいて説明する。
図1は本発明の原理構成図である。これは、第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換するための原理構成を示している。
【0019】
変換規則管理手段1は、第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換する際の変換規則1aを管理している。この変換規則1aは、規則要素の集合である。各規則要素は、その規則要素を第1の文書タイプに従った文書構造中のどのノードに適用するかを示す適用条件、文書構造中の該当するノードをどういう部分構造に変換するかを示す変換パターン、及びその変換パターンをどの位置に接続するのかを示す接続条件を含んでいる。なお、変換パターンは、部分構造中に複数のノードが生成される場合には、第1の文書構造2のノードが持っている内容を引き継ぐべき、部分構造中のノードの指定も含んでいる。また、一つのノードから複数の部分構造を生成するような、変換パターンもある。接続条件は、省略時の解釈は予め定義されており、それ以外の位置に接続する場合にのみ、条件が指定されている。
【0020】
規則要素決定手段3は、第1の文書タイプに従った第1の文書構造2が入力されると、第1の文書構造2中のノードを一つずつ所定の順序で選択する。そして、選択したノードと規則要素中の適用条件とを照合し、そのノードに適用可能な規則要素を決定する。部分構造生成手段4は、規則要素決定手段3が決定した規則要素の変換パターンに従い、第1の文書構造2の各ノードの変換後の部分構造4aを作成する。
【0021】
接続位置決定手段5は、部分構造作成手段4で作成された部分構造の接続位置を決定する。以前に作成されている部分構造は、互いに接続されており、作成過程の文書構造6aが作られている。この作成過程の文書構造6a上の位置から、新たに作成された部分構造の接続位置を決定する。部分構造接続手段6は、接続位置決定手段5で決定された接続位置に、部分構造作成手段4で作成された部分構造を接続する。
【0022】
このようにして、第1の文書構造2の全てのノードに対応して作成された部分構造を互いに接続することにより、第2の文書構造7が生成される。各ノードに対応して作成される部分構造は複数であってもよく、各部分構造が複数のノードを有していてもよい。そのため、第1の文書クラスには存在しないが第2の文書クラスには存在すべきノードや部分木を補った、第2の文書構造を生成することが可能となる。
【0023】
図1では、すでに第1の文書構造が認識されている状態での文書構造の変換機能を示しているが、一般に取り扱われるのは文書データである。文書データは、その文書データが属する文書クラスの定義によって解析しなければ、その文書構造を認識できない。そこで、文書データの文書構造の解析機能を含めた文書構造変換装置について、以下に説明する。
【0024】
図2は、本発明を適用する文書構造変換装置の概略構成を示すブロック図である。この実施の形態は、ある文書クラスの制約に従って作成された文書データの文書構造(入力文書構造)を、別の文書クラスによって制約されている文書構造(出力文書構造)に変換するものを示している。また、この実施の形態で取り扱う文書構造は木構造である。
【0025】
文書構造変換装置10には、入出力u/i21と変換規則管理u/i22とが接続されている。入出力u/i21は、文書構造変換装置に対して、ユーザが変換する文書データを入力したり、変換結果を参照したりするためのユーザインタフェースである。変換規則管理u/i22は、文書構造変換装置10内の変換規則管理部12に対して、ユーザが変換規則の登録や更新、削除を行うためのユーザインタフェースである。
【0026】
文書構造変換装置10は、文書構造の変換に必要な情報を管理する機能として、変換の対象となる文書クラスの構造制約を管理している文書クラス管理部11と、入力する文書構造の各要素が、変換後にどういう部分構造になるかを決める規則(変換規則)を管理している変換規則管理部12とを有している。さらに、文書構造変換装置10は、構造変換処理機能部として、入力された文書データの文書構造を解析する文書パーサ13、得られた文書構造の各ノードに対して適応すべき規則要素を決定する規則要素決定部14、決定された規則要素に基づき部分構造を作成する部分構造作成部15、作成された部分構造の接続位置を決定する接続位置決定部16、決定された接続位置に部分構造を接続する部分構造接続部17、及び全ての部分構造が接続された文書構造から文書データを作成する文書ジェネレータ18を有している。
【0027】
これらの文書構造変換装置10内の各構成要素の機能を、以下に詳しく説明する。
文書クラス管理部11は、変換の対象となる文書クラスの定義を複数管理しており、具体的には、文書クラスの定義をその文書クラスの名前(名前は、文書クラス管理部内で一意である)とペアで記憶している。そして、文書パーサ13から文書クラスの名前とともにその文書クラスの定義が要求されると、指定された名前をもつ文書クラス定義を文書パーサ13へ渡す。
【0028】
文書クラスの定義は、文書構造を構成するノードのタイプ定義と、定義されたタイプのノード間の接続関係を規定した構造制約とからなる。以下の説明においては、ある文書クラスのタイプの定義と構造制約とを満たした文書構造を、その文書クラスの文書構造と呼び、ある文書クラスの文書構造を持つ文書データを、その文書クラスの文書データと呼ぶこととする。
【0029】
ノードのタイプ定義は、「タイプ名」と「内容型指定」とからなる。
「タイプ名」は、ノードのタイプを識別するための文字列である(以降、タイプ名が「A」であるタイプは「Aタイプ」とよび、「Aタイプ」のノードは「Aノード」とよぶものとする)。
【0030】
「内容型指定」は、このタイプのノードが内容を持つのか持たないのか、持つならどの種類の内容を持つのかを示す。この実施の形態では、可能な内容型は、文字列型、幾何図形型のどちらかであるものとする。
【0031】
構造制約は、以下の構造制約子と上記のタイプ定義とで作られた木構造によって定義される。構造制約子には、「SEQ」と「REP」とがある。
「SEQ」は、複数の下位構造をとり、その下位構造で規定された構造が、規定された順序で出現することを示す。
【0032】
「REP」は、単一の下位構造をとり、その下位構造で規定された構造が、1回以上繰り返し出現することを示す。
「OPT」は、単一の下位構造をとり、その下位構造で規定された構造が、出現しないか、1回出現するかのどちらかであることを示す。
【0033】
変換規則管理部12の中には、複数の変換規則が、その規則が適用されて変換が施される文書の文書クラスの文書クラス名(入力文書クラス名)と、その規則を適用した結果生成される文書の文書クラス名(出力文書クラス名)とともに格納されている。
【0034】
変換規則は、規則要素のリストである。規則要素は、入力文書構造中のノード(入力ノード)が出力文書中でどのような部分構造(出力部分構造)になるかを規定したものであり、対応元の条件、接続位置の条件、及び対応先のパターンの三つのフィールドから構成される。以下に、各フィールドの内容について説明する。
【0035】
対応元の条件は、規則要素が適用される入力文書構造中のノードについての条件である。対応元の条件には、その条件を持つ規則要素が適用されるノードのタイプや、そのノードが持つ内容についての条件が規定される。
【0036】
接続位置の条件は、規則要素が適用された結果生成される出力部分構造が、変換途中の出力文書構造のどの位置に接続するかの条件である。接続位置の条件には、その条件を持つ規則要素が適用された結果生成された出力部分構造の親ノードとなるノードのタイプや、そのノードの廻りのノード(親、祖父、兄弟ノードなど)についての条件が規定される。
【0037】
対応先のパターンには、そのパターンを持つ規則要素が適用された結果生成される、出力部分構造のパターンが規定される。このパターンは、出力文書クラス中に出現し得るノードによって構成される木構造の列である。
【0038】
対応先のパターンは、「<」と「>」とで囲んだノードのタイプ名のリストで表現する。例えば対応先のパターンが、
<..., A<B,C,D*>, ...>
の場合は、ノードAがノードB,C,Dの子ノードを持つパターンであることを示している。
【0039】
また、パターン中には、対応ノードと呼ぶノードが必ず一つだけ存在する。入力ノードが内容を持てば、その内容がコピーされて対応ノードの内容になる。入力ノードが下位構造を持てば、その下位構造の変換結果である部分構造は、対応ノードの下位構造になる。この例では、タイプ名の直後に「*」を付けることにより、対応ノードであることを表現する。
【0040】
変換規則管理部12内のこれらの情報は、変換規則管理u/i22を用いて、ユーザが設定する。即ち、文書構造の変換を行うためには、変換前の文書クラスと変換後の文書クラスとに応じた変換規則を、予め設定しておく必要がある。
【0041】
以上のような情報が、文書クラス管理部11と変換規則管理部12で管理されている状態で、ユーザは、入出力u/i21を用いて、文書構造を変換すべき文書データを入力する。これにより、変換処理が開始される。以下に、各処理機能部の処理内容をフローチャートを用いて説明する。
【0042】
図3は文書構造変換装置10で行われる処理全体の手順を示したフローチャートである。これは、ユーザが入出力u/i21を用いて、文書データの変換の指示とともに、入力文書クラス名、出力文書クラス名、及び変換対象となる入力文書データを入力した際に開始される。
〔S1〕文書パーサ13が、入力文書データから文書構造を抽出する。具体的には、文書パーサ13は、まず、入力文書クラス名を持つ文書クラスの定義を文書クラス管理部11から取り出す。そして、取り出した定義にしたがって、入力文書データを解析して、入力文書データの文書構造を取り出す。この文書構造が、変換の対象となる入力文書構造となる。
〔S2〕規則要素決定部14が、ユーザから入力された入力文書クラス名、出力文書クラス名とともに変換規則管理部12に格納されている変換規則を取り出す。
〔S3〕規則要素決定部14が、ルートノードをcurrent ノードとする。構造の変換処理では、入力文書構造のどれかのノードに着目し、そのノードがどういう部分構造に変換されるかを決定することを再帰的に実行することによって行われる。このとき着目するノードがcurrent ノードである。
〔S4〕取り出した変換規則に基づいて、規則要素決定部14、部分構造作成部15、接続位置決定部16、及び部分構造接続部17が連動して、文書構造の変換を行う。この処理の詳細は、図4および図5において説明する。
〔S5〕変換の終了後、文書ジェネレータ18が、生成された文書構造をもとに出力文書クラスに適合した文書データを生成する。ユーザは、入出力u/i21を用いて、この文書データを参照できる。
【0043】
図4は文書構造の変換処理(図3のステップS4)の手順を示したフローチャートの前半である。この処理は、図3のステップS4、またはこのフローチャートの後半(図5)で示すステップS21において呼び出された際に実行される。即ち、処理が開始された後は、変換の途中でこの文書構造変換の処理が、違うノードをcurrent ノードとして再帰的に呼び出される。
【0044】
この処理が開始されるには、current ノードが特定されている必要がある。ステップS4から呼び出された際には、入力側の文書構造のルートノードがcurrent ノードである。また、ステップS21から呼び出された際には、ステップS20、またはステップS23で指定されたノードがcurrent ノードである。
〔S11〕規則要素決定部14が、current ノードに適応できる規則要素を変換規則から見つけ出し、それをcurrent 規則要素にする。この処理の詳細は、図6において説明する。
〔S12〕部分構造作成部15が、current 規則要素の対応先のパターンにしたがって、対応先の部分構造(出力部分構造)を作成する。このときcurrent ノードが内容を持てば、その内容のコピーを作成し、出力部分構造中の対応ノードの内容とする。なお、対応ノード以外に、内容を持つべきノードが生成された場合には、そのノードには、内容を格納するための空の領域が作成される。
〔S13〕部分構造作成部15が、current ノードから対応ノードへのポインタを作成する。このポインタは、部分構造の接続位置の決定の際に利用される。
〔S14〕部分構造作成部15が、current ノードがルートノードか否かを判断する。ルートノードであればステップS19(図5に示す)に進み、ルートノードでなければステップS15に進む。
〔S15〕ルートノードでないと判断された場合、作成された部分構造の接続位置を決定する。この処理の詳細は、図7において説明する。なお、この処理からステップS17までの処理は、接続位置決定部16が行う。
〔S16〕current 規則要素に接続位置の条件が定義されているか否かを判断する。接続位置の条件が定義されていなければステップS18に進み、接続位置の条件が定義されていればステップS17に進む。
〔S17〕接続位置の条件が定義されていれば、接続位置の条件を満たす接続位置を決定する。この処理の詳細は、図8において説明する。
〔S18〕部分構造接続部17が、決定された接続位置に部分構造を接続する。この処理の詳細は、図9において説明する。
【0045】
図5は文書構造の変換処理(図3のステップS4)の手順を示したフローチャートの後半である。
〔S19〕current ノードが子ノードを持つか否かを調べる。子ノードを持たない場合、処理は終了する。このとき、この処理を呼び出した上位の構造変換プロセスがあればそこに処理が戻る。上位の構造変換プロセスがなければ、構造変換処理全体が終了する。なお、この処理からステップS23までの処理は、規則要素決定部14が行う。
〔S20〕current ノードが子ノードを持つ場合、current ノードの長男ノードを選択する。
〔S21〕選択したノードに対して図4、図5に示したフローチャートと同じ処理を再帰的に実行する。
〔S22〕呼び出した処理が終了した後、選択されたcurrent ノードが弟を持つか否かを判断する。弟のノードを持たなければ、処理は終了する。このとき、この処理を呼び出した上位の構造変換プロセスがあればそこに処理が戻る。上位の構造変換プロセスがなければ、構造変換処理全体が終了する。
〔S23〕現在のcurrent ノードが弟のノードを持つ場合には、選択されたノードの直後の弟のノードを選択し、ステップS21に進む。ステップS21では、このステップで選択したノードをcurrent ノードとして、構造変換プロセスが再帰的に呼び出される。
【0046】
図6は、規則要素決定部14で行われるcurrent 規則要素決定処理(図4のステップS11)の手順を示したフローチャートである。
〔S31〕変換規則の最初の規則要素を選択する。
〔S32〕選択した規則要素の対応元の条件に、current ノードがマッチするか否かを判断する。マッチする場合にはステップS33に進み、マッチしない場合にはステップS34に進む。
〔S33〕対応元の条件にマッチしたら、マッチした規則要素をcurrent 規則要素としてこの処理を終了する。
〔S34〕対応元の条件にマッチしない場合には、次の規則要素が変換規則中に存在するか否かを判断する。次の規則要素が存在すればステップS35に進み、次の規則要素が存在しなければ、エラー終了となる。
〔S35〕次の規則要素が存在する場合には、その規則要素を選択し、current ノードが選択した規則要素の対応元の条件にマッチするか否かの判断のステップS32に戻る。
【0047】
次に、接続位置の決定処理の詳細を説明する。この例では、current 規則要素に接続位置の条件が定義されていない場合には、以下のような条件に従って、接続位置を決定する。
【0048】
current ノードが兄をもたなければ、current ノードの親ノードの対応ノードを接続位置とする。一方、current ノードが兄を持つ場合には、兄に対応する部分構造の論理順序順で最後尾のノードの親ノードを接続位置とする。ここで、論理順序順で最後尾とは、部分構造の最後尾の木のルートの末子の末子の...と選んでいった場合の最後のノードである。
【0049】
なお、接続位置の条件が定義されている場合には、ここで決めた接続位置が、接続位置の探索の起点として使用される。
図7は、接続位置決定部16で行われる部分構造の接続位置の決定処理(図4のステップS15)の手順を示したフローチャートである。
〔S41〕current ノードの親ノードの対応ノードを接続位置にする。なお、親ノードの対応ノードは、その親ノードに対して作成されたポインタによって示されている。
〔S42〕current ノードが兄を持つか否かを判断する。兄を持っていればステップS43に進み、兄をもたなければ接続位置の決定を終了する。
【0050】
兄を持つ場合以下のステップS43〜ステップS45の処理により、直接の兄に対応して作成された部分構造の論理順序順で最後尾のノードを求める。図4、図5の手順から、直接の兄に対応する部分構造は、current ノードの親ノードの対応ノードの下位に接続済みである。従って、直接の兄に対応して作成された部分構造の論理順序順で最後尾のノードは、current ノードの親ノードの対応ノードから辿ることができる。
〔S43〕接続位置の末子が子ノードを持つかどうかを判断する。末子が子ノードを持てばステップS44に進み、末子が子ノードを持たなければ、接続位置の決定は終了する。
〔S44〕末子が子ノードを持つならば、その末子がcurrent ノードの直接の兄の対応ノードか否かを判断する。末子がcurrent ノードの直接の兄の対応ノードであれば、接続位置の決定は終了する(current ノードの直接の兄の対応ノード以下のノードが接続位置になることはない)。末子がcurrent ノードの直接の兄の対応ノードでなければ、ステップS45に進む。
〔S45〕末子がcurrent ノードの直接の兄の対応ノードでなければ、その末子を接続位置とし、接続位置の末子が子ノードを持つかどうかのチェックに戻る。
【0051】
図7の処理によりcurrent 規則要素中に接続位置の条件が規定されていない場合の接続位置が決定する。
current 規則要素中に接続位置の条件が規定されている場合、部分構造の接続位置は、図7の手順で決まった接続位置と、current ノードの親ノードの対応ノードを結ぶパス上のどこかである。つまり、current ノードの親ノードの対応ノードより上位のノードに接続することはない。なぜなら、これより上位に接続すると、入力文書構造で規定されていたノードの包含関係を満たさなくなるからである。
【0052】
図8はcurrent 規則要素中に接続位置の条件が規定されている場合の、部分構造の接続位置の決定処理(図4のステップS17)の手順を示したフローチャートである。この処理は、接続位置決定部16が行う。
〔S51〕現在の接続位置がcurrent 規則要素中の接続位置の条件を満たすか否かを判断する。接続位置の条件を満たす場合には処理を終了し、接続位置の条件を満たさない場合にはステップS52に進む。
〔S52〕接続位置の条件を満たさない場合、接続位置がcurrent ノードの親ノードの対応ノードか否かを判断する。接続位置がcurrent ノードの親ノードの対応ノードである場合、接続位置の条件を満たす接続位置が見つからなかったのでエラー終了となる。接続位置がcurrent ノードの親ノードの対応ノードでなければ、ステップS53に進む。
〔S53〕接続位置の親ノードを接続位置にし、接続位置の条件を満たすかどうかのチェックに戻る。
【0053】
図7、図8の処理により、部分構造の接続位置が決定する。そして、決定した接続位置にcurrent ノードに対応して作成された部分構造が接続される。この際、木の列である部分構造は、その木の列のルートノード同士が、同じノードの兄弟ノードになるように接続される。その兄弟ノードの親ノードが部分構造の接続位置である。
【0054】
図9は、部分構造の接続処理(図4のステップS18)の手順を示したフローチャートである。
〔S61〕部分構造が空列か否かを判断する。空列であれば処理を終了し、空列でなければステップS62に進む。
〔S62〕空列でなければ、部分構造の先頭の木を選択する。
〔S63〕選択した木のルートノードを接続位置の末子として接続する。
〔S64〕部分構造中に次の木が存在するかどうかが調べられる。存在しなけれ、処理は終了する。
〔S65〕次の木が存在すれば、その木を選択し、選択した木の接続に戻る。
【0055】
以上のような処理を図2に示した文書構造変換装置10が行うことにより、文書構造変換装置に入力された文書データの構造が、他の文書タイプに従った文書構造に変換される。しかも、新たな文書構造には、変換前の文書構造に含まれないノードを付加することができる。
【0056】
次に、上記のような文書構造変換装置を用いた文書構造の変換を、具体例を用いて説明する。以下の例では、「技術メモ」という名の文書クラスの文書データの構造を、「Technical Report」という文書クラス名の文書クラスに変換する場合である。
【0057】
文書クラス管理部11は、「技術メモ」という文書クラス名の文書クラスと、「Technical Report」という文書クラス名の文書クラスの文書クラス定義を記憶している。
【0058】
「技術メモ」という文書クラスは、以下のようなタイプ定義を含んでいる。
タイプ名:技術メモ 内容型:内容を持たない
タイプ名:文頭 内容型:内容を持たない
タイプ名:表題 内容型:文字列
タイプ名:著者 内容型:文字列
タイプ名:見出し 内容型:文字列
タイプ名:段落 内容型:文字列
図10は「技術メモ」の構造制約を示す図である。この構造制約31によると、ルートノードのタイプ名は「技術メモ」である。「技術メモ」のノードには、構造制約子「SEQ」により二つの枝が設けられている。一方の枝には「文頭」のノードが接続されている。他方の枝には、構造制約子「REP」及び「SEQ」により、「見出し」と「段落」のノードが接続されている。「文頭」のノードには、構造制約子「SEQ」により二つの枝が設けられている。それぞれの枝には、「表題」のノードと「著者」のノードとが接続されている。
【0059】
一方、「Technical Report」という文書クラスは、以下のようなタイプ定義を含んでいる。
タイプ名:Report 内容型:内容を持たない
タイプ名:Header 内容型:内容を持たない
タイプ名:Report−Title 内容型:文字列
タイプ名:Author 内容型:文字列
タイプ名:Revision−Dates 内容型:内容を持たない
タイプ名:Date 内容型:文字列
タイプ名:Section 内容型:内容を持たない
タイプ名:Title 内容型:文字列
タイプ名:Paragraph 内容型:文字列
図11は「Technical Report」の構造制約を示す図である。この構造制約32によると、ルートノードのタイプ名は「Report」である。「Report」のノードには、構造制約子「SEQ」により二つの枝が設けられている。一方の枝には「Header」のノードが接続されている。他方の枝には、「Section 」のノードが接続さされている。
【0060】
「Header」のノードには、構造制約子「SEQ」により三つの枝が設けられており、それぞれの枝には、「Report−Title」、「Author」、「Revision−date 」のノードが接続されている。「Revision−date 」のノードには、さらに構造制約子「REP」により「Date」のノードが接続されている。
【0061】
「Section 」のノードには、構造制約子「SEQ」により三つの枝が設けられている。最初の枝には「Title 」のノードが接続されている。次の枝には構造制約子「REP」により「Paragraph 」のノードが接続されている。3つめの枝は、構造制約子「OPT」および「REP」により、自己のノード(「Section 」のノード)に接続されている。
【0062】
図10と図11とを比較すると、図11の方が構成要素として存在するノードが数が多い。従って、「技術メモ」の文書クラスの文書を、「Technical Report」の文書クラスの文書に変換する際に、各ノード間の1対1の関係のみを定義しても、「Technical Report」の文書クラスの文書を正しく作成することができないことが分かる。そこで、次のような変換規則を変換規則管理部12に格納する。
【0063】
図12は、変換規則管理部に格納されている変換規則の例である。この変換規則33は、「技術メモ」の文書クラスの文書を、「Technical Report」の文書クラスの文書に変換するためのものであり、入力文書クラス名:「技術メモ」、出力文書クラス名:「Technical Report」とともに格納されている。
【0064】
この変換規則33には、以下のような規則が定義されている。
”タイプが「技術メモ」”の対応元の条件に対しては、接続位置の条件は”なし”であり、対応先のパターンは”<Report*> ”である。
【0065】
”タイプが「文頭」”の対応元の条件に対しては、接続位置の条件は”なし”であり、対応先のパターンは”<Header*> ”である。
”タイプが「表題」”の対応元の条件に対しては、接続位置の条件は”なし”であり、対応先のパターンは”<Report−Title*> ”である。
【0066】
”タイプが「著者」”の対応元の条件に対しては、接続位置の条件は”なし”であり、対応先のパターンは”<Author*,Revision−Dates<Date>>”である。
”タイプが「見出し」で内容に「第*章」のパターンの文字列を持つもの”の対応元の条件に対しては、接続位置の条件は”タイプ名が「Report」”であり、対応先のパターンは”<Section<Title*>> ”である。
【0067】
”タイプが「見出し」で内容に「第*節」のパターンの文字列を持つもの”の対応元の条件に対しては、接続位置の条件は”タイプ名が「Section 」であり親ノードのタイプが「Report」であるもの”であり、対応先のパターンは”<Section<Title*>> ”である。
【0068】
”タイプが「見出し」で内容に「第*項」のパターンの文字列を持つもの”の対応元の条件に対しては、接続位置の条件は”タイプ名が「Section 」であり祖父ノードのタイプが「Report」であるもの”であり、対応先のパターンは”<Section<Title*>> ”である。
【0069】
“タイプが「段落」”の対応元の条件に対しては、接続位置の条件は“なし”であり、対応先のパターンは“<Paragraph*>”である。”
以上 のような定義と変換規則が設定されている状態で、ユーザは、入出力u/i21を用いて「技術メモ」の文書クラスの文書データを入力する。そのデータは、文書パーサ13で構造が解析される。
【0070】
図13は文書パーサ13によって抽出された文書構造40の例である。図13において、楕円で囲まれているのがノードであり、楕円中の文字列はノードのタイプを示している。また、ノードに接続された長方形の中の文字列が、そのノードの持つ内容である。
【0071】
この図は、「技術メモ」の文書クラスの文書構造40である。この文書構造は、「技術メモ」のノードがルートノードである。このルートノードの子は、「文頭1」、「見出し1」、「段落1」、「段落2」、「見出し2」、「段落3」、「見出し3」、及び「段落4」のノードである。ルートノードの子の中で「文頭1」のノード以外のノードは内容を持っている。「文頭1」のノードの子は、「表題1」と「著者1」のノードである。「表題1」と「著者1」とのノードは内容を持っている。
【0072】
このような文書構造が抽出されると、規則要素決定部14において、各ノードに適用すべき規則要素が決定される。規則要素が決定すると、その規則要素に示されている対応先のパターンに従って、部分構造が作成される。
【0073】
例えば、図13の「著者1」のノードの規則要素は、図12の4行目に示された”タイプが「著者」”の対応元条件に合致する。従って、”<Author*,Revision−Dates<Date>>”で示された対応先パターンに従って、部分構造が作成される。
【0074】
図14は「著者1」のノードから作成される部分構造である。「著者1」のノードからは、二つの部分構造41,42が作成される。作成された部分構造41,42は、列を成しており、この例では部分構造41が先頭である。
【0075】
部分構造41は、「Author1 」のノードである。「Author1 」のノードは対応ノードであるため、「著者1」の持っていた内容を引き継いでいる。部分構造42は、「Revision−Dates1 」のノードと、そのノードの子である「Date1 」のノードで構成されている。「Date1 」は、内容を持つノードであるため、内容を格納するための領域が設けられている。
【0076】
また、図13の「見出し1」のノードの規則要素は、図12の5行目に示された”タイプが「見出し」で内容に「第*章」のパターンの文字列を持つもの”の対応元条件に合致する。従って、”<Section<Title*>> ”で示された対応先のパターンに従って部分構造が作成される。
【0077】
図15は「見出し1」のノードから作成される部分構造である。「見出し1」のノードからは、部分構造43が作成される。この部分構造43は、「Section1」のノードと、そのノードの子である「Title1」のノードで構成されている。「Title1」のノードは対応ノードであるため、「見出し1」が持っていた内容を引き継いでいる。
【0078】
同様にして、図13に示した文書構造内の全てのノードに対応する部分構造が作成される。そして、部分構造が作成される度に、それ以前に作成されている部分構造に対する接続位置が決定され、その位置に接続される。
【0079】
図16は、部分構造の接続位置の探索状況を示す図である。この例は、図13の「見出し3」のノードから作成された部分構造45の接続位置の探索状況である。部分構造45が作成される前に、既に、「技術メモ」のノード、「見出し3」のノードの兄にあたるノード、及び兄にあたるノードの子のノードから作成された部分構造は接続されている。従って、既に接続されている部分構造によって、文書構造44が形成されている。この文書構造44の所定の位置に接続位置が決定される。
【0080】
「見出し3」のノードは、図12の変換規則の5行目に示された規則要素が適用される。この規則要素には、接続位置の条件が”タイプが「Report」”と示されている。この場合、まず接続位置の条件が”なし”の場合の接続位置が探索される。すると、「Section2」のノードが接続位置となる。従って、「Report1 」のノード(「見出し3」のノードの親のノードの対応ノード)から「Section2」のノードまでの経路のどこかに、接続位置の条件を満たす接続位置がなければならない。
【0081】
そこで、接続位置の条件にマッチするノードを現在の接続位置から上に向かって調べていく。即ち、「Section2」のノード、「Section1」のノード、「Report1 」のノードの順で、接続位置の条件を満たすか否かが検討される。その結果、「Report1 」のノードが接続位置の条件を満たしていることが分かり、その位置が接続位置として決定される。そして、決定された接続位置であるノードの下位構造として、部分構造45が接続される。
【0082】
図17は変換後の文書構造を示す図である。変換後の文書構造50は、「Technical Report」の文書クラスの定義に従った文書構造となっている。この文書構造から、文書ジェネレータ18が、変換結果の文書データを作成する。その文書データを、ユーザは入出力u/i21を用いて参照することができる。
【0083】
【発明の効果】
以上説明したように本発明の文書構造変換装置では、変換規則管理手段に管理されている木構造の列によって表される部分構造に変換されるかを示す変換パターンに従って、部分構造作成手段が第1の文書構造の各ノードの部分構造を作成し、部分構造接続手段が作成された部分構造を接続することにより、第2の文書構造を生成するようにしたため、変換パターンとして、ノードが第2の文書構造中でどのようなノードに変換されるかだけでなく、その近傍で補われなければならないノードについても変換規則に記述することにより、第2の文書クラスの制約上必要なノードや部分木を補った文書構造の変換が可能となる。従って、ノードや部分木を容易に補うことができる。
【0084】
また、本発明の文書構造変換方法では、木構造の列によって表される部分構造に変換されるかを示す変換パターンに従って、部分構造作成手段が第1の文書構造の各ノードの部分構造を作成し、作成された部分構造を接続することにより第2の文書構造を生成するようにしたため、変換パターンとして、ノードが第2の文書構造中でどのようなノードに変換されるかだけでなく、その近傍で補われなければならないノードについても変換規則に記述することにより、第2の文書クラスの制約上必要なノードや部分木を補った文書構造の変換が容易となる。
【図面の簡単な説明】
【図1】本発明の原理構成図である。
【図2】本発明を適用する文書構造変換装置の概略構成を示すブロック図である。
【図3】文書構造変換装置で行われる処理全体の手順を示したフローチャートである。
【図4】文書構造の変換処理の手順を示したフローチャートの前半である。
【図5】文書構造の変換処理の手順を示したフローチャートの後半である。
【図6】規則要素決定部で行われるcurrent 規則要素決定処理の手順を示したフローチャートである。
【図7】接続位置決定部で行われる部分構造の接続位置の決定処理の手順を示したフローチャートである。
【図8】current 規則要素中に接続位置の条件が規定されている場合の、部分構造の接続位置の決定処理の手順を示したフローチャートである。
【図9】部分構造の接続処理の手順を示したフローチャートである。
【図10】「技術メモ」の構造制約を示す図である。
【図11】「Technical Report」の構造制約を示す図である。
【図12】変換規則管理部に格納されている変換規則の例である。
【図13】文書パーサによって抽出された文書構造の例である。
【図14】「著者1」のノードから作成される部分構造である。
【図15】「見出し1」のノードから作成される部分構造である。
【図16】部分構造の接続位置の探索状況を示す図である。
【図17】変換後の文書構造を示す図である。
【符号の説明】
1 変換規則管理手段
1a 変換規則
2 第1の文書構造
3 規則要素決定手段
4 部分構造作成手段
4a 部分構造
5 接続位置決定手段
6 部分構造接続手段
6a 作成過程の文書構造
7 第2の文書構造
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a document structure conversion apparatus and a document structure conversion method for creating a document structure, and more particularly to a document structure conversion apparatus and a document structure conversion method for creating a document structure that satisfies a structure constraint of a predetermined document class.
[0002]
[Prior art]
A document that has a logical structure represented by chapters, sections, and paragraphs as a component is called a structured document. By unifying the structure of this document, it is easy to share and convert documents. Are known. With the spread of international standards such as SGML (Standard Generalized Markup Language) and ODA (Office Document Architecture), structured documents are becoming the mainstream of electronic documents.
[0003]
This structured document is usually structured according to a classification called a document class that defines the structure and components of the document. In ODA, the common logical structure corresponds to the document class, and in SGML, DTD (Data Type Definition) plays the role of the document class.
[0004]
In a structured document, it is important that the document structure conforms to the constraints of the document class. For example, a rule for laying out a structured document is often determined on the assumption that the document structure and its constituent elements satisfy the constraints of a specific document class. For this reason, when the document structure deviates from the document class restriction, output with a correct layout cannot be performed.
[0005]
Many programs for processing many structured documents, such as creating an abstract list from a group of reports, use the fact that a target document is created according to a specific document class. When such a program is used, the presence of a document that does not follow a predetermined document class can be an obstacle to program execution. Furthermore, in a database that targets structured documents, the document class is often used as a schema, and the presence of data that deviates from the schema greatly impairs the reliability of the database.
[0006]
Therefore, in order to apply various processing programs prepared for a document conforming to a certain document class B to a document of another document class A, the document structure according to the document class A is changed to another document class B. Must be converted to a document structure according to
[0007]
In order to solve the above problem, a rule defining a 1: 1 relationship between nodes is prepared such that a node of type a in document class A is converted to a node of type b in document class B by conversion. The document structure is determined by determining which type of node in the document class B each node in the document structure according to the document class A uses the rules when converting the document structure. Some perform conversions.
[0008]
For example, “Structure of Editing Structured Documents—Problem and solutions (Electronic Publishing, vol. 5, No. 4, pp. 209-216) by Fred Cole, Heather Brown”, ck. For the type of node specified in document class A, the type of node specified in document class B after the conversion of that type node is defined as a rule. Therefore, a method of converting each node of the document structure according to a predefined rule can be easily considered.
[0009]
JP-A-7-28817 discloses a one-to-one correspondence between types constituting a document class when a document structure according to document class A is converted into a document structure according to another document class B. A document conversion method is disclosed in which a user defines a relationship and uses the corresponding relationship to convert the structure of the document.
[0010]
[Problems to be solved by the invention]
However, there are cases where the nodes necessary for the converted document class and the nodes corresponding to the subtree are not included in the structural constraints of the document class before conversion. In this case, the conventional technique has a problem that it is difficult to perform document structure conversion to compensate for the shortage.
[0011]
That is, the nodes in the created document structure are only those for which corresponding nodes exist in the document structure before conversion, and the nodes without corresponding ones remain insufficient. The document structure created in this way cannot completely satisfy the constraints of document class B.
[0012]
The present invention has been made in view of such a point, and when converting the document structure of the first document class so as to conform to the second document class, necessary nodes can be easily supplemented. An object of the present invention is to provide a document structure creation device.
[0013]
Another object of the present invention is to provide a document structure creation method capable of easily supplementing necessary nodes when converting the document structure of the first document class to conform to the second document class. It is to be.
[0014]
[Means for Solving the Problems]
According to the present invention, in order to solve the above-described problem, a document structure conversion apparatus for converting a document structure according to the first document type into a document structure according to the second document type conforms to the first document type. An application condition indicating which node in the document structure is applied and what kind of node satisfies the application condition Represented by a tree column A conversion rule managing means for managing a conversion rule having a rule element consisting of a combination of a conversion pattern indicating whether to be converted into a partial structure, and a first document structure according to the first document type are input. And by selecting the nodes in the first document structure in a predetermined order and comparing the selected nodes with the application conditions in the conversion rule, Said A rule element determining means for determining a rule element to be applied to the selected node; a partial structure creating means for creating a partial structure of the selected node according to the rule element conversion pattern determined by the rule element determining means; A connection position determining means for determining a connection position of the partial structure created by the partial structure creating means from the document structure of the creation process, and a connection position on the document structure of the creation process determined by the connection position determining means And a partial structure connecting means for connecting the partial structures created by the partial structure creating means. When An apparatus for converting a document structure is provided.
[0015]
According to such a document structure conversion apparatus, when the first document structure is input, the rule element of each node is determined by the rule element determination means. The partial structure of each node is created by the partial structure creation means in accordance with the rule element conversion pattern. Then, the connection position of each partial structure is determined by the connection position determination means, and the partial structure connection means connects the corresponding partial structure to the determined position. As a result, if it is defined that a plurality of nodes are generated as the conversion pattern, the second document structure can be created by compensating for the missing nodes in the first document structure.
[0016]
A document structure conversion method for converting a document structure according to a first document type into a document structure according to a second document type, wherein the first document structure according to the first document type is input. The nodes in the first document structure in a predetermined order. By rule element determination means Select and what Represented by a tree column By comparing an application condition indicating which node in the document structure according to the first document type is applied with a conversion pattern indicating whether it is converted into a partial structure, and the selected node, Said The transformation pattern to be applied to the selected node By rule element determination means And determining a partial structure of each node in the first document structure according to the determined conversion pattern. By means of partial structure creation Create and connect the created partial structure to the connection position according to the predetermined definition on the document structure in the creation process When A document structure conversion method is provided.
[0017]
According to this document structure conversion method, by defining a conversion pattern so that a plurality of nodes are generated, a second document that compensates for nodes that are insufficient in the input first document structure. A structure is generated.
[0018]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a principle configuration diagram of the present invention. This shows a principle configuration for converting a document structure according to the first document type into a document structure according to the second document type.
[0019]
The conversion rule management means 1 manages the conversion rule 1a when converting the document structure according to the first document type to the document structure according to the second document type. This conversion rule 1a is a set of rule elements. Each rule element has an application condition indicating to which node in the document structure the rule element is applied according to the first document type, and a conversion indicating to which partial structure the corresponding node in the document structure is converted. A connection condition indicating a pattern and a position to which the conversion pattern is connected is included. It should be noted that the conversion pattern includes designation of a node in the partial structure that should inherit the contents of the node of the first document structure 2 when a plurality of nodes are generated in the partial structure. There is also a conversion pattern that generates a plurality of partial structures from one node. The connection conditions are defined in advance when omitted, and the conditions are specified only when connecting to other positions.
[0020]
When the first document structure 2 according to the first document type is input, the rule element determination unit 3 selects the nodes in the first document structure 2 one by one in a predetermined order. Then, the selected node and the application condition in the rule element are collated, and the rule element applicable to the node is determined. The partial structure generation unit 4 creates a partial structure 4 a after conversion of each node of the first document structure 2 in accordance with the rule element conversion pattern determined by the rule element determination unit 3.
[0021]
The connection position determination means 5 determines the connection position of the partial structure created by the partial structure creation means 4. Previously created partial structures are connected to each other, and a document structure 6a in the creation process is created. The connection position of the newly created partial structure is determined from the position on the document structure 6a in the creation process. The partial structure connecting means 6 connects the partial structure created by the partial structure creating means 4 to the connection position determined by the connection position determining means 5.
[0022]
In this way, the second document structure 7 is generated by connecting the partial structures created corresponding to all the nodes of the first document structure 2 to each other. There may be a plurality of partial structures created corresponding to each node, and each partial structure may have a plurality of nodes. Therefore, it is possible to generate a second document structure that supplements nodes and subtrees that do not exist in the first document class but should exist in the second document class.
[0023]
FIG. 1 shows a document structure conversion function in a state where the first document structure has already been recognized. Generally, however, document data is handled. The document structure cannot be recognized unless the document data is analyzed according to the definition of the document class to which the document data belongs. Therefore, a document structure conversion apparatus including a document structure analysis function for document data will be described below.
[0024]
FIG. 2 is a block diagram showing a schematic configuration of a document structure conversion apparatus to which the present invention is applied. In this embodiment, a document structure (input document structure) of document data created according to a restriction of a certain document class is converted into a document structure (output document structure) restricted by another document class. Yes. The document structure handled in this embodiment is a tree structure.
[0025]
An input / output u / i 21 and a conversion rule management u / i 22 are connected to the document structure conversion apparatus 10. The input / output u / i 21 is a user interface for inputting document data to be converted by the user and referring to the conversion result to the document structure conversion apparatus. The conversion rule management u / i 22 is a user interface for the user to register, update, and delete conversion rules with respect to the conversion rule management unit 12 in the document structure conversion apparatus 10.
[0026]
The document structure conversion apparatus 10 has, as functions for managing information necessary for conversion of the document structure, a document class management unit 11 that manages the structure restrictions of the document class to be converted, and each element of the input document structure Includes a conversion rule management unit 12 that manages rules (conversion rules) for determining what partial structure is to be obtained after conversion. Furthermore, the document structure conversion apparatus 10 determines, as a structure conversion processing function unit, a document parser 13 that analyzes the document structure of the input document data, and a rule element to be applied to each node of the obtained document structure. The rule element determination unit 14, the partial structure creation unit 15 that creates a partial structure based on the determined rule element, the connection position determination unit 16 that determines the connection position of the created partial structure, and the partial structure at the determined connection position A partial structure connecting unit 17 to be connected and a document generator 18 for creating document data from a document structure to which all partial structures are connected are provided.
[0027]
The function of each component in the document structure conversion apparatus 10 will be described in detail below.
The document class management unit 11 manages a plurality of document class definitions to be converted. Specifically, the document class definition includes the name of the document class (name is unique within the document class management unit). ) And a pair. When the document parser 13 requests the definition of the document class together with the name of the document class, the document class definition having the designated name is passed to the document parser 13.
[0028]
The definition of a document class includes a type definition of nodes constituting a document structure and a structure constraint that defines a connection relationship between nodes of the defined type. In the following description, a document structure that satisfies the definition of a document class type and a structure constraint is called a document structure of that document class, and document data having a document structure of a document class is referred to as a document of that document class. This is called data.
[0029]
The type definition of a node consists of “type name” and “content type designation”.
The “type name” is a character string for identifying the type of the node (hereinafter, the type whose type name is “A” is called “A type”, and the node of “A type” is “A node”. Shall be called).
[0030]
“Content type designation” indicates whether this type of node has content or not, and if so, what type of content it has. In this embodiment, a possible content type is assumed to be either a character string type or a geometric figure type.
[0031]
The structure constraint is defined by a tree structure created by the following structure constraint and the above type definition. There are “SEQ” and “REP” as the structure constraints.
“SEQ” has a plurality of substructures, and indicates that the structures defined by the substructures appear in a defined order.
[0032]
“REP” takes a single substructure and indicates that the structure defined by the substructure appears repeatedly one or more times.
“OPT” takes a single substructure and indicates that the structure defined by the substructure either does not appear or appears once.
[0033]
In the conversion rule management unit 12, a plurality of conversion rules are generated as a result of applying the document class name (input document class name) of the document class of the document to which the rule is applied and converted. Stored together with the document class name (output document class name).
[0034]
A conversion rule is a list of rule elements. The rule element specifies what kind of partial structure (output partial structure) a node (input node) in the input document structure becomes in the output document. It consists of three fields of the corresponding pattern. The contents of each field will be described below.
[0035]
The correspondence source condition is a condition for a node in the input document structure to which the rule element is applied. In the condition of the correspondence source, the type of the node to which the rule element having the condition is applied and the condition regarding the contents of the node are defined.
[0036]
The condition of the connection position is a condition of the output partial structure generated as a result of applying the rule element to which position in the output document structure being converted. For the connection location condition, the type of the node that becomes the parent node of the output substructure generated as a result of applying the rule element with that condition, and the nodes around the node (parent, grandfather, sibling nodes, etc.) The conditions are defined.
[0037]
For the corresponding pattern, an output partial structure pattern generated as a result of applying a rule element having the pattern is defined. This pattern is a tree-structured column composed of nodes that can appear in the output document class.
[0038]
The corresponding pattern is expressed by a list of node type names enclosed by “<” and “>”. For example, the corresponding pattern is
<. . . , A <B, C, D *>,. . . >
In this case, it is indicated that the node A is a pattern having child nodes of the nodes B, C, and D.
[0039]
Further, there is always only one node called a corresponding node in the pattern. If the input node has contents, the contents are copied to become the contents of the corresponding node. If the input node has a subordinate structure, the partial structure that is the conversion result of the subordinate structure becomes a subordinate structure of the corresponding node. In this example, “*” is added immediately after the type name to represent a corresponding node.
[0040]
The information in the conversion rule management unit 12 is set by the user using the conversion rule management u / i 22. That is, in order to convert the document structure, it is necessary to set in advance conversion rules according to the document class before conversion and the document class after conversion.
[0041]
In a state where the above information is managed by the document class management unit 11 and the conversion rule management unit 12, the user uses the input / output u / i 21 to input document data whose document structure is to be converted. Thereby, the conversion process is started. Below, the processing content of each processing function part is demonstrated using a flowchart.
[0042]
FIG. 3 is a flowchart showing a procedure of the entire process performed in the document structure conversion apparatus 10. This is started when the user inputs an input document class name, an output document class name, and input document data to be converted together with an instruction to convert document data using the input / output u / i 21.
[S1] The document parser 13 extracts the document structure from the input document data. Specifically, the document parser 13 first takes out the definition of the document class having the input document class name from the document class management unit 11. Then, according to the extracted definition, the input document data is analyzed to extract the document structure of the input document data. This document structure becomes the input document structure to be converted.
[S2] The rule element determination unit 14 extracts the conversion rule stored in the conversion rule management unit 12 together with the input document class name and the output document class name input by the user.
[S3] The rule element determination unit 14 sets the root node as a current node. In the structure conversion process, attention is paid to any node in the input document structure, and the partial structure in which the node is converted is recursively executed. The node of interest at this time is the current node.
[S4] Based on the extracted conversion rule, the rule element determination unit 14, the partial structure creation unit 15, the connection position determination unit 16, and the partial structure connection unit 17 work together to convert the document structure. Details of this processing will be described with reference to FIGS.
[S5] After the conversion is completed, the document generator 18 generates document data conforming to the output document class based on the generated document structure. The user can refer to the document data using the input / output u / i 21.
[0043]
FIG. 4 is the first half of a flowchart showing the procedure of the document structure conversion process (step S4 in FIG. 3). This process is executed when called in step S4 in FIG. 3 or step S21 shown in the latter half of the flowchart (FIG. 5). That is, after the process is started, the document structure conversion process is recursively called with a different node as a current node in the middle of conversion.
[0044]
In order to start this process, the current node needs to be specified. When called from step S4, the root node of the document structure on the input side is the current node. When called from step S21, the node specified in step S20 or step S23 is the current node.
[S11] The rule element determination unit 14 finds a rule element that can be applied to the current node from the conversion rule, and makes it a current rule element. Details of this processing will be described with reference to FIG.
[S12] The partial structure creating unit 15 creates a corresponding partial structure (output partial structure) in accordance with the corresponding pattern of the current rule element. At this time, if the current node has contents, a copy of the contents is created and used as the contents of the corresponding node in the output partial structure. When a node that should have contents other than the corresponding node is generated, an empty area for storing the contents is created in that node.
[S13] The partial structure creation unit 15 creates a pointer from the current node to the corresponding node. This pointer is used when determining the connection position of the partial structure.
[S14] The partial structure creation unit 15 determines whether or not the current node is a root node. If it is the root node, the process proceeds to step S19 (shown in FIG. 5), and if it is not the root node, the process proceeds to step S15.
[S15] When it is determined that the node is not a root node, the connection position of the created partial structure is determined. Details of this processing will be described with reference to FIG. In addition, the connection position determination part 16 performs the process from this process to step S17.
[S16] It is determined whether or not a connection position condition is defined in the current rule element. If the connection position condition is not defined, the process proceeds to step S18, and if the connection position condition is defined, the process proceeds to step S17.
[S17] If a connection position condition is defined, a connection position that satisfies the connection position condition is determined. Details of this processing will be described with reference to FIG.
[S18] The partial structure connecting portion 17 connects the partial structure to the determined connection position. Details of this processing will be described with reference to FIG.
[0045]
FIG. 5 is the latter half of the flowchart showing the procedure of the document structure conversion process (step S4 in FIG. 3).
[S19] It is checked whether or not the current node has a child node. If there are no child nodes, the process ends. At this time, if there is an upper structure conversion process that has called this process, the process returns to that process. If there is no upper structure conversion process, the entire structure conversion process is completed. The rule element determination unit 14 performs the processes from this process to step S23.
[S20] If the current node has a child node, the eldest node of the current node is selected.
[S21] The same processing as the flowcharts shown in FIGS. 4 and 5 is recursively executed on the selected node.
[S22] After the called process is completed, it is determined whether or not the selected current node has a younger brother. If there is no brother node, the process ends. At this time, if there is an upper structure conversion process that has called this process, the process returns to that process. If there is no upper structure conversion process, the entire structure conversion process is completed.
[S23] If the current current node has a brother node, select the brother node immediately after the selected node, and proceed to step S21. In step S21, the structure conversion process is recursively called with the node selected in this step as the current node.
[0046]
FIG. 6 is a flowchart showing the procedure of the current rule element determination process (step S11 in FIG. 4) performed by the rule element determination unit 14.
[S31] The first rule element of the conversion rule is selected.
[S32] It is determined whether or not the current node matches the condition of the correspondence source of the selected rule element. If they match, the process proceeds to step S33, and if they do not match, the process proceeds to step S34.
[S33] If the condition of the correspondence source is matched, the matched rule element is set as the current rule element, and this process is terminated.
[S34] If the condition of the correspondence source is not matched, it is determined whether or not the next rule element exists in the conversion rule. If the next rule element exists, the process proceeds to step S35. If the next rule element does not exist, the process ends in an error.
[S35] If the next rule element exists, the rule element is selected, and the process returns to step S32 for determining whether or not the current node matches the condition corresponding to the selected rule element.
[0047]
Next, details of the connection position determination process will be described. In this example, when the connection position condition is not defined in the current rule element, the connection position is determined according to the following conditions.
[0048]
If the current node does not have an older brother, the corresponding node of the parent node of the current node is set as the connection position. On the other hand, when the current node has an older brother, the parent node of the last node is set as the connection position in the logical order of the partial structure corresponding to the older brother. Here, the last in the logical order is the last child of the root of the last tree of the substructure. . . This is the last node in the case of selecting.
[0049]
When the connection position condition is defined, the connection position determined here is used as a starting point for searching for the connection position.
FIG. 7 is a flowchart showing the procedure of the partial structure connection position determination process (step S15 in FIG. 4) performed by the connection position determination unit 16.
[S41] The node corresponding to the parent node of the current node is set to the connection position. Note that the corresponding node of the parent node is indicated by a pointer created for the parent node.
[S42] It is determined whether the current node has an older brother. If it has an elder brother, it progresses to step S43, and if it does not have an elder brother, the determination of a connection position is complete | finished.
[0050]
In the case of having an elder brother, the last node is obtained in the logical order of the partial structure created corresponding to the direct elder brother by the processing of the following steps S43 to S45. From the procedures of FIGS. 4 and 5, the partial structure corresponding to the direct brother is already connected to the lower level of the corresponding node of the parent node of the current node. Therefore, the last node in the logical order of the partial structure created corresponding to the direct brother can be traced from the corresponding node of the parent node of the current node.
[S43] It is determined whether the last child at the connection position has a child node. If the youngest child has a child node, the process proceeds to step S44. If the youngest child has no child node, the determination of the connection position ends.
[S44] If the last child has a child node, it is determined whether or not the last child is a corresponding node of the immediate brother of the current node. If the youngest child is a corresponding node of the current node's direct older brother, the determination of the connection position ends (nodes below the current node's direct older brother's corresponding node do not become the connection position). If the youngest child is not a corresponding node of the current node's direct brother, the process proceeds to step S45.
[S45] If the last child is not a node corresponding to the current node's direct brother, the last child is set as a connection position, and the process returns to checking whether the last child at the connection position has a child node.
[0051]
With the processing in FIG. 7, the connection position when the connection position condition is not defined in the current rule element is determined.
When the connection position condition is defined in the current rule element, the connection position of the partial structure is somewhere on the path connecting the connection position determined in the procedure of FIG. 7 and the corresponding node of the parent node of the current node. is there. That is, no connection is made to a node higher than the corresponding node of the parent node of the current node. This is because if the connection is made higher than this, the inclusion relation of nodes defined in the input document structure is not satisfied.
[0052]
FIG. 8 is a flowchart showing the procedure of the determination process of the connection position of the partial structure (step S17 in FIG. 4) when the connection position condition is defined in the current rule element. This process is performed by the connection position determination unit 16.
[S51] It is determined whether or not the current connection position satisfies the condition of the connection position in the current rule element. If the connection position condition is satisfied, the process ends. If the connection position condition is not satisfied, the process proceeds to step S52.
[S52] When the connection position condition is not satisfied, it is determined whether or not the connection position is a node corresponding to the parent node of the current node. If the connection position is a node corresponding to the parent node of the current node, an error ends because no connection position that satisfies the connection position is found. If the connection position is not the corresponding node of the parent node of the current node, the process proceeds to step S53.
[S53] The parent node of the connection position is set to the connection position, and the process returns to checking whether the connection position condition is satisfied.
[0053]
The connection position of the partial structure is determined by the processing of FIGS. Then, the partial structure created corresponding to the current node is connected to the determined connection position. At this time, the partial structures that are the columns of the trees are connected such that the root nodes of the columns of the trees are sibling nodes of the same node. The parent node of the sibling node is the connection position of the partial structure.
[0054]
FIG. 9 is a flowchart showing the procedure of the partial structure connection process (step S18 in FIG. 4).
[S61] It is determined whether or not the partial structure is empty. If it is an empty string, the process ends. If it is not an empty string, the process proceeds to step S62.
[S62] If it is not an empty string, the first tree of the partial structure is selected.
[S63] The root node of the selected tree is connected as the last child of the connection position.
[S64] It is checked whether the next tree exists in the partial structure. If it does not exist, the process ends.
[S65] If the next tree exists, the tree is selected and the process returns to the connection of the selected tree.
[0055]
2 is performed by the document structure conversion apparatus 10 shown in FIG. 2, the structure of the document data input to the document structure conversion apparatus is converted into a document structure according to another document type. In addition, nodes that are not included in the document structure before conversion can be added to the new document structure.
[0056]
Next, document structure conversion using the document structure conversion apparatus as described above will be described using a specific example. In the following example, the structure of the document data of the document class named “Technical Memo” is converted into the document class named “Technical Report”.
[0057]
The document class management unit 11 stores a document class with a document class name “Technical Memo” and a document class definition with a document class name “Technical Report”.
[0058]
The document class “Technical Memo” includes the following type definition.
Type name: Technical memo Content type: No content
Type name: Beginning of contents Content type: No content
Type name: Title Content type: String
Type name: Author Content type: String
Type name: Heading Content type: String
Type name: Paragraph Content type: String
FIG. 10 is a diagram showing the structure restrictions of the “technical memo”. According to this structural constraint 31, the type name of the root node is “technical memo”. The node of “technical memo” is provided with two branches by the structure constraint element “SEQ”. One branch is connected to a “start of sentence” node. The other branch is connected with “Heading” and “Paragraph” nodes by structural constraints “REP” and “SEQ”. The node of “sentence” is provided with two branches by the structure constraint element “SEQ”. Each branch is connected to a “title” node and an “author” node.
[0059]
On the other hand, the document class “Technical Report” includes the following type definition.
Type name: Report Content type: No content
Type name: Header Content type: No content
Type name: Report-Title Content type: String
Type name: Author Content type: String
Type name: Revision-Dates Content type: No content
Type name: Date Content type: String
Type name: Section Content type: No content
Type name: Title Content type: String
Type name: Paragraph Content type: String
FIG. 11 is a diagram showing the structure restriction of “Technical Report”. According to this structure constraint 32, the type name of the root node is “Report”. The node “Report” is provided with two branches by the structure constraint “SEQ”. A node “Header” is connected to one branch. A node of “Section” is connected to the other branch.
[0060]
The “Header” node is provided with three branches by the structure constraint element “SEQ”, and the nodes “Report-Title”, “Author”, and “Revision-date” are connected to each branch. ing. The node of “Date” is further connected to the node of “Revision-date” by the structure constraint “REP”.
[0061]
The node of “Section” is provided with three branches by the structure constraint element “SEQ”. A node “Title” is connected to the first branch. The node of “Paragraph” is connected to the next branch by the structure constraint “REP”. The third branch is connected to its own node (node of “Section”) by the structure constraints “OPT” and “REP”.
[0062]
When FIG. 10 is compared with FIG. 11, the number of nodes existing as components in FIG. 11 is larger. Therefore, even when only a one-to-one relationship between each node is defined when converting a document of “Technical Memo” document class to a document of “Technical Report” document, the “Technical Report” document is defined. It turns out that the class document cannot be created correctly. Therefore, the following conversion rule is stored in the conversion rule management unit 12.
[0063]
FIG. 12 is an example of conversion rules stored in the conversion rule management unit. This conversion rule 33 is for converting a document of the document class of “technical memo” into a document of the document class of “Technical Report”. Input document class name: “technical memo”, output document class name: It is stored together with “Technical Report”.
[0064]
In the conversion rule 33, the following rule is defined.
For the correspondence source condition of “Technical Memo” type, the connection position condition is “none”, and the correspondence destination pattern is “<Report *>”.
[0065]
For the correspondence source condition of “type“ sentence ””, the connection position condition is “none”, and the correspondence destination pattern is “<Header *>”.
For the correspondence source condition of “type“ title ””, the connection position condition is “none”, and the correspondence destination pattern is “<Report-Title *>”.
[0066]
For the correspondence source condition of “type“ author ””, the connection position condition is “none”, and the correspondence destination pattern is “<Author *, Revision-Dates <Date >>”.
For the condition of the correspondence source of "the type is" Heading "and the content has the character string of" Chapter * "pattern in the content", the connection position condition is "Type name is" Report "" The previous pattern is “<Section <Title * >>”.
[0067]
For the condition of the correspondence source of “the type is“ Heading ”and the content has the character string of the“ section * section ”pattern”, the connection position condition is “Type name is“ Section ”and the parent node The type is “Report” ”, and the corresponding pattern is“ <Section <Title * >> ”.
[0068]
For the condition of the correspondence source of “The type is“ Heading ”and the content has the character string of the pattern of“ * ”in the contents”, the connection position condition is “Type name is“ Section ”and the grandfather node's The type is “Report” ”, and the corresponding pattern is“ <Section <Title * >> ”.
[0069]
For the corresponding source condition of the type “paragraph”, the connection position condition is “none” and the corresponding pattern is “<Paragraph *>”. ”
With the above definitions and conversion rules set, the user inputs document data of the document class “technical memo” using the input / output u / i 21. The structure of the data is analyzed by the document parser 13.
[0070]
FIG. 13 is an example of the document structure 40 extracted by the document parser 13. In FIG. 13, a node is surrounded by an ellipse, and a character string in the ellipse indicates a node type. The character string in the rectangle connected to the node is the content of the node.
[0071]
This figure shows the document structure 40 of the document class of “technical memo”. In this document structure, a “technical memo” node is a root node. The children of this root node are the nodes of “Sentence 1”, “Heading 1”, “Paragraph 1”, “Paragraph 2”, “Heading 2”, “Paragraph 3”, “Heading 3”, and “Paragraph 4”. is there. Among the children of the root node, nodes other than the node of “sentence 1” have contents. The children of the node of “Sentence 1” are the nodes “Title 1” and “Author 1”. The nodes “Title 1” and “Author 1” have contents.
[0072]
When such a document structure is extracted, the rule element determination unit 14 determines a rule element to be applied to each node. When the rule element is determined, a partial structure is created in accordance with the corresponding pattern indicated in the rule element.
[0073]
For example, the rule element of the node of “author 1” in FIG. A partial structure is created in accordance with the corresponding pattern indicated by “Dates <Date >>”.
[0074]
FIG. 14 shows a partial structure created from the node of “Author 1”. Two partial structures 41 and 42 are created from the node of “Author 1”. The created partial structures 41 and 42 form a column, and in this example, the partial structure 41 is the head.
[0075]
The partial structure 41 is a node of “Author1”. Since the node of “Author1” is a corresponding node, the contents possessed by “author 1” are taken over. The partial structure 42 includes a node “Revision-Dates1” and a node “Date1” that is a child of the node. Since “Date1” is a node having contents, an area for storing contents is provided.
[0076]
Further, the rule element of the node of “Heading 1” in FIG. 13 is “the type is“ Heading ”and the content has a character string of the pattern of“ Chapter * ”shown in the fifth line of FIG. Therefore, the partial structure is created according to the corresponding pattern indicated by “<Section <Title * >>”.
[0077]
FIG. 15 shows a partial structure created from the node of “Heading 1”. A partial structure 43 is created from the node of “Heading 1”. The partial structure 43 includes a “Section1” node and a “Title1” node that is a child of the node. Since the “Title 1” node is a corresponding node, the contents of “Heading 1” are taken over.
[0078]
Similarly, partial structures corresponding to all nodes in the document structure shown in FIG. 13 are created. Each time a partial structure is created, a connection position with respect to the partial structure created before is determined and connected to that position.
[0079]
FIG. 16 is a diagram illustrating a search state of connection positions of partial structures. This example is a search situation of the connection position of the partial structure 45 created from the node of “Heading 3” in FIG. Before the partial structure 45 is created, the partial structure created from the “technical memo” node, the node that is the elder brother of the “heading 3” node, and the child node of the elder node is already connected. Therefore, the document structure 44 is formed by the already connected partial structures. A connection position is determined at a predetermined position of the document structure 44.
[0080]
The rule element shown in the fifth line of the conversion rule in FIG. 12 is applied to the node of “Heading 3”. In this rule element, the connection position condition is indicated as “Type is“ Report ”.” In this case, first, the connection position when the connection position condition is “None” is searched. "Is the connection position. Therefore, there must be a connection position that satisfies the condition of the connection position somewhere in the route from the node of “Report 1” (corresponding node of the parent node of the node of “Heading 3”) to the node of “Section 2”.
[0081]
Therefore, the node that matches the connection position condition is examined upward from the current connection position. That is, whether or not the connection position condition is satisfied is examined in the order of the “Section 2” node, the “Section 1” node, and the “Report 1” node. As a result, it is found that the node of “Report1” satisfies the connection position condition, and the position is determined as the connection position. Then, the partial structure 45 is connected as a subordinate structure of the node that is the determined connection position.
[0082]
FIG. 17 is a diagram showing the document structure after conversion. The converted document structure 50 is a document structure in accordance with the definition of the “Technical Report” document class. From this document structure, the document generator 18 creates document data as a conversion result. The user can refer to the document data using the input / output u / i 21.
[0083]
【The invention's effect】
As described above, in the document structure conversion device of the present invention, the conversion rule management means manages the document structure conversion device. Indicates whether to convert to a substructure represented by a tree column According to the conversion pattern, the partial structure creating means creates a partial structure of each node of the first document structure, and the partial structure connecting means connects the created partial structures to generate the second document structure. Therefore, as a conversion pattern, not only what node is converted into the second document structure, but also a node that must be supplemented in the vicinity thereof is described in the conversion rule. It is possible to convert a document structure supplemented with necessary nodes and subtrees due to document class restrictions. Therefore, it is possible to easily supplement the nodes and subtrees.
[0084]
In the document structure conversion method of the present invention, Indicates whether to convert to a substructure represented by a tree column According to the conversion pattern, the partial structure creating means creates a partial structure of each node of the first document structure and generates the second document structure by connecting the created partial structures. Necessary for the restriction of the second document class by describing not only to which node the node is converted in the second document structure but also the node that must be supplemented in the vicinity thereof in the conversion rule. It is easy to convert the document structure that compensates for various nodes and subtrees.
[Brief description of the drawings]
FIG. 1 is a principle configuration diagram of the present invention.
FIG. 2 is a block diagram showing a schematic configuration of a document structure conversion apparatus to which the present invention is applied.
FIG. 3 is a flowchart showing a procedure of overall processing performed by the document structure conversion apparatus.
FIG. 4 is a first half of a flowchart showing a procedure of document structure conversion processing;
FIG. 5 is the latter half of the flowchart showing the procedure of the document structure conversion process.
FIG. 6 is a flowchart showing a procedure of a current rule element determination process performed by a rule element determination unit.
FIG. 7 is a flowchart showing a procedure for determining a connection position of a partial structure performed by a connection position determination unit.
FIG. 8 is a flowchart showing a procedure for determining a connection position of a partial structure when a connection position condition is defined in a current rule element;
FIG. 9 is a flowchart showing a procedure of partial structure connection processing;
FIG. 10 is a diagram showing a structure restriction of “technical memo”.
FIG. 11 is a diagram showing a structural restriction of “Technical Report”.
FIG. 12 is an example of conversion rules stored in a conversion rule management unit.
FIG. 13 is an example of a document structure extracted by a document parser.
FIG. 14 is a partial structure created from a node of “Author 1”.
FIG. 15 is a partial structure created from a node of “Heading 1”;
FIG. 16 is a diagram illustrating a search state of connection positions of partial structures.
FIG. 17 is a diagram illustrating a document structure after conversion.
[Explanation of symbols]
1 Conversion rule management means
1a Conversion rules
2 First document structure
3 Rule element decision means
4 Partial structure creation means
4a Partial structure
5 Connection position determination means
6 Partial structure connection means
6a Document structure of the creation process
7 Second document structure

Claims (4)

第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換する文書構造変換装置において、
前記第1の文書タイプに従った文書構造中のどのノードに適用されるのかを示す適用条件と、前記適用条件を満たしたノードがどういう木構造の列によって表される部分構造に変換されるかを示す変換パターンと、の組からなる規則要素を有する変換規則を管理する変換規則管理手段と、
前記第1の文書タイプに従った第1の文書構造が入力されると、前記第1の文書構造中のノードを所定の順番で選択し、選択したノードを前記変換規則中の適用条件と対比することにより、前記選択したノードに適用すべき規則要素を決定する規則要素決定手段と、
前記規則要素決定手段により決定された規則要素の変換パターンに従って、選択されたノードの部分構造を作成する部分構造作成手段と、
作成過程の文書構造の中から、前記部分構造作成手段で作成された部分構造の接続位置を決定する接続位置決定手段と、
前記接続位置決定手段で決定された作成過程の文書構造上の接続位置に、前記部分構造作成手段で作成された部分構造を接続する部分構造接続手段と、
を有することを特徴する文書構造変換装置。
In a document structure conversion device for converting a document structure according to a first document type into a document structure according to a second document type,
An application condition indicating which node in the document structure according to the first document type is applied, and a node satisfying the application condition is converted into a partial structure represented by a tree structure column A conversion rule management means for managing a conversion rule having a rule element consisting of a set of a conversion pattern indicating
When a first document structure according to the first document type is input, nodes in the first document structure are selected in a predetermined order, and the selected nodes are compared with application conditions in the conversion rule. by a rule element determination means for determining a rule element to be applied to the selected nodes,
A partial structure creating means for creating a partial structure of the selected node according to the conversion pattern of the rule elements determined by the rule element determining means;
A connection position determination means for determining a connection position of the partial structure created by the partial structure creation means from the document structure of the creation process;
Partial structure connection means for connecting the partial structure created by the partial structure creation means to the connection position on the document structure of the creation process determined by the connection position determination means;
Document structure conversion device characterized by having a.
前記変換規則管理手段は、規則要素の中に、変換後の部分構造を既生成文書構造のどの位置に接続すべきかを示す接続条件をさらに含み、
前記接続位置決定手段は、前記規則要素決定手段により決定された規則要素の接続条件に従って、部分構造の接続位置を決定する、
ことを特徴とする請求項1記載の文書構造変換装置。
The conversion rule management means further includes, in the rule element, a connection condition indicating to which position in the already-generated document structure the partial structure after conversion should be connected,
The connection position determining means determines the connection position of the partial structure according to the connection conditions of the rule elements determined by the rule element determining means;
The document structure conversion apparatus according to claim 1, wherein:
前記規則要素決定手段は、前記所定の順番として、最初に前記第1の文書構造のルートノードを選択し、兄弟のノードの間では兄のノードを優先的に選択し、兄のノードの子孫のノードが全て選択された後に弟のノードを選択する、
ことを特徴とする請求項1記載の文書構造変換装置。
The rule element determination means first selects a root node of the first document structure as the predetermined order, preferentially selects an older brother node among sibling nodes, and selects descendants of the older brother node. Select brother nodes after all nodes are selected,
The document structure conversion apparatus according to claim 1, wherein:
第1の文書タイプに従った文書構造を第2の文書タイプに従った文書構造に変換する文書構造変換方法であって、
前記第1の文書タイプに従った第1の文書構造が入力されると、前記第1の文書構造中のノードを所定の順番で規則要素決定手段により選択し、
どういう木構造の列によって表される部分構造に変換されるかを示す変換パターンを、前記第1の文書タイプに従った文書構造中のどのノードに適用されるのかを示す適用条件と、選択したノードとを対比することにより、前記選択したノードに適用すべき変換パターンを前記規則要素決定手段により決定し、
決定した変換パターンに従って、前記第1の文書構造中の各ノードの部分構造を部分構造作成手段により作成し、
作成過程の文書構造上の所定の定義に従った接続位置に、作成された部分構造を接続する、
ことを特徴する分文書構造変換方法。
A document structure conversion method for converting a document structure according to a first document type into a document structure according to a second document type,
When the first document structure according to the first document type is input, the nodes in the first document structure are selected by the rule element determination means in a predetermined order;
An application condition indicating which node in the document structure according to the first document type is applied with a conversion pattern indicating what kind of tree structure column is converted into the partial structure is selected. by comparing the node, a conversion pattern to be applied to the selected nodes determined by the rule element determination means,
In accordance with the determined conversion pattern, a partial structure of each node in the first document structure is created by the partial structure creating means ,
Connect the created partial structure to the connection position according to the predetermined definition on the document structure in the creation process.
Min document structure conversion method characterized by.
JP16563696A 1996-06-26 1996-06-26 Document structure conversion apparatus and document structure conversion method Expired - Fee Related JP3617192B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16563696A JP3617192B2 (en) 1996-06-26 1996-06-26 Document structure conversion apparatus and document structure conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16563696A JP3617192B2 (en) 1996-06-26 1996-06-26 Document structure conversion apparatus and document structure conversion method

Publications (2)

Publication Number Publication Date
JPH1011442A JPH1011442A (en) 1998-01-16
JP3617192B2 true JP3617192B2 (en) 2005-02-02

Family

ID=15816134

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16563696A Expired - Fee Related JP3617192B2 (en) 1996-06-26 1996-06-26 Document structure conversion apparatus and document structure conversion method

Country Status (1)

Country Link
JP (1) JP3617192B2 (en)

Also Published As

Publication number Publication date
JPH1011442A (en) 1998-01-16

Similar Documents

Publication Publication Date Title
US7197510B2 (en) Method, system and program for generating structure pattern candidates
US6931590B2 (en) Method and system for managing documents
JP4141556B2 (en) Structured document management method, apparatus for implementing the method, and medium storing the processing program
US7120869B2 (en) Enhanced mechanism for automatically generating a transformation document
CN100565521C (en) Be used for generating the dynamic approach of XML document from database
US7516145B2 (en) System and method for incrementally transforming and rendering hierarchical data files
US20020095410A1 (en) Structured-text cataloging method, structured-text searching method, and portable medium used in the methods
US20070239762A1 (en) Automated interactive visual mapping utility and method for transformation and storage of XML data
JPH11242676A (en) Method for registering structured document, method for retrieving structured document, and portable medium used in these methods
JPH0830620A (en) Structure retrieving device
US20080209572A1 (en) Data Processing System, Data Processing Method, and Management Server
Leung et al. Relational database design using the NIAM conceptual schema
US20090083300A1 (en) Document processing device and document processing method
US5727195A (en) Document retrieving object instructing apparatus
JP2005227851A (en) Method and device for structured data storage
US20080005662A1 (en) Server Device and Name Space Issuing Method
Benson et al. The design and implementation of a hierarchical interface for the multi-lingual database system
Arnon Scrimshaw: A language for document queries and transformations
JP3168829B2 (en) Search formula creation support system
US20090287994A1 (en) Document processing device and document processing method
JP3617192B2 (en) Document structure conversion apparatus and document structure conversion method
JP2006127235A (en) Structured document management system, structured document management method and program
US20080005085A1 (en) Server Device and Search Method
JPH08263277A (en) Automatic generation device for data operation program
JP3610679B2 (en) Document structure conversion apparatus and document structure conversion method

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20041019

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041101

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20071119

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081119

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091119

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101119

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees