JP4995801B2 - Document analysis apparatus, document analysis program, and document analysis method - Google Patents
Document analysis apparatus, document analysis program, and document analysis method Download PDFInfo
- Publication number
- JP4995801B2 JP4995801B2 JP2008280765A JP2008280765A JP4995801B2 JP 4995801 B2 JP4995801 B2 JP 4995801B2 JP 2008280765 A JP2008280765 A JP 2008280765A JP 2008280765 A JP2008280765 A JP 2008280765A JP 4995801 B2 JP4995801 B2 JP 4995801B2
- Authority
- JP
- Japan
- Prior art keywords
- line
- data
- character string
- data length
- hierarchy
- 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.)
- Active
Links
Images
Landscapes
- Information Transfer Between Computers (AREA)
- Document Processing Apparatus (AREA)
Description
本発明は、メールツールにより自動的に改行が行われた場合であっても、引用階層を整形して同一階層内で文の認識処理を行う文書解析装置、文書解析プログラムおよび文書解析方法に関する。 The present invention relates to a document analysis apparatus , a document analysis program, and a document analysis method for recognizing a sentence in the same hierarchy by shaping a citation hierarchy even when a line break is automatically performed by a mail tool.
近年、パソコンの普及率は高く、インターネット環境が整備されるに伴って、電子メールによる海外との情報のやり取りが益々盛んになってきている。また、電子メールの翻訳に機械翻訳を使用する利用者も増えてきている。 In recent years, the penetration rate of personal computers is high, and with the establishment of the Internet environment, the exchange of information with overseas by e-mail has become increasingly popular. In addition, an increasing number of users use machine translation for e-mail translation.
これまでの電子メールの利用者は、学校や企業などにおいて電子メールの記述に関するマナー教育を受けており、一定文字数で改行を挿入するなど、読みやすさを考慮した記述が行われていたが、パソコンの普及により、このようなマナーを知らない利用者も増えてきている。この結果、画面の横幅一杯に文字を入力したり、改行なしで記述されたメールも多数見受けられるようになっている。 Until now, e-mail users have received manners education about writing e-mails at schools and companies, etc., and descriptions such as inserting line breaks with a certain number of characters were taken into consideration, With the spread of personal computers, the number of users who do not know such manners is increasing. As a result, a large number of e-mails can be seen in which characters are entered in the full width of the screen or written without line breaks.
このようなことから、メールソフトによっては、指定した桁数で自動的に折り返す(改行する)機能を有しているものがある。この機能が有効な場合には、明示的に改行したところと、自動折り返しによる改行の二重の改行により、非常に読み難い状態になる。また、メールの返信時には元のメールの引用部分に引用記号が挿入されることにより、さらに改行され返信が繰り返されるうちに、もともとは同じ階層の文であっても階層が乱れてしまい、引用部分か返答部分かを判断するのも困難となる。 For this reason, some mail software has a function to automatically wrap (break) a specified number of digits. When this function is enabled, it becomes very difficult to read due to the line breaks explicitly and double line breaks by automatic wrapping. Also, when replying to an email, a quotation mark is inserted in the quoted portion of the original email, so that the line is broken even if the sentence is originally in the same hierarchy while the reply is repeated and the reply is repeated. It is also difficult to determine whether it is a response part.
そこで、パソコン等から受信したメールを表示した場合に本文が不自然な箇所で改行されないようにするために、受信したメールの本文の改行データを整形して不自然な改行を解消するようにしたものがある(例えば、特許文献1参照)。すなわち、この特許文献1のものは、メール文において、引用文の最初の引用記号を記憶し、改行データを検出するとメールソフトにより自動的に挿入された改行か利用者が意図して挿入した改行かを判断して、自動的に挿入された改行と判断した場合は改行を削除して引用文の一部とし、意図した改行と判断した場合は、前述の引用文の終端に引用終端記号を付与し、画面の表示幅に応じて改行の挿入と、引用文字から引用終端記号の間に存在する文の先頭に引用記号を挿入することで、メール文書の可読性を向上させるという手法をとっている。
しかしながら、特許文献1のものでは、行頭に引用記号を検出した後のデータを検査し、2回目以降の引用記号を検出した場合は削除する。そして、改行データを検出した場合は、改行データの次の文字、すなわち行頭文字が、「 」(スペース)、「(」(開き括弧)、「?」(疑問符)、「数字」、「・」(中黒)、のいずれでもない場合は、自動的に挿入された改行と判断して改行を削除する。また、改行データの一つ前の文字が、句読点、「)」(閉じ括弧)のいずれでもない場合は、自動的に挿入された改行と判断して改行を削除する。
However, in
一方、自動的に挿入された改行ではないと判断した場合は、引用の終端を意味するコードを付与し、画面に表示する場合に、現在の画面幅に合わせた位置で改行を行う。そして、引用部分に相当する文の場合は改行コードに続いて引用記号を付与することで、メール文書の可読性を向上させるというものである。従って、引用の階層が異なる場合でも、同じ階層のデータとして認識されてしまうという問題がある。また、下記に示すようなメールの本文データA1では、数字で始まるため「2」の前の自動的に挿入された改行が削除されないという問題が発生する。 On the other hand, if it is determined that it is not an automatically inserted line break, a code meaning the end of citation is added, and when displaying on the screen, a line break is made at a position that matches the current screen width. In the case of a sentence corresponding to a quoted portion, the readability of the mail document is improved by adding a quote symbol after the line feed code. Therefore, there is a problem that even when the citation layers are different, they are recognized as data of the same layer. Further, since the mail body data A1 as shown below starts with a number, there is a problem in that the automatically inserted line feed before “2” is not deleted.
[メールの本文データA1]
本発明の目的は、複数回のメールのやり取りが行われ引用階層が乱れた場合でも、自動改行データが挿入された場合の規則性を判定することにより、より正確な文の単位が認識できるようにメールの本文データを整形できる、文書解析プログラムおよび文書解析方法を提供することである。
[Mail body data A1]
It is an object of the present invention to recognize a more accurate sentence unit by determining regularity when automatic line feed data is inserted even when a mail is exchanged multiple times and the citation hierarchy is disturbed. To provide a document analysis program and a document analysis method capable of formatting mail body data.
本発明に係わる文書解析装置は、入力装置から入力されたメールの本文データを改行ごとに読み込み各行文字列の文字の数に基づき各行ごとにデータ長を判定するとともに各行文字列の引用記号の数に基づいて各行ごとに引用階層を判定する文書階層判定部と、前記文書階層判定部で判定したデータ長のうちデータ長が最大値の予め定めた範囲内であるデータ長近似最大行の引用階層が次の行の引用階層より大きい場合は前記データ長近似最大行の文字列に含まれる引用記号及び改行を取り除いた文字列と次の行の文字列に含まれる引用記号及び改行を取り除いた文字列との結合文字列の長さが前記データ長の最大値の予め定めた範囲内かどうかを判定し前記結合文字列の長さが前記データ長の最大値の予め定めた範囲内であるときには前記データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定する同一階層判定部と、前記同一階層判定部で同一階層と判定された前記データ長近似最大行とその次の行の文字列を結合して結合文字列とし前記データ長近似最大行の引用階層を表す引用記号を前記結合文字列に付与して新たな行として出力装置に出力する文書整形部とを備える。 The document analysis apparatus according to the present invention reads the mail body data input from the input device for each line feed , determines the data length for each line based on the number of characters in each line character string, and determines the number of quotation marks in each line character string. A document hierarchy determination unit that determines a citation hierarchy for each line based on the document hierarchy, and a citation hierarchy of a data length approximate maximum line that has a data length within a predetermined range of a maximum value among the data lengths determined by the document hierarchy determination unit If is greater than the citation hierarchy of the next line, the character string from which the quotation mark and line feed are removed from the character string of the maximum approximate data length line and the character from which the quotation mark and line feed are removed from the character string of the next line when the length of the coupling length of the string of binding strings and string to determine whether the predetermined range of the maximum value of the data length is within a predetermined range of the maximum value of the data length Above The same hierarchy determination unit that determines that the actual hierarchy of the data length approximate maximum line and the next line is a character string of the same hierarchy, and the data length approximation maximum that is determined to be the same hierarchy by the same hierarchy determination unit A document format that combines a line and the character string of the next line to form a combined character string, adds a quoting symbol representing the citation hierarchy of the line with the approximate maximum data length to the combined character string, and outputs it to the output device as a new line A part .
本発明によれば、複数回のメールのやり取りが行われ引用階層が乱れた場合でも、自動改行データが挿入された場合の規則性を判定することにより、より正確な文の単位が認識できるようにメールの本文データを整形できる。 According to the present invention, it is possible to recognize a more accurate sentence unit by determining regularity when automatic line feed data is inserted even when a plurality of mails are exchanged and the citation hierarchy is disturbed. You can format mail body data.
図1は本発明の実施の形態に係わる文書解析装置11の機能ブロック図であり、図2は本発明の実施の形態に係る文書解析装置のハードウエア構成を示すブロック構成図である。
FIG. 1 is a functional block diagram of a
図2において、文書解析装置11は、例えば一般的なコンピュータに文書解析プログラムなどのソフトウェアプログラムがインストールされ、そのソフトウェアプログラムが演算制御装置12のプロセッサ13において実行されることにより実現される。
In FIG. 2, the
演算制御装置12は文書解析に関する各種演算を行うものであり、演算制御装置12はプロセッサ13とメモリ14とを有し、メモリ14には翻訳に関する文書解析プログラム15が記憶され、プロセッサ13により処理が実行される際には作業エリア16が用いられる。演算制御装置12の演算結果等は出力装置17である表示装置18に表示出力され、また、通信制御装置19を介して通信ネットワークに出力される。
The
入力装置20は演算制御装置12に情報を入力するものであり、例えば、マウス21、キーボード22、ディスクドライブ23、通信制御装置19から構成され、例えば、マウス21やキーボード22は表示装置18を介して演算制御装置12に各種指令を入力し、キーボード22、ディスクドライブ23、通信制御装置19はメールの本文データを入力する。
The
すなわち、ディスクドライブ23はメールの本文データを記憶媒体に入出力するものであり、通信制御装置19は文書解析装置11をインターネットやLANなどの通信ネットワークに接続するものである。通信制御装置19はLANカードやモデムなどの装置であり、通信制御装置19を介して通信ネットワークと送受信したデータは入力信号又は出力信号として演算制御装置12に送受信される。さらに、演算制御装置12の演算結果やメールツールのプログラム等を記憶するハードディスクドライブ(HDD)24が設けられている。
That is, the
図1は本発明の実施の形態に係わる文書解析装置11の機能ブロック図である。図2に示す演算制御装置12内の各機能ブロックは、上述の文書解析プログラム15を構成する各プログラムに対応する。すなわち、プロセッサ13が文書解析プログラム15を構成する各プログラムを実行することで、演算制御装置12は、各機能ブロックとして機能することとなる。また、記憶装置25のブロックは、演算制御装置12内のメモリ14及びハードディスクドライブ24の記憶領域に対応する。
FIG. 1 is a functional block diagram of a
入力処理部26は、外部との入力のインターフェースを行うものであり、インターネットなどの通信制御装置19やキーボード23などの入力装置20を通じてメールの本文データやコマンドを受け取るものである。
The
出力処理部27は、外部との出力のインターフェースを行うものであり、インターネットなどの通信制御装置19や表示装置18などの出力装置17を通じてメールの本文データを出力するものである。
The
制御部28は装置全体の制御を行うものであり、入力処理部26から送られたメールの本文データを記憶装置25のデータ一時記憶部29に記憶したり、文書階層判定部30、同一階層判定部31、文書整形部32、文認識処理部33を制御したり、これらの演算結果を記憶したデータ一時記憶部29の内容を出力処理部27に送り出力装置17に出力したりする。
The
文書階層判定部30は、入力処理部26を介して入手されたメールの本文データの階層を判定するものである。すなわち、メールの本文データの各行文字列の文字の数に基づき各行ごとにデータ長を判定するとともに、各行文字列の引用記号の数に基づいて各行ごとに引用階層を判定する。そして、各行ごとの文字列、データ長及び引用階層を記憶装置25のデータ一時記憶部29に記憶する。
The document
同一階層判定部31は、隣接する行の引用階層が同一階層かどうかを判定するものである。この判定の仕方については後述する。
The same
文書整形部32は、同一階層判定部31で同一階層と判定された行の文字列を結合して結合文字列とし、その引用階層を表す引用記号を結合文字列に付与して新たな行として記憶装置25のデータ一時記憶部29に記憶するものである。
The
文認識処理部33は、文書整形部32により新たに付与された行を含むメールの本文データの隣接する同一階層の行を結合し、結合文字列内の句点の位置で一文と判定し、その一文ごとの文の先頭にその引用階層の引用記号を付した文字列を作成し、記憶装置25のデータ一時記憶部29に記憶するものである。
The sentence
次に、本発明の実施の形態に係わる文書解析装置11の実施例1の動作について説明する。図3は、本発明の実施の形態に係わる文書解析装置11の実施例1の動作を示すフローチャートである。
Next, operation | movement of Example 1 of the
入力装置20から演算処理装置12にメールの本文データが入力されると、制御部28は入力処理部26を起動し、入力処理部26はメールの本文データの改行毎にデータを読み込む(S201)。いま、下記のようなメールの本文データA2が読み込まれたとする。
When mail text data is input from the
[メールの本文データA2]
このメールの本文データA2は、以下に示すメールの本文データA3がメールツールの設定により全角20文字の位置で自動的に改行され、1度目の返信時に「はい。」が挿入され、さらに2度の転送が行われたものである。
[Mail body data A2]
In the mail body data A2, the mail body data A3 shown below is automatically broken at a position of 20 full-width characters according to the setting of the mail tool, and “Yes” is inserted at the first reply, and then twice. Has been transferred.
[メールの本文データA3]
メールの本文データA2及びメールの本文データA3から分かるように、メールの本文データA2は、本来同一行であった文字が自動改行により異なる行になった上、引用階層も異なった状態になってしまったものである。
[Mail body data A3]
As can be seen from the mail body data A2 and the mail body data A3, the mail body data A2 has different characters due to the automatic line feed, and the citation hierarchy is also different. It is a fool.
入力処理部26により読み込まれたメールの本文データA2は記憶装置25のデータ一時記憶部29に記憶される。表1は、記憶装置25のデータ一時記憶部29に記憶されたメールの本文データA2のテーブルの一例を示している。
表1に示すように、配列番号はメールの本文データの各行毎のデータに付された番号であり、データは本文データの各行毎の文字列である。長さは本文データの各行毎のデータの長さ(文字列の数)であり、引用階層はメールの返信の回数を示す階層である。表1では、メールの本文データA2を読み込んだままデータを記憶しているので、長さ及び引用階層は空白となっている。 As shown in Table 1, the array element number is a number assigned to each line of mail body data, and the data is a character string for each line of body data. The length is the data length (number of character strings) for each line of the body data, and the citation hierarchy is a hierarchy indicating the number of mail replies. In Table 1, since the data is stored while the mail body data A2 is read, the length and citation hierarchy are blank.
メールの本文データA2が改行毎に読み込まれ、記憶装置25のデータ一時記憶部29に表1のように記憶されると、制御部28は文書階層判定部30が起動され、文書階層判定が行われる(S202)。
When the mail body data A2 is read for each line feed and stored in the data
図4は、文書階層判定部30の文書階層判定の処理内容を示すフローチャートである。文書階層判定部30での文書階層判定は、メールの本文データの階層を判定するものである。
FIG. 4 is a flowchart showing the processing contents of document hierarchy determination of the document
まず、文書階層判定部30は、行データ指定変数iに初期値「1」をセットし(S301)、記憶装置25のデータ一時記憶部29に記憶されているメールの本文データA2の配列番号がi番目のデータSiを取得する(S302)。iが「1」であるときは、データS1として(>>> メールツールの設定が、「メール送信時)が取得される。
First, the document
次に、引用階層を示す変数L、データSiの各要素を指定する変数N、引用記号配列の位置を示す変数Mに初期値「1」をセットする(S303)。引用階層を示す変数Lはメールの返信の回数を示す変数であり、データSiの各要素を指定する変数NはデータSiの要素(文字列)の位置を指定する変数であり、引用記号配列の位置を示す変数Mは引用記号を指定するための変数である。表2に引用記号配列のテーブルの一例を示す。
引用記号配列の位置を示す変数Mが「1」であるときは、引用記号として「>」が取得され、引用記号配列の位置を示す変数Mが「2」であるときは、引用記号として「|」が取得される。 When the variable M indicating the position of the reference symbol array is “1”, “>” is acquired as the reference symbol, and when the variable M indicating the position of the reference symbol array is “2”, the reference symbol “ | "Is acquired.
次に、引用記号配列の位置を示す変数Mが指示する位置の引用記号CMを取得する(304)。そして、変数Nから始まるデータSiの文字は引用記号CMと一致したかどうかを判定し(S305)、一致しない場合は、引用記号CMは最後のデータか判定し(S306)、引用記号CMが最後のデータではない場合はM=M+1を行い(S307)、ステップS304に戻る。これにより、ステップS304では、引用記号CMとして「|」が取得されることになる。このようにして、データSiの先頭からデータSiの文字が表2に示される引用記号配列に格納されている各引用記号と一致するかどうかを判定していくことになる。 Next, the quote symbol CM at the position indicated by the variable M indicating the position of the quote symbol array is acquired (304). Then, it is determined whether or not the character of the data Si starting from the variable N matches the quote symbol CM (S305). If not, it is determined whether the quote symbol CM is the last data (S306), and the quote symbol CM is the last one. If not, M = M + 1 is performed (S307), and the process returns to step S304. Thereby, in step S304, “|” is acquired as the quotation symbol CM. In this way, it is determined from the beginning of the data Si whether or not the character of the data Si matches each quote symbol stored in the quote symbol array shown in Table 2.
いま、i、L、N、Mがいずれも「1」であるとする。iが「1」である1行目のデータS1は(>>> メールツールの設定が、「メール送信時)である。ステップS304の判定においては、変数Mは1であるので、引用記号CMは「>」であり、変数N(=1)が示す位置のデータSi(S1)が示す文字は「>」である。従って、ステップS305での判定では、変数N(=1)から始まるデータSi(S1)の文字「>」は引用記号CM(=>)と一致するので、ステップS308に進む。 Assume that i, L, N, and M are all “1”. The data S1 in the first row where i is “1” is (>>> the mail tool setting is “at the time of mail transmission.” In the determination of step S304, the variable M is 1, so the quotation mark CM Is “>”, and the character indicated by the data Si (S1) at the position indicated by the variable N (= 1) is “>”. Accordingly, in the determination in step S305, the character “>” of the data Si (S1) starting from the variable N (= 1) matches the quotation mark CM (=>), and the process proceeds to step S308.
ステップS308では、データSiの判定開始位置を示す変数Nに、一致した引用記号CM「>」の長さを加える。これにより、変数Nを次の判定開始位置に更新する。また、引用階層を示す変数Lに1を加えてL+1とし、変数Lを次の引用階層に更新する。なお、引用記号配列の位置を示す変数MはM=1のままとする。変数Mの更新はステップS307で行われるからである。また、データSiのN番目の位置がスペースである場合には、変数Nに1を加えてN+1とし、変数Nを次の判定開始位置に更新する。 In step S308, the length of the matching reference symbol CM “>” is added to the variable N indicating the determination start position of the data Si. Thereby, the variable N is updated to the next determination start position. Further, 1 is added to the variable L indicating the citation hierarchy to obtain L + 1, and the variable L is updated to the next citation hierarchy. Note that the variable M indicating the position of the reference symbol array remains M = 1. This is because the variable M is updated in step S307. If the Nth position of the data Si is a space, 1 is added to the variable N to obtain N + 1, and the variable N is updated to the next determination start position.
そして、ステップS304の処理に戻り、ステップS305においてデータSiの変数Nの位置の文字が引用記号CMと一致しなくなるまで、ステップS304、S305、S308を繰り返し行う。ステップS305においてデータSiの変数Nの位置の文字が引用記号CMと一致しなくなるとステップS306に移行し、引用記号CMが最後のデータになるまで、ステップS304、S305、S308を繰り返し行う。 Then, returning to the process of step S304, steps S304, S305, and S308 are repeated until the character at the position of the variable N in the data Si does not match the quote symbol CM in step S305. If the character at the position of the variable N in the data Si does not match the quote symbol CM in step S305, the process proceeds to step S306, and steps S304, S305, and S308 are repeated until the quote symbol CM becomes the last data.
ステップS306の判定で、引用記号CMが最後のデータになったと判定されると、ステップS309に進む。ステップS309では、メールツールによっては引用記号CMとともにスペースが挿入される場合があるため、スペースに対する評価を行う。SiデータのN番目がN≠1、かつN番目の文字はスペース、かつN−1番目の文字はスペースではないかどうかを判定し、そうである場合には、スペースは引用記号として扱いS308に進む。ステップS309の条件を満たさない場合は、引用階層を示す変数LとともにデータSi、データSiの長さをデータ一時記憶部29に記憶する(S310)。これにより、表3に示すように、メールの本文データの1行目のデータS1については、データS1の長さは40、引用階層は4が記憶される。データS1の長さは半角文字数で示され、引用階層は引用記号CMの数とスペースとの合計で示されている。
次に、データSiは最後の行かどうかを判定し(S311)、最後の行でないときは、行データ指定変数iに1を加算して(S312)、ステップS302に戻る。これにより、2行目以降に対しても同様の処理を行い、最後の行に達すると処理を終了する。このとき、記憶装置25のデータ一時記憶部29に記憶されたメールの本文データA2のテーブルは、表4に示すように、各行のSiに対して、データS1の長さ及び引用階層が記憶される。
このようにして、文書階層判定部30によりメールの本文データの階層が判定されると、同一階層判定部31は、隣接する行の引用階層が同一階層かどうかを判定する。同一階層判定部31は、図3のステップS203において、記憶装置25のデータ一時記憶部29に記憶された表4に示すメールの本文データA2のテーブルより、メールの本文データA2のデータSiのうち引用階層の最大値n及びデータ長の最大値MAXを取得しデータ一時記憶部29に記憶する。また、行データ指定変数iに「1」をセットし、ループ変数Jに「1」をセットする(S203)。
In this way, when the hierarchy of the mail body data is determined by the document
続いて、同一階層判定部31は、表4に示すメールの本文データA2より、i番目のデータSiと引用階層Liを取得する(S204)。そして、取得したデータSiの長さがデータ長最大値MAXの近似範囲にあるデータ長近似最大行かどうかを判定する。すなわち、同一階層判定部31は、データSiの長さ>MAX−補正値であるかどうかを判断する(S205)。ここで、補正値はデータ長最大値MAXの±2を近似値として判断する。この補正値はユーザにより設定できるようにしてもよい。補正値を設定するのは、例えば、引用階層の一部にスペースが挿入されたり、英語の場合には単語間にスペースが入るので、その影響を考慮するためである。
Subsequently, the same
ステップS205の判定で、データSiの長さがデータ長近似最大行であると判定されたときは、同一階層判定部31は、次の行であるi+1行目のデータSi+1が取得できるかどうかを判定し(S206)、データSi+1が取得できるとときは、次の行であるi+1行目のデータSi+1と引用階層Li+1とを取得する(S207)。
When it is determined in step S205 that the length of the data Si is the data length approximate maximum row, the same
そして、同一階層判定部31は、データ長近似最大行であるデータSiの引用階層LiがデータSi+1の引用階層Li+1よりも大きく、かつ、データSiとデータSi+1との引用記号部分を取り除いた長さを加えた値が、データ長最大値MAXの近似値かを判定する。すなわち、Li>Li+1かつ引用記号を取り除いたSiとSi+1の長さがMAX近似値内かどうかを判定する(S208)。ステップS208の条件を満たした場合には、同一階層判定部31は、データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定する。これは、データSi+1はもともとデータSiの一部であったが自動改行により改行が挿入されたデータと判定できるからである。
Then, the same
次に、文書整形部32は、Si+1の引用記号を取り除きSiに結合する(S209)。すなわち、データSi+1の先頭からの引用記号を取り除き、データSiのデータの最後に結合する。この場合の引用記号には、引用記号に付加される引用記号に続く最初のスペースも含まれる。
Next, the
そして、文書整形部32は、データSi+1が最後のデータであるかどうかを判定し(S210)、最後のデータでない場合には、i=i+2とし(S211)、ステップS204に戻る。文書整形部32は、データSiが最後のデータである場合はJ=J+1とし(S212)、ループ変数Jが引用階層の最大値nと等しいかどうかを判断する。すなわち、J=nかどうかを判断し(S213)、J=nでないときはi=1とし(S214)、ステップS204に戻り、ステップS204〜S214の処理を繰り返し行う。
Then, the
なお、ステップS205の判定でデータSiの長さがデータ長近似最大行でないと判定されたとき、ステップ208の判定でステップS208の条件を満たさなかった場合はステップS210に進む。また、ステップS206の判定でSi+1が取得できなかったときはステップS212に進む。
When it is determined in step S205 that the length of the data Si is not the data length approximate maximum row, if the determination in
ここで、1回目のステップS204〜S214の処理が完了した時点では、表4に示すメールの本文データA2の配列番号1、2、配列番号4、5、配列番号7、8がそれぞれ結合され、表5に示すようなメールの本文データとなる。
さらに、ループ変数Jが引用階層の最大値nと等しくなるまで、S204〜S214の処理を繰り返すことにより、表6に示すようなメールの本文データとなり、自動改行により乱れた引用階層が整形される。
このように、文書整形部32は同一階層と判定されたデータ長近似最大行とその次の行の文字列とを結合して結合文字列とし、データ長近似最大行の引用階層を表す引用記号を結合文字列に付与して新たな行として、記憶装置25のデータ一時記憶部29に記憶する。
In this way, the
続いて、表6に示す引用階層が整形されたメールの本文データに対して文認識処理が行われる(S215)。図5は、文認識処理部33の文認識処理の処理内容を示すフローチャートである。文認識処理部33での文認識処理は、文書整形部32により新たに付与された行を含むメールの本文データの隣接する同一階層の行を結合し、文の文字列とするものである。
Subsequently, sentence recognition processing is performed on the body data of the mail in which the citation hierarchy shown in Table 6 is shaped (S215). FIG. 5 is a flowchart showing the processing content of the sentence recognition processing of the sentence
表6に示す文書整形されたメールの本文データの各行からデータSiを取り出すために、図5に示すように、まず、行データ指定変数iに初期値「1」をセットする(S401)。 In order to extract the data Si from each line of the text data of the document-shaped mail shown in Table 6, first, an initial value “1” is set to the line data designation variable i as shown in FIG. 5 (S401).
続いてi番目のデータSiを取得し、取得したデータSiの引用記号を取り除いてデータ一時記憶部29の文認識処理記憶領域に格納する。すなわち、データSiから引用記号を取り除いてデータ一時記憶部に格納する(S402)。そして、取り除いた引用記号の引用階層Liをデータ一時記憶部29に記憶する(S403)。この取り除いた引用記号の引用階層Liはデータ一時記憶部29の引用階層記憶領域に記憶しておくことになる。次に、i番目の位置から引用階層が異なるデータが出現するまで処理を繰り返すためのループカウンタの役割を行う変数pに初期値「1」をセットする(S404)。
Subsequently, the i-th data Si is acquired, the quotation mark of the acquired data Si is removed, and the i-th data Si is stored in the sentence recognition processing storage area of the temporary
続いてデータSi+pの引用記号の引用階層は取得できたかどうかを判定し(S405)、データSi+pの引用記号の引用階層が取得できなかったときは処理を終了する。一方、データSi+pの引用記号の引用階層が取得できたときは、データSiの引用階層LiとデータSi+pの引用階層とが同じかどうかを判定する(S406)。引用階層が同じである場合は、データSi+pの引用記号の文字列を削除し、データSi+pの末尾に改行コードを付与してデータ一時記憶部29に記憶する(S407)。これらのデータは、データ一時記憶部29の文認識処理記憶領域に追加して記憶されることになる。そして、次のデータを取得するために変数pをp=p+1とし(S408)、ステップS405に戻る。
Subsequently, it is determined whether or not the citation hierarchy of the citation symbol of the data Si + p can be acquired (S405). If the citation hierarchy of the citation symbol of the data Si + p cannot be acquired, the process ends. On the other hand, when the citation hierarchy of the citation symbol of the data Si + p is acquired, it is determined whether the citation hierarchy Li of the data Si and the citation hierarchy of the data Si + p are the same (S406). If the citation hierarchies are the same, the character string of the citation symbol of the data Si + p is deleted, a line feed code is added to the end of the data Si + p, and stored in the data temporary storage unit 29 (S407). These data are additionally stored in the sentence recognition processing storage area of the data
ステップS406の判定で、引用階層が異なるデータSiが出現した場合は、文認識処理記憶領域のデータを基に文の判定処理を行う(S409)。この場合、
文認識処理記憶領域のデータは、表7に示すように、引用階層が同じデータが格納されたメール本文データとなっている。
As shown in Table 7, the data in the sentence recognition processing storage area is mail text data in which data having the same citation hierarchy is stored.
ステップS409での文判定処理では、例えば、「。」などの句点を文末と判断して、「メールツールの設定が…になっている。」を切り出す。続いて、「全」から次に出現する「。」までを一文とする。続いて「以上」を一文とする。 In the sentence determination processing in step S409, for example, a phrase such as “.” Is determined as the end of the sentence, and “Mail tool setting is... Subsequently, a sentence from “all” to “.” That appears next is taken as one sentence. Next, “above” is a sentence.
最後まで達したら、文毎の先頭に引用記号を挿入する(S410)。すなわち、データ一時記憶部29の引用階層記憶領域に一時的に記憶した引用記号の文字列を各々の文の先頭に付加すると、表8に示すようなメールの本文データとなる。
そして、データSiは最後のデータかどうかを判定し(S411)、最後のデータまで達していない場合は、変数iをp分進めるべくi=i+pとし(S412)、ステップS402に戻り、データSi+pからS402〜S411の処理を繰り返し行う。これにより、表9に示すように、「はい。」が文認識処理の対象となり、「はい。」が文の単位として取得される。
そして、「はい。」に一時的に記憶した引用記号の文字列を挿入すると、表10に示すようなメールの本文データが得られる。
本発明の実施の形態の実施例1によれば、メールツールの設定により自動的に改行が行われ、メールの書き手が同じで階層が異なるデータとなった場合であっても、自動的に挿入された改行により乱れた階層を整形して、同一階層内で文の認識処理を行うので、文の認識精度を向上させることができる。このように、改行により乱れた階層を整形して文の認識精度を向上できるので、翻訳対象となるメールの本文データの翻訳精度も向上できる。例えば、翻訳装置では正しい翻訳結果を得るためには、翻訳対象となる文の単位を正確に認識する必要があるが、その要請にも応えることができる。 According to Example 1 of the embodiment of the present invention, line breaks are automatically made according to the setting of the mail tool, and even when the data is the same in the writer of the mail and in a different hierarchy, it is automatically inserted. Since the layer disturbed by the line break is shaped and the sentence recognition process is performed in the same layer, the sentence recognition accuracy can be improved. As described above, the accuracy of the sentence recognition can be improved by shaping the layer disturbed by the line feed, so that the translation accuracy of the mail body data to be translated can also be improved. For example, in order to obtain a correct translation result in a translation apparatus, it is necessary to accurately recognize a sentence unit to be translated, but the request can be met.
次に、本発明の実施の形態に係わる文書解析装置11の実施例2の動作について説明する。図6は、本発明の実施の形態に係わる文書解析装置11の実施例2の動作を示すフローチャートである。この実施例2は、図3に示すフローチャートのステップS208の条件が満たされないと判定された場合に、引用階層LiがデータSi+1の長さより大きいかどうかを判定するステップS208aを追加して設けたものである。
Next, the operation of Example 2 of the
これにより、同一階層判定部31は、ステップS208の条件を満たさないとき、すなわち、データ長近似最大行の引用階層Liが次の行の引用階層Li+1より大きく、かつ結合文字列の長さがデータ長の最大値の近似範囲内ではないときは、データ長近似最大行の引用階層Liと次の行の文字列とを比較し、データ長近似最大行の引用階層が次の行の文字列より大きいときは、データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定するようにしたものである。
As a result, when the same
いま、メール本文データとして、次に示すメール本文データA4を用いて説明する。 Now, description will be made using the following mail body data A4 as mail body data.
[メール本文データA4]
[Mail text data A4]
メール本文データA4は、11文字目で明示的に改行を入れたデータが複数回のメールのやりとりにより、メールツールの設定により20文字で自動的に折り返され、本来同一の階層のデータが異なる階層になったものである。メール本文データA4は、図6のステップS208までの処理で表11に示すメール本文データとなる。
表11のメール本文データに対して、図6のステップS208において、1番目のデータS1の引用記号を取り除いた「メールツールの設定」と2番目のデータS2の「が」とを結合したデータの長さは20となる。従って、ステップS208では、データ長最大値MAXである39の近似値と判定されず、1番目のデータS1と2番目のデータS2とは結合しないと判定される。 For the mail body data in Table 11, in step S208 of FIG. 6, the data obtained by combining “setting of mail tool” obtained by removing the quotation mark of the first data S1 and “ga” of the second data S2. The length is 20. Therefore, in step S208, it is not determined that the approximate value is 39, which is the maximum data length value MAX, and it is determined that the first data S1 and the second data S2 are not combined.
そこで、実施例2では、図6のステップS208で結合しないと判定された場合に、2番目のデータS2の長さと1番目のデータS1の引用階層L1とを比較し、2番目のデータS2の長さが1番目のデータS1の引用階層L1より小さい場合は、同一階層のデータであると判定する(S208a)。そして、文書整形部32は、ステップS208aの判定に基づきデータSiとデータSi+1とを結合することになる。
Therefore, in the second embodiment, when it is determined in step S208 in FIG. 6 that they are not combined, the length of the second data S2 is compared with the citation hierarchy L1 of the first data S1, and the second data S2 When the length is smaller than the citation hierarchy L1 of the first data S1, it is determined that the data is in the same hierarchy (S208a). Then, the
この、図6のフローチャートにおいて、1回目のステップS204〜S214の処理で、表12に示すメール本文データとなる。
そして、2回目のステップS204〜S214の処理で表13に示すメール本文データとなる。
2回目のS204〜S214の処理で表13に示すメール本文データのようにデータの階層が同じとなるため、図6のステップS213において、変数Jが引用階層の最大値nに達するか、または処理結果が前回と同じである場合は、文書整形部32の処理を終了し(S213)、文認識処理に移行する(S215)。
Since the data hierarchy is the same as the mail body data shown in Table 13 in the second processing of S204 to S214, the variable J reaches the maximum value n of the citation hierarchy in step S213 in FIG. If the result is the same as the previous time, the process of the
以上の説明では、同一階層判定部31は、ステップS208の条件を満たさないときは、データ長近似最大行の引用階層Liと次の行の文字列とを比較し、データ長近似最大行の引用階層が次の行の文字列より大きいときは、データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定するようにしたが、データ長近似最大行の引用階層と予め定めた引用階層閾値とを比較し、データ長近似最大行の引用階層が予め定めた引用階層閾値以上であるときは、データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定するようにしてもよい。また、データ長近似最大行の次の行の文字列と予め定めた文字数とを比較し、データ長近似最大行の次の行の文字列が予め定めた文字数以下であるときは、データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定するようにしてもよい。
In the above description, when the condition of step S208 is not satisfied, the same
本発明の実施の形態の実施例2によれば、実施例1の効果に加え、引用階層が深い場合であっても、自動的に挿入された改行により乱れた階層を整形できる。 According to Example 2 of the embodiment of the present invention, in addition to the effect of Example 1, even when the citation hierarchy is deep, it is possible to shape a hierarchy that is disturbed by a line feed that is automatically inserted.
次に、本発明の実施の形態に係わる文書解析装置11の他の一例を説明する。図7は本発明の実施の形態に係わる文書解析装置11の他の一例の機能ブロック図である。文書解析装置11のハードウエア構成は、図2に示した構成と同じである。
Next, another example of the
入力処理部26は、外部との入力のインターフェースを行うものであり、インターネットなどの通信制御装置19やキーボード23などの入力装置20を通じてメールの本文データやコマンドを受け取るものである。
The
出力処理部27は、外部との出力のインターフェースを行うものであり、インターネットなどの通信制御装置19や表示装置18などの出力装置17を通じてメールの本文データを出力するものである。
The
制御部28は装置全体の制御を行うものであり、入力処理部26から送られたメールの本文データを記憶装置25のデータ一時記憶部29に記憶したり、行結合判定閾値算出部34、結合行判定部35、データ整形部36を制御したり、これらの演算結果を記憶したデータ一時記憶部29の内容を出力処理部27に送り出力装置17に出力したりする。
The
行結合判定閾値算出部34は、記憶装置35に記憶されたメールの本文データを行ごとに読み出して各行文字列の文字の数に基づき、各行ごとにデータ長を判定して記憶装置に記憶するとともに記憶装置に記憶されたデータ長の最大値とその最大値以外で出現頻度が高いデータ長の値との差分を行結合判定閾値として算出する。
The line combination determination threshold
結合行判定部35は、記憶装置25に記憶されたメールの本文データを行ごとに読み出し、読み出した行のデータ長が最大値の近似範囲であり、その行のデータ長と次の行のデータ長との差が行結合判定閾値算出部34で算出された行結合判定閾値の近似範囲であるときは、読み出した行及びその次の行に行結合の指標である繰り返し情報を付与して記憶装置25に記憶するものである。
The combined
データ整形部36は、記憶装置25に記憶されたメールの本文データを行ごとに読み出し、読み出した行の結合行判定部35で付与された繰り返し情報で行間の結合が指示されているときは、行を結合して結合文字列を記憶部25に記憶するものである。
The
次に、図7に示した本発明の実施の形態の文書解析装置の他の一例の動作について説明する。図8は本発明の実施の形態の文書解析装置の他の一例の動作を示すフローチャートである。 Next, the operation of another example of the document analysis apparatus according to the embodiment of the present invention shown in FIG. 7 will be described. FIG. 8 is a flowchart showing the operation of another example of the document analysis apparatus according to the embodiment of the present invention.
いま、入力処理部26より、次に示すメールの本文データA5が入力されたとする。
Assume that the following mail body data A5 is input from the
「メールの本文データA5」
“Mail text data A5”
メールの本文データA5は、以下に示すメールの本文データA6がメールツールの設定により、全角20文字の位置で改行されたものである。 The mail body data A5 is obtained by cutting the following mail body data A6 at a position of 20 full-width characters according to the setting of the mail tool.
「メールの本文データA6」
"Mail text data A6"
入力装置20から演算処理装置12にメールの本文データA5が入力されると、制御部28は入力処理部26を起動し、入力処理部26はメールの本文データA5の改行毎に記憶部25のデータ一時記憶部29にデータを読み込む(S801)。表14はデータ一時記憶部29の入力データ記憶領域に記憶されたメールの本文データA5を示している。
次に、制御部28は行結合判定閾値算出部34を起動する。行結合判定閾値算出部34は、記憶装置35のデータ一時記憶部29の入力データ記憶領域に記憶されたメールの本文データA5を行ごとに読み出して各行文字列の文字の数に基づき各行ごとに各行のデータ長を判定し(S802)、記憶装置35のデータ一時記憶部29に記憶し、記憶装置25のデータ一時記憶部29に記憶したデータ長の最大値とその最大値以外で出現頻度が高いデータ長の値との差分を行結合判定閾値として算出する(S803)。
Next, the
すなわち、行結合判定閾値算出部34は、表14のメールの本文データA5に対して、改行毎にデータを読み込み各行のデータ長さを調べ、その結果を表15に示すようなメールの本文データとして記憶装置25のデータ一時記憶部29に記憶する。
そして、表15のメールの本文データより、データ長最大値と、その最大値以外で出現頻度が高いデータ長とを検出し、データ長最大値から出現頻度が高いデータ長を引いた値を行結合判定閾値とする。 Then, the data length maximum value and a data length having a high appearance frequency other than the maximum value are detected from the body data of the mail in Table 15, and a value obtained by subtracting the data length having a high appearance frequency from the maximum data length is calculated. It is set as a combination determination threshold value.
ここで、表15のメールの本文データでは、データ長最大値が40、出現頻度が高いデータ長が10であるので、ステップS803で算出される行結合判定閾値は30となる。 Here, in the mail text data of Table 15, the maximum data length value is 40 and the data length with high appearance frequency is 10, so the row combination determination threshold value calculated in step S803 is 30.
次に、行結合判定部35は、行データ指定変数iに初期値「1」をセットし(S804)、繰り返し情報を示す変数Qに初期値「1」をセットする(S805)。行データ指定変数iは表15のメールの本文データから各行のデータSiを取得するための変数iであり、変数Qは行結合を判定するための変数である。
Next, the row
そして、行結合判定部35は、表15のメールの本文データからデータSiの文字列及びデータSiの長さを取得する(S806)。これにより、データSiの文字列として(メールツールの設定が、「メール送信時に2)が取得され、データSiの長さとして40が取得される。これらのデータが取得できたかどうかを判定し(S807)、データが取得できない場合は、繰り返し情報の変数Qに「0」をセットし(S808)、行結合判定部35は表16のメールの本文データの繰り返し情報には「0」を記憶し処理を終了する。
行結合判定部35は、データSiの文字列及びデータSiの長さが取得できたときは、データSiの長さがデータ長最大値MAXの近似範囲であるかどうかを判定する(S809)。近似範囲はデータ長最大値MAXから補正値を引いた値を最大値の近似範囲判定値とする。MAX−補正値<|データSiの長さ|<MAXとする。ここでは、補正値を例えば2とするが利用者が任意の値を設定できるようにしてもよい。
When the character string of the data Si and the length of the data Si can be acquired, the row
データSiの長さがデータ長最大値MAXの近似範囲でないときは、行結合判定部35は、データSiの行が繰り返しの対象にはならないと判断し、繰り返し情報の変数Qに「0」をセットし(S810)、変数iに1を加えてi=i+1とし(S811)、ステップS805の処理に戻る。この場合、表16のメールの本文データの繰り返し情報には「0」が記憶される。
When the length of the data Si is not within the approximate range of the data length maximum value MAX, the row
ステップS809の判定で、データSiの長さがデータ長最大値MAXの近似範囲である場合は、次のデータSi+1の文字列とデータSi+1の長さとを取得する(S812)。これにより、データSi+1の文字列として(0文字で自)、データSi+1の長さとして10が取得される。データが取得できない場合は、これらのデータが取得できたかどうかを判定し(S813)、繰り返し情報の変数Qに「0」をセットし(S808)、行結合判定部35は表16のメールの本文データの繰り返し情報には「0」を記憶し処理を終了する。
If it is determined in step S809 that the length of the data Si is within the approximate range of the data length maximum value MAX, the character string of the next data Si + 1 and the length of the data Si + 1 are acquired (S812). Thus, 10 is acquired as the character string of the data Si + 1 (0 character is self) and the length of the data Si + 1. If the data cannot be acquired, it is determined whether or not these data have been acquired (S813), the variable Q of the repetition information is set to “0” (S808), and the row
行結合判定部35は、データSi+1の文字列及びデータSi+1の長さが取得できたときは、データSiの長さとデータSi+1の長さとの差分を算出する(S814)。続いて、その差分が行結合判定閾値と近似範囲であるかどうかを判定する(S815)。ここでは、差分は30であるので、行結合判定閾値と近似範囲であるため、表16のメールの本文データのデータSiとデータSi+1との繰り返し情報に変数Qの値(Q=1)をセットし、Q=Q+1とする(S816)。
When the character string of the data Si + 1 and the length of the data Si + 1 can be acquired, the row
一方、ステップS815の判定で、差分が行結合判定閾値と近似範囲ではない場合には、繰り返し情報の変数Qに「0」をセットし(S817)、行結合判定部35は表16のメールの本文データの繰り返し情報には「0」を記憶する。そして、データSi+1が最後のデータかどうかを判定し(S818)、データSi+1が最後のデータである場合は、行結合判定部35は処理を終了し、次のデータ整形処理に移行する(S819)。一方、最後のデータではない場合は、変数iに2を加えてi=i+2とし(S820)、ステップS806に戻る。
On the other hand, if it is determined in step S815 that the difference is not within the approximate range of the row combination determination threshold, “0” is set to the variable Q of the repetition information (S817), and the row
続いて、表16に示す繰り返し情報が付与されたメールの本文データに対してデータ整形処理が行われる(S819)。図9は、データ整形部36のデータ整形の処理内容を示すフローチャートである。データ整形部36でのデータ整形処理は、読み出した行に付与された繰り返し情報で行間の結合が指示されているときは、行を結合して結合文字列を作成しデータを整形するものである。
Subsequently, a data shaping process is performed on the body data of the mail with the repetition information shown in Table 16 (S819). FIG. 9 is a flowchart showing the contents of the data shaping process of the
まず、表16に示す繰り返し情報が付与されたメールの本文データにアクセスするための行データ指定変数iに「1」をセットするとともに、繰り返し状態変数Kに「0」をセットする(S901)。 First, “1” is set to the row data designation variable i for accessing the mail body data to which the repetition information shown in Table 16 is assigned, and “0” is set to the repetition state variable K (S901).
続いて、表16に示すメールの本文データよりデータSiの文字列とデータSiの繰り返し情報とを取得する(S902)。これらのデータが取得できたかどうかを判定し(S903)、データが取得できない場合は、データ整形部36は処理を終了する。データSiの文字列とデータSiの繰り返し情報とが取得できた場合は、繰り返し情報が0か否かを判定する(S904)。
Subsequently, the character string of the data Si and the repetitive information of the data Si are acquired from the mail body data shown in Table 16 (S902). It is determined whether or not these data can be acquired (S903). If the data cannot be acquired, the
繰り返し情報が0の場合は、次の行とは結合しないため、データSiに改行を付与して整形し、その整形結果したデータSiを記憶する(S905)。この場合、データSiは記憶装置25のデータ一時記憶部29の整形結果記憶領域に記憶される。そして、変数iに1を加算しi=i+1として(S906)、ステップS902に戻る。
If the repetitive information is 0, it is not combined with the next line. Therefore, the data Si is given a line feed and is shaped, and the data Si obtained as a result of the shaping is stored (S905). In this case, the data Si is stored in the shaping result storage area of the data
繰り返し情報が0以外の場合は、データSiの次のデータSi+1の文字列とデータSi+1の繰り返し情報とを取得する(S907)。これらのデータが取得できたかどうかを判定し(S908)、データが取得できない場合は、データ整形部36は処理を終了する。
If the repetition information is other than 0, the character string of the data Si + 1 next to the data Si and the repetition information of the data Si + 1 are acquired (S907). It is determined whether or not these data have been acquired (S908). If the data cannot be acquired, the
データSi+1の文字列とデータSi+1の繰り返し情報とが取得できた場合には、データSi+1の次のデータSi+2の繰り返し情報を取得する(S909)。データSi+2の繰り返し情報が取得できたかどうかを判定し(S910)、データSi+2の繰り返し情報が取得できた場合は0か否かを判定する(S911)。 When the character string of the data Si + 1 and the repetition information of the data Si + 1 can be acquired, the repetition information of the data Si + 2 next to the data Si + 1 is acquired (S909). It is determined whether or not the repetition information of the data Si + 2 has been acquired (S910). If the repetition information of the data Si + 2 has been acquired, it is determined whether or not it is 0 (S911).
ステップS910の判定でSi+2の繰り返し情報が取得できない場合、または、ステップS911の判定でデータSi+2の繰り返し情報が0の場合は、変数Kは「1」がどうかを判定する(S912)。ステップS912の判定で変数Kの値が「1」である場合は、データSiの文字列とデータSi+1の文字列とを結合して末尾に改行を付与し、記憶装置25のデータ一時記憶部29の整形結果記憶領域に記憶する。すなわち、SiとSi+1とを結合して記憶する(S913)。繰り返し変数Kが「1」以外の場合は、データSiとデータSi+1の末尾にそれぞれ改行を付与し、記憶装置25のデータ一時記憶部29の整形結果記憶領域に記憶する。すなわち、SiとSi+1とそれぞれ記憶する(S914)。そして、繰り返し状態が解除されるため、変数Kに「0」をリセットする(S915)。
If the repetition information of Si + 2 cannot be acquired in the determination in step S910, or if the repetition information of data Si + 2 is 0 in the determination in step S911, it is determined whether or not the variable K is “1” (S912). If the value of the variable K is “1” in the determination in step S912, the character string of the data Si and the character string of the data Si + 1 are combined to add a line feed at the end, and the temporary
一方、ステップS911の判定で、データSi+2の繰り返し情報が「0」以外の場合は、データSiとデータSi+1とデータSi+2とデータSi+3とが一定の規則で連続する行と判断できる。そこで、データSiの文字列とデータSi+1の文字列とを結合して末尾に改行を付与し、記憶装置25のデータ一時記憶部29の整形結果記憶領域に記憶する。すなわち、SiとSi+1とを結合して記憶する(S916)。そして、繰り返し状態にあるため、変数Kに「1」をセットする(S917)。データSi+1は最後のデータであるかどうかを判定し(S918)、最後のデータである場合は処理を終了し、最後のデータではない場合は、変数iに2を加算しi=i+2として(S919)、S902に戻る。
On the other hand, if it is determined in step S911 that the repetition information of the data Si + 2 is other than “0”, it can be determined that the data Si, the data Si + 1, the data Si + 2, and the data Si + 3 are consecutive lines according to a certain rule. Therefore, the character string of the data Si and the character string of the data Si + 1 are combined to give a line feed at the end, and stored in the shaping result storage area of the data
ステップS901〜ステップS919の処理が終了した時点で、記憶装置25のデータ一時記憶部29の整形結果記憶領域に記憶された表17に示すようなメールの本文データが得られる。表17に示すように、文字列が整形されている。
このように、メールツールの設定により自動的に改行が行われ、文の途中で改行されて、長い文、短い文、長い文、短い文のような状態となったとしても、文のデータ整形処理を行うことにより文を整形できる。 In this way, line breaks are automatically performed according to the settings of the mail tool, and even if the line breaks in the middle of the sentence and it becomes a state like a long sentence, short sentence, long sentence, short sentence, the data formatting of the sentence Sentences can be shaped by processing.
本発明の実施の形態によれば、自動的に挿入された改行により乱れた階層を整形した後に、同一階層内で文の認識処理を行うので、文の認識精度を向上させることができる。 According to the embodiment of the present invention, the sentence recognition processing is performed in the same hierarchy after shaping the hierarchy disturbed by the automatically inserted line feed, so that the sentence recognition accuracy can be improved.
11…文書解析装置、12…演算制御装置、13…プロセッサ、14…メモリ、15…文書解析プログラム、16…作業エリア、17…出力装置、18…表示装置、19…通信制御装置、20…入力装置、21…マウス、22…キーボード、23…ディスクドライブ、24…ハードディスクドライブ、25…記憶装置、26…入力処理部、27…出力処理部、28…制御部、29…データ一時記憶部、30…文書階層判定部、31…同一階層判定部、32…文書整形部、33…文認識処理部、34…行結合判定閾値算出部、35…結合行判定部、36…データ整形部
DESCRIPTION OF
Claims (6)
前記文書階層判定部で判定したデータ長のうちデータ長が最大値の予め定めた範囲内であるデータ長近似最大行の引用階層が次の行の引用階層より大きい場合は前記データ長近似最大行の文字列に含まれる引用記号及び改行を取り除いた文字列と次の行の文字列に含まれる引用記号及び改行を取り除いた文字列との結合文字列の長さが前記データ長の最大値の予め定めた範囲内かどうかを判定し前記結合文字列の長さが前記データ長の最大値の予め定めた範囲内であるときには前記データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定する同一階層判定部と、
前記記憶装置に記憶されている各行文字列のうち、前記同一階層判定部で同一階層と判定された前記データ長近似最大行とその次の行の文字列については、当該データ長近似最大行の次の行の引用記号を取り除き、当該データ長近似最大行の最後に結合する処理によって整形して、その各行文字列全体を出力装置に出力する文書整形部とを備えた文書解析装置。 For each line character string that is read from the body data of the email input from the input device for each line feed and stored in the storage device , the data length is determined for each line based on the number of characters in each line character string, and each line character string is quoted A document hierarchy determination unit that determines the citation hierarchy for each line based on the number of symbols;
If the citation hierarchy of the data length approximation maximum line that is within the predetermined range of the maximum value among the data lengths determined by the document hierarchy determination unit is larger than the citation hierarchy of the next line, the data length approximation maximum line The length of the combined character string between the character string from which the quotation mark and line feed are removed and the character string from which the quotation mark and line feed are removed from the next line is the maximum value of the data length. It is determined whether or not it is within a predetermined range, and when the length of the combined character string is within a predetermined range of the maximum value of the data length, the actual hierarchy of the data length approximate maximum line and the next line is The same hierarchy determination unit for determining that the character strings are in the same hierarchy;
Of the line character strings stored in the storage device, the data length approximate maximum line determined to be the same hierarchy by the same hierarchy determination unit and the character string of the next line , the data length approximate maximum line A document analysis apparatus comprising: a document formatting unit that removes a quotation mark from the next line, shapes the line by approximating the end of the maximum data length approximate line, and outputs the entire line character string to the output device.
入力装置から入力されたメールの本文データを改行ごとに読み込み前記記憶装置に記憶された各行文字列について、当該各行文字列の文字の数に基づき各行ごとにデータ長を判定するとともに各行文字列の引用記号の数に基づいて各行ごとに引用階層を判定する手順と、
前記判定したデータ長のうちデータ長が最大値の予め定めた範囲内であるデータ長近似最大行の引用階層が次の行の引用階層より大きい場合は前記データ長近似最大行の文字列に含まれる引用記号及び改行を取り除いた文字列と次の行の文字列に含まれる引用記号及び改行を取り除いた文字列との結合文字列の長さが前記データ長の最大値の予め定め範囲内かどうかを判定する手順と、
前記結合文字列の長さが前記データ長の最大値の予め定めた範囲内であるときには前記データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定する手順と、
前記記憶装置に記憶されている各行文字列のうち、前記同一階層と判定された前記データ長近似最大行とその次の行の文字列については、当該データ長近似最大行の次の行の引用記号を取り除き、当該データ長近似最大行の最後に結合する処理によって整形して、その各行文字列全体を前記出力装置に出力する手順とを実行させるための文書解析プログラム。 A storage device that stores a document analysis program, an input device that inputs mail body data, an arithmetic control device that executes the document analysis program stored in the storage device, and outputs an arithmetic result of the arithmetic control device In a document analysis program used in a document analysis apparatus configured by a computer having an output device for
For each line string stored in the storage device, the body text data of the mail input from the input device is read for each line feed, and the data length is determined for each line based on the number of characters in each line string. A procedure for determining the citation hierarchy for each row based on the number of quotes,
If the citation hierarchy of the data length approximation maximum line whose data length is within the predetermined range of the determined data length is larger than the citation hierarchy of the next line, it is included in the character string of the data length approximation maximum line Whether the length of the combined character string between the character string from which the quotation mark and line feed are removed and the character string from which the quotation mark and line feed are removed is within the predetermined range of the maximum value of the data length A procedure for determining whether or not
When the length of the combined character string is within a predetermined range of the maximum value of the data length, it is determined that the actual hierarchy of the approximate maximum data length line and the next line is a character string in the same hierarchy. Procedure and
Among the line character strings stored in the storage device, for the character string of the data length approximate maximum line and the next line determined to be the same hierarchy, the citation of the line next to the data length approximate maximum line A document analysis program for executing a procedure of removing symbols and shaping by the process of combining at the end of the approximate maximum data length line and outputting the entire line character string to the output device.
前記判定したデータ長のうちデータ長が最大値の予め定めた範囲内であるデータ長近似最大行の引用階層が次の行の引用階層より大きい場合は前記データ長近似最大行の文字列に含まれる引用記号及び改行を取り除いた文字列と次の行の文字列に含まれる引用記号及び改行を取り除いた文字列との結合文字列の長さが前記データ長の最大値の予め定めた範囲内かどうかを判定し、
前記結合文字列の長さが前記データ長の最大値の予め定めた範囲内であるときには前記データ長近似最大行とその次の行との実際の階層は同一階層の文字列であると判定し、
前記記憶装置に記憶されている各行文字列のうち、前記同一階層と判定された前記データ長近似最大行とその次の行の文字列については、当該データ長近似最大行の次の行の引用記号を取り除き、当該データ長近似最大行の最後に結合する処理によって整形して、その各行文字列全体を出力装置に出力する文書解析方法。 For each line character string that is read from the body data of the email input from the input device for each line feed and stored in the storage device , the data length is determined for each line based on the number of characters in each line character string, and each line character string is quoted Determine the citation hierarchy for each line based on the number of symbols,
If the citation hierarchy of the data length approximation maximum line whose data length is within the predetermined range of the determined data length is larger than the citation hierarchy of the next line, it is included in the character string of the data length approximation maximum line The length of the combined character string between the character string from which the quotation mark and the line feed are removed and the character string from which the quotation mark and the line feed are removed included in the next line is within a predetermined range of the maximum value of the data length. Whether or not
When the length of the combined character string is within a predetermined range of the maximum value of the data length, it is determined that the actual hierarchy of the data length approximate maximum line and the next line is a character string in the same hierarchy. ,
Among the line character strings stored in the storage device, for the character string of the data length approximate maximum line and the next line determined to be the same hierarchy, the citation of the line next to the data length approximate maximum line A document analysis method that removes symbols, shapes them by a process of combining them at the end of the approximate maximum data length line, and outputs the entire line character string to the output device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008280765A JP4995801B2 (en) | 2008-10-31 | 2008-10-31 | Document analysis apparatus, document analysis program, and document analysis method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008280765A JP4995801B2 (en) | 2008-10-31 | 2008-10-31 | Document analysis apparatus, document analysis program, and document analysis method |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011065462A Division JP5161990B2 (en) | 2011-03-24 | 2011-03-24 | Document analysis apparatus, document analysis program, and document analysis method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010108326A JP2010108326A (en) | 2010-05-13 |
JP4995801B2 true JP4995801B2 (en) | 2012-08-08 |
Family
ID=42297701
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008280765A Active JP4995801B2 (en) | 2008-10-31 | 2008-10-31 | Document analysis apparatus, document analysis program, and document analysis method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4995801B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108763176A (en) * | 2018-04-10 | 2018-11-06 | 达而观信息科技(上海)有限公司 | A kind of document processing method and device |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3772404B2 (en) * | 1996-08-29 | 2006-05-10 | カシオ計算機株式会社 | Electronics |
JP3886661B2 (en) * | 1999-03-30 | 2007-02-28 | 富士通株式会社 | Text editing system |
JP2002132662A (en) * | 2000-10-20 | 2002-05-10 | Oki Electric Ind Co Ltd | Text shaping method, text shaping device, electronic mail transferring device, and electronic mail device |
JP2005196305A (en) * | 2003-12-26 | 2005-07-21 | Just Syst Corp | Document shaping device and electronic mail device equipped with its function |
-
2008
- 2008-10-31 JP JP2008280765A patent/JP4995801B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2010108326A (en) | 2010-05-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP4345772B2 (en) | Document editing apparatus, program, and storage medium | |
KR20150000566A (en) | Apparatus and method for outputting image according to text input in real time | |
US20230006953A1 (en) | Information processing apparatus, information processing system, and non-transitory computer readable medium | |
CN115577149B (en) | Data processing method, device and equipment and readable storage medium | |
JP4995801B2 (en) | Document analysis apparatus, document analysis program, and document analysis method | |
JP5161990B2 (en) | Document analysis apparatus, document analysis program, and document analysis method | |
CN103164038B (en) | The Japanese input method of touch screen terminal and device | |
CN110377167B (en) | Font generating method and font generating device | |
CN111045836B (en) | Search method, search device, electronic equipment and computer readable storage medium | |
JP7275816B2 (en) | Information processing device and program | |
JP2002108768A (en) | Information terminal equipment, electronic mail system connecting the same with server device, electronic mail creating method and recording medium recording electronic mail creating program | |
KR101452638B1 (en) | Method and apparatus for recommending contents | |
KR20180007183A (en) | sentence input method and devices using the Representative of alphabet with the spaces | |
JP2006195575A (en) | Information processing device and method thereof | |
US20110078561A1 (en) | Method and system of formatting text in an electronic document to increase reading speed | |
JP4262077B2 (en) | Information processing apparatus, control method therefor, and program | |
CN114741315B (en) | Use case updating method and device, electronic equipment and storage medium | |
KR100418349B1 (en) | Method for compression and restoration of data | |
JP2016197315A (en) | Character recognition apparatus, character recognition processing system, and program | |
WO2023073886A1 (en) | Information processing system, information processing device, information processing method, and recording medium | |
US20230237282A1 (en) | Method for inputting a message on a terminal in a primary language and translating passages from a secondary language | |
JP5542368B2 (en) | Character string input device, character string input method, and program | |
CN112541651A (en) | Electronic device, pronunciation learning method, and server device | |
JP4287815B2 (en) | Display device, display device control method, and program | |
JP2005196305A (en) | Document shaping device and electronic mail device equipped with its function |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110125 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110324 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110412 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110601 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20111108 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120208 |
|
A911 | Transfer to examiner for re-examination before appeal (zenchi) |
Free format text: JAPANESE INTERMEDIATE CODE: A911 Effective date: 20120216 |
|
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: 20120413 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120510 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150518 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 4995801 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
S531 | Written request for registration of change of domicile |
Free format text: JAPANESE INTERMEDIATE CODE: R313531 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |