JP2006215679A - Information processor, information processing method, and recording medium - Google Patents
Information processor, information processing method, and recording medium Download PDFInfo
- Publication number
- JP2006215679A JP2006215679A JP2005025858A JP2005025858A JP2006215679A JP 2006215679 A JP2006215679 A JP 2006215679A JP 2005025858 A JP2005025858 A JP 2005025858A JP 2005025858 A JP2005025858 A JP 2005025858A JP 2006215679 A JP2006215679 A JP 2006215679A
- Authority
- JP
- Japan
- Prior art keywords
- information
- brackets
- pair
- information processing
- parentheses
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
Description
この発明は括弧あるいはタグを含んだ情報を処理する情報処理装置及び情報処理方法並びに記録媒体に関する。 The present invention relates to an information processing apparatus, an information processing method, and a recording medium for processing information including parentheses or tags.
まず、特開平7−302264号公報には、括弧が入力された場合に、他の文字コードとは異なった表示色で表示を行うと共に、前括弧に対応する後括弧を同色に統一して、一目で括弧の対応関係を把握することができる情報処理装置を提供するものが記載されていた。
しかしながら、上記の技術によれば、開括弧と閉括弧はある情報中でそれぞれ1種類しか存在しないことが前提とされており、ある開括弧に対応する閉括弧として認識されるのは、その開括弧と同じ種類の閉括弧(例えば、通常の開括弧に対する通常の閉括弧や、開カギ括弧に対する閉カギ括弧)だけに限られる。
そのため、上記の技術は複数種類の開括弧又は閉括弧が存在する場合には対応できない。また、開括弧に対応する同じ種類の閉括弧がいわゆる入れ子構造を持っていることが前提となっており、同じ種類の開括弧と開括弧と同じ数だけ現れない場合や、その対応関係がとれていない場合には適用できない。
そこで、この発明は、開括弧と閉括弧が1種類づつしか存在しない情報のみならず、上記のような括弧類の対応関係が必ずしも明確ではない情報についても括弧類の階層構造を適切に判断する機能を提供することを課題とする。
However, according to the above technique, it is assumed that there is only one kind of open parenthesis and closing parenthesis in each piece of information, and what is recognized as a closing parenthesis corresponding to a certain open parenthesis is the opening parenthesis. It is limited to the same kind of closing parenthesis as the parenthesis (for example, a normal closing parenthesis for a normal opening parenthesis or a closing bracket for an opening bracket).
Therefore, the above technique cannot cope with a case where a plurality of types of open parentheses or closing parentheses exist. In addition, it is assumed that the same kind of closing parenthesis corresponding to the opening parenthesis has a so-called nested structure. If not, it is not applicable.
Therefore, the present invention is a function that appropriately determines the hierarchical structure of parentheses not only for information in which there is only one kind of open parenthesis and closing parenthesis, but also for information in which the correspondence relationship of parentheses is not necessarily clear as described above. It is an issue to provide.
本発明は上述の問題に鑑み為されたものであり、前括弧類、後括弧類を検索する検索手段を有する情報処理装置において、前括弧類と後括弧類が一対の組を構成するかどうかを判別する判別手段を提供する。なお、この場合、一対の組を構成する前括弧類と後括弧類が、前括弧類と同じ種類の後括弧類ではない場合がある。ここで、同じ種類の後括弧類とは、特定の前括弧類に対して、通常対となって使用されるものをいう。 The present invention has been made in view of the above problems, and in an information processing apparatus having a search means for searching for a front bracket and a back bracket, whether or not the front bracket and the rear bracket constitute a pair. Discriminating means for discriminating the above is provided. In this case, the parentheses and rear brackets constituting the pair may not be the same kind of rear brackets as the front brackets. Here, the same kind of parenthesis refers to what is usually used as a pair for a specific front bracket.
また、上記判別手段により判別された一対の組を構成する前括弧類と後括弧類についての情報を、情報出力手段に出力することにより、この後に別の情報処理装置による処理の参考情報を付加することが可能となる。 In addition, by outputting information about the parentheses and rear brackets that constitute the pair determined by the determination means to the information output means, this is followed by reference information for processing by another information processing apparatus. It becomes possible to do.
例えば、情報出力手段に対して、元々情報入力手段より入力された情報に、上記判別手段により判別された一対の組を構成する前括弧類の直前又は直後、及び、後括弧類の直前又は直後に識別情報(例えば、HTMLタグの対等が考えられるが、これに限られない)を挿入することにより、後のコンピュータによる処理の参考情報を付加することができる。 For example, for the information output means, the information originally input from the information input means is immediately before or immediately after the front brackets constituting the pair of pairs determined by the determination means, and immediately before or after the rear brackets. By inserting identification information (for example, a pair of HTML tags is conceivable, but not limited thereto), reference information for later computer processing can be added.
さらに、上記判別手段により判別された一対の組を構成する前括弧類と後括弧類で囲まれる領域について、それらの領域を画面に表示する際に領域毎に色を変化させることも可能となる。また、上記判別手段により判別された一対の組を構成する前括弧類と後括弧類だけを、それぞれ別の色に変えて表示することも可能となる。 Furthermore, regarding the areas surrounded by the front brackets and rear brackets that constitute the pair determined by the determination means, the colors can be changed for each area when the areas are displayed on the screen. . In addition, it is possible to display only the front brackets and rear brackets constituting the pair of pairs determined by the determination means by changing them to different colors.
当発明によれば、括弧類の対応関係が複雑であり階層構造がわかりづらいものや、前括弧類と同じ種類の後括弧類が現れない情報についても、その階層構造を取得することができる。それにより、その階層構造についての参考情報を付加し、コンピュータでの後の処理を簡単に行うことができる。また、その階層構造について色を変化させて表現することにより、ユーザが情報を見てもその階層構造が明確となる。
According to the present invention, it is possible to acquire the hierarchical structure of information that has a complicated correspondence relationship between parentheses and whose hierarchical structure is difficult to understand, and information that does not have the same type of parentheses as the preceding parentheses. Thereby, reference information about the hierarchical structure can be added and subsequent processing by the computer can be easily performed. In addition, by expressing the hierarchical structure by changing colors, the hierarchical structure becomes clear even when the user looks at the information.
この発明の実施の一形態を、図1、図2、図3、図4に基づいて説明する。なお、実施形態はこれに限られるものではない。 An embodiment of the present invention will be described with reference to FIGS. 1, 2, 3, and 4. FIG. Note that the embodiment is not limited to this.
まず、図1において、2の括弧類対応関係格納メモリとは前括弧類の種類、及び、後括弧類の種類の情報を格納しているものであり、表1に示すように、前括弧類の文字コード又は後括弧類の文字コード、及び、前括弧類又は後括弧類の種類を表す数値を格納している。
First, in FIG. 1, the parenthesis type
括弧類とは前括弧類と後括弧類からなる。ここで、前括弧類とは、ある範囲が開始することを意味する文字、文字列あるいは情報をいい、後括弧類とは、ある前括弧類に対応する特定の文字、文字列あるいは情報で、前括弧類により開始される範囲が終了することを意味するものをいう。なお、括弧類の具体的な例としては、通常使用される括弧及びカギ括弧並びにXMLやHTMLで使用されるタグ等が考えられるが、これに限定されるわけではない。 Parentheses consist of front brackets and back brackets. Here, the front brackets refer to characters, character strings, or information meaning that a certain range starts, and the rear brackets are specific characters, character strings, or information corresponding to a certain front bracket, Means the end of the range that begins with the brackets. Note that specific examples of parentheses include commonly used parentheses and lock brackets, and tags used in XML and HTML, but are not limited thereto.
表1のうち前括弧類か後括弧類かどうかの判定は、この例においては、種類欄の数値が負か正かにより判定される。 In this example, whether or not it is a front bracket or a back bracket in Table 1 is determined based on whether the numerical value in the type column is negative or positive.
表1のうち通常の括弧については、全角・半角の両方が用いられる可能性があることから、全角・半角のそれぞれを別個に括弧類対応関係格納メモリにその情報を格納している。表1においては、No1,2及びNo6,7がそれぞれ全角・半角の括弧に対応している。 Since normal brackets in Table 1 may use both full-width and half-width characters, the full-width and half-width are separately stored in the parenthesis correspondence storage memory. In Table 1, No1, 2 and No6, 7 correspond to full-width and half-width brackets, respectively.
表1のうち*とは、>以外の文字全てに当てはまるということを意味している。 * In Table 1 means that it applies to all characters other than>.
図1において3の前括弧類格納メモリとは、前括弧類の存在する位置(前括弧類が複数の文字からなっている場合には、その前括弧類の最初の文字の位置又は最後の文字の位置若しくはその双方、以下同じ)及び種類が格納される。 In FIG. 1, the storage memory for the brackets 3 is the position where the brackets exist (if the brackets consist of multiple characters, the position of the first character or the last character of the brackets) , Or both, and so on) and type.
図1において4の括弧類格納メモリとは、前括弧類の存在する位置及び種類と、それに対応する後括弧類の存在する位置(複数の文字からなっている場合には、その後括弧類の最初の文字の位置又は最後の文字の位置若しくはその双方、以下同じ)及び種類を格納するものである。この場合、格納されている前括弧類と後括弧類は、同じ種類の前括弧類と後括弧類ではない場合がある。 In FIG. 1, the parenthesis storage memory 4 indicates the position and type where the front brackets exist and the position where the corresponding rear brackets exist (if it consists of a plurality of characters, the first of the parentheses thereafter. And the last character position or both, the same shall apply hereinafter) and type. In this case, the stored front brackets and rear brackets may not be the same type of front brackets and rear brackets.
図1において5の括弧類種類別処理方法格納メモリとは、表2のように前括弧類及び後括弧類の種類に応じて行う動作の種類の情報を格納している。 In FIG. 1, the parenthesis type processing method storage memory 5 stores information on the types of operations to be performed according to the types of front brackets and rear brackets as shown in Table 2.
図1において8の括弧類多重度格納メモリとは、現在処理対象としている領域での括弧類の多重度を格納している。 In FIG. 1, the parenthesis multiplicity storage memory 8 stores the multiplicity of parentheses in the region currently being processed.
図1において9の括弧類挿入方法格納メモリとは、表3のとおり括弧類、及び、それと対になる括弧類の種類に応じて、括弧類多重度格納メモリを変更するタイミングを制御するための情報を格納している。
In FIG. 1, the parenthesis insertion
図1において10の括弧類処理方法格納メモリとは、表4のとおり括弧類、及び、それと対になる括弧類の種類に応じて、括弧類多重度格納メモリをどのように変更するかを制御するための情報を格納している。 In FIG. 1, 10 parentheses processing method storage memory controls how the multiplicity storage memory for parentheses is changed according to the types of parentheses and their parentheses as shown in Table 4. It stores information for
かかる構成において、図1の「1.括弧類対抽出処理」に対応する処理の説明を、図2に示すフローチャートに従って行う。 In such a configuration, the processing corresponding to “1. Parenthesis pair extraction processing” in FIG. 1 will be described according to the flowchart shown in FIG.
ステップS1では情報入力手段により入力される情報でまだ処理していない情報があるかどうかを判断する。その結果、まだ未処理の情報があればS2へと進み、全ての情報が処理済である場合は括弧類対抽出処理を終了する。なお、情報入力手段からの読込は、順次読込によるものとして、以下は記述しているが、それに限定されるものではない。 In step S1, it is determined whether there is information that has not yet been processed among the information input by the information input means. As a result, if there is still unprocessed information, the process proceeds to S2, and if all the information has been processed, the parenthesis pair extraction process is terminated. In addition, although the following is described as reading from the information input means by sequential reading, it is not limited to this.
ステップS2では未処理の情報を読み込み、ステップS3へと進む。 In step S2, unprocessed information is read, and the process proceeds to step S3.
ステップS3ではステップS2で読み込まれた情報を括弧類対応関係格納メモリと照合することにより、その情報が前括弧類又は後括弧類があるかどうかを判定する。その判定の結果、前括弧類に該当した場合にはステップS4へ、後括弧類に該当した場合にはステップS5に、いずれにも該当しなかった場合には、ステップS1に進む。 In step S3, the information read in step S2 is checked against the parenthesis correspondence storage memory to determine whether the information has a front bracket or a rear bracket. As a result of the determination, the process proceeds to step S4 if it falls under the brackets, proceeds to step S5 if it falls under the brackets, and proceeds to step S1 if it does not fall under either.
なお、ステップS3の「いずれにも該当しなかった場合」には、括弧類対応関係格納メモリに格納されている複数文字からなる括弧類の前半の一部分には合致しているが、全体に合致しているかどうかはわからない、という場合も含まれる(例えば、「<T」まで読み込んだとしても、<TD*>と一致するかどうかは不明である)。そこで、このような場合に、ステップS3について、実際にプログラムを組む場合の詳細を以下26項から29項において、記載する。 Note that in the case of “does not correspond to any of” in step S3, it matches the part of the first half of the parentheses consisting of multiple characters stored in the parenthesis correspondence storage memory, but it matches the whole. There is a case where it is not known whether or not it is correct (for example, even if “<T” is read, it is unknown whether or not it matches <TD *>). Therefore, in such a case, the details in the case of actually building a program in step S3 will be described in the following items 26 to 29.
まず、括弧類対応関係格納メモリに格納されている括弧類(以下、この項から29項においては単に括弧類という)毎にメモリ(以下、括弧類に対応するメモリという。また、また、その括弧類に対応するメモリの値をCと表記する。)を準備しておく。初期状態は全ての括弧類に対応するメモリの値(=C)を0としておく。 First, for each parenthesis stored in the parenthesis correspondence storage memory (hereinafter simply referred to as parentheses in this section to 29), the memory (hereinafter referred to as memory corresponding to the parentheses. The memory value corresponding to the class is denoted as C.). In the initial state, the memory values (= C) corresponding to all parentheses are set to 0.
括弧類対応関係格納メモリに格納されている各括弧類の(C+1)文字目の文字が*であった場合には、その括弧類に対応するメモリの値に1を加算しておいたうえで、28項の処理を行う。 When the character of the (C + 1) th character of each parenthesis stored in the parenthesis correspondence storage memory is *, after adding 1 to the memory value corresponding to the parenthesis , 28 processing is performed.
そして、情報入力装置より読込んだデータと、括弧類対応関係格納メモリに格納されている各括弧類の(C+1)文字目の文字を比較し、括弧類毎に一致した場合にはその括弧類に対応するメモリの値に1を加える。その括弧類に対応するCの値とその括弧類の長さが一致した時点で、その括弧類に該当したものと判断する。 Then, the data read from the information input device is compared with the (C + 1) -th character of each parenthesis stored in the parenthesis correspondence storage memory. 1 is added to the memory value corresponding to. When the value of C corresponding to the parenthesis matches the length of the parenthesis, it is determined that the parenthesis is applicable.
また、情報入力装置より読込んだデータと、括弧類対応関係格納メモリに格納されている各括弧類の(C+1)文字目の文字とが一致しなかった場合、括弧類対応関係格納メモリに格納されているその括弧類のC文字目が*である場合を除き、その括弧類に対応するメモリの値を0にリセットする。以下、27項に戻り、処理を継続する。
If the data read from the information input device does not match the (C + 1) -th character of each parenthesis stored in the parenthesis correspondence storage memory, it is stored in the parenthesis correspondence storage memory. The value of the memory corresponding to the parenthesis is reset to 0 unless the C character of the parenthesis is *. Thereafter, the process returns to the
ステップS4では、ステップS3で判別された前括弧類の最初の文字の位置、最後の文字の位置、及び、括弧類の種類を前括弧類格納メモリに格納する。 In step S4, the position of the first character, the position of the last character, and the type of parenthesis determined in step S3 are stored in the bracket storage memory.
なお、ステップS4で格納する「括弧類の種類」とは、括弧類対応関係格納メモリにより該当する前括弧類の種類を表す数値のことをいう(以下、括弧類の種類とは括弧類対応関係格納メモリにより該当する括弧類の種類を表す数値のことをいう)。 Note that the “type of parentheses” stored in step S4 means a numerical value indicating the type of the preceding parenthesis in the parenthesis correspondence storage memory (hereinafter, the type of parentheses is the parenthesis correspondence relationship). This is a numerical value indicating the type of parentheses corresponding to the storage memory).
ステップS5では、まず、前括弧類格納メモリに格納されたデータのうちで、最後に格納されたものについて、前括弧類の最初の文字の位置、最後の文字の位置、及び、括弧類の種類についての情報を取得し、ステップS6に進む。 In step S5, first of all the data stored in the bracket storage memory, the first character position of the bracket, the position of the last character, and the type of brackets Is acquired, and the process proceeds to step S6.
情報入力手段からの読込が順次読込を前提とすると、メモリに格納する段階で既に、位置の昇順でソートされているため、別途ソート処理を行う必要はない。しかし、順次読込を前提としない場合であっても、ステップS5で、前括弧類格納メモリは、常に前括弧類の最初の文字の位置、最後の文字の位置及び種類の昇順にソートした上で、そのメモリの最後に格納されたものから取得していくことにより、結果として位置についての降順で前括弧類についての情報を取得することができる。 If reading from the information input means is premised on sequential reading, it is already sorted in the ascending order of position at the stage of storage in the memory, so there is no need to perform a separate sorting process. However, even if sequential reading is not premised, in step S5, the bracket storage memory is always sorted in ascending order of the first character position, last character position, and type in the brackets. As a result, it is possible to acquire information about the parentheses in descending order of the position by acquiring from the last stored in the memory.
また、通常、情報入力装置から入力された情報のうちのある最小単位(例えば、テキストの場合は1文字、バイト列の場合は1バイトをいうがこれに限られない)が、ある前括弧類及び後括弧類の一部であり、かつ、他の前括弧類及び後括弧類の一部となることはない。そのため、括弧類の位置でソートする場合に、括弧類の最初の文字の位置、括弧類の最後の文字の位置、その双方のいずれを用いてソートしても結果は同一となる。 Usually, a certain minimum unit of information input from the information input device (for example, one character in the case of text, one byte in the case of a byte string, but not limited to this) is a certain bracket. And part of the parentheses, and not part of other front and rear parentheses. Therefore, when sorting by the position of the parentheses, the result is the same regardless of whether the first character position of the parentheses or the last character position of the parentheses is used.
ステップS6では、その前括弧類の括弧の種類とステップS3で判別された後括弧類の括弧の種類とを用いて、括弧類種類別処理方法格納メモリより、前括弧類及び後括弧類の種類に応じて行う動作の種類の情報を取得し、ステップS7へ進む。 In step S6, using the type of parenthesis of the preceding parenthesis and the type of parenthesis of the rear parenthesis determined in step S3, the type of the parenthesis and rear parenthesis from the storage method storage memory according to the type of parenthesis The information on the type of operation to be performed is acquired according to, and the process proceeds to step S7.
ステップS7では、ステップS6で取得した前括弧類及び後括弧類の種類に応じて行う動作の種類の情報の数値が-1の場合にはステップS8へ、0の場合にはステップS10へ、1の場合にはステップS11へ進む。 In step S7, if the numerical value of the type of operation performed in accordance with the type of brackets and brackets acquired in step S6 is -1, go to step S8, if 0, go to step S10, In this case, the process proceeds to step S11.
ステップS8では、まず、ステップS5で取得した前括弧類の位置、前括弧類の種類、及び、ステップS3で判別された後括弧類の種類をそれぞれ、括弧類の位置、種類、それに対応する括弧類の種類として、括弧類格納メモリに格納する。次に、ステップS3で判別された後括弧類の位置、後括弧類の種類、及び、ステップS5で取得した前括弧類の種類をそれぞれ、括弧類の位置、種類、それに対応する括弧類の種類として、括弧類格納メモリに格納し、ステップS9に進む。 In step S8, first, the position of the parenthesis obtained in step S5, the type of the parenthesis, and the type of the parenthesis determined in step S3 are the position of the parenthesis, the type, and the corresponding parenthesis. Stored in the bracket storage memory as the class type. Next, the position and type of parentheses, and the type of parentheses corresponding to the position and type of parentheses obtained in step S5, respectively. Is stored in the parenthesis storage memory, and the process proceeds to step S9.
なお、ここでいう括弧類(含む前括弧類、後括弧類)の位置とは、括弧類の最初の文字の位置、最後の文字の位置の双方をいう(以下、同じ)。なお、括弧類が1文字からのみなる場合には、括弧類の最初の文字の位置、及び、最後の文字の位置は一致する。 The position of the parentheses (including the preceding parenthesis and the rear parenthesis) here refers to both the position of the first character and the position of the last character of the parentheses (hereinafter the same). When the parentheses are composed of only one character, the position of the first character and the position of the last character of the parentheses are the same.
ステップS9では、ステップS5で取得した前括弧類の情報を前括弧類格納メモリにより削除し、ステップS1に戻る。 In step S9, the information on the brackets acquired in step S5 is deleted from the bracket storage memory, and the process returns to step S1.
ステップS10では、ステップS8と同じ処理を行い(ステップS9に進む部分を除く)、ステップS3に進む。 In step S10, the same process as in step S8 is performed (except for the part that proceeds to step S9), and the process proceeds to step S3.
ステップS11では、ステップS8と同じ処理を行い(ステップS9に進む部分を除く)、ステップS5に進む。 In step S11, the same process as in step S8 is performed (except for the part that proceeds to step S9), and the process proceeds to step S5.
次に、図1における「6.括弧類情報出力処理」を、図3に示すフローチャートに従って説明を行う。 Next, “6. Parenthesis information output processing” in FIG. 1 will be described according to the flowchart shown in FIG.
ステップS21では、処理対象となる本文(以下、元データ又はTという)、及び、その元データに基づき判別された括弧類格納メモリに格納された情報あるいはそれと同等の情報(以下、Aという)を、メモリ又はハードディスクより取得する。なお、Aについては、あらかじめ括弧類の開始位置・終了位置・括弧類の種類及び、その括弧類に対応する括弧類の種類について、その順番で、昇順にソートをしておく。 In step S21, the text to be processed (hereinafter referred to as original data or T), and the information stored in the bracket storage memory determined based on the original data or information equivalent thereto (hereinafter referred to as A) Obtain from memory or hard disk. For A, the parenthesis start position / end position / parenthesis type and the parenthesis type corresponding to the parenthesis are sorted in ascending order in that order.
なお、上記における、括弧類の種類の昇順とは、括弧類の種類が表1:括弧類対応関係格納メモリに示された括弧類に対応する数値の昇順ということを意味している。 In the above, the ascending order of the types of parentheses means that the types of parentheses are ascending order of numerical values corresponding to the parentheses shown in Table 1: Parentheses correspondence storage memory.
ステップS22では、括弧類多重度格納メモリ(以下、Mという)を0に設定しておく。また、Mの値に依存して定まる、ある特定の領域が開始することを意味する特定の情報(以下、Mに依存した開始情報という)、及び、その特定の領域が終了することを意味する特定の情報(以下、Mに依存した終了情報という)を定めておく。 In step S22, the parenthesis multiplicity storage memory (hereinafter referred to as M) is set to 0. Also, specific information that is determined depending on the value of M and means that a specific area starts (hereinafter referred to as start information that depends on M), and that specific area ends. Specific information (hereinafter referred to as end information depending on M) is defined.
なお、上記のMに依存した開始情報、及び、Mに依存した終了情報とは、例えば、XMLやHTMLの開始タグ(例えば「<SPAN CLASS=“COLOR?”>」:?の部分にはMで表される数値が入る)、及び、終了タグ(例えば「</SPAN>」)等が考えられるが、これに限られるものではない。 The start information depending on M and the end information depending on M are, for example, an XML or HTML start tag (for example, “<SPAN CLASS =“ COLOR? ”>” :? And an end tag (for example, “</ SPAN>”) are conceivable, but are not limited thereto.
ステップS23では、Aに次の情報があるかないかを判断し、次の情報があれば、ステップS24へ進む。もし、Aに次の情報がなければ、ステップS34に進む。 In step S23, it is determined whether or not the next information exists in A. If there is the next information, the process proceeds to step S24. If there is no next information in A, the process proceeds to step S34.
ステップS24では、Aの次の情報を読み込み(この読み込んだデータをBとする)、ステップS25に進む。 In step S24, the next information of A is read (this read data is set as B), and the process proceeds to step S25.
ステップS25では、Bの括弧類の種類及び、その括弧類に対応する括弧類の種類を用いて、括弧類挿入方法格納メモリより、その2つの括弧類の種類に応じた値を取得する。その値が-1の場合にはステップS26へ、1の場合にはステップS27へ進む。 In step S25, using the type of parentheses of B and the type of parentheses corresponding to the parentheses, a value corresponding to the two types of parentheses is acquired from the parenthesis insertion method storage memory. If the value is -1, the process proceeds to step S26, and if the value is 1, the process proceeds to step S27.
ステップS26では、Tの未処理部分の初めからBの括弧類の開始位置の直前までの情報を、情報出力装置に出力し、ステップS28に進む。 In step S26, information from the beginning of the unprocessed portion of T to the position immediately before the start position of the brackets of B is output to the information output device, and the process proceeds to step S28.
ステップS27では、Tの未処理部分の初めからBの括弧類の終了位置までの情報を、情報出力装置に出力し、ステップS28に進む。 In step S27, information from the beginning of the unprocessed portion of T to the end position of the parentheses of B is output to the information output device, and the process proceeds to step S28.
なお、Tの未処理部分とは、この情報処理装置において、まだ情報出力装置に出力されていない部分をいう。そのため、ステップS26(又はステップS27)の処理により情報出力装置に出力された部分は、以後のステップS26(又はステップS27、S34)の処理では、「Tの未処理部分」には該当しなくなることとなり、その次の情報より後の情報が情報出力装置への出力対象となる。 The unprocessed portion of T is a portion of the information processing apparatus that has not been output to the information output apparatus. Therefore, the part output to the information output device by the process of step S26 (or step S27) does not correspond to the “unprocessed part of T” in the subsequent process of step S26 (or steps S27, S34). Thus, the information after the next information becomes the output target to the information output device.
ステップS28では、Bの括弧類の種類及び、その括弧類に対応する括弧類の種類を用いて、括弧類処理方法格納メモリより、その2つの括弧類の種類に応じた値を取得する。その値が-1の場合にはステップS29へ、1の場合にはステップS31へ、0の場合にはステップS33へ進む。 In step S28, using the type of parentheses of B and the type of parentheses corresponding to the parentheses, a value corresponding to the two types of parentheses is acquired from the parenthesis processing method storage memory. If the value is -1, the process proceeds to step S29. If the value is 1, the process proceeds to step S31. If the value is 0, the process proceeds to step S33.
ステップS29では、Mに依存した終了情報を情報出力装置に出力し、ステップS30に進む。 In step S29, end information depending on M is output to the information output device, and the process proceeds to step S30.
ステップS30では、Mから1を減じたうえで、ステップS23に戻る。なお、Mから1を減じた結果負となる場合には、Mは0のままにしておく。 In step S30, after subtracting 1 from M, the process returns to step S23. If the result of subtracting 1 from M is negative, M remains 0.
ステップS31では、Mに1を加算したうえで、ステップS32に進む。 In step S31, 1 is added to M, and the process proceeds to step S32.
ステップS32では、Mに依存した開始情報を情報出力装置に出力し、ステップS23に戻る。 In step S32, start information depending on M is output to the information output device, and the process returns to step S23.
ステップS33では、何もせずにステップS23に戻る In step S33, do nothing and return to step S23.
ステップS34では、Tの未処理部分を情報出力装置に出力し、括弧類情報出力処理を終了する。 In step S34, the unprocessed portion of T is output to the information output device, and the bracket information output processing ends.
なお、一対の組を構成する前括弧類と後括弧類についての情報を、情報入力手段から入力された情報に対して、その前括弧類の直前、直後の両方、その後括弧類の直前、直後の両方に識別情報を挿入する場合には、下記のような手段による。 Note that information about the front brackets and rear brackets that make up a pair is both immediately before and immediately after the front brackets, and immediately before and after the parentheses for the information input from the information input means. When the identification information is inserted into both, the following means are used.
図3のフローチャートにおいて、ステップS25からは常にステップS26に進むこととし、ステップS27は削除する。さらに、ステップS29については後括弧類の前後に(M)に依存した後括弧類識別情報(例えばHTMLタグの対)を付加して出力することとし、ステップS31については、前括弧類の前後に(M)に依存した前括弧類識別情報(例えばHTMLタグの対)を付加して出力することとし、実現できる。 In the flowchart of FIG. 3, the process always proceeds from step S25 to step S26, and step S27 is deleted. Furthermore, for step S29, the parenthesis identification information (for example, a pair of HTML tags) depending on (M) is added before and after the parenthesis and output, and for step S31, before and after the front bracket. This can be realized by adding the bracket identification information (for example, a pair of HTML tags) depending on (M) and outputting.
次に、図1における「7.画面表示手段」を図4に示すフローチャートに従って、説明を行う。 Next, “7. Screen display means” in FIG. 1 will be described according to the flowchart shown in FIG.
ステップS41では、処理対象となる本文(以下、元データ又はTという)、及び、その元データに基づき判別された括弧類格納メモリに格納された情報(以下、Aという)をメモリ又はハードディスクより取得する。なお、Aについては、あらかじめ括弧類の開始位置・終了位置・括弧類の種類及び、その括弧類に対応する括弧類の種類について、その順番で、昇順にソートをしておく。 In step S41, the text to be processed (hereinafter referred to as original data or T) and the information (hereinafter referred to as A) stored in the bracket storage memory determined based on the original data are acquired from the memory or the hard disk. To do. For A, the parenthesis start position / end position / parenthesis type and the parenthesis type corresponding to the parenthesis are sorted in ascending order in that order.
なお、上記における、括弧類の種類の昇順、及び、その括弧類に対応する括弧類の種類の昇順とは、括弧類の種類が表1:括弧類対応関係格納メモリに示された括弧類に対応する数値の昇順ということを意味している。 In the above, the ascending order of the types of parentheses and the ascending order of the types of parentheses corresponding to the parentheses are the parenthesis types indicated in Table 1: Parentheses correspondence storage memory. It means that the corresponding numerical values are ascending.
ステップS42では、括弧類多重度格納メモリ(以下、Mという)を0に設定しておく。また、Mの値に対応して、画面表示色をあらかじめ対応づけておく(例えばM=0ならば黒、M=1ならば赤、M=2ならば緑、M=3ならば紫、M=4ならば紺色等とすることが考えられる)。 In step S42, the parenthesis multiplicity storage memory (hereinafter referred to as M) is set to 0. In addition, the screen display color is associated with the value of M in advance (for example, black if M = 0, red if M = 1, green if M = 2, purple if M = 3, M If it is = 4, it can be considered to be amber.)
ステップS43では、Aに次の情報があるかないかを判断し、次の情報があれば、ステップS44へ進む。もし、Aに次の情報がなければ、ステップS49に進む。 In step S43, it is determined whether or not the next information exists in A. If there is the next information, the process proceeds to step S44. If there is no next information in A, the process proceeds to step S49.
ステップS44では、Aの次の情報を読み込み(この読み込んだデータをBとする)、ステップS45に進む。 In step S44, the next information of A is read (this read data is set as B), and the process proceeds to step S45.
ステップS45では、Bの括弧類の種類及び、その括弧類に対応する括弧類の種類を用いて、括弧類挿入方法格納メモリより、その2つの括弧類の種類に応じた値を取得する。その値が-1の場合にはステップS46へ、1の場合にはステップS47へ進む。 In step S45, using the type of parentheses of B and the type of parentheses corresponding to the parentheses, a value corresponding to the two types of parentheses is acquired from the parenthesis insertion method storage memory. If the value is -1, the process proceeds to step S46, and if the value is 1, the process proceeds to step S47.
ステップS46では、Tの未処理部分の、初めからBの括弧類の開始位置の直前までの情報を、Mの値に対応づけられた画面表示色を用いて、画面表示手段に表示し、ステップS48に進む。 In step S46, the information from the beginning of the unprocessed part of T to the point immediately before the start position of the parentheses of B is displayed on the screen display means using the screen display color associated with the value of M. Proceed to S48.
ステップS47では、Tの未処理部分の、初めからBの括弧類の終了位置までの情報を、Mの値に対応づけられた画面表示色を用いて、画面表示手段に表示し、ステップS48に進む。 In step S47, the information from the beginning of the unprocessed part of T to the end position of the brackets of B is displayed on the screen display means using the screen display color associated with the value of M, and in step S48 move on.
なお、Tの未処理部分とは、この情報処理装置において、まだ画面表示手段に表示されていない部分をいう。そのため、ステップS46(又はステップS47)の処理により画面表示手段に表示された部分は、以後のステップS46(又はステップS47、S49)の処理では、「Tの未処理部分」には該当しなくなることとなり、その次の情報より後の情報が画面表示手段への表示対象となる。 The unprocessed portion of T is a portion that has not been displayed on the screen display means in this information processing apparatus. Therefore, the part displayed on the screen display means by the process of step S46 (or step S47) will not correspond to the “unprocessed part of T” in the subsequent process of step S46 (or steps S47, S49). Thus, the information after the next information is displayed on the screen display means.
ステップS48では、Bの括弧類の種類とその括弧類に対応する括弧類の種類とを用いて、括弧類処理方法関係メモリより、処理方法を示す値を取得し、その値をMに加算する。その後ステップS43に戻る。 In step S48, a value indicating the processing method is acquired from the parenthesis processing method related memory using the type of parenthesis of B and the type of parenthesis corresponding to the parenthesis, and the value is added to M. . Thereafter, the process returns to step S43.
ステップS49では、Tの未処理部分をMの値に対応づけられた画面表示色を用いて、画面表示手段に表示し、画面表示処理を終了する。 In step S49, the unprocessed portion of T is displayed on the screen display means using the screen display color associated with the value of M, and the screen display processing ends.
なお、「7:画面表示処理」において、括弧類の画面表示色のみを変更させることも考えられる。その場合には、図4において、ステップS45からは常にステップS46に進むこととし、ステップS46ではM=0の場合の画面表示色にて表示を行うように変更し、ステップS47は削除する。 In “7: Screen display processing”, only the screen display color in parentheses may be changed. In that case, in FIG. 4, the process always proceeds from step S45 to step S46. In step S46, the display is changed to display in the screen display color when M = 0, and step S47 is deleted.
さらに、ステップS48については、 Bの括弧類の種類とその括弧類に対応する括弧類の種類とを用いて括弧類処理方法関係メモリより、処理方法を示す値を取得し、その値に応じて処理方法を分ける。 Furthermore, for step S48, a value indicating the processing method is obtained from the parenthesis processing method related memory using the type of parenthesis of B and the type of parenthesis corresponding to the parenthesis, and according to the value Separate processing methods.
すなわち、前記処理方法を示す値が-1の場合には、 Bの括弧類の開始位置から終了位置までの情報をMに対応した色で画面表示手段に表示した後に、Mの値に前記処理方法を示す値を加算するようにし、前記処理方法を示す値が-1以外の場合には、Mの値に前記処理方法を示す値を加算した後に(B)の括弧類の開始位置から終了位置までの情報を(M)に対応した色で画面表示手段に表示することにより実現できる。 That is, when the value indicating the processing method is -1, the information from the start position to the end position of the brackets B is displayed on the screen display means in a color corresponding to M, and then the process value is set to the value M. When the value indicating the method is added, and the value indicating the processing method is other than -1, the value indicating the processing method is added to the value of M, and then the processing ends from the start position of the parentheses in (B) This can be realized by displaying the information up to the position on the screen display means in a color corresponding to (M).
図5は、この発明の実施の一形態による情報処理装置の機能を実現するための一例の機能ブロック図を示す。 FIG. 5 is a functional block diagram showing an example for realizing the functions of the information processing apparatus according to the embodiment of the present invention.
バス101に対してCPU110、RAM(Random Access Memory)111、ROM(Read Only Memory)112およびグラフィック部116が接続される。CPU110は、RAM111をワークメモリとして用い、所定のプログラムに基づき、このコンピュータ装置100の全体を制御する。RAM111は、上述した括弧類対応関係格納メモリ等の各種メモリの格納領域としても用いられる。ROM112は、このコンピュータ装置100の初期起動用のプログラムおよびデータなどが予め格納される。
A
また、CPU110において、プログラムの指示に従い所定の表示制御信号が生成され、バス101を介してグラフィック部116に供給される。グラフィック部116では、供給された表示制御信号に応じてディスプレイ130で表示可能な表示信号を生成する。表示信号は、グラフィック部116から例えばCRT(Cathode Ray Tube)やLCD(Liquid Crystal Display)からなるディスプレイ130に供給され、所定の表示がなされる。
In addition, a predetermined display control signal is generated in the
バス101には、さらに、I/O部113、ハードディスクドライブ(HDD)114および通信I/F115が接続される。
The
I/O部113は、このコンピュータ装置100と外部とのデータのやりとりを制御する。例えばキーボード120やマウス121がI/O部113に接続される。キーボード120から入力された文字情報や、マウス121の移動情報およびボタン情報がI/O部113に供給され、バス101を介して例えばCPU110に供給される。
The I / O unit 113 controls data exchange between the computer apparatus 100 and the outside. For example, a
HDD114は、情報を入力するための情報入力手段として、あるいは、情報出力手段とすることができ、RAM111の代わりにワークメモリとして用いることもできる。さらに、HDD114には、このコンピュータ装置100の基本的な制御システムであるOS(Operating System)プログラムや、このコンピュータ装置100において上述した文書処理装置300を実現するためのプログラムおよびデータなどが格納される。
The HDD 114 can be used as an information input unit for inputting information or as an information output unit, and can also be used as a work memory instead of the
通信I/F115は、このコンピュータ装置100と、例えばインターネットといった外部のネットワークと接続され、CPU110の指示に基づき、外部のネットワークとの通信を制御する。ネットワークに接続された他の機器で作成された情報を入力するために、この通信I/F115を情報入力手段としてあるいは情報出力手段としてコンピュータ装置100に入力することができる。
The communication I /
なお、プログラムは、CD−ROMやMOのような記録媒体によって供給されるのに限らず、例えばネットワークに接続された他のコンピュータ装置などから入手するようにしてもよい。通信I/F115の制御によりネットワークから当該プログラムデータがダウンロードされる。ダウンロードされたプログラムデータが例えば所定にHDD114上に展開および格納され、インストールが完了される。勿論、これに限らず、外部I/O123を介して外部の他の機器からプログラムデータを入手するようにしてもよい。
The program is not limited to being supplied by a recording medium such as a CD-ROM or MO, and may be obtained from, for example, another computer device connected to a network. The program data is downloaded from the network under the control of the communication I /
「実施形態の効果」
この実施形態によれば、対となって使用される括弧類が単一の場合でなく、それが複数ある場合や、括弧類が対となって使用されていない場合でも、画面表示色を変えるタイミングや、特定の情報の挿入(又は作成)方法を、適切に制御することができる。
"Effect of the embodiment"
According to this embodiment, the screen display color is changed even when there are a plurality of parentheses used as a pair and when there are a plurality of parentheses or when the parentheses are not used as a pair. The timing and the method of inserting (or creating) specific information can be appropriately controlled.
「他の実施形態」
図1における2の括弧類対応関係格納メモリにおいては、表1に記載されている文字以外のものであっても、ある範囲を指定するために対となって使用されるものについて表1の「前括弧類又は後括弧類の文字」にその対を追加し、表1の「種類」欄に適切な数値を指定することにより上記の処理を実施することができる。
"Other embodiments"
In the memory for storing
図2におけるステップS21からステップS23の処理については、必ずしも1文字ずつ読み込むことにより処理する必要はない。例えば、正規表現等を用いて、該当するパターンを自動でマッチングした上で、その該当したパターンの出現箇所が先頭に近いほうから順に、ステップS24又はステップS25へと進んでいっても問題はない。 The processing from step S21 to step S23 in FIG. 2 is not necessarily performed by reading one character at a time. For example, there is no problem even if the corresponding pattern is automatically matched using a regular expression or the like, and the appearance portion of the corresponding pattern proceeds from step S24 or step S25 in order from the top. .
図2におけるステップS23の前括弧類か後括弧類かどうかの判定、及び、図3におけるステップS8の括弧類が対になって使用されるかどうかの判定についても、必ずしも図1における2の括弧類対応関係格納メモリについて表1に記載のように「種類」欄の数値を用いることにより判定するよる必要はなく、また、そもそも括弧類対応関係格納メモリをつかった実装を行う必要もない。例えば、条件分岐処理等により記述しても問題はなく、これらの実装方法が上記の処理に影響を与えるものではない。 The determination of whether the parenthesis or rear bracket in step S23 in FIG. 2 and the determination of whether or not the parentheses in step S8 in FIG. 3 are used in pairs are not necessarily two brackets in FIG. As shown in Table 1, it is not necessary to determine the class correspondence storage memory by using the numerical value in the “type” column, and it is not necessary to implement using the parenthesis correspondence storage memory. For example, there is no problem even if it is described by conditional branch processing or the like, and these mounting methods do not affect the above processing.
図2におけるステップS26,S27の処理については、図1における4の括弧類種類別処理方法格納メモリについて、必ずしも表2に記載のように動作の種類を表す数値を用いることにより判定するよる必要はなく、また、そもそも表2に掲げたような表をつかった実装を行う必要もない。例えば、条件分岐処理等により記述しても問題はなく、これらの実装方法が上記の処理に影響を与えるものではない。 The processing in steps S26 and S27 in FIG. 2 need not necessarily be determined by using the numerical value representing the type of operation as shown in Table 2 for the processing method storage memory for parentheses type 4 in FIG. In addition, there is no need to implement using the table shown in Table 2 in the first place. For example, there is no problem even if it is described by conditional branch processing or the like, and these mounting methods do not affect the above processing.
なお、図3においては、元データの括弧類で囲まれた領域の始まる位置の直前又はその括弧類で囲まれた領域を囲んでいる前括弧類の直前、及びその領域の終わる位置の直後又はその括弧類で囲まれた領域を囲んでいる後括弧類の直後に特定の情報を付加することとしているが、その特定の情報は元データとは別の情報又はファイルとして出力する方法もある。 In FIG. 3, immediately before the start position of the area surrounded by parentheses in the original data, immediately before the front brackets surrounding the area surrounded by the parentheses, and immediately after the position where the area ends or Although specific information is added immediately after the parentheses surrounding the area surrounded by the parentheses, there is a method of outputting the specific information as information or a file different from the original data.
図4におけるステップS5については、図1における9の括弧類挿入方法格納メモリにつぃいて、必ずしも表3に記載のように動作の種類を表す数値を用いることにより判定するよる必要はなく、また、そもそも表3に掲げたような表をつかった実装を行う必要もない。例えば、条件分岐処理等により記述しても問題はなく、これらの実装方法が上記の処理に影響を与えるものではない。 Step S5 in FIG. 4 does not necessarily have to be determined by using the numerical value representing the type of operation as shown in Table 3 for the parenthesis insertion method storage memory of 9 in FIG. In the first place, there is no need to implement using the table shown in Table 3. For example, there is no problem even if it is described by conditional branch processing or the like, and these mounting methods do not affect the above processing.
図1:
実線 処理の流れを表す
破線 メモリ・ハードディスク等を参照していることを表す
四角実線(横長) 処理を表す
四角波線(横長) メモリを表す
四角(角丸) 入出力を表す
四角(縦長) 図2から図4で表現している範囲を表す
図2、図3、図4:
S? プログラム処理のステップを表す
実線 処理の流れを表す
四角 処理を表す
菱形 条件分岐を表す
丸 プログラムの該当部分へ遷移することを表す
四角(角丸) 処理開始又は処理終了を表す
Figure 1:
Solid line Indicates the processing flow
Dashed line Indicates that a memory or hard disk is being referenced
Square solid line (horizontal) Indicates processing
Square wave line (horizontal) Represents memory
Square (Rounded circle) Indicates input / output
Square (Longitudinal) Indicates the range expressed in FIGS.
2, FIG. 3, FIG. 4:
S? Represents program processing steps
Solid line Indicates the processing flow
Represents square processing
Rhombus Indicates a conditional branch
Circle Indicates transition to the relevant part of the program
Square (Rounded circle) Indicates the start or end of processing
Claims (19)
A recording medium recording a processing program according to the processing steps of any one of claims 10 to 18.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005025858A JP2006215679A (en) | 2005-02-02 | 2005-02-02 | Information processor, information processing method, and recording medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005025858A JP2006215679A (en) | 2005-02-02 | 2005-02-02 | Information processor, information processing method, and recording medium |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2006215679A true JP2006215679A (en) | 2006-08-17 |
Family
ID=36978886
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005025858A Pending JP2006215679A (en) | 2005-02-02 | 2005-02-02 | Information processor, information processing method, and recording medium |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2006215679A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011034153A (en) * | 2009-07-29 | 2011-02-17 | Tkc Corp | Text analyzing device, text displaying device, text analyzing method, text displaying method, text analyzing program, and text displaying program |
CN103802516A (en) * | 2014-01-27 | 2014-05-21 | 宁波欧罗巴焊割科技有限公司 | Two-tone nested printing technology of panel |
-
2005
- 2005-02-02 JP JP2005025858A patent/JP2006215679A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011034153A (en) * | 2009-07-29 | 2011-02-17 | Tkc Corp | Text analyzing device, text displaying device, text analyzing method, text displaying method, text analyzing program, and text displaying program |
CN103802516A (en) * | 2014-01-27 | 2014-05-21 | 宁波欧罗巴焊割科技有限公司 | Two-tone nested printing technology of panel |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8434014B1 (en) | System and method for editing information | |
US6151570A (en) | Translating apparatus, dictionary search apparatus, and translating method | |
US20070061410A1 (en) | Webpage search | |
JP4120888B2 (en) | Data retrieval apparatus and method | |
JP2008041003A (en) | Document display processor and document display processing program | |
JP2006215679A (en) | Information processor, information processing method, and recording medium | |
JPH07129605A (en) | Document retrieval device | |
JP2005107931A (en) | Image search apparatus | |
JP2007257369A (en) | Information retrieval device | |
JP2006195575A (en) | Information processing device and method thereof | |
JP2008305105A (en) | Document data processor | |
US20120154436A1 (en) | Information display apparatus and information display method | |
JP2006120070A (en) | Programming device, its symbol inputting method, and recording medium | |
JP2003241964A (en) | Software maintenance data generation device and generation program | |
JP2785692B2 (en) | Dictionary search and display device | |
JP2947686B2 (en) | Search result display method in translation support system | |
JP2005011301A (en) | Document processor and document processing program | |
JP3933517B2 (en) | DOCUMENT SEARCH METHOD, DOCUMENT SEARCH DEVICE, DOCUMENT SEARCH PROGRAM, AND RECORDING MEDIUM CONTAINING THE PROGRAM | |
JP2007233912A (en) | Style sheet producing device and style sheet production program | |
JP5193894B2 (en) | Data editing apparatus, data editing method, and program | |
JPH03266066A (en) | Character-string substitution system with attribute | |
JP3898799B2 (en) | Document converter | |
JP3329476B2 (en) | Kana-Kanji conversion device | |
JP2007179505A (en) | Retrieval device, system, method and program, and storage medium | |
JPH11282599A (en) | Display method and device for change of file contents and medium recording display program |