JP6296044B2 - Code processing program and data structure - Google Patents

Code processing program and data structure Download PDF

Info

Publication number
JP6296044B2
JP6296044B2 JP2015238737A JP2015238737A JP6296044B2 JP 6296044 B2 JP6296044 B2 JP 6296044B2 JP 2015238737 A JP2015238737 A JP 2015238737A JP 2015238737 A JP2015238737 A JP 2015238737A JP 6296044 B2 JP6296044 B2 JP 6296044B2
Authority
JP
Japan
Prior art keywords
code
data
node
character
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
Application number
JP2015238737A
Other languages
Japanese (ja)
Other versions
JP2016034158A (en
Inventor
大介 二宮
大介 二宮
真嘉 樋口
真嘉 樋口
豊 小山
豊 小山
雅樹 西垣
雅樹 西垣
量 松村
量 松村
敏郎 小野
敏郎 小野
崇記 小澤
崇記 小澤
純史 川井
純史 川井
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2015238737A priority Critical patent/JP6296044B2/en
Publication of JP2016034158A publication Critical patent/JP2016034158A/en
Application granted granted Critical
Publication of JP6296044B2 publication Critical patent/JP6296044B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

本技術は、符号化技術に関する。   The present technology relates to an encoding technology.

従来技術では、入力文字列の圧縮を行うために文節木を生成する。この文節木の各ノードは、文字又は文字列と置き換える符号と、圧縮される文字と、階層を表すデータと、親ノードポインタと、使用される可能性がある各文字に対応する子ノードへのポインタと、各子ノードに対応する文字が出現する回数を計数するカウンタとを含む。例えば入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBB」が入力された場合、図1に示すような文節木が生成される。なお、新たなノードを生成するための出現回数の閾値は2である。この例では、第0階層のノードとしてルートノードが設けられており、第1階層のノードとして文字「0x00」乃至「0xFF」についてのノードが設けられている。第2階層のノードとして、文字「0x41」の子ノードとして文字「0x42」及び「0x41」についてのノードと、文字「0x42」の子ノードとして文字「0x43」についてのノードと、文字「0x43」の子ノードとして文字「0x42」についてのノードとが設けられている。さらに、第3階層のノードとして、文字「0x42」の子ノードとして文字「0x43」についてのノードと、文字「0x42」の子ノードとして文字「0x43」「0x41」及び「0x42」についてのノードとが設けられている。なお、各ノードについては、符号(A)と、文字(B)と、子ノードについての文字の出現回数(C)と、子ノードへのポインタ(D)とを模式的に示している。   In the prior art, a phrase tree is generated in order to compress an input character string. Each node in this phrase tree has a code that replaces the character or character string, the character to be compressed, the data representing the hierarchy, the parent node pointer, and the child node corresponding to each character that may be used. It includes a pointer and a counter that counts the number of times a character corresponding to each child node appears. For example, when an input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBB” is input, a phrase tree as shown in FIG. 1 is generated. Note that the threshold of the number of appearances for generating a new node is 2. In this example, a root node is provided as a node of the 0th hierarchy, and nodes for characters “0x00” to “0xFF” are provided as nodes of the 1st hierarchy. As nodes of the second hierarchy, nodes for characters “0x42” and “0x41” as child nodes of character “0x41”, nodes for character “0x43” as child nodes of character “0x42”, and characters “0x43” A node for the character “0x42” is provided as a child node. Furthermore, as the nodes of the third hierarchy, there are a node for the character “0x43” as a child node of the character “0x42”, and a node for the characters “0x43”, “0x41”, and “0x42” as child nodes of the character “0x42”. Is provided. In addition, about each node, the code | symbol (A), the character (B), the appearance frequency (C) of the character about a child node, and the pointer (D) to a child node are shown typically.

図2に示すように子ノードポインタと子ノードについての文字の出現回数とが、使用可能な文字種256個分となるので、1つのノードで3085バイトのメモリ容量が消費されることになる。仮に符号長2バイトで表現できる最大数65536個のノードが設けられるとすると、合計で約192Mバイトメモリ容量が消費される。   As shown in FIG. 2, since the child node pointer and the number of appearances of characters for the child node are 256 usable character types, the memory capacity of 3085 bytes is consumed in one node. If a maximum number of 65536 nodes that can be expressed by a code length of 2 bytes is provided, a total memory capacity of about 192 Mbytes is consumed.

文節木は文字列を置き換える符号の種類(すなわちノード数)が多いほど、多様なデータを圧縮することができる。しかし、符号の種類がこのように多くなるとノード数も多くなり、文節木全体のサイズが大きくなってしまう。   In the phrase tree, the more types of codes (ie, the number of nodes) that replace character strings, the more data can be compressed. However, when the number of types of codes increases in this way, the number of nodes also increases, and the overall size of the phrase tree increases.

特開2011−221845号公報JP 2011-221845 A

従って、本技術の目的は、一側面において、文節木を表すデータ構造のためのメモリ容量を削減するための技術を提供することである。   Accordingly, an object of the present technology is, in one aspect, to provide a technology for reducing a memory capacity for a data structure representing a phrase tree.

本技術の第1の態様に係る文節木のデータ構造は、分節木のデータ構造であって、(A)分節木を構成する複数のノードそれぞれが、特定の文字または文字列に対応する符号を保持する第1の領域と、(B)特定の文字または文字列の次に入力文字列において出現する文字の出現順番を複数の文字それぞれについて保持する第2の領域と、(C)特定の文字または文字列の次に入力文字列において出現した文字の出現回数が特定の閾値を超えていない場合は上記出現回数を、出現回数が特定の閾値を超えた場合は特定の文字または文字列と特定の文字または文字列の次に入力文字列において出現した文字とからなる文字列に対応して生成される符号を、特定の文字または文字列の次に入力文字列において出現した文字の出現順番に応じて保持する第3の領域とを有する。   The data structure of the phrase tree according to the first aspect of the present technology is a data structure of a segment tree, and (A) each of a plurality of nodes constituting the segment tree has a code corresponding to a specific character or character string. A first area to be held; (B) a second area to hold the appearance order of the character appearing in the input character string next to the specific character or character string for each of the plurality of characters; and (C) the specific character. Or, if the number of appearances of the character that appears in the input character string after the character string does not exceed a specific threshold, the number of appearances is specified, and if the number of appearances exceeds a specific threshold, the specific character or character string is specified. The code generated corresponding to the character string that consists of the character that appears in the input character string next to the character or character string in the order of appearance of the character that appears in the input character string after the specific character or character string Hold accordingly And a third region that.

本技術の第2の態様に係るデータ構造は、文節木に対応する第1のデータと、文節木の各ノードに対応する文字又は文字列についての第2のデータと、文節木の階層についての第3のデータとを有する。また、第1のデータにおいて、文節木の各ノードについて、当該ノードの親ノードの符号又は当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられている。第2のデータは、文節木の第2階層以降の各階層の各ノードについて当該ノードに対応する文字又は文字列のコードを当該ノードの符号の順に含む。さらに、第3のデータは、文節木の第2階層以降の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号と、第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む。   The data structure according to the second aspect of the present technology includes: first data corresponding to a phrase tree; second data regarding a character or character string corresponding to each node of the phrase tree; And third data. In the first data, for each node in the phrase tree, the maximum code of the code of the parent node of the node or the code of the child node of the node, the code of the character represented by the node, and the node Data that associates with the hierarchy to which the node belongs is arranged in the order of the codes of the nodes. The second data includes, for each node in each hierarchy after the second hierarchy of the phrase tree, a character or character string code corresponding to the node in the order of the code of the node. Further, the third data includes, for each hierarchy after the second hierarchy of the phrase tree, the number of nodes belonging to the hierarchy, the smallest code among the codes of the nodes belonging to the hierarchy, and the minimum in the second data. The data which matches the offset value from the head of the arrangement position of the character or character string corresponding to the code of.

文節木を表すデータ構造のためのメモリ容量を削減できるようになる。   The memory capacity for the data structure representing the phrase tree can be reduced.

図1は、従来例の文節木を表すデータ構造の一例を模式的に示す図である。FIG. 1 is a diagram schematically showing an example of a data structure representing a conventional phrase tree. 図2は、従来例の使用メモリ量の一例を示す図である。FIG. 2 is a diagram illustrating an example of the amount of memory used in the conventional example. 図3は、第1の実施の形態に係る文節木の1ノード分のデータ構造を示す図である。FIG. 3 is a diagram illustrating a data structure for one node of a phrase tree according to the first embodiment. 図4は、拡張カウンタ兼子ノード番号の配列の一例を示す図である。FIG. 4 is a diagram showing an example of an array of extension counter / child node numbers. 図5は、実施の形態に係る情報処理装置の機能ブロック図である。FIG. 5 is a functional block diagram of the information processing apparatus according to the embodiment. 図6は、実施の形態に係るメインの処理フローを示す図である。FIG. 6 is a diagram illustrating a main processing flow according to the embodiment. 図7は、文節木生成処理の処理フローを示す図である。FIG. 7 is a diagram illustrating a processing flow of phrase tree generation processing. 図8は、文節木のデータの生成処理を説明するための図である。FIG. 8 is a diagram for explaining phrase tree data generation processing. 図9は、文節木のデータの生成処理を説明するための図である。FIG. 9 is a diagram for explaining phrase tree data generation processing. 図10は、文節木のデータの生成処理を説明するための図である。FIG. 10 is a diagram for explaining phrase tree data generation processing. 図11は、文節木のデータの生成処理を説明するための図である。FIG. 11 is a diagram for explaining data generation processing of phrase trees. 図12は、文節木のデータの生成処理を説明するための図である。FIG. 12 is a diagram for explaining phrase tree data generation processing. 図13は、文節木のデータの生成処理を説明するための図である。FIG. 13 is a diagram for explaining phrase tree data generation processing. 図14は、文節木のデータの生成処理を説明するための図である。FIG. 14 is a diagram for explaining phrase tree data generation processing. 図15は、文節木のデータの生成処理を説明するための図である。FIG. 15 is a diagram for explaining phrase tree data generation processing. 図16は、文節木のデータの生成処理を説明するための図である。FIG. 16 is a diagram for explaining phrase tree data generation processing. 図17は、文節木のデータの生成処理を説明するための図である。FIG. 17 is a diagram for explaining phrase tree data generation processing. 図18は、文節木のデータの生成処理を説明するための図である。FIG. 18 is a diagram for explaining phrase tree data generation processing. 図19は、文節木のデータの生成処理を説明するための図である。FIG. 19 is a diagram for explaining phrase tree data generation processing. 図20Aは、文節木のデータの生成処理を説明するための図である。FIG. 20A is a diagram for explaining the phrase tree data generation process. 図20Bは、文節木のデータの生成処理を説明するための図である。FIG. 20B is a diagram for explaining phrase tree data generation processing. 図20Cは、文節木のデータの生成処理を説明するための図である。FIG. 20C is a diagram for explaining the data generation process of the phrase tree. 図20Dは、文節木のデータの生成処理を説明するための図である。FIG. 20D is a diagram for explaining the data generation process of phrase trees. 図20Eは、文節木のデータの生成処理を説明するための図である。FIG. 20E is a diagram for explaining the phrase tree data generation process. 図20Fは、文節木のデータの生成処理を説明するための図である。FIG. 20F is a diagram for describing phrase tree data generation processing. 図21は、文節木のデータの生成処理を説明するための図である。FIG. 21 is a diagram for explaining phrase tree data generation processing. 図22Aは、文節木のデータの生成処理を説明するための図である。FIG. 22A is a diagram for explaining the phrase tree data generation process. 図22Bは、文節木のデータの生成処理を説明するための図である。FIG. 22B is a diagram for explaining phrase tree data generation processing. 図23は、文節木のデータの生成処理を説明するための図である。FIG. 23 is a diagram for explaining phrase tree data generation processing. 図24Aは、文節木のデータの生成処理を説明するための図である。FIG. 24A is a diagram for explaining data generation processing of phrase trees. 図24Bは、文節木のデータの生成処理を説明するための図である。FIG. 24B is a diagram for explaining the phrase tree data generation process. 図24Cは、文節木のデータの生成処理を説明するための図である。FIG. 24C is a diagram for explaining the phrase tree data generation process. 図24Dは、文節木のデータの生成処理を説明するための図である。FIG. 24D is a diagram for explaining the data generation process of phrase trees. 図24Eは、文節木のデータの生成処理を説明するための図である。FIG. 24E is a diagram for explaining the phrase tree data generation process. 図24Fは、文節木のデータの生成処理を説明するための図である。FIG. 24F is a diagram for describing phrase tree data generation processing. 図25は、文節木のデータの生成処理を説明するための図である。FIG. 25 is a diagram for explaining phrase tree data generation processing. 図26Aは、番号取得処理の処理フローを示す図である。FIG. 26A is a diagram illustrating a processing flow of number acquisition processing. 図26Bは、配列設定処理の処理フローを示す図である。FIG. 26B is a diagram illustrating a processing flow of array setting processing. 図27は、カレントノード設定処理の処理フローを示す図である。FIG. 27 is a diagram illustrating a processing flow of current node setting processing. 図28は、文節木の一例を示す図である。FIG. 28 is a diagram illustrating an example of a phrase tree. 図29は、ソート後の文節木の一例を示す図である。FIG. 29 is a diagram illustrating an example of the phrase tree after sorting. 図30は、圧縮マップを説明するための図である。FIG. 30 is a diagram for explaining the compression map. 図31は、圧縮マップの生成を説明するための図である。FIG. 31 is a diagram for explaining generation of a compression map. 図32は、圧縮マップの生成処理を説明するための図である。FIG. 32 is a diagram for explaining compression map generation processing. 図33は、圧縮マップの生成処理を説明するための図である。FIG. 33 is a diagram for explaining compression map generation processing. 図34は、圧縮マップの生成処理を説明するための図である。FIG. 34 is a diagram for explaining compression map generation processing. 図35は、圧縮マップの生成処理を説明するための図である。FIG. 35 is a diagram for explaining compression map generation processing. 図36は、圧縮マップの生成処理を説明するための図である。FIG. 36 is a diagram for explaining compression map generation processing. 図37は、圧縮マップの生成処理を説明するための図である。FIG. 37 is a diagram for explaining compression map generation processing. 図38は、圧縮マップの生成処理を説明するための図である。FIG. 38 is a diagram for explaining compression map generation processing. 図39は、圧縮マップの生成処理を説明するための図である。FIG. 39 is a diagram for explaining compression map generation processing. 図40は、圧縮マップの生成処理を説明するための図である。FIG. 40 is a diagram for explaining compression map generation processing. 図41は、圧縮マップの生成処理を説明するための図である。FIG. 41 is a diagram for explaining compression map generation processing. 図42は、圧縮マップの生成処理を説明するための図である。FIG. 42 is a diagram for explaining compression map generation processing. 図43は、圧縮マップの生成処理を説明するための図である。FIG. 43 is a diagram for explaining compression map generation processing. 図44は、圧縮マップの生成処理を説明するための図である。FIG. 44 is a diagram for explaining compression map generation processing. 図45は、圧縮マップの生成処理を説明するための図である。FIG. 45 is a diagram for explaining compression map generation processing. 図46は、圧縮マップの生成処理を説明するための図である。FIG. 46 is a diagram for explaining compression map generation processing. 図47は、圧縮マップの生成処理を説明するための図である。FIG. 47 is a diagram for explaining compression map generation processing. 図48は、圧縮マップの生成処理を説明するための図である。FIG. 48 is a diagram for explaining compression map generation processing. 図49は、圧縮マップの生成処理を説明するための図である。FIG. 49 is a diagram for explaining compression map generation processing. 図50は、圧縮マップの生成処理を説明するための図である。FIG. 50 is a diagram for explaining compression map generation processing. 図51は、圧縮マップ生成処理の処理フローを示す図である。FIG. 51 is a diagram showing a processing flow of compression map generation processing. 図52は、エントリ追加処理の処理フローを示す図である。FIG. 52 is a diagram showing a processing flow of entry addition processing. 図53は、圧縮処理の処理フローを示す図である。FIG. 53 is a diagram showing a processing flow of compression processing. 図54は、圧縮マップの一例を示す図である。FIG. 54 is a diagram illustrating an example of a compression map. 図55は、圧縮処理を説明するための図である。FIG. 55 is a diagram for explaining the compression processing. 図56は、伸張処理の処理フローを示す図である。FIG. 56 is a diagram showing a processing flow of decompression processing. 図57は、伸張処理を説明するための図である。FIG. 57 is a diagram for explaining the decompression process. 図58は、文節木のデータ構造を用いて圧縮する場合の処理を説明するための図である。FIG. 58 is a diagram for explaining processing when compression is performed using a phrase tree data structure. 図59は、文節木のデータ構造を用いて圧縮する場合の処理を説明するための図である。FIG. 59 is a diagram for explaining processing when compression is performed using a phrase tree data structure. 図60は、文節木のデータ構造を用いて圧縮する場合の処理を説明するための図である。FIG. 60 is a diagram for explaining processing when compression is performed using a phrase tree data structure. 図61は、文節木のデータ構造を用いて圧縮する場合の処理を説明するための図である。FIG. 61 is a diagram for explaining processing when compression is performed using a data structure of a phrase tree. 図62は、文節木のデータ構造を用いて伸張する場合の処理を説明するための図である。FIG. 62 is a diagram for explaining processing when decompressing using the data structure of the phrase tree. 図63は、文節木のデータ構造を用いて伸張する場合の処理を説明するための図である。FIG. 63 is a diagram for explaining processing when decompressing using the data structure of the phrase tree. 図64は、文節木のデータ構造を用いて伸張する場合の処理を説明するための図である。FIG. 64 is a diagram for explaining processing when decompressing using the data structure of the phrase tree. 図65は、文節木のデータ構造を用いて伸張する場合の処理を説明するための図である。FIG. 65 is a diagram for explaining processing when decompressing using the data structure of the phrase tree. 図66は、文節木のデータ構造を用いて伸張する場合の処理を説明するための図である。FIG. 66 is a diagram for explaining processing when decompressing using the data structure of the phrase tree. 図67は、第2の実施の形態を説明するための文節木を表す図である。FIG. 67 is a diagram illustrating a phrase tree for explaining the second embodiment. 図68は、第2の実施の形態における圧縮マップの模式図である。FIG. 68 is a schematic diagram of a compression map according to the second embodiment. 図69は、第2の実施の形態におけるエントリ追加処理2の処理フローを示す図である。FIG. 69 is a diagram illustrating a processing flow of entry addition processing 2 according to the second embodiment. 図70は、第2の実施の形態における圧縮処理2の処理フローを示す図である。FIG. 70 is a diagram illustrating a processing flow of compression processing 2 according to the second embodiment. 図71は、第2の実施の形態における圧縮マップの一例を示す図である。FIG. 71 is a diagram illustrating an example of a compression map according to the second embodiment. 図72は、第3の実施の形態における圧縮マップの一例を示す図である。FIG. 72 is a diagram illustrating an example of a compression map according to the third embodiment. 図73は、第3の実施の形態における階層情報の一例を示す図である。FIG. 73 is a diagram illustrating an example of the hierarchy information in the third embodiment. 図74は、第3の実施の形態における伸張マップの一例を示す図である。FIG. 74 is a diagram illustrating an example of an expansion map according to the third embodiment. 図75は、第3の実施の形態における圧縮マップ生成処理2の処理フローを示す図である。FIG. 75 is a diagram illustrating a processing flow of the compression map generation processing 2 according to the third embodiment. 図76は、第3の実施の形態におけるエントリ追加処理3の処理フローを示す図である。FIG. 76 is a diagram illustrating a processing flow of entry addition processing 3 according to the third embodiment. 図77は、第3の実施の形態における設定処理の処理フローを示す図である。FIG. 77 is a diagram illustrating a processing flow of setting processing according to the third embodiment. 図78は、第3の実施の形態における圧縮処理3の処理フローを示す図である。FIG. 78 is a diagram illustrating a processing flow of the compression processing 3 in the third embodiment. 図79は、第3の実施の形態における伸張処理2の処理フローを示す図である。FIG. 79 is a diagram illustrating a processing flow of the decompression processing 2 according to the third embodiment. 図80は、伸張処理2を説明するための図である。FIG. 80 is a diagram for explaining the decompression process 2. 図81は、第4の実施の形態における圧縮マップの一例を示す図である。FIG. 81 is a diagram illustrating an example of a compression map according to the fourth embodiment. 図82は、第4の実施の形態における階層情報の一例を示す図である。FIG. 82 is a diagram illustrating an example of the hierarchy information in the fourth embodiment. 図83は、第4の実施の形態における伸張マップの一例を示す図である。FIG. 83 is a diagram illustrating an example of an expansion map according to the fourth embodiment. 図84は、第4の実施の形態における圧縮マップ生成処理3の処理フローを示す図である。FIG. 84 is a diagram showing a processing flow of the compression map generation processing 3 in the fourth embodiment. 図85は、第4の実施の形態におけるエントリ追加処理4の処理フローを示す図である。FIG. 85 is a diagram illustrating a process flow of the entry addition process 4 in the fourth embodiment. 図86は、第4の実施の形態における設定処理2の処理フローを示す図である。FIG. 86 is a diagram illustrating a processing flow of setting processing 2 according to the fourth embodiment. 図87は、第4の実施の形態における圧縮処理4の処理フローを示す図である。FIG. 87 is a diagram illustrating a processing flow of the compression processing 4 in the fourth embodiment. 図88は、第4の実施の形態における伸張処理3の処理フローを示す図である。FIG. 88 is a diagram illustrating a processing flow of the decompression processing 3 according to the fourth embodiment. 図89は、コンピュータの機能ブロック図である。FIG. 89 is a functional block diagram of a computer.

[実施の形態1]
図3に本実施の形態に係る文節木におけるノード1つ分のデータ構造を示す。ノードのデータブロックは、符号(IDX)の領域と、文字出現番号の配列の領域と、カウンタ兼子ノード番号の配列の領域と、スパンド番号の領域と、文字出現数の領域とを含む。また、これとは別に、拡張カウンタ兼子ノード番号の配列数をカウントするための領域を有する。
[Embodiment 1]
FIG. 3 shows a data structure for one node in the phrase tree according to the present embodiment. The data block of the node includes a code (IDX) region, a character appearance number array region, a counter / child node number array region, a spanned number region, and a character appearance number region. Separately from this, there is an area for counting the number of arrays of extension counter / child node numbers.

文字出現番号の領域は、本ノードの符号に対応する文字又は文字列の次に出現する各文字(0x00乃至0xFFまでの各文字)について出現順番を保持する配列である。但し、文字出現数が256の場合以外「FF」は未使用を表す。また、他の値は、カウンタ兼子ノード番号の配列番号を表す。例えば、文字「0x41(A)」のノードについて着目し、文節木を生成するための文字列が「ABAAC」である場合、最初の「A」の次にまず出現した文字はB(0x42)なので、文字出現番号の領域0x42番目に「0」が設定され、次の「A」の次に出現した文字はAなので、文字出現番号の領域0x41番目に「1」が設定され、次の「A」の次に出現した文字はCなので、文字出現番号の領域0x43番目に「2」が設定される。   The character appearance number area is an array that holds the appearance order of each character (each character from 0x00 to 0xFF) that appears next to the character or character string corresponding to the code of this node. However, “FF” represents unused, except when the number of character appearances is 256. The other values represent the array number of the counter / child node number. For example, paying attention to the node of the character “0x41 (A)”, when the character string for generating the phrase tree is “ABAAC”, the character that first appears after the first “A” is B (0x42). , “0” is set in the character appearance number area 0x42 and the character that appears next to the next “A” is A, so “1” is set in the character appearance number area 0x41 and the next “A” “2” is set in the character appearance number area 0x43.

カウンタ兼子ノード番号の配列には、出現順番に従って出現回数(カウンタ)又は子ノード番号(「0x」が付された番号)が格納される。上で述べた例では、「0」番目に文字「0x42」についての子ノード番号(符号)「0x0100」が格納され、「1」番目に文字「0x41」についての子ノード番号(符号)「0x0104」が格納され、「2」番目に文字「0x043」についての出現回数「1」が格納されている。本実施の形態では、カウンタ兼子ノード番号の領域には、8つの出現回数又は子ノード番号しか格納できない。8つを超える出現回数又は子ノード番号を保持する場合には、拡張カウンタ兼子ノード番号の配列の番号をスパンド番号の領域に設定する。スパンド番号の初期値は「0xFFFF」である。   The counter / child node number array stores the number of appearances (counter) or child node numbers (numbers with “0x”) according to the order of appearance. In the example described above, the child node number (code) “0x0100” for the character “0x42” is stored in the “0” th, and the child node number (code) “0x0104” for the character “0x41” is stored in the “1” th. ", And the number of appearances" 1 "for the character" 0x043 "is stored in the" 2 "th position. In the present embodiment, only 8 occurrence counts or child node numbers can be stored in the counter / child node number area. When the number of appearances or child node numbers exceeding eight is held, the array number of the extended counter / child node number is set in the spanned number area. The initial value of the spanned number is “0xFFFF”.

拡張カウンタ兼子ノード番号の配列は、どのノードからも参照される共通領域に設けられる。図4に示すように、この配列も1つで8つの出現回数又は子ノード番号を保持できるようになっており、最後にこの配列でも不足する場合に参照すべき拡張カウンタ兼子ノード番号の配列の番号(拡張スパンド番号)が設定されるようになっている。   The array of extension counter / child node numbers is provided in a common area referenced from any node. As shown in FIG. 4, the number of occurrences or child node numbers of this array can be held by one, and the extension counter / child node number array to be referred to when this array is insufficient at the end. A number (extended spanned number) is set.

文字出現数の領域には、本ノードに対応する文字又は文字列の次に出現した文字の数が設定される。上で述べた例では「B」「A」「C」の3文字出現したので「3」が設定される。   The number of characters that appear next to the character or character string corresponding to this node is set in the character appearance number area. In the example described above, since three characters “B”, “A”, and “C” appear, “3” is set.

このように、デフォルトで特定できる子ノードの数を限定して必ずしも用いない子ノードへのポインタの領域を削減している。また、親ノードへのポインタも有していないので、メモリ使用量が削減されている。   Thus, the number of child nodes that can be specified by default is limited to reduce the area of pointers to child nodes that are not necessarily used. In addition, since it does not have a pointer to the parent node, the memory usage is reduced.

本実施の形態では、このような文節木を生成する処理、このような文節木からディスクに格納するためのデータ構造である圧縮マップを生成する処理、圧縮マップを用いた圧縮処理及び伸張処理、並びにこれらの処理を実施する装置などについて説明する。   In the present embodiment, a process for generating such a phrase tree, a process for generating a compression map that is a data structure for storing in the disk from such a phrase tree, a compression process and an expansion process using the compression map, An apparatus for performing these processes will be described.

本実施の形態に係る情報処理装置100の機能ブロック図を図5に示す。情報処理装置100は、文節木生成部110と、圧縮マップ生成部120と、データ格納部130と、圧縮処理部140と、伸張処理部150と、入出力部160とを有する。   FIG. 5 shows a functional block diagram of the information processing apparatus 100 according to the present embodiment. The information processing apparatus 100 includes a phrase tree generation unit 110, a compression map generation unit 120, a data storage unit 130, a compression processing unit 140, an expansion processing unit 150, and an input / output unit 160.

文節木生成部110は、例えば入出力部160から入力された文節木生成のための入力文字列に対して処理を行って本実施の形態に係る文節木のデータを生成する。圧縮マップ生成部120は、文節木生成部110が生成した文節木のデータから圧縮マップを生成して、データ格納部130に格納する。   For example, the phrase tree generation unit 110 performs processing on an input character string for generation of a phrase tree input from the input / output unit 160 to generate phrase tree data according to the present embodiment. The compression map generation unit 120 generates a compression map from the phrase tree data generated by the phrase tree generation unit 110 and stores the compression map in the data storage unit 130.

圧縮処理部140は、データ格納部130に格納されている圧縮マップを用いて例えば入出力部160から入力された圧縮対象の入力文字列に対して圧縮処理を実施して、圧縮結果をデータ格納部130に格納する。伸張処理部150は、データ格納部130に格納されている圧縮マップを用いて、例えばデータ格納部130に格納されている圧縮結果に対して伸張処理を実施し、伸張結果をデータ格納部130に格納する。入出力部160は、伸張結果を表示装置などの出力装置又は他のコンピュータなどに出力する場合もある。   The compression processing unit 140 uses the compression map stored in the data storage unit 130 to perform compression processing on the input character string to be compressed input from the input / output unit 160, for example, and stores the compression result as data Stored in the unit 130. The decompression processing unit 150 uses the compression map stored in the data storage unit 130 to perform, for example, decompression processing on the compression result stored in the data storage unit 130, and stores the decompression result in the data storage unit 130. Store. The input / output unit 160 may output the expansion result to an output device such as a display device or another computer.

次に、図6乃至図66を用いて情報処理装置100の処理内容について説明する。まず、文節木生成部110は、入力文字列に対して文節木生成処理を実施する(図6:ステップS1)。この文節木生成処理については図7乃至図27を用いて詳細に説明する。また、圧縮マップ生成部120は、文節木生成部110によって生成された文節木から圧縮マップを生成する圧縮マップ生成処理を実施し、データ格納部130に格納する(ステップS3)。圧縮マップ生成処理については図28乃至図52を用いて詳細に説明する。   Next, processing contents of the information processing apparatus 100 will be described with reference to FIGS. First, the phrase tree generation unit 110 performs a phrase tree generation process on the input character string (FIG. 6: step S1). This phrase tree generation process will be described in detail with reference to FIGS. In addition, the compression map generation unit 120 performs a compression map generation process for generating a compression map from the phrase tree generated by the phrase tree generation unit 110, and stores the compression map generation process in the data storage unit 130 (step S3). The compression map generation process will be described in detail with reference to FIGS.

その後、例えば入出力部160から圧縮対象の入力文字列が入力されると、圧縮処理部140は、圧縮マップを用いて圧縮処理を実施し、圧縮結果をデータ格納部130に格納する(ステップS5)。圧縮処理については図53乃至図55を用いて詳細に説明する。また、例えば入出力部160から指示されると、伸張処理部150は、例えばデータ格納部130に格納されている圧縮結果に対して、圧縮マップを用いて伸張処理を実施し、処理結果をデータ格納部130に格納する(ステップS7)。伸張処理については図56及び図57を用いて詳細に説明する。   Thereafter, for example, when an input character string to be compressed is input from the input / output unit 160, the compression processing unit 140 performs a compression process using the compression map and stores the compression result in the data storage unit 130 (step S5). ). The compression process will be described in detail with reference to FIGS. For example, when instructed by the input / output unit 160, the decompression processing unit 150 performs decompression processing on the compression result stored in the data storage unit 130, for example, using a compression map, and the processing result is stored as data. Store in the storage unit 130 (step S7). The decompression process will be described in detail with reference to FIGS.

次に、文節木生成処理について図7を用いて説明する。まず、文節木生成部110は、符号0x0000乃至0x00FFのノードのデータを生成する(ステップS11)。必ず設けられる第1階層のノードを初期設定として生成する。   Next, phrase tree generation processing will be described with reference to FIG. First, the phrase tree generator 110 generates node data with codes 0x0000 to 0x00FF (step S11). A node in the first hierarchy that is always provided is generated as an initial setting.

そして、文節木生成部110は、入力文字列から入力文字を1バイト読み込み、そのノードをカレントノードに設定する(ステップS13)。さらに、文節木生成部110は、入力文字列から次の入力文字を1バイト読み込む(ステップS15)。そして、文節木生成部110は、次の入力文字が入力文字列の終端であるか判断する(ステップS17)。次の入力文字が入力文字列の終端であれば、処理は呼出元の処理に戻る。   Then, the phrase tree generation unit 110 reads one byte of the input character from the input character string, and sets the node as the current node (step S13). Further, the phrase tree generation unit 110 reads one byte of the next input character from the input character string (step S15). Then, the phrase tree generation unit 110 determines whether the next input character is the end of the input character string (step S17). If the next input character is the end of the input character string, the process returns to the caller process.

一方、次の入力文字が入力文字列の終端ではない場合には、文節木生成部110は、入力文字のコードを配列番号として用いて、カレントノードの文字出現番号の配列に格納されている値Aを取得する(ステップS18)。そして、文節木生成部110は、番号取得処理を実施する(ステップS19)。この番号取得処理については、図26A及び図26Bを用いて説明する。   On the other hand, if the next input character is not the end of the input character string, the phrase tree generator 110 uses the code of the input character as the array number, and the value stored in the character appearance number array of the current node A is acquired (step S18). Then, the phrase tree generation unit 110 performs a number acquisition process (step S19). This number acquisition process will be described with reference to FIGS. 26A and 26B.

その後、文節木生成部110は、カレントノード設定処理を実施する(ステップS21)。カレントノード設定処理については、図27を用いて説明する。その後処理はステップS15に戻る。   Thereafter, the phrase tree generator 110 performs a current node setting process (step S21). The current node setting process will be described with reference to FIG. Thereafter, the process returns to step S15.

番号取得処理及びカレントノード設定処理の詳細を述べる前に、処理内容を分かり易くするために、具体例について図8乃至図25を用いて説明しておく。ここでは、「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」という文字列を入力する際の処理を説明する。また、文節木のデータ構造だけではなく、文節木の模式図をも併せて説明する。   Before describing the details of the number acquisition process and the current node setting process, a specific example will be described with reference to FIGS. Here, the processing when inputting the character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” will be described. In addition to the data structure of the phrase tree, a schematic diagram of the phrase tree will also be described.

ステップS11では、模式的に示せば図8に示すように、第1階層として符号0x0001乃至0x00FFのノードが生成される。この例では主に符号「0x0041」「0x0042」「0x0043」のノード及びその子ノードが主な処理対象となるので、この部分のみが示されている。また、図9に示すようなデータ構造のデータブロックが生成される。このように、文字「0x41」に対応する符号「0x0041」についての図3に示したデータブロックと、文字「0x42」に対応する符号「0x0042」についての図3に示したデータブロックと、文字「0x43」に対応する符号「0x0043」についての図3に示したデータブロックとが生成される。この段階では設定される値は初期値である。   In step S11, as schematically shown in FIG. 8, nodes 0x0001 to 0x00FF are generated as the first layer. In this example, mainly the nodes of the codes “0x0041”, “0x0042”, and “0x0043” and their child nodes are the main processing targets, so only this portion is shown. Further, a data block having a data structure as shown in FIG. 9 is generated. Thus, the data block shown in FIG. 3 for the code “0x0041” corresponding to the character “0x41”, the data block shown in FIG. 3 for the code “0x0042” corresponding to the character “0x42”, and the character “ The data block shown in FIG. 3 for the code “0x0043” corresponding to “0x43” is generated. The value set at this stage is an initial value.

次に、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の最初の「A」を読み込み、対応する符号「0x0041」のノードをカレントノードに設定する。また、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の次の「B」を読み込む。そうすると、図10に示すように、カレントノードの文字出現番号の配列において「0x42(B)」の値を参照すると「0xFF」のため、文字出現番号=出現順番=0を設定する。また、文字出現数の値を「0」から「1」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x42」に対応する符号「0x0042」のノードに変更する。なお、新たなカレントノードを黒塗り三角形で表し、旧カレントノードを白抜き三角形で表す。   Next, the first “A” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read, and the node with the corresponding code “0x0041” is set as the current node. Also, “B” next to the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 10, when the value of “0x42 (B)” is referred to in the character appearance number array of the current node, “0xFF” is set, so that character appearance number = order of appearance = 0 is set. Also, the value of the character appearance number is updated from “0” to “1”. Furthermore, in the array of counter and child node numbers, the value of the appearance order “0” is smaller than “0x0100”, so the appearance count “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node “0x0042” corresponding to the character “0x42”. The new current node is represented by a black triangle, and the old current node is represented by a white triangle.

次に、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「A」を読み込む。そうすると、図11に示すように、カレントノードの文字出現番号の配列において「0x41(A)」の値を参照すると「0xFF」のため、文字出現番号=出現順番=0を設定する。また、文字出現数の値を「0」から「1」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x41」に対応する符号「0x0041」のノードに変更する。   Next, “A” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 11, when the value of “0x41 (A)” is referenced in the character appearance number array of the current node, “0xFF” is set, so that character appearance number = appearance order = 0 is set. Also, the value of the character appearance number is updated from “0” to “1”. Furthermore, in the array of counter and child node numbers, the value of the appearance order “0” is smaller than “0x0100”, so the appearance count “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node with a code “0x0041” corresponding to the character “0x41”.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「B」を読み込む。そうすると、図12に示すように、カレントノードの文字出現番号の配列において「0x42(B)」の値を参照すると出現順番「0」が得られる。そして、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「1」を1インクリメントする。そうすると、閾値「2」に達するので、図12に示すように、新規に符号「0x0100」の子ノードを生成し、カウンタ兼子ノード番号の配列の「0」番目に子ノードの符号「0x0100」を設定する。符号「0x0100」は「AB」に対応する符号となる。そして、カレントノードを符号「0x0100」の子ノードに設定する。文節木は、図8のような状態から、図13に示す状態に変化する。   Furthermore, “B” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 12, when the value “0x42 (B)” is referenced in the character appearance number array of the current node, the appearance order “0” is obtained. In the counter / child node number array, the value “0” in the order of appearance is smaller than “0x0100”, so the appearance count “1” is incremented by one. Then, since the threshold value “2” is reached, as shown in FIG. 12, a child node with a code “0x0100” is newly generated, and the code “0x0100” of the child node is added to the “0” th of the counter / child node number array. Set. The code “0x0100” is a code corresponding to “AB”. Then, the current node is set as a child node of the code “0x0100”. The phrase tree changes from the state shown in FIG. 8 to the state shown in FIG.

また、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「C」を読み込む。そうすると、図14に示すように、カレントノードの文字出現番号の配列において「0x43(C)」の値を参照すると「0xFF」のため、文字出現番号=出現順番=0を設定する。また、文字出現数の値を「0」から「1」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x43」に対応する符号「0x0043」のノードに変更する。   Also, “C” in the input character string “ABABCABCCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 14, when the value “0x43 (C)” is referred to in the character appearance number array of the current node, “0xFF” is set, so that character appearance number = appearance order = 0 is set. Also, the value of the character appearance number is updated from “0” to “1”. Furthermore, in the array of counter and child node numbers, the value of the appearance order “0” is smaller than “0x0100”, so the appearance count “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node of the code “0x0043” corresponding to the character “0x43”.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「A」を読み込む。そうすると、図15に示すように、カレントノードの文字出現番号の配列において「0x41(A)」の値を参照すると「0xFF」のため、文字出現番号=出現順番=0を設定する。また、文字出現数の値を「0」から「1」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x41」に対応する符号「0x0041」のノードに変更する。   Furthermore, “A” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 15, when the value of “0x41 (A)” is referred to in the character appearance number array of the current node, “0xFF” is set, so that character appearance number = appearance order = 0 is set. Also, the value of the character appearance number is updated from “0” to “1”. Furthermore, in the array of counter and child node numbers, the value of the appearance order “0” is smaller than “0x0100”, so the appearance count “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node with a code “0x0041” corresponding to the character “0x41”.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「B」を読み込む。そうすると、図16に示すように、カレントノードの文字出現番号の配列において「0x42(B)」の値を参照すると「0」のため、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値を参照する。そうすると符号「0x0100」が得られるので、カレントノードを符号「0x0100」のノードに変更する。   Furthermore, “B” of the input character string “ABABCABCCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 16, when the value “0x42 (B)” is referred to in the character appearance number array of the current node, it is “0”, and therefore the appearance order “0” th in the counter / child node number array. Refers to the value. Then, since the code “0x0100” is obtained, the current node is changed to the node of the code “0x0100”.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「C」を読み込む。そうすると、図17に示すように、カレントノードの文字出現番号の配列において「0x43(C)」の値を参照すると出現順番「0」が得られる。そして、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「1」を1インクリメントする。そうすると、閾値「2」に達するので、図17に示すように、新規に符号「0x0101」の子ノードを生成し、カウンタ兼子ノード番号の配列の「0」番目に子ノードの符号「0x0101」を設定する。符号「0x0101」は「ABC」に対応する符号となる。そして、カレントノードを符号「0x0101」の子ノードに設定する。文節木は、図13のような状態から、図18に示す状態に変化する。   Furthermore, “C” of the input character string “ABABCABCABCCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 17, when the value “0x43 (C)” is referenced in the character appearance number array of the current node, the appearance order “0” is obtained. In the counter / child node number array, the value “0” in the order of appearance is smaller than “0x0100”, so the appearance count “1” is incremented by one. Then, since the threshold value “2” is reached, as shown in FIG. 17, a child node with a code “0x0101” is newly generated, and the code “0x0101” of the child node is added to the “0” th of the counter / child node number array. Set. The code “0x0101” is a code corresponding to “ABC”. Then, the current node is set as a child node of the code “0x0101”. The phrase tree changes from the state shown in FIG. 13 to the state shown in FIG.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「A」を読み込む。そうすると、図19に示すように、カレントノードの文字出現番号の配列において「0x41(A)」の値を参照すると「0xFF」のため、文字出現番号=出現順番=0を設定する。また、文字出現数の値を「0」から「1」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x41」に対応する符号「0x0041」のノードに変更する。このような処理を繰り返して行く。   Furthermore, “A” of the input character string “ABABCABCABCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 19, when the value of “0x41 (A)” is referred to in the character appearance number array of the current node, “0xFF” is set, so that character appearance number = appearance order = 0 is set. Also, the value of the character appearance number is updated from “0” to “1”. Furthermore, in the array of counter and child node numbers, the value of the appearance order “0” is smaller than “0x0100”, so the appearance count “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node with a code “0x0041” corresponding to the character “0x41”. This process is repeated.

そして、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「I」を読み込む段階になったものとする。この時カレントノードは符号「0x0102」のノードであり、図20A乃至図20Fに示すように、カレントノードの文字出現番号の配列において「0x49(I)」の値を参照すると「0xFF」であるため、文字出現番号=出現順番「8」を設定する。また、文字出現数の値を「8」から「9」に更新する。さらに、カウンタ兼子ノード番号の配列において、出現順番「8」番目は、デフォルトの配列には入っていないので、拡張カウンタ兼子ノード番号の配列を参照することになる。ここでは拡張カウンタ兼子ノード番号の配列「0」を確保し、その配列において「0(=8−8)」番目の値を参照する。この拡張カウンタ兼子ノード番号の配列「0」における出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x49」に対応する符号「0x0049」のノードに変更する。なお、この段階では文節木は図21に示すような状態となっている。符号「0x0102」の子ノード(第3階層のノード)が8つ既に生成されている。   Then, it is assumed that “I” in the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. At this time, the current node is a node having the code “0x0102”, and as shown in FIGS. 20A to 20F, when the value “0x49 (I)” is referenced in the array of the character appearance numbers of the current node, it is “0xFF”. , Character appearance number = appearance order “8” is set. Also, the value of the character appearance number is updated from “8” to “9”. Furthermore, in the counter / child node number array, the appearance order “8” is not included in the default array, so the extended counter / child node number array is referred to. Here, the array “0” of the extension counter / child node number is secured, and the “0 (= 8−8)” th value is referred to in the array. Since the value “0” in the order of appearance in the array “0” of this extended counter / child node number is smaller than “0x0100”, the number of appearances “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node with a code “0x0049” corresponding to the character “0x49”. At this stage, the phrase tree is in a state as shown in FIG. Eight child nodes (third layer nodes) of the code “0x0102” have already been generated.

その後、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「C」を読み込む。そうすると、図22A及び図22Bに示すように、カレントノードの文字出現番号の配列において「0x43(C)」の値を参照すると出現順番「0」が得られる。そして、カウンタ兼子ノード番号の配列において、出現順番「0」番目の値が「0x0100」より小さいので、出現回数「0」を1インクリメントして「1」を設定する。また、出現回数が閾値「2」に達していないので、カレントノードを文字「0x43」に対応する符号「0x0043」のノードに変更する。   Thereafter, “C” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIGS. 22A and 22B, when the value “0x43 (C)” is referred to in the character appearance number array of the current node, the appearance order “0” is obtained. In the counter / child node number array, the value “0” in the order of appearance is smaller than “0x0100”, so the number of appearances “0” is incremented by 1 and set to “1”. In addition, since the number of appearances does not reach the threshold “2”, the current node is changed to a node of the code “0x0043” corresponding to the character “0x43”.

さらに、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「B」を読み込む。そうすると、図23に示すように、カレントノードの文字出現番号の配列において「0x42(B)」の値を参照すると「1」のため、カウンタ兼子ノード番号の配列において、出現順番「1」番目の値を参照する。そうすると符号「0x0102」が得られるので、カレントノードを符号「0x0102」のノードに変更する。   Furthermore, “B” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIG. 23, when the value of “0x42 (B)” is referred to in the character appearance number array of the current node, the value is “1”. Refers to the value. Then, since the code “0x0102” is obtained, the current node is changed to the node of the code “0x0102”.

最後に、入力文字列「ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI」の「I」を読み込む。そうすると、図24A乃至図24Fに示すように、カレントノードの文字出現番号の配列において「0x49(I)」の値を参照すると出現順番「8」が得られる。カウンタ兼子ノード番号の配列において、出現順番「8」番目は、デフォルトの配列には入っていないので、拡張カウンタ兼子ノード番号の配列を参照することになる。ここでは拡張カウンタ兼子ノード番号の配列「0」において「0(=8−8)」番目の値を参照すると、「0x0100」より小さいので、出現回数「1」を1インクリメントする。そうすると、閾値「2」に達するので、図24A乃至図24Fに示すように、新規に符号「0x010D」の子ノードを生成し、カウンタ兼子ノード番号の配列の「0」番目に子ノードの符号「0x010D」を設定する。符号「0x010D」は「ABI」に対応する符号となる。そして、カレントノードを符号「0x010D」の子ノードに設定する。文節木は、図23のような状態から、図25に示す状態に変化する。このように、第2階層には4個、第3階層には10個のノードを有する文節木が生成されるが、出現順番で子ノードを生成しているので、第2階層及び第3階層において、符号は、対応する文字のコード順には並べられていない。   Finally, “I” of the input character string “ABABCABCABCCBCBCBCAAACBACBACBBCCBBCBECBECBDCBDCBGCBGCBHCBHCBFCBFCBICBI” is read. Then, as shown in FIGS. 24A to 24F, the appearance order “8” is obtained by referring to the value “0x49 (I)” in the character appearance number array of the current node. In the counter / child node number array, the appearance order “8” is not included in the default array, so the extended counter / child node number array is referred to. Here, referring to the “0 (= 8−8)”-th value in the array “0” of the extension counter / child node number is smaller than “0x0100”, the appearance count “1” is incremented by one. Then, since the threshold value “2” is reached, as shown in FIGS. 24A to 24F, a child node with a code “0x010D” is newly generated, and the code “0” of the child node number “0” in the counter / child node number array is displayed. 0x010D "is set. The code “0x010D” is a code corresponding to “ABI”. Then, the current node is set as a child node of code “0x010D”. The phrase tree changes from the state shown in FIG. 23 to the state shown in FIG. In this way, a phrase tree having four nodes in the second hierarchy and 10 nodes in the third hierarchy is generated, but child nodes are generated in the order of appearance, so the second hierarchy and the third hierarchy are generated. Are not arranged in the code order of the corresponding characters.

このような処理を実施するための番号取得処理について、図26Aを用いて説明する。文節木生成部110は、値Aが0xFF且つ文字出現数が256ではないという条件を満たしているか判断する(ステップS31)。この条件が満たされている場合には、今まで出現していなかった文字が出現したことになるので、文節木生成部110は、値Aにカレントノードについての文字出現番号を設定し(ステップS33)、文字出現数を1インクリメントする(ステップS35)。   A number acquisition process for performing such a process will be described with reference to FIG. 26A. The phrase tree generation unit 110 determines whether the condition that the value A is 0xFF and the number of character appearances is not 256 is satisfied (step S31). When this condition is satisfied, a character that has not appeared so far has appeared, so the phrase tree generation unit 110 sets the character appearance number for the current node as the value A (step S33). ), The character appearance count is incremented by 1 (step S35).

ステップS31の条件を満たしていないと判断された場合又はステップS35の後に、文節木生成部110は、値Aが8以上であるか判断する(ステップS37)。値Aが8未満であれば、文節木生成部110は、カウンタ兼子ノード番号の配列においてA番目に格納されている値Bを取得する(ステップS51)。そして呼出元の処理に戻る。   When it is determined that the condition of step S31 is not satisfied or after step S35, the phrase tree generation unit 110 determines whether the value A is 8 or more (step S37). If the value A is less than 8, the phrase tree generator 110 acquires the value B stored in the Ath position in the counter / child node number array (step S51). Then, the process returns to the caller process.

一方、値Aが8以上であれば、文節木生成部110は、スパンド番号が0xFFFFとなっているか判断する(ステップS39)。スパンド番号が0xFFFFである場合には、まだ拡張カウンタ兼子ノード番号の配列を取得していないことになる。従って、スパンド番号が0xFFFFである場合には、文節木生成部110は、配列設定処理を実施する(ステップS41)。そして処理はステップS43に移行する。   On the other hand, if the value A is 8 or more, the phrase tree generator 110 determines whether the spanned number is 0xFFFF (step S39). If the spanned number is 0xFFFF, the array of extension counters and child node numbers has not yet been acquired. Accordingly, when the spanned number is 0xFFFF, the phrase tree generation unit 110 performs an array setting process (step S41). Then, the process proceeds to step S43.

配列設定処理について図26Bを用いて説明する。文節木生成部110は、カレントノードについてのスパンド番号又は現在参照している拡張カウンタ兼子ノード番号の配列の拡張スパンド番号に、現在の配列数を設定する(ステップS68)。そして、文節木生成部110は、配列数を1インクリメントする(ステップS69)。そして、呼出元の処理に戻る。   The array setting process will be described with reference to FIG. 26B. The phrase tree generation unit 110 sets the current number of arrays to the spanned number for the current node or the expanded spanned number of the array of the currently referenced extended counter / child node number (step S68). Then, the phrase tree generation unit 110 increments the number of arrays by 1 (step S69). Then, the process returns to the caller process.

ステップS39でスパンド番号が0xFFFFではなく他の値が設定されているか、又はステップS41の後に、文節木生成部110は、取得した「スパンド番号」又は「拡張スパンド番号」番目の拡張カウンタ兼子ノード番号の配列を参照する(ステップS43)。そして、文節木生成部110は、A=A−8を算出する(ステップS45)。その後、文節木生成部110は、Aが8以上であるか判断する(ステップS47)。Aが8以上であれば、拡張カウンタ兼子ノード番号の配列を2以上使用することになる。Aが8以上であれば、現在参照している拡張カウンタ兼子ノード番号の配列における拡張スパンド番号が0xFFFFであるか判断する(ステップS53)。拡張スパンド番号が0xFFFFでない場合にはステップS57に移行する。一方、拡張スパンド番号が0xFFFFである場合には、新たな拡張カウンタ兼子ノード番号の配列を設定することになるので、文節木生成部110は、配列設定処理(図26B)を実施する(ステップS55)。そして処理はステップS57に移行する。   In step S39, the spanned number is not 0xFFFF but another value is set, or after step S41, the phrase tree generation unit 110 acquires the “spanned number” or “extended spanned number” -th extended counter / child node number. Is referred to (step S43). Then, the phrase tree generation unit 110 calculates A = A-8 (step S45). Thereafter, the phrase tree generator 110 determines whether A is 8 or more (step S47). If A is 8 or more, two or more arrays of extension counter / child node numbers are used. If A is 8 or more, it is determined whether or not the extended spanned number in the array of the currently referred extended counter / child node number is 0xFFFF (step S53). If the expanded spanned number is not 0xFFFF, the process proceeds to step S57. On the other hand, when the extended spanned number is 0xFFFF, an array of a new extended counter / child node number is set, so the phrase tree generation unit 110 performs an array setting process (FIG. 26B) (step S55). ). Then, the process proceeds to step S57.

そして、文節木生成部110は、参照先の拡張カウンタ兼子ノード番号の配列における拡張スパンド番号、又は配列設定処理において設定された拡張カウンタ兼子ノード番号の配列における拡張スパンド番号を取得する(ステップS57)。そして処理はステップS43に戻る。   Then, the phrase tree generation unit 110 acquires the extended spanned number in the array of reference destination extended counter / child node numbers or the extended spanned number in the array of extended counter / child node numbers set in the array setting process (step S57). . Then, the process returns to step S43.

一方、値Aが8未満となれば、文節木生成部110は、参照先の拡張カウンタ兼子ノード番号の配列のA番目に格納されている値Bを取得する(ステップS49)。そして処理は呼出元の処理に戻る。   On the other hand, if the value A is less than 8, the phrase tree generation unit 110 acquires the value B stored in the Ath position in the array of reference destination extended counter / child node numbers (step S49). Then, the process returns to the caller process.

以上の処理を実施することで、子ノードの符号又は文字の出現回数を得ることができるようになる。   By performing the above processing, it is possible to obtain the number of appearances of the code or character of the child node.

次に、カレントノード設定処理について、図27を用いて説明する。文節木生成部110は、カウンタ兼子ノード番号(又は拡張カウンタ兼子ノード番号)の配列のA番目に格納されている値Bが子ノード番号(すなわち0x0100以上の符号)であるか判断する(ステップS71)。値Bが子ノード番号である場合には、文節木生成部110は、カレントノードを子ノードに位置づける(ステップS83)。そして呼出元の処理に戻る。   Next, the current node setting process will be described with reference to FIG. The phrase tree generation unit 110 determines whether or not the value B stored in the A-th array of the counter / child node number (or extension counter / child node number) is a child node number (that is, a code of 0x0100 or more) (step S71). ). When the value B is a child node number, the phrase tree generation unit 110 positions the current node as a child node (step S83). Then, the process returns to the caller process.

一方、値Bが子ノード番号ではない場合には、文節木生成部110は、値Bを1インクリメントする(ステップS73)。そして、文節木生成部110は、値Bが閾値以上となったか判断する(ステップS75)。値Bが閾値未満であれば、文節木生成部110は、カレントノードを入力文字の対応する符号のノード(すなわち、入力文字コードのノード)に位置づける(ステップS77)。そして呼出元の処理に移行する。   On the other hand, if the value B is not a child node number, the phrase tree generation unit 110 increments the value B by 1 (step S73). Then, the phrase tree generation unit 110 determines whether the value B is equal to or greater than a threshold value (step S75). If the value B is less than the threshold value, the phrase tree generation unit 110 positions the current node as the node corresponding to the code of the input character (that is, the node of the input character code) (step S77). Then, the process proceeds to the caller process.

一方、値Bが閾値以上であれば、文節木生成部110は、カウンタ兼子ノード番号(又は拡張カウンタ兼子ノード番号)の配列のA番目に、新たな子ノードの符号を設定する(ステップS79)。データブロックのうち最も大きい符号+1で新たな子ノードの符号が設定される。さらに、文節木生成部110は、設定した符号の新たな子ノードのデータブロックを生成し、カレントノードを、生成したノードに位置づける(ステップS81)。   On the other hand, if the value B is greater than or equal to the threshold value, the phrase tree generation unit 110 sets the code of the new child node in the Ath position of the counter / child node number (or extension counter / child node number) array (step S79). . The code of a new child node is set with the largest code + 1 in the data block. Further, the phrase tree generation unit 110 generates a data block of a new child node with the set code, and positions the current node as the generated node (step S81).

このような処理を実施すれば、図24A乃至図24Fに示すような文節木が生成される。   When such processing is performed, a phrase tree as shown in FIGS. 24A to 24F is generated.

次に、圧縮マップ生成処理について説明する。上でも述べたように、文節木は、第1階層については文字コードの順に符号を付与しているので符号の小さい順にソートされているが、第2階層以降については出現順に符号が付与されてしまうので、階層や対応する文字コードとは無関係に符号が付与されている。図28に示す簡単な例では、第2階層には符号「0x0100」「0x0104」「0x0106」「0x0102」のノードが付与されており、連続した符号となっていない。また、文字コード「0x41」に対応する符号「0x0041」の子ノード「0x0100」で表す文字コードは「0x42」であり、子ノード「0x0104」で表す文字コードは「0x41」であり、この点においても符号は文字コードの順に整列されていない。   Next, the compression map generation process will be described. As described above, the phrase trees are sorted in ascending order of the codes because the codes are assigned in the order of the character codes for the first layer, but the codes are assigned in the order of appearance for the second and subsequent layers. Therefore, the code is assigned regardless of the hierarchy and the corresponding character code. In the simple example shown in FIG. 28, nodes of codes “0x0100”, “0x0104”, “0x0106”, and “0x0102” are assigned to the second layer, and are not continuous codes. Also, the character code represented by the child node “0x0100” of the code “0x0041” corresponding to the character code “0x41” is “0x42”, and the character code represented by the child node “0x0104” is “0x41”. The codes are not arranged in the order of the character codes.

本実施の形態では、圧縮マップを生成する際に、図28に示すような符号の付与態様から、図29に示すように、階層順及び親ノード毎に対応する文字(符号に対応する文字列の最後の文字)のコード順にソートするように、符号を振り直す。図29の例では、第2階層の符号「0x0100」には文字「0x41」のノードを対応付け、符号「0x0101」には文字「0x42」のノードを対応付け、符号「0x0102」には文字「0x43」のノードを対応付け、符号「0x0103」に文字「0x42」のノードを対応付ける。また、第3階層の符号「0x0104」に文字「0x43」のノードを対応付け、符号「0x0105」に文字「0x41」のノードを対応付け、符号「0x0106」に文字「0x42」のノードを対応付け、符号「0x0107」に文字「0x43」のノードを対応付ける。このようにすれば、ノードの二分探索(二分検索)が可能となる。   In this embodiment, when a compression map is generated, characters corresponding to each hierarchical order and parent node (a character string corresponding to a symbol) are generated as shown in FIG. The code is re-assigned so that it is sorted in the order of the code of the last character). In the example of FIG. 29, the node of the character “0x41” is associated with the code “0x0100” of the second layer, the node of the character “0x42” is associated with the code “0x0101”, and the character “0x0102” is associated with the character “0x0102”. The node “0x43” is associated, and the node “0x42” is associated with the code “0x0103”. Further, the node of the character “0x43” is associated with the code “0x0104” of the third layer, the node of the character “0x41” is associated with the code “0x0105”, and the node of the character “0x42” is associated with the code “0x0106”. The node of the character “0x43” is associated with the code “0x0107”. In this way, a binary search (binary search) of nodes becomes possible.

より具体的に圧縮マップを説明する。圧縮マップは、親ノードの符号と自ノードの文字コード(自ノードの符号に対応する文字又は文字列の最後の文字)とを対応付ける対応付けデータを符号の順番で並べたデータである。実際には、カレントノードの符号と、当該カレントノードのカウンタ兼子ノード番号の配列に符号が格納されていることが確認された文字出現番号の配列の番号とを対応付ける対応付けデータを含む。図28に示すような文節木の場合には、図30の左側のような圧縮マップが生成される。上でも述べたように、符号は出現順に付与されるので、親ノードの符号の列はソートされておらず、結果として符号で表される文字列自体も文字コード順にソートされていない。なお、図30の例では、符号も文字列も示されているが、これらのデータは圧縮マップには含まれていない補足情報である。   The compression map will be described more specifically. The compression map is data in which association data that associates the code of the parent node with the character code of the own node (the character corresponding to the code of the own node or the last character of the character string) is arranged in the order of the codes. Actually, it includes association data that associates the code of the current node with the number of the array of character appearance numbers whose code is confirmed to be stored in the counter / child node number array of the current node. In the case of a phrase tree as shown in FIG. 28, a compression map as shown on the left side of FIG. 30 is generated. As described above, since the codes are assigned in the order of appearance, the code sequence of the parent node is not sorted, and as a result, the character strings themselves represented by the codes are not sorted in the character code order. In the example of FIG. 30, the code and the character string are shown, but these data are supplementary information not included in the compression map.

本実施の形態では、文節木から図30の右側に示すように、上記のようなソート及び符号の振り直しを実施して、親ノードの符号と自ノードの文字コードとを対応付ける対応付けデータを、新たに振り直された符号の順番に並べることで圧縮マップを生成する。図30の例でも分かるように、親ノードの符号は符号の小さい順にソートされている。これによって圧縮マップの二分探索が可能となる。   In the present embodiment, as shown on the right side of FIG. 30 from the phrase tree, the above sort and code reassignment are performed, and the association data for associating the code of the parent node with the character code of the own node is obtained. Then, the compressed map is generated by arranging them in the order of the newly reassigned codes. As can be seen from the example of FIG. 30, the codes of the parent nodes are sorted in ascending order of the codes. This allows a binary search of the compressed map.

本実施の形態では、ソートを行うために、図31に示すように、ソート領域を導入する。ソート領域には、以下の処理で特定される符号を、以下の処理で特定された順で格納する。この際、ソート領域の配列番号はソート後の符号となる。図31の例では、配列番号「0x0100」の位置には、第2階層のノードの符号として最初にソート前符号「0x0104」が格納される。すなわち、ソート前符号「0x0104」のノードは、今後ソート後符号「0x0100」として取り扱われる。このノードについては、親ノードの符号は「0x0041」であり、このノードで表される文字コードは「0x41」である。   In this embodiment, in order to sort, a sort area is introduced as shown in FIG. In the sort area, codes specified by the following processing are stored in the order specified by the following processing. At this time, the array number of the sort area is the code after sorting. In the example of FIG. 31, the pre-sort code “0x0104” is first stored as the code of the second layer node at the position of the array element number “0x0100”. That is, the node with the pre-sort code “0x0104” will be handled as the post-sort code “0x0100” in the future. For this node, the sign of the parent node is “0x0041”, and the character code represented by this node is “0x41”.

より具体的な処理内容を、図24A乃至図24Fに示すような文節木のデータが得られた場合を一例として段階的に説明する。   More specific processing contents will be described step by step, taking as an example the case where phrase tree data as shown in FIGS. 24A to 24F is obtained.

まず、符号「0x0000」乃至「0x00FF」のノードについてはソートを行わなくてもよいので、そのまま圧縮マップにデータを登録する。例えば図32に示すようなデータが圧縮マップに登録される。なお、親ノードは根ノードなので親ノードの符号として「root」というデータが登録されており、さらにそれぞれの担当する文字「0x00」乃至「0xFF」が登録される。さらに、図33に示すように、ソート領域にはノード「0x0000」乃至「0x00FF」を小さい順に登録する。   First, since it is not necessary to sort the nodes with codes “0x0000” to “0x00FF”, data is registered in the compression map as it is. For example, data as shown in FIG. 32 is registered in the compression map. Since the parent node is the root node, data “root” is registered as a code of the parent node, and the characters “0x00” to “0xFF” in charge of each are registered. Further, as shown in FIG. 33, nodes “0x0000” to “0x00FF” are registered in the sorting area in ascending order.

次に、ソート領域に登録されている符号のノードを配列番号(=ソート後の符号)の小さい順に処理を行う。但し、子ノードが存在しないと圧縮マップには対応付けデータは登録されないので、図25に示す文節木に示すように符号「0x0040」までの処理の説明は省略する。そして、図34に示すように、配列番号「0x0041」を処理することになると、符号「0x0041」のデータブロックを参照し、その文字出現番号の配列番号「0x00」から順番に「0xFF」以外の値が登録されている位置を探索する。この例では、「0x41」番目に出現順番「1」が登録されているので、カウンタ兼子ノード番号の配列で「1」番目を参照する。そうすると、「0x100」以上の値として符号「0x0104」が登録されているので、ソート領域の最後端「0x0100」に「0x0104」を登録する。さらに、圧縮マップに、図35に示すように、ソート後符号「0x100」番目に、親ノードのソート後の符号「0x0041」と文字出現番号の配列番号「0x41」に相当する文字コードとを対応付ける対応付けデータを登録する。   Next, the nodes of the codes registered in the sort area are processed in ascending order of the array element numbers (= sorted codes). However, if there is no child node, the association data is not registered in the compression map, so the description of the processing up to the code “0x0040” is omitted as shown in the phrase tree shown in FIG. Then, as shown in FIG. 34, when processing the array element number “0x0041”, the data block of the code “0x0041” is referred to, and the character appearance number from the array element number “0x00” in order is not “0xFF”. Search for the position where the value is registered. In this example, since the appearance order “1” is registered in the “0x41” th, the “1” th is referred to in the counter / child node number array. Then, since the code “0x0104” is registered as a value equal to or greater than “0x100”, “0x0104” is registered at the last end “0x0100” of the sort area. Furthermore, as shown in FIG. 35, the code “0x100” after the sorting of the parent node is associated with the character code corresponding to the array number “0x41” of the character appearance number, as shown in FIG. Register the association data.

また、図36に示すように、符号「0x0041」のデータブロックにおける文字出現番号の配列番号「0x42」番目には、出現順番「0」が登録されているので、カウンタ兼子ノード番号の配列で「0」番目を参照する。そうすると、「0x100」以上の値として符号「0x0100」が登録されているので、ソート領域の最後端「0x0101」に「0x0100」を登録する。さらに、圧縮マップに、図37に示すように、ソート後符号「0x101」番目に、親ノードのソート後の符号「0x0041」と文字出現番号の配列番号「0x42」に相当する文字コードとを対応付ける対応付けデータを登録する。   Further, as shown in FIG. 36, since the appearance order “0” is registered in the array number “0x42” of the character appearance number in the data block with the code “0x0041”, the array of counter and child node numbers is “ Refer to the 0th position. Then, since the code “0x0100” is registered as a value equal to or greater than “0x100”, “0x0100” is registered at the last end “0x0101” of the sort area. Furthermore, as shown in FIG. 37, the code “0x101” after sorting of the parent node and the character code corresponding to the array number “0x42” of the character appearance number are associated with the compression map, as shown in FIG. Register the association data.

さらに、図38に示すように、符号「0x0041」のデータブロックにおける文字出現番号の配列番号「0x43」番目には、出現順番「2」が登録されているので、カウンタ兼子ノード番号の配列で「2」番目を参照する。そうすると、「0x100」未満の値「1」が登録されているので、圧縮マップに対応付けデータを登録することはない。文字出現番号の以後の配列番号について処理しても圧縮マップに対応付けデータを登録することはない。   Further, as shown in FIG. 38, since the appearance order “2” is registered in the array number “0x43” of the character appearance number in the data block of the code “0x0041”, the array of counter and child node numbers is “ Reference is made to “2” th. Then, since the value “1” less than “0x100” is registered, the association data is not registered in the compression map. Even if the sequence numbers after the character appearance number are processed, the association data is not registered in the compression map.

次に、図39に示すように、配列番号「0x0042」を処理することになると、符号「0x0042」のデータブロックを参照し、その文字出現番号の配列番号「0x00」から順番に「0xFF」以外の値が登録されている位置を探索する。この例では、「0x41」番目に出現順番「0」が登録されているので、カウンタ兼子ノード番号の配列で「0」番目を参照する。そうすると、「0x100」未満の値「1」が登録されているので、圧縮マップに対応付けデータを登録することはない。   Next, as shown in FIG. 39, when processing the array element number “0x0042”, the data block with the code “0x0042” is referred to, and the character appearance number from the array element number “0x00” in order is not “0xFF”. The position where the value of is registered is searched. In this example, since the appearance order “0” is registered in the “0x41” th, the “0” th is referred to in the counter / child node number array. Then, since the value “1” less than “0x100” is registered, the association data is not registered in the compression map.

また、符号「0x0042」のデータブロックにおける文字出現番号の配列番号「0x42」番目には、「0xFF」が登録されているので圧縮マップにはデータは登録されない。   In addition, since “0xFF” is registered at the array element number “0x42” of the character appearance number in the data block of the code “0x0042”, no data is registered in the compression map.

さらに、図40に示すように、符号「0x0042」のデータブロックにおける文字出現番号の配列番号「0x43」番目には、出現順番「1」が登録されているので、カウンタ兼子ノード番号の配列で「1」番目を参照する。そうすると、「0x100」以上の値として符号「0x0106」が登録されているので、ソート領域の最後端「0x0102」に「0x0106」を登録する。さらに、圧縮マップに、図41に示すように、ソート後符号「0x102」番目に、親ノードのソート後の符号「0x0042」と文字出現番号の配列番号「0x43」に相当する文字コードとを対応付ける対応付けデータを登録する。文字出現番号の以後の配列番号について処理しても圧縮マップに対応付けデータを登録することはない。   Further, as shown in FIG. 40, since the appearance order “1” is registered in the array number “0x43” of the character appearance number in the data block of the code “0x0042”, the array of the counter / child node number is “ Refer to “1” th. Then, since the code “0x0106” is registered as a value equal to or greater than “0x100”, “0x0106” is registered at the last end “0x0102” of the sort area. Furthermore, as shown in FIG. 41, the code “0x102” after sorting of the parent node and the character code corresponding to the array number “0x43” of the character appearance number are associated with the compression map, as shown in FIG. Register the association data. Even if the sequence numbers after the character appearance number are processed, the association data is not registered in the compression map.

次に、図42に示すように、配列番号「0x0043」を処理することになると、符号「0x0043」のデータブロックを参照し、その文字出現番号の配列番号「0x00」から順番に「0xFF」以外の値が登録されている位置を探索する。この例では、「0x41」番目に出現順番「0」が登録されているので、カウンタ兼子ノード番号の配列で「0」番目を参照する。そうすると、「0x100」未満の値「1」が登録されているので、圧縮マップに対応付けデータを登録することはない。   Next, as shown in FIG. 42, when processing the array element number “0x0043”, the data block of the code “0x0043” is referred to, and the character appearance number from the array element number “0x00” in order is not “0xFF”. The position where the value of is registered is searched. In this example, since the appearance order “0” is registered in the “0x41” th, the “0” th is referred to in the counter / child node number array. Then, since the value “1” less than “0x100” is registered, the association data is not registered in the compression map.

さらに、図43に示すように、符号「0x0043」のデータブロックにおける文字出現番号の配列番号「0x42」番目には、出現順番「1」が登録されているので、カウンタ兼子ノード番号の配列で「1」番目を参照する。そうすると、「0x100」以上の値として符号「0x0102」が登録されているので、ソート領域の最後端「0x0103」に「0x0102」を登録する。さらに、圧縮マップに、図44に示すように、ソート後符号「0x103」番目に、親ノードのソート後の符号「0x0043」と文字出現番号の配列番号「0x42」に相当する文字コードとを対応付ける対応付けデータを登録する。文字出現番号の以後の配列番号について処理しても圧縮マップに対応付けデータを登録することはない。   Furthermore, as shown in FIG. 43, since the appearance order “1” is registered at the array appearance number “0x42” of the character appearance number in the data block of the code “0x0043”, the array of counter and child node numbers is “ Refer to “1” th. Then, since the code “0x0102” is registered as a value equal to or greater than “0x100”, “0x0102” is registered in the last end “0x0103” of the sort area. Furthermore, as shown in FIG. 44, the code “0x103” after sorting of the parent node and the character code corresponding to the array number “0x42” of the character appearance number are associated with the code “0x103” after sorting as shown in FIG. Register the association data. Even if the sequence numbers after the character appearance number are processed, the association data is not registered in the compression map.

ソート後符号「0x0044」のデータブロックを処理しても圧縮マップにデータが登録されることはなく、ソート後符号「0x00FF」までの全データブロックを処理しても圧縮マップにデータが登録されることはない。   Even if the data block with the code “0x0044” after sorting is processed, the data is not registered in the compression map, and the data is registered in the compression map even if all the data blocks up to the code “0x00FF” after sorting are processed. There is nothing.

また、図45に示すように、配列番号「0x0100」を処理することになると、符号「0x0100」のデータブロックを参照し、その文字出現番号の配列番号「0x00」から順番に「0xFF」以外の値が登録されている位置を探索する。この例では、「0x43」番目に出現順番「0」が登録されているので、カウンタ兼子ノード番号の配列で「0」番目を参照する。そうすると、「0x100」以上の値として符号「0x0101」が登録されているので、ソート領域の最後端「0x0104」に「0x0101」を登録する。さらに、圧縮マップに、図46に示すように、ソート後符号「0x104」番目に、親ノードのソート後の符号「0x0100」と文字出現番号の配列番号「0x43」に相当する文字コードとを対応付ける対応付けデータを登録する。文字出現番号の以後の配列番号について処理しても圧縮マップに対応付けデータを登録することはない。   Also, as shown in FIG. 45, when processing the array element number “0x0100”, the data block of the code “0x0100” is referred to, and the character appearance number from the array element number “0x00” in order is not “0xFF”. Search for the position where the value is registered. In this example, since the appearance order “0” is registered at the “0x43” th, the “0” th is referred to in the array of counter / child node numbers. Then, since the code “0x0101” is registered as a value equal to or greater than “0x100”, “0x0101” is registered at the last end “0x0104” of the sort area. Further, as shown in FIG. 46, the code “0x0100” after the sorting of the parent node is associated with the character code corresponding to the array number “0x43” of the character appearance number, as shown in FIG. Register the association data. Even if the sequence numbers after the character appearance number are processed, the association data is not registered in the compression map.

また、ソート後符号「0x0101」のデータブロックを処理しても圧縮マップにデータが登録されることはない。   Further, even if the data block with the sorted code “0x0101” is processed, data is not registered in the compression map.

また、図47に示すように、配列番号「0x0102」を処理することになると、符号「0x0102」のデータブロックを参照し、その文字出現番号の配列番号「0x00」から順番に「0xFF」以外の値が登録されている位置を探索する。この例では、「0x41」番目に出現順番「1」が登録されているので、カウンタ兼子ノード番号の配列で「1」番目を参照する。そうすると、「0x100」以上の値として符号「0x0105」が登録されているので、ソート領域の最後端「0x0105」に「0x0105」を登録する。さらに、圧縮マップに、図48に示すように、ソート後符号「0x105」番目に、親ノードのソート後の符号「0x0103」と文字出現番号の配列番号「0x41」に相当する文字コードとを対応付ける対応付けデータを登録する。このデータブロックについては、文字出現番号の以後の配列番号について処理すると、順調に圧縮マップに対応付けデータが追加されるようになる。   Also, as shown in FIG. 47, when processing the array element number “0x0102”, the data block with the code “0x0102” is referred to, and the character appearance number from the array element number “0x00” in order is other than “0xFF”. Search for the position where the value is registered. In this example, since the appearance order “1” is registered in the “0x41” th, the “1” th is referred to in the counter / child node number array. Then, since the code “0x0105” is registered as a value equal to or greater than “0x100”, “0x0105” is registered at the last end “0x0105” of the sort area. Further, as shown in FIG. 48, the code “0x105” after sorting of the parent node is associated with the code “0x0103” after sorting of the parent node and the character code corresponding to the array number “0x41” of the character appearance number, as shown in FIG. Register the association data. With respect to this data block, if the array number after the character appearance number is processed, the association data is added to the compression map smoothly.

そして、図49に示すように、符号「0x0102」のデータブロックにおける文字出現番号の配列番号「0x49」番目には、出現順番「8」が登録されているので、拡張カウンタ兼子ノード番号の配列で「0」番目を参照する。そうすると、「0x100」以上の値として符号「0x010D」が登録されているので、ソート領域の最後端「0x010D」に「0x010D」を登録する。さらに、圧縮マップに、図50に示すように、ソート後符号「0x10D」番目に、親ノードのソート後の符号「0x0103」と文字出現番号の配列番号「0x49」に相当する文字コードとを対応付ける対応付けデータを登録する。文字出現番号の以後の配列番号について処理しても圧縮マップに対応付けデータを登録することはない。以下の処理で圧縮マップにはデータは登録されないので、説明を省略する。   As shown in FIG. 49, since the appearance order “8” is registered in the array number “0x49” of the character appearance number in the data block of the code “0x0102”, the array of extension counters and child node numbers is used. Refer to the “0” th. Then, since the code “0x010D” is registered as a value equal to or greater than “0x100”, “0x010D” is registered at the last end “0x010D” of the sort area. Further, as shown in FIG. 50, the code “0x0103” after sorting of the parent node and the character code corresponding to the array number “0x49” of the character appearance number are associated with the compression map “0x10D” th as shown in FIG. Register the association data. Even if the sequence numbers after the character appearance number are processed, the association data is not registered in the compression map. Since no data is registered in the compression map in the following processing, the description is omitted.

次に、図51及び図52を用いて圧縮マップ生成処理を説明する。   Next, the compression map generation process will be described with reference to FIGS.

圧縮マップ生成部120は、圧縮マップに、第1階層のノード「0x0000」乃至「0x00FF」のデータとして、根ノードを表すデータrootとノードの符号に対応する文字コードとを対応付ける対応付けデータを順番に追加する(図51:ステップS91)。また、圧縮マップ生成部120は、ソート領域に、第1の階層のノード「0x0000」乃至「0x00FF」の符号を、順番に追加する(ステップS93)。そして、圧縮マップ生成部120は、ソート領域から、ソート後符号の小さい順に、未処理の符号を1つ読み出す(ステップS95)。ここで未処理の符号を読み出すことができない場合には(ステップS97:Noルート)、呼出元の処理に戻る。   The compression map generation unit 120 sequentially associates the compression map with the data “root” representing the root node and the character code corresponding to the code of the node as the data of the nodes “0x0000” to “0x00FF” of the first hierarchy. (FIG. 51: Step S91). Further, the compression map generation unit 120 sequentially adds the codes of the nodes “0x0000” to “0x00FF” of the first hierarchy to the sort area (step S93). Then, the compression map generator 120 reads one unprocessed code from the sort area in ascending order of the sorted code (step S95). If an unprocessed code cannot be read (step S97: No route), the process returns to the caller process.

一方、未処理の符号を読み出すことができれば(ステップS97:Yesルート)、圧縮マップ生成部120は、文節木において、読み出した符号のノードのデータブロックを参照する(ステップS99)。そして、圧縮マップ生成部120は、エントリ追加処理を実施する(ステップS101)。このエントリ追加処理については、図52を用いて説明する。エントリ追加処理が終了すると、ステップS95に戻る。   On the other hand, if the unprocessed code can be read (step S97: Yes route), the compression map generation unit 120 refers to the data block of the read code node in the phrase tree (step S99). Then, the compression map generation unit 120 performs entry addition processing (step S101). This entry addition process will be described with reference to FIG. When the entry addition process ends, the process returns to step S95.

次に、エントリ追加処理の処理フローについて説明する。   Next, the processing flow of entry addition processing will be described.

圧縮マップ生成部120は、読み出した符号のノードのデータブロックにおいて、文字出現番号の配列における未処理の番号における値Aを、番号の小さい順に取り出す(図52:ステップS111)。ここで、圧縮マップ生成部120は、処理が、文字出現番号の配列における終端まで既に行われていたか判断する(ステップS113)。処理が文字出現番号の配列における終端まで既に行われていた場合には、呼出元の処理に戻る。   In the data block of the read code node, the compression map generation unit 120 extracts the value A in the unprocessed number in the character appearance number array in ascending order (FIG. 52: step S111). Here, the compression map generation unit 120 determines whether the processing has already been performed up to the end of the character appearance number array (step S113). If the process has already been performed up to the end of the character appearance number array, the process returns to the caller process.

一方、処理が文字出現番号の配列における終端まで行われていない場合には、圧縮マップ生成部120は、取り出した値Aが0xFFであり且つ文字出現数が256ではないか判断する(ステップS115)。この条件を満たす場合には、符号がカウンタ兼子ノード番号の配列に登録されていないのでステップS111に戻る。   On the other hand, if the processing has not been performed up to the end of the character appearance number array, the compression map generation unit 120 determines whether the extracted value A is 0xFF and the number of character appearances is 256 (step S115). . If this condition is satisfied, the code is not registered in the counter / child node number array, and the process returns to step S111.

一方、値Aが上で述べた条件を満たさない場合には、圧縮マップ生成部120は、値Aが8以上であるか判断する(ステップS117)。Aが8以上の場合には、拡張カウンタ兼子ノード番号の配列を用いているので、圧縮マップ生成部120は、スパンド番号の値を読み取り、スパンド番号番目(拡張スパンド番号の場合もある)の拡張カウンタ兼子ノード番号の配列を参照する(ステップS119)。また、圧縮マップ生成部120は、値Aを−8する(ステップS121)。そして、圧縮マップ生成部120は、値Aが8以上であるか判断する(ステップS123)。まだ値Aが8以上である場合には、圧縮マップ生成部120は、拡張カウンタ兼子ノード番号の最後尾に格納されている拡張スパンド番号の値Cを取得する(ステップS125)。そして処理はステップS119に戻る。   On the other hand, when the value A does not satisfy the above-described conditions, the compression map generation unit 120 determines whether the value A is 8 or more (step S117). When A is 8 or more, since the array of extended counter / child node numbers is used, the compression map generation unit 120 reads the value of the spanned number and expands the spanned number-th (which may be an extended spanned number). Reference is made to the counter / child node number array (step S119). Further, the compression map generator 120 decrements the value A by -8 (step S121). Then, the compression map generation unit 120 determines whether the value A is 8 or more (step S123). If the value A is still 8 or more, the compression map generator 120 acquires the value C of the extended spanned number stored at the end of the extended counter / child node number (step S125). Then, the process returns to step S119.

一方、値Aが8より小さい場合には、圧縮マップ生成部120は、参照先の拡張カウンタ兼子ノード番号の配列においてA番目に格納されている値Bを読み出す(ステップS127)。そして処理はステップS130に移行する。   On the other hand, when the value A is smaller than 8, the compression map generation unit 120 reads the value B stored in the Ath position in the array of reference destination extended counter / child node numbers (step S127). Then, the process proceeds to step S130.

一方、値Aが初めからAが8未満である場合には、圧縮マップ生成部120は、カウンタ兼子ノード番号の配列においてA番目に格納されている値Bを読み出す(ステップS129)。   On the other hand, if the value A is initially less than 8, the compression map generator 120 reads the value B stored in the Ath position in the counter / child node number array (step S129).

そして、圧縮マップ生成部120は、取り出した値Bが「0x0100」以上であるか判断する(ステップS130)。取り出した値Bが「0x0100」未満であれば、圧縮マップのデータを追加することはないので、処理はステップS111に戻る。一方、取り出した値Bが「0x0100」以上であれば、圧縮マップ生成部120は、符号Bをソート領域の最後尾に追加する(ステップS131)。また、圧縮マップ生成部120は、圧縮マップに、ソート領域における処理対象の配列番号と文字出現番号の配列における処理対象の配列番号とを対応付ける対応付けデータを追加する(ステップS133)。そして処理はステップS111に戻る。   Then, the compression map generation unit 120 determines whether or not the extracted value B is “0x0100” or more (step S130). If the extracted value B is less than “0x0100”, the compression map data is not added, and the process returns to step S111. On the other hand, if the extracted value B is “0x0100” or more, the compression map generation unit 120 adds the code B to the end of the sort area (step S131). Further, the compression map generation unit 120 adds association data that associates the processing target array number in the sort area with the processing target array number in the character appearance number array in the compression map (step S133). Then, the process returns to step S111.

以上のような処理を実施することで、上で具体的に説明した処理が行われるようになる。また、このように生成された圧縮マップであれば、ディスクにそのまま格納することができ、圧縮処理及び伸張処理において利用することができる。   By performing the processing as described above, the processing specifically described above is performed. In addition, the compression map generated in this way can be stored on the disk as it is, and can be used in compression processing and decompression processing.

次に、圧縮マップを用いた圧縮処理について、図53乃至図55を用いて説明する。   Next, compression processing using a compression map will be described with reference to FIGS.

圧縮処理部140は、圧縮対象の入力文字列から1文字取り出し、圧縮マップにおいて当該文字に対応する符号をカレントノードに位置づける(図53:ステップS141)。また、圧縮処理部140は、入力文字列から次の1文字取り出す(ステップS143)。ここで、圧縮処理部140は、ステップS143で文字を取り出すことができたか判断する(ステップS144)。文字を取り出すことができれば、圧縮処理部140は、カレントノードの符号が「0x0100」より小さいか判断する(ステップS147)。   The compression processing unit 140 extracts one character from the input character string to be compressed, and positions the code corresponding to the character in the compression map as the current node (FIG. 53: step S141). The compression processing unit 140 extracts the next character from the input character string (step S143). Here, the compression processing unit 140 determines whether or not characters have been extracted in step S143 (step S144). If the character can be extracted, the compression processing unit 140 determines whether the code of the current node is smaller than “0x0100” (step S147).

カレントノードの符号が「0x0100」より小さい場合には、圧縮処理部140は、「親ノードの符号=カレントノードの符号、文字コード=取り出した文字」となるノードについて、圧縮マップにおいて符号「0x0100」から最終ノードの範囲で二分探索を実施する(ステップS149)。そして処理はステップS153に移行する。   When the code of the current node is smaller than “0x0100”, the compression processing unit 140 uses the code “0x0100” in the compression map for a node having “parent node code = current node code, character code = extracted character”. A binary search is performed in the range from to the last node (step S149). Then, the process proceeds to step S153.

一方、カレントノードが「0x0100」以上であれば、圧縮処理部140は、「親ノードの符号=カレントノードの符号、文字コード=取り出した文字」となるノードについて、圧縮マップにおいてカレントノードの符号+1から最終ノードの範囲で二分探索を実施する(ステップS151)。そして処理はステップS153に移行する。   On the other hand, if the current node is “0x0100” or more, the compression processing unit 140 adds the code +1 of the current node in the compression map for a node having “parent node code = current node code, character code = extracted character”. To the final node (step S151). Then, the process proceeds to step S153.

ステップS153の処理に移行して、圧縮処理部140は、二分探索により該当ノードが見つかったか判断する(ステップS153)。該当ノードが見つからなかった場合には、圧縮処理部140は、圧縮結果としてカレントノードの符号を出力し(ステップS157)、カレントノードを、ステップS143で取り出した文字のノードに設定する(ステップS159)。そして処理はステップS143に戻る。一方、該当ノードが見つかった場合には、圧縮処理部140は、カレントノードを該当ノードに変更する(ステップS155)。そして処理はステップS143に戻る。   Shifting to the process of step S153, the compression processing unit 140 determines whether the corresponding node is found by the binary search (step S153). If no corresponding node is found, the compression processing unit 140 outputs the code of the current node as the compression result (step S157), and sets the current node as the node of the character extracted in step S143 (step S159). . Then, the process returns to step S143. On the other hand, when the corresponding node is found, the compression processing unit 140 changes the current node to the corresponding node (step S155). Then, the process returns to step S143.

ステップS143で文字が取り出せなかった場合には、圧縮処理部140は、カレントノードの符号を圧縮結果として出力する(ステップS145)。そして処理は呼出元の処理に戻る。   If the character cannot be extracted in step S143, the compression processing unit 140 outputs the code of the current node as the compression result (step S145). Then, the process returns to the caller process.

このような処理を実施することで、文字列の圧縮が行われる。   By performing such processing, the character string is compressed.

例えば、図54に示すような圧縮マップが生成され、「ABCAA」という圧縮対象の文字列が入力された場合の処理について具体的に説明する。   For example, a process when a compression map as shown in FIG. 54 is generated and a character string to be compressed of “ABCAA” is input will be specifically described.

まず、入力文字列「ABCAA」の「A」を処理する場合には、カレントノードが「0x0041」に設定される(図55における[1])。次に、「ABCAA」の「B」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x42」というノードについて、符号「0x0100」から「0x0107」の範囲で二分探索を実施する。そうすると、符号「0x0101」が該当するノードであることが分かるので、カレントノードを「0x0101」に設定する(図55における[2])。   First, when processing “A” of the input character string “ABCAA”, the current node is set to “0x0041” ([1] in FIG. 55). Next, when “B” of “ABCAA” is processed, a binary search is performed for the node “parent node code = 0x0041, character code = 0x42” in the range of codes “0x0100” to “0x0107”. . Then, since it can be seen that the code “0x0101” is the corresponding node, the current node is set to “0x0101” ([2] in FIG. 55).

さらに、「ABCAA」の「C」を処理する場合には、「親ノードの符号=0x0101、文字コード=0x43」というノードについて、符号「0x0102」から「0x0107」の範囲で二分探索を実施する。そうすると、符号「0x0104」が該当するノードであることが分かるので、カレントノードを「0x0104」に設定する(図55における[3])。さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0104、文字コード=0x41」となるノードについて、符号「0x0105」から「0x0107」の範囲で二分探索を実施する。そうすると、見つからないので、カレントノードの符号「0x0104」を圧縮結果に追加する(図55における[4])。なお、文字コード「0x041」に対応する符号「0x0041」のノードをカレントノードに設定する。   Further, when “C” of “ABCAA” is processed, a binary search is performed in the range of “0x0102” to “0x0107” for the node “parent node code = 0x0101, character code = 0x43”. Then, since the code “0x0104” is found to be the corresponding node, the current node is set to “0x0104” ([3] in FIG. 55). Further, when “A” of “ABCAA” is processed, a binary search is performed in the range of the codes “0x0105” to “0x0107” for the node having “parent node code = 0x0104, character code = 0x41”. . Then, since it is not found, the code “0x0104” of the current node is added to the compression result ([4] in FIG. 55). Note that the node of the code “0x0041” corresponding to the character code “0x041” is set as the current node.

さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x41」というノードについて、符号「0x0100」から「0x0107」の範囲で二分探索を実施する。そうすると、符号「0x0100」が該当するノードであることが分かるので、カレントノードを「0x0100」に設定する(図55における[5])。これで入力文字列の全文字を処理したので、カレントノードの符号「0x0100」を出力して、処理を終了する(図55における[6])。   Further, when “A” of “ABCAA” is processed, a binary search is performed in the range of the codes “0x0100” to “0x0107” for the node “parent node code = 0x0041, character code = 0x41”. Then, since the code “0x0100” is found to be the corresponding node, the current node is set to “0x0100” ([5] in FIG. 55). Since all the characters of the input character string have been processed, the current node code “0x0100” is output and the processing is terminated ([6] in FIG. 55).

このように圧縮処理を実施することができる。   In this way, the compression process can be performed.

次に、図56及び図57を用いて伸張処理の処理フローを説明する。まず、伸張処理部150は、圧縮データから未処理の符号を1つ読み出し、圧縮マップにおいて該当するノードをカレントノードに設定する(図56:ステップS161)。なお、ステップS161で符号を取得できなければ処理は呼出元の処理に戻る(ステップS163:Noルート)。一方、符号が取得できれば(ステップS163:Yesルート)、伸張処理部150は、カレントノードの文字を作業域に出力する(ステップS165)。そして、伸張処理部150は、カレントノードに親ノードの符号が含まれているか判断する(ステップS167)。親ノードの符号がrootである場合には、親ノードの符号は無しと判断する。親ノードの符号がない場合には、伸張処理部150は、作業域の文字列を後ろから伸張結果として出力する(ステップS169)。処理はステップS161に戻る。一方、親ノードの符号がある場合には、伸張処理部150は、親ノードの符号をカレントノードに位置づける(ステップS171)。そして処理はステップS165に戻る。   Next, the processing flow of the decompression process will be described with reference to FIGS. First, the decompression processing unit 150 reads one unprocessed code from the compressed data, and sets the corresponding node in the compression map as the current node (FIG. 56: step S161). If the code cannot be acquired in step S161, the process returns to the caller process (step S163: No route). On the other hand, if the code can be acquired (step S163: Yes route), the decompression processing unit 150 outputs the character of the current node to the work area (step S165). Then, the decompression processing unit 150 determines whether the current node includes the parent node code (step S167). If the parent node has a root code, it is determined that the parent node has no code. If there is no parent node code, the decompression processing unit 150 outputs the character string in the work area from the back as the decompression result (step S169). The process returns to step S161. On the other hand, if there is a code of the parent node, the decompression processing unit 150 positions the code of the parent node as the current node (step S171). Then, the process returns to step S165.

このような処理を実施することで符号を文字列に伸張することができるようになる。   By executing such processing, the code can be expanded into a character string.

例えば図54に示すような圧縮マップを用いて符号「0x0104、0100」が圧縮データとして入力された場合を説明する。   For example, a case where a code “0x0104, 0100” is input as compressed data using a compression map as shown in FIG. 54 will be described.

まず、符号「0x0104」のノードをカレントノードに設定し、カレントノードにおける文字「C」を作業領域に出力する。また、親ノードの符号が「0x0101」であるので、カレントノードを符号「0x0101」のノードに設定する(図57における[1])。また、カレントノードの符号「0x0101」における文字「B」を作業域に出力する。さらに、親ノードの符号が「0x0041」であるので、カレントノードを符号「0x0041」に設定する(図57における[2])。   First, the node with the code “0x0104” is set as the current node, and the character “C” at the current node is output to the work area. Further, since the code of the parent node is “0x0101”, the current node is set to the node of code “0x0101” ([1] in FIG. 57). In addition, the character “B” in the code “0x0101” of the current node is output to the work area. Further, since the code of the parent node is “0x0041”, the current node is set to the code “0x0041” ([2] in FIG. 57).

そして、カレントノードの符号「0x0041」における文字「A」を作業域に出力する。但し、親ノードは存在しないので、作業域の文字を逆順に出力すると、「ABC」が得られる。   Then, the character “A” in the code “0x0041” of the current node is output to the work area. However, since there is no parent node, “ABC” is obtained when characters in the work area are output in reverse order.

次に、新たな符号「0x0100」を読み出すと、カレントノードに設定して、当該符号のノードにおける文字「A」を作業域に出力する。そして、親ノードの符号が「0x0041」であるので、カレントノードを符号「0x0041」のノードに設定する(図57における[4])。そして、カレントノードにおける文字「A」を作業域に出力する。ここでカレントノードには親ノードの符号は無いので、作業域の文字列を逆順に出力すると、「AA」がさらに得られる。ここで伸張処理が完了する(図57における[5])。   Next, when a new code “0x0100” is read, it is set as the current node, and the character “A” at the node of the code is output to the work area. Since the code of the parent node is “0x0041”, the current node is set to the node of code “0x0041” ([4] in FIG. 57). Then, the character “A” at the current node is output to the work area. Here, since the current node does not have a parent node code, “AA” is further obtained when the character strings in the work area are output in reverse order. Here, the decompression process is completed ([5] in FIG. 57).

このように文節木のデータ構造を変更したため、処理途中で消費するメモリ容量を削減できる。   Since the phrase tree data structure is changed in this way, the memory capacity consumed during processing can be reduced.

なお、圧縮マップを生成せずとも、文節木のデータを用いて圧縮処理を実施することができる。   Note that the compression processing can be performed using the phrase tree data without generating the compression map.

例えば、図24A乃至図24Fで表した文節木のデータを用いて文字列「ABCAA」を圧縮する場合を一例に説明する。   For example, a case where the character string “ABCAA” is compressed using the data of the phrase tree shown in FIGS. 24A to 24F will be described as an example.

「ABCAA」における「A」を読み出すと、図58に示すように、文字「A」に対応する符号「0x0041」のノードをカレントノードに設定する。さらに、「ABCAA」における「B」を読み出すと、文字出現番号の配列において「0x42(B)」番目の値「0」を得て、カウンタ兼子ノード番号の配列における出現順番「0」の値を読み出す。この場合、符号「0x0100」が得られる。符号「0x0100」であれば、この符号に対応するノードをカレントノードに設定する。   When “A” in “ABCAA” is read, as shown in FIG. 58, the node of the code “0x0041” corresponding to the character “A” is set as the current node. Further, when “B” in “ABCAA” is read, the “0x42 (B)”-th value “0” is obtained in the character appearance number array, and the value of the appearance order “0” in the counter / child node number array is obtained. read out. In this case, the code “0x0100” is obtained. If the code is “0x0100”, the node corresponding to this code is set as the current node.

次に、「ABCAA」における「C」を読み出すと、図59に示すように、文字出現番号の配列において「0x43(C)」番目の値「0」を得て、カウンタ兼子ノード番号の配列における出現順番「0」の値を読み出す。ここでは、符号「0x0101」が得られる。符号「0x0101」であれば、この符号のノードをカレントノードに設定する。   Next, when “C” in “ABCAA” is read, the “0x43 (C)”-th value “0” is obtained in the array of character appearance numbers, as shown in FIG. The value of the appearance order “0” is read. Here, the code “0x0101” is obtained. If the code is “0x0101”, the node of this code is set as the current node.

また、「ABCAA」における「A」を読み出すと、図60に示すように、文字出現番号の配列において「0x41(A)」番目の値「0」を得て、カウンタ兼子ノード番号の配列における出現順番「0」の値を読み出す。そうすると、符号「0x0100」より小さい値であるので、カレントノードの符号「0x0101」を圧縮結果として出力する。   Further, when “A” in “ABCAA” is read, the “0x41 (A)”-th value “0” is obtained in the array of character appearance numbers as shown in FIG. 60, and appears in the array of counter and child node numbers. Read the value of order “0”. Then, since the value is smaller than the code “0x0100”, the code “0x0101” of the current node is output as the compression result.

さらに、「ABCAA」における「A」を読み出すと、図61に示すように、文字出現番号の配列において「0x41(A)」番目の値「1」を得て、カウンタ兼子ノード番号の配列における出現順番「1」の値を読み出す。そうすると、符号「0x0104」が得られる。ここで入力文字列は終了するので、符号「0x0104」も圧縮結果として出力する。そうすると、最終的に「0x0101」「0x0104」が圧縮結果として出力されることになる。   Further, when “A” in “ABCAA” is read, the “0x41 (A)”-th value “1” is obtained in the character appearance number array as shown in FIG. Read the value of order “1”. Then, the code “0x0104” is obtained. Since the input character string ends here, the code “0x0104” is also output as the compression result. Then, “0x0101” and “0x0104” are finally output as the compression results.

また、文節木のデータを用いて圧縮データを伸張することもできる。ここでは、図24A乃至図24Fで表した文節木のデータを用いて符号「0x0101」「0x0104」を伸張する場合を一例に説明する。   It is also possible to decompress compressed data using phrase tree data. Here, a case where the codes “0x0101” and “0x0104” are expanded using the phrase tree data shown in FIGS. 24A to 24F will be described as an example.

まず、図62に示すように、符号「0x0101」を、カウンタ兼子ノード番号の配列の中に含むノードを探索する。そうすると、今回は符号「0x0100」のノードの出現順番「0」が特定される。そうすると、文字出現番号の配列で「0」が登録されている番号を探索すると「0x43」が得られる。この文字コード「0x43」を作業域に出力する。   First, as shown in FIG. 62, a node including the code “0x0101” in the counter / child node number array is searched. Then, the appearance order “0” of the node with the code “0x0100” is specified this time. Then, when a number in which “0” is registered in the character appearance number array is searched, “0x43” is obtained. This character code “0x43” is output to the work area.

次に、図63に示すように、符号「0x0100」を、カウンタ兼子ノード番号の配列の中に含むノードを探索する。そうすると、今回は符号「0x0041」のノードの出現順番「0」が特定される。そうすると、文字出現番号の配列で「0」が登録されている番号を探索すると「0x42」が得られる。この文字コード「0x42」を作業域に出力する。   Next, as shown in FIG. 63, a node including the code “0x0100” in the counter / child node number array is searched. Then, the appearance order “0” of the node with the code “0x0041” is specified this time. Then, when a number in which “0” is registered in the character appearance number array is searched, “0x42” is obtained. This character code “0x42” is output to the work area.

次に、符号「0x0041」が探索対象となるが符号「0x0100」より小さいので、符号「0x0041」に対応する文字「0x41」を作業域に出力する。   Next, since the code “0x0041” is a search target but is smaller than the code “0x0100”, the character “0x41” corresponding to the code “0x0041” is output to the work area.

そうすると、図64に示すように、作業域内の文字の順番を入れ替えて、「0x41」「0x42」「0x43」が伸張結果として出力される。   Then, as shown in FIG. 64, the order of the characters in the work area is changed, and “0x41”, “0x42”, and “0x43” are output as the expansion result.

次に、図65に示すように、符号「0x0104」を、カウンタ兼子ノード番号の配列の中に含むノードを探索する。そうすると、今回は符号「0x0041」のノードの出現番号「1」が特定される。そうすると、文字出現番号の配列で「1」が登録されている番号を探索すると「0x41」が得られる。この文字コード「0x41」を作業域に出力する。   Next, as shown in FIG. 65, a node including the code “0x0104” in the counter / child node number array is searched. Then, the appearance number “1” of the node with the code “0x0041” is specified this time. Then, when a number in which “1” is registered in the character appearance number array is searched, “0x41” is obtained. This character code “0x41” is output to the work area.

さらに、符号「0x0041」が探索対象となるが上で述べたのと同様に符号「0x0100」より小さいので、符号「0x0041」に対応する文字「0x41」を作業域に出力する。   Further, although the code “0x0041” is a search target, it is smaller than the code “0x0100” as described above, so the character “0x41” corresponding to the code “0x0041” is output to the work area.

そうすると、図66に示すように、作業域内の文字の順番を入れ替えて、「0x41」「0x41」を伸張結果に追加する。このようにして、「ABCAA」が得られる。   Then, as shown in FIG. 66, the order of the characters in the work area is changed, and “0x41” and “0x41” are added to the decompression result. In this way, “ABCAA” is obtained.

[実施の形態2]
本実施の形態では圧縮処理の処理速度を向上させるために、圧縮マップのデータ構造を変更する。
[Embodiment 2]
In this embodiment, the data structure of the compression map is changed in order to improve the processing speed of the compression process.

具体的には、各ノードについて子ノードの最大ノード番号(最大子ノードの符号)を保持するようにする。圧縮処理では、ステップS149及びステップS151でも、カレントノードを親ノードとするノードを探索している。すなわち、カレントノードの子ノードであることが検索の条件となっているが、探索範囲はステップS149では「0x0100」から最終ノードまでであり、ステップS151ではカレントノードの符号+1から最終ノードまでである。   Specifically, the maximum node number (sign of the maximum child node) of the child node is held for each node. In the compression processing, a node having the current node as a parent node is also searched in steps S149 and S151. That is, the search condition is that it is a child node of the current node, but the search range is from “0x0100” to the last node in step S149, and from the code +1 of the current node to the last node in step S151. .

図67に模式的に示す文節木において、例えば、カレントノードが「0x0103」のノードであるとすると、子ノードの探索範囲は、実際には「0x0105」乃至「0x0107」のノードであるが、第1の実施の形態では、「0x0104」についても探索対象となっていた。この例では1つのノードしか余分になっていないが、実際には「0x0100」「0x0101」「0x0102」に多数の子ノードが存在する場合には影響がある。また、「0x0101」がカレントノードであれば、子ノードは「0x0104」のみであるが、第1の実施の形態では「0x0102」乃至「0x0107」が探索範囲となっていた。   In the phrase tree schematically shown in FIG. 67, for example, if the current node is a node of “0x0103”, the search range of child nodes is actually a node of “0x0105” to “0x0107”. In the first embodiment, “0x0104” is also a search target. In this example, there is only one extra node, but there is actually an effect when there are many child nodes in “0x0100”, “0x0101”, and “0x0102”. If “0x0101” is the current node, the child node is only “0x0104”. However, in the first embodiment, “0x0102” to “0x0107” are search ranges.

これに対して各ノードについて最大子ノードの符号を保持すれば、カレントノードの1つ前のノードの最大子ノードの符号+1のノードからカレントノードの最大子ノードまでを探索範囲として絞り込むことができるようになる。なお、子ノードが存在しない場合には、そのノードの符号−1のノードの最大子ノードの符号をコピーしておく。   On the other hand, if the code of the maximum child node is held for each node, the search range can be narrowed down from the node of the code +1 of the maximum child node of the node immediately before the current node to the maximum child node of the current node. It becomes like this. When there is no child node, the code of the maximum child node of the node of code −1 of the node is copied.

このように最大子ノードの符号を保持すれば、カレントノードが「0x0103」であれば最大子ノードは「0x0107」となっている。さらにカレントノードの符号「0x0103」−1=「0x0102」の最大子ノードの符号「0x0104」+1=「0x0105」が得られるので、探索範囲は「0x0105」乃至「0x0107」であると効率的に特定できるようになる。   If the sign of the maximum child node is held in this way, if the current node is “0x0103”, the maximum child node is “0x0107”. Furthermore, since the code “0x0104” + 1 = “0x0105” of the maximum child node of the code “0x0103” −1 = “0x0102” of the current node is obtained, the search range is efficiently identified as “0x0105” to “0x0107” become able to.

具体的には、圧縮マップは、図68に示すように、親ノードの符号と、文字コードと、最大子ノードの符号とを対応付ける形に変形される。   Specifically, as shown in FIG. 68, the compression map is transformed into a form in which the code of the parent node, the character code, and the code of the maximum child node are associated with each other.

次に、本実施の形態に係る圧縮マップ生成処理について説明する。本実施の形態では、圧縮マップ生成処理におけるエントリ追加処理を、図69に示すように変更する。但し、変更部分は、ステップS135が追加された部分のみである。   Next, compression map generation processing according to the present embodiment will be described. In the present embodiment, the entry addition process in the compression map generation process is changed as shown in FIG. However, the changed part is only the part to which step S135 is added.

ステップS135では、1つのノードについて文字出現番号の配列を最後まで処理した後に、圧縮マップ生成部120は、ソート領域に最後に追加した符号の配列番号を最大子ノードの符号として設定する。処理に係るノードについてソート領域に子ノードの符号を追加しなかった場合、すなわち子ノードが存在していない場合には、処理に係るノードより前のノードと同じ符号が最大子ノードの符号として設定されることになる。   In step S135, after processing the array of the character appearance numbers for one node to the end, the compression map generation unit 120 sets the array number of the code added last to the sort area as the code of the maximum child node. If the child node code is not added to the sort area for the processing node, that is, if no child node exists, the same code as the node before the processing node is set as the maximum child node code. Will be.

また、本実施の形態に係る圧縮処理は、図70に示すような処理フローとなる。但し、図53の処理フローと異なる部分は、ステップS147乃至SS151の部分のみである。   Further, the compression processing according to the present embodiment has a processing flow as shown in FIG. However, the part different from the processing flow of FIG. 53 is only the part of steps S147 to SS151.

具体的には、圧縮処理部140は、カレントノードの符号が「0x0000」であるか否かを判断する(ステップS147b)。これは、「0x0000」のノードだけが、カレントノードより1つ前のノードの最大子ノードを取得できないためである。カレントノードの符号が「0x0000」である場合には、圧縮処理部140は、「親ノードの符号=カレントノードの符号、文字コード=取り出した文字」となるノードについて、圧縮マップにおいて符号「0x0100」から最大子ノードの符号の範囲で二分探索を実施する(ステップS149b)。そして処理はステップS153に移行する。ステップS149よりも探索の範囲が狭められている。   Specifically, the compression processing unit 140 determines whether the code of the current node is “0x0000” (step S147b). This is because only the node “0x0000” cannot acquire the maximum child node of the node immediately before the current node. When the code of the current node is “0x0000”, the compression processing unit 140 sets the code “0x0100” in the compression map for the node having “parent node code = current node code, character code = extracted character”. To perform a binary search in the range of the code of the maximum child node (step S149b). Then, the process proceeds to step S153. The search range is narrower than in step S149.

一方、カレントノードが「0x0000」でない場合には、圧縮処理部140は、「親ノードの符号=カレントノードの符号、文字コード=取り出した文字」となるノードについて、圧縮マップにおいて、カレントノードの1つ前のノードの最大子ノードの符号+1から最大子ノードの符号の範囲で二分探索を実施する(ステップS151b)。そして処理はステップS153に移行する。同様に、ステップS151よりも探索の範囲が狭められている。   On the other hand, if the current node is not “0x0000”, the compression processing unit 140 sets 1 of the current node in the compression map for the node having “parent node code = current node code, character code = extracted character”. A binary search is performed in the range from the code +1 of the maximum child node of the previous node to the code of the maximum child node (step S151b). Then, the process proceeds to step S153. Similarly, the search range is narrower than in step S151.

図67の文節木について上で述べた処理を実施すれば、図71のような圧縮マップが得られる。このような圧縮マップを用いて、入力文字列「ABCAA」について上で述べた圧縮処理を実施すると、以下のようになる。なお、処理結果自体は、図55に示したものと同様である。   If the above-described processing is performed on the phrase tree of FIG. 67, a compression map as shown in FIG. 71 is obtained. When the compression processing described above is performed on the input character string “ABCAA” using such a compression map, the following is performed. The processing result itself is the same as that shown in FIG.

まず、入力文字列「ABCAA」の「A」を処理する場合には、カレントノードが「0x0041」に設定される(図55における[1])。次に、「ABCAA」の「B」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x42」というノードについて、符号「0x0100」から「0x0101」(カレントノードの最大子ノードの符号)の範囲で二分探索を実施する。そうすると、符号「0x0101」が該当するノードであることが分かるので、カレントノードを「0x0101」に設定する(図55における[2])。   First, when processing “A” of the input character string “ABCAA”, the current node is set to “0x0041” ([1] in FIG. 55). Next, when processing “B” of “ABCAA”, for the node “parent node code = 0x0041, character code = 0x42”, the codes “0x0100” to “0x0101” (the maximum child node of the current node) Binary search is performed within the range of the sign. Then, since it can be seen that the code “0x0101” is the corresponding node, the current node is set to “0x0101” ([2] in FIG. 55).

さらに、「ABCAA」の「C」を処理する場合には、「親ノードの符号=0x0101、文字コード=0x43」というノードについて、符号「0x0104」(1つ前のノードの最大子ノードの符号+1=カレントノードの最大子ノードの符号)で二分探索を実施する。そうすると、符号「0x0104」が該当するノードであることが分かるので、カレントノードを「0x0104」に設定する(図55における[3])。   Further, when “C” of “ABCAA” is processed, the code “0x0104” (the code of the maximum child node of the previous node + 1) is added to the node “parent node code = 0x0101, character code = 0x43”. = Binary search at the maximum child node of the current node). Then, since the code “0x0104” is found to be the corresponding node, the current node is set to “0x0104” ([3] in FIG. 55).

さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0104、文字コード=0x41」となるノードについて、符号「0x0108」(1つ前のノードの最大子ノードの符号+1)から符号「0x0107」(カレントノードの最大子ノード)が探索範囲として特定されるが、探索範囲の始点と終点が逆転しており、探索不要であることが分かる。そうすると、目的のノードは見つからないので、カレントノードの符号「0x0104」を圧縮結果に追加する(図55における[4])。なお、文字コード「0x041」に対応する符号「0x0041」のノードをカレントノードに設定する。   Further, when “A” of “ABCAA” is processed, the code “0x0108” (the code of the maximum child node of the previous node is set for the node having “parent node code = 0x0104, character code = 0x41”). The code “0x0107” (the maximum child node of the current node) is specified as the search range from +1), but it can be seen that the start point and end point of the search range are reversed, and no search is necessary. Then, since the target node is not found, the code “0x0104” of the current node is added to the compression result ([4] in FIG. 55). Note that the node of the code “0x0041” corresponding to the character code “0x041” is set as the current node.

さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x41」というノードについて、符号「0x0100」から「0x0101」(カレントノードの最大子ノードの符号)の範囲で二分探索を実施する。そうすると、符号「0x0100」が該当するノードであることが分かるので、カレントノードを「0x0100」に設定する(図55における[5])。これで入力文字列の全文字を処理したので、カレントノードの符号「0x0100」を出力して、処理を終了する(図55における[6])。   Further, when “A” of “ABCAA” is processed, the codes “0x0100” to “0x0101” (the code of the largest child node of the current node) for the node “parent node code = 0x0041, character code = 0x41” ) Perform binary search within the range. Then, since the code “0x0100” is found to be the corresponding node, the current node is set to “0x0100” ([5] in FIG. 55). Since all the characters of the input character string have been processed, the current node code “0x0100” is output and the processing is terminated ([6] in FIG. 55).

以上のように具体例でも探索範囲が狭められていることが分かる。   As described above, it can be seen that the search range is narrowed even in the specific example.

[実施の形態3]
第3の実施の形態では、伸張処理の処理速度を向上させる。図56で示した処理では、根ノード(root)までノードを遡ることになるので、ノードの探索の処理回数が多くなっている。そこで、本実施の形態では、圧縮マップのデータ構造を変更すると共に、新たに階層情報及び伸張マップを生成して保持しておくものとする。このように追加のデータを保持するようになったとしても、追加で必要な容量は800KB程度であり、負担がそれほど増えるわけではない。なお、圧縮マップは、446KB程度である。
[Embodiment 3]
In the third embodiment, the processing speed of the decompression process is improved. In the process shown in FIG. 56, since the node is traced back to the root node (root), the number of node search processes is increased. Therefore, in this embodiment, it is assumed that the data structure of the compression map is changed, and the hierarchical information and the decompression map are newly generated and held. Even if additional data is held in this way, the additional required capacity is about 800 KB, and the burden does not increase so much. The compression map is about 446 KB.

図72に本実施の形態に係る圧縮マップの一例を示す。図72に示すように、基本的な構成は第1の実施の形態と同様であるが、親ノードの符号と自ノードの文字コードと自ノードの所属階層の番号とを対応付けて格納するようになっている。   FIG. 72 shows an example of the compression map according to the present embodiment. As shown in FIG. 72, the basic configuration is the same as that of the first embodiment, but the code of the parent node, the character code of the own node, and the number of the hierarchy to which the own node belongs are stored in association with each other. It has become.

また、図73は、第1階層以降の各階層について、階層内ノード数と、階層内先頭符号と、伸張文字列先頭オフセット(offset)値とが対応付けられるようになっている。図73の例は、図67の文節木を基にしているが、階層情報があれば、第2階層には4つのノード「0x0100」「0x0101」「0x0102」「0x0103」があり、これらがそれぞれ2文字からなる文字列を表していることが分かる。また、これらの文字列は合計2×4=8バイトである。また、第3階層においては4つのノード「0x0104」「0x0105」「0x0106」「0x0107」があり、これらがそれぞれ3文字からなる文字列を表していることが分かる。また、これらの文字列は合計3×4=12バイトであることも分かる。伸張文字列先頭オフセット値は、階層が特定されたとき、当該階層の先頭の符号の文字又は文字列が、伸張マップの先頭からどれだけ離れた位置に配置されているかを示している。   In FIG. 73, for each layer after the first layer, the number of nodes in the layer, the head code in the layer, and the expanded character string head offset (offset) value are associated with each other. The example of FIG. 73 is based on the phrase tree of FIG. 67, but if there is hierarchy information, there are four nodes “0x0100”, “0x0101”, “0x0102”, and “0x0103” in the second hierarchy, It can be seen that it represents a character string consisting of two characters. These character strings are 2 × 4 = 8 bytes in total. Further, in the third hierarchy, there are four nodes “0x0104”, “0x0105”, “0x0106”, and “0x0107”, and it can be seen that these represent character strings each consisting of three characters. It can also be seen that these character strings total 3 × 4 = 12 bytes. The expanded character string head offset value indicates how far the character or character string of the code at the head of the layer is located from the beginning of the expanded map when the layer is specified.

さらに、図74は、本実施の形態に係る伸張マップの一例を示す。本実施の形態に係る伸張マップは、所属するノードの符号に対応する文字が、符号の順番で格納されている連想配列である。図67の文節木であれば、第2階層については、0番目には「AA」、1番目には「AB」、2番目には「BC」、3番目には「CB」が登録されている。また、第3階層については、0番目には「ABC」、1番目には「CBA」、2番目には「CBB」、3番目には「CBC」が登録されている。   Further, FIG. 74 shows an example of an expansion map according to the present embodiment. The decompression map according to the present embodiment is an associative array in which characters corresponding to the codes of the nodes to which they belong are stored in the order of the codes. 67, in the second hierarchy, “AA” is registered for the 0th, “AB” for the 1st, “BC” for the 2nd, and “CB” for the 3rd. Yes. For the third hierarchy, “ABC” is registered for the 0th, “CBA” for the first, “CBB” for the second, and “CBC” for the third.

このような圧縮マップなどのデータを生成する処理を、図75乃至図77を用いて説明する。   Processing for generating data such as a compression map will be described with reference to FIGS.

圧縮マップ生成部120は、圧縮マップに、第1階層のノード「0x0000」乃至「0x00FF」のデータとして、根ノードを表すデータrootとノードの符号に対応する文字コードと所属階層番号「1」を対応付ける対応付けデータを順番に追加する(図75:ステップS181)。   The compression map generation unit 120 adds data root representing the root node, the character code corresponding to the code of the node, and the belonging hierarchy number “1” as data of the nodes “0x0000” to “0x00FF” of the first hierarchy to the compression map. The association data to be associated is added in order (FIG. 75: step S181).

また、圧縮マップ生成部120は、階層情報に第1階層の情報を設定する(ステップS183)。すなわち、第1階層には256個のノードがあるので、階層内ノード数に256を設定し、階層内先頭符号に「0x0000」を設定し、伸張文字列先頭オフセットには「0」を設定する。これらは固定値である。   In addition, the compression map generation unit 120 sets the information of the first layer in the layer information (Step S183). That is, since there are 256 nodes in the first layer, 256 is set as the number of nodes in the layer, “0x0000” is set as the head code in the layer, and “0” is set as the decompressed character string head offset. . These are fixed values.

さらに、圧縮マップ生成部120は、伸張マップに第1階層の情報を設定する(ステップS185)。第1階層は1文字で文字コードそのものであるから「0x00」から「0xFF」までを設定する。これらは固定値である。   Further, the compression map generation unit 120 sets the first layer information in the decompression map (step S185). Since the first layer is one character and the character code itself, “0x00” to “0xFF” are set. These are fixed values.

そして、圧縮マップ生成部120は、ソート領域に、第1の階層のノード「0x0000」乃至「0x00FF」の符号を、順番に追加する(ステップS187)。また、圧縮マップ生成部120は、次階層内先頭符号に「0x0100」を設定する(ステップS189)。次階層内先頭符号は、以下で用いる変数である。さらに、圧縮マップ生成部120は、階層カウンタを1に初期化する(ステップS190)。   Then, the compression map generation unit 120 sequentially adds the codes of the nodes “0x0000” to “0x00FF” of the first hierarchy to the sort area (step S187). Further, the compression map generation unit 120 sets “0x0100” as the head code in the next layer (step S189). The head code in the next layer is a variable used in the following. Further, the compression map generation unit 120 initializes the hierarchy counter to 1 (step S190).

その後、圧縮マップ生成部120は、ソート領域から、ソート後符号の小さい順に、未処理の符号を1つ読み出す(ステップS191)。ここで未処理の符号を読み出すことができない場合には(ステップS193:Noルート)、圧縮マップ生成部120は、以下で説明するノード数カウンタの値を、階層情報における最終階層の階層内ノード数として設定する(ステップS195)。そして処理は呼出元の処理に戻る。   After that, the compression map generation unit 120 reads one unprocessed code from the sorting area in ascending order of the sorted code (step S191). If the unprocessed code cannot be read out here (step S193: No route), the compression map generation unit 120 uses the value of the node number counter described below as the number of nodes in the hierarchy of the final hierarchy in the hierarchy information. (Step S195). Then, the process returns to the caller process.

一方、未処理の符号を読み出すことができれば(ステップS193:Yesルート)、圧縮マップ生成部120は、文節木において、読み出した符号のノードのデータブロックを参照する(ステップS197)。そして、圧縮マップ生成部120は、本実施の形態に係るエントリ追加処理3を実施する(ステップS199)。このエントリ追加処理3については、図76を用いて説明する。さらに、エントリ追加処理3の後に、圧縮マップ生成部120は、設定処理を実施する(ステップS201)。設定処理については、図77を用いて説明する。そして処理はステップS191に戻る。   On the other hand, if the unprocessed code can be read (step S193: Yes route), the compression map generation unit 120 refers to the data block of the node of the read code in the phrase tree (step S197). Then, the compression map generation unit 120 performs the entry addition process 3 according to the present embodiment (step S199). The entry addition process 3 will be described with reference to FIG. Further, after the entry addition process 3, the compression map generation unit 120 performs a setting process (step S201). The setting process will be described with reference to FIG. Then, the process returns to step S191.

次に、エントリ追加処理3について図76を用いて説明する。図76は、図52とほぼ同じであるが、ステップS133がステップS133bに変更され、ステップS137及びS139が追加されている。   Next, the entry addition process 3 will be described with reference to FIG. FIG. 76 is substantially the same as FIG. 52, but step S133 is changed to step S133b, and steps S137 and S139 are added.

すなわち、ステップS133bでは、圧縮マップ生成部120は、圧縮マップに、ソート領域における処理対象の配列番号(親ノードの符号)と文字出現番号の配列における処理対象の配列番号(子ノードの文字コード)と階層カウンタの値(所属階層)とを対応付ける対応付けデータを追加する(ステップS133b)。   That is, in step S133b, the compression map generation unit 120 adds the processing target array number (parent node code) in the sort area and the processing target array number (child node character code) in the array of character appearance numbers to the compression map. And association data for correlating the value of the hierarchy counter (affiliation hierarchy) with each other (step S133b).

また、圧縮マップ生成部120は、伸張マップに、親ノードの文字列+文字出現番号の配列番号(子ノードの文字コード)を、子ノードに対応する文字列として階層カウンタの値の階層において設定する(ステップS137)。親ノードの文字列(処理に係る符号の文字列)は、例えば圧縮マップをステップS95で特定された符号を用いてたどることによって特定する。また、親ノードの文字列は、圧縮マップで所属階層を取得して、階層情報における、カレントノードが所属する階層の「伸張文字列先頭オフセット」+(カレントノードの符号−階層内先頭符号)×階層の位置を、伸張マップにおいて参照すれば、得ることができる。   In addition, the compression map generation unit 120 sets the character string of the parent node + the array number of the character appearance number (character code of the child node) in the decompression map in the hierarchy of the value of the hierarchy counter as a character string corresponding to the child node. (Step S137). The character string of the parent node (character string of the code related to the process) is specified by following the compression map using the code specified in step S95, for example. Also, the character string of the parent node is obtained by acquiring the affiliation hierarchy in the compression map, and in the hierarchy information, “decompressed character string head offset” of the hierarchy to which the current node belongs + (code of current node−head code in hierarchy) × The position of the hierarchy can be obtained by referring to the extension map.

さらに、圧縮マップ生成部120は、ノード数カウンタの値を1インクリメントする(ステップS139)。そして処理はステップS111に戻る。   Furthermore, the compression map generator 120 increments the value of the node number counter by 1 (step S139). Then, the process returns to step S111.

以上のようにすれば、圧縮マップ、階層情報及び伸張マップの一部を生成できるようになる。   In this way, a part of the compression map, hierarchy information, and decompression map can be generated.

次に、設定処理について、図77を用いて説明する。   Next, the setting process will be described with reference to FIG.

圧縮マップ生成部120は、これまでに設定されていた次階層先頭符号がカレントノードの符号であるか判断する(ステップS211)。次階層先頭符号の初期値は「0x0100」である。次階層先頭符号がカレントノードの符号ではない場合には処理はステップS219に移行する。一方、次階層先頭符号がカレントノードの符号であれば、圧縮マップ生成部120は、エントリ追加処理3において、子ノードが特定されたか判断する(ステップS213)。子ノードが存在しない場合には、圧縮マップ生成部120は、次階層先頭符号に、カレントノードの符号+1を設定する(ステップS217)。そして処理は呼出元の処理に戻る。   The compression map generation unit 120 determines whether the next layer head code set so far is the code of the current node (step S211). The initial value of the next layer head code is “0x0100”. If the next layer head code is not the code of the current node, the process proceeds to step S219. On the other hand, if the next layer head code is the code of the current node, the compression map generation unit 120 determines whether a child node is specified in the entry addition process 3 (step S213). If there is no child node, the compression map generator 120 sets the code +1 of the current node as the next layer head code (step S217). Then, the process returns to the caller process.

一方、子ノードが存在した場合には、次階層先頭符号に、エントリ追加処理3において特定された子ノードのうち最小子ノードの符号を設定する(ステップS215)。そして処理はステップS219に移行する。   On the other hand, if there is a child node, the code of the smallest child node among the child nodes specified in the entry addition process 3 is set as the next layer top code (step S215). Then, the process proceeds to step S219.

ステップS219の処理に移行して、圧縮マップ生成部120は、カレントノードの符号+1が次階層先頭符号であるか判断する(ステップS219)。すなわち、処理に係るノードが、現階層の最終ノードであるか判断する。カレントノードの符号+1が次階層先頭符号である場合には、圧縮マップ生成部120は、階層情報の階層内ノード数に、ノード数カウンタの値を設定する(ステップS221)。また、圧縮マップ生成部120は、階層情報において、次階層の階層内先頭符号としてカレントノード+1を設定する(ステップS223)。さらに、圧縮マップ生成部120は、階層情報における次の階層の伸張文字列先頭オフセットとして、現階層の伸張文字列先頭オフセット+ノード数カウンタ×階層番号(階層カウンタの値)を設定する(ステップS225)。   Shifting to the process of step S219, the compression map generation unit 120 determines whether the code +1 of the current node is the next layer head code (step S219). That is, it is determined whether the node related to the process is the last node in the current hierarchy. When the code +1 of the current node is the next layer head code, the compression map generator 120 sets the value of the node number counter to the number of nodes in the layer of the layer information (step S221). In addition, the compression map generation unit 120 sets current node + 1 as the first code in the hierarchy of the next hierarchy in the hierarchy information (step S223). Further, the compression map generation unit 120 sets the decompressed character string head offset of the current layer + node number counter × hierarchy number (hierarchy counter value) as the decompressed character string head offset of the next layer in the layer information (step S225). ).

そして、圧縮マップ生成部120は、ノード数カウンタを0に初期化し(ステップS227)、階層カウンタの値を1インクリメントする(ステップS229)。そして処理は、呼出元の処理に戻る。   Then, the compression map generation unit 120 initializes the node number counter to 0 (step S227), and increments the value of the hierarchy counter by 1 (step S229). Then, the process returns to the caller process.

このような処理を実施することで上で述べた圧縮マップ、階層情報及び伸張マップを生成することができる。   By performing such processing, the compression map, the hierarchy information, and the decompression map described above can be generated.

次に、本実施の形態に係る圧縮処理3について図78を用いて説明する。本実施の形態に係る圧縮処理3は、第1の実施の形態に係る圧縮処理とほぼ同じであり、異なるのはステップS147乃至S151に代わり、ステップS151cを実行するような点である。   Next, compression processing 3 according to the present embodiment will be described with reference to FIG. The compression process 3 according to the present embodiment is substantially the same as the compression process according to the first embodiment, and is different in that step S151c is executed instead of steps S147 to S151.

すなわち、圧縮処理部140は、「親ノードの符号=カレントノードの符号、文字コード=取り出した文字」となるノードについて、圧縮マップにおいて、カレントノードの階層の次の階層の階層内先頭符号(階層情報内のデータ)から次の階層(階層情報内のデータ)の階層内ノード数の範囲で二分探索を実施する(ステップS151c)。   In other words, the compression processing unit 140, for a node having “parent node code = current node code, character code = extracted character”, in the compression map, the first code in the hierarchy (hierarchy) A binary search is performed within the range of the number of nodes in the hierarchy from the data in the information) to the next hierarchy (data in the hierarchy information) (step S151c).

このようにすれば、第1の実施の形態に係る圧縮処理における探索範囲より狭められている。   In this way, it is narrower than the search range in the compression processing according to the first embodiment.

例えば、「ABCAA」という圧縮対象の文字列が入力された場合の処理について具体的に説明する。   For example, a process when a character string to be compressed of “ABCAA” is input will be specifically described.

まず、入力文字列「ABCAA」の「A」を処理する場合には、カレントノードが「0x0041」に設定される(図55における[1])。次に、「ABCAA」の「B」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x42」というノードについて、現階層が「1」であるから第2階層の符号「0x0100」から「0x0103」の範囲で二分探索を実施する。そうすると、符号「0x0101」が該当するノードであることが分かるので、カレントノードを「0x0101」に設定する(図55における[2])。   First, when processing “A” of the input character string “ABCAA”, the current node is set to “0x0041” ([1] in FIG. 55). Next, when “B” of “ABCAA” is processed, since the current hierarchy is “1” for the node “parent node code = 0x0041, character code = 0x42”, the second hierarchy code “0x0100” ”To“ 0x0103 ”. Then, since it can be seen that the code “0x0101” is the corresponding node, the current node is set to “0x0101” ([2] in FIG. 55).

さらに、「ABCAA」の「C」を処理する場合には、「親ノードの符号=0x0101、文字コード=0x43」というノードについて、現階層が「2」であるから第3階層の符号「0x0104」から「0x0107」の範囲で二分探索を実施する。そうすると、符号「0x0104」が該当するノードであることが分かるので、カレントノードを「0x0104」に設定する(図55における[3])。   Further, when “C” of “ABCAA” is processed, since the current layer is “2” for the node “parent node code = 0x0101, character code = 0x43”, the third layer code “0x0104” To “0x0107”. Then, since the code “0x0104” is found to be the corresponding node, the current node is set to “0x0104” ([3] in FIG. 55).

さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0104、文字コード=0x41」となるノードについて、現階層が「3」であるので、次階層が存在しないので、探索無しで該当ノード無しと言うことが分かる。従って、カレントノードの符号「0x0104」を圧縮結果に追加する(図55における[4])。なお、文字コード「0x41」に対応する符号「0x0041」のノードをカレントノードに設定する。   Further, when “A” of “ABCAA” is processed, since the current layer is “3” for the node having “parent node code = 0x0104, character code = 0x41”, there is no next layer. It can be seen that there is no corresponding node without searching. Therefore, the code “0x0104” of the current node is added to the compression result ([4] in FIG. 55). Note that the node of the code “0x0041” corresponding to the character code “0x41” is set as the current node.

さらに、「ABCAA」の「A」を処理する場合には、「親ノードの符号=0x0041、文字コード=0x41」というノードについて、現階層が「1」であるから第2階層の符号「0x0100」から「0x0103」の範囲で二分探索を実施する。そうすると、符号「0x0100」が該当するノードであることが分かるので、カレントノードを「0x0100」に設定する(図55における[5])。これで入力文字列の全文字を処理したので、カレントノードの符号「0x0100」を出力して、処理を終了する(図55における[6])。   Further, when “A” of “ABCAA” is processed, since the current layer is “1” for the node “parent node code = 0x0041, character code = 0x41”, the second layer code “0x0100” To “0x0103”. Then, since the code “0x0100” is found to be the corresponding node, the current node is set to “0x0100” ([5] in FIG. 55). Since all the characters of the input character string have been processed, the current node code “0x0100” is output and the processing is terminated ([6] in FIG. 55).

このように圧縮処理を実施することができる。   In this way, the compression process can be performed.

次に、本実施の形態に係る伸張処理2の処理内容について図79及び図80を用いて説明する。   Next, processing contents of the decompression processing 2 according to the present embodiment will be described with reference to FIGS. 79 and 80. FIG.

まず、伸張処理部150は、圧縮データから1つ符号を取り出し、圧縮マップにおいて該当するノードをカレントノードに位置づける(ステップS231)。圧縮データから符号が読み出せなかった場合には(ステップS233:Noルート)、処理は呼出元の処理に戻る。一方、圧縮データから符号を読み出すことができれば(ステップS233:Yesルート)、階層情報における、カレントノードが所属する階層の「伸張文字列先頭オフセット」+(カレントノードの符号−階層内先頭符号)×階層の位置を、伸張マップにおいて参照し、階層バイト分出力する(ステップS235)。そしてステップS231に戻る。伸長文字列先頭オフセット、階層内先頭符号については、階層情報から読み出すことによって得られる。   First, the decompression processing unit 150 extracts one code from the compressed data, and positions the corresponding node in the compression map as the current node (step S231). If the code cannot be read from the compressed data (step S233: No route), the process returns to the caller process. On the other hand, if the code can be read from the compressed data (step S233: Yes route), “hierarchical character string head offset” of the hierarchy to which the current node belongs in the hierarchy information + (code of current node−head code in hierarchy) × The position of the hierarchy is referred to in the decompression map and output for the hierarchy bytes (step S235). Then, the process returns to step S231. The decompressed character string head offset and the head code within the hierarchy are obtained by reading from the hierarchy information.

このように階層情報と伸張マップを用いることで処理が高速化される。   In this way, the processing speed is increased by using the hierarchy information and the extension map.

例えば、「0x0104」「0x0100」を伸張する場合の処理を図80を用いて説明する。   For example, a process when decompressing “0x0104” and “0x0100” will be described with reference to FIG.

まず、符号「0x0104」を読み出すと、圧縮マップから第3階層であることが特定されるので、第3階層の伸張文字列先頭オフセット「264」+(カレントノードの符号「0x0104」−階層内先頭符号「0x0104」)×3=「264」となるので、伸張マップの先頭から264バイトから3バイト分取り出す。そうすると、「ABC」が出力される(図80[1])。
さらに、次の符号「0x0100」を読み出すと、圧縮マップから第2階層であることが特定されるので、第2階層の伸張文字オフセット「256」+(カレントノードの符号「0x0100」−階層内先頭符号「0x0100」)×2=「256」となるので、伸張マップの先頭から256バイトから2バイト分取り出す。そうすると、「AA」がさらに出力されることになる(図80[2])。
First, when the code “0x0104” is read out, it is specified from the compression map that it is the third layer. Therefore, the decompressed character string head offset “264” of the third layer + (current node code “0x0104” −the head in the layer Since the code is “0x0104”) × 3 = “264”, 3 bytes are extracted from 264 bytes from the head of the decompression map. Then, “ABC” is output (FIG. 80 [1]).
Further, when the next code “0x0100” is read, it is specified from the compression map that it is the second layer. Therefore, the second layer expanded character offset “256” + (current node code “0x0100” −the head in the layer) Since the code “0x0100”) × 2 = “256”, 2 bytes are extracted from 256 bytes from the head of the decompression map. Then, “AA” is further output (FIG. 80 [2]).

以上のように2ステップで伸張されるので、処理が高速化される。   As described above, since the decompression is performed in two steps, the processing speed is increased.

[実施の形態4]
本実施の形態では実施の形態2及び3を統合する。また、伸張マップ及び階層情報において固定で且つ圧縮マップのデータから得られる情報については省略することで、メモリ使用量を削減する。
[Embodiment 4]
In the present embodiment, the second and third embodiments are integrated. Also, information that is fixed in the decompression map and hierarchy information and obtained from the compression map data is omitted, thereby reducing the memory usage.

本実施の形態に係る圧縮マップの一例を図81に示す。本実施の形態では、ソート後の符号の順番で、自ノードの文字コードと、最大子ノードの符号と、所属階層とを対応付けている。親ノードの符号については、階層情報及び伸張マップがあれば用いられないので、省略されている。   An example of the compression map according to the present embodiment is shown in FIG. In the present embodiment, the character code of the own node, the code of the maximum child node, and the affiliation hierarchy are associated in the order of the codes after sorting. The code of the parent node is omitted because it is not used if there is hierarchical information and an extension map.

さらに、図82に本実施の形態に係る階層情報を示す。本実施の形態に係る階層情報は、第3の実施の形態と異なり、第1階層のデータが省略されている。第2階層以降の各階層について、階層内ノード数と、階層内先頭符号と、伸張文字列先頭オフセットとが登録されるようになっている。第1階層のデータが省略されているので、伸張文字列先頭オフセットの値が変更されている。   Further, FIG. 82 shows hierarchical information according to the present embodiment. The hierarchy information according to the present embodiment is different from the third embodiment in that the data of the first hierarchy is omitted. For each layer after the second layer, the number of nodes in the layer, the head code within the layer, and the decompressed character string head offset are registered. Since the data of the first layer is omitted, the value of the decompressed character string head offset is changed.

また、図83に本実施の形態に係る伸張マップを示す。本実施の形態に係る伸張マップは、第3の実施の形態と異なり、第1階層のデータが省略されている。伸張マップは、第2階層以降の符号の小さい順に、該当する文字列が格納されている連想配列である。   FIG. 83 shows an expansion map according to the present embodiment. In the decompression map according to the present embodiment, unlike the third embodiment, the data of the first layer is omitted. The decompression map is an associative array in which corresponding character strings are stored in ascending order of codes after the second layer.

本実施の形態に係る圧縮マップ生成処理3の処理フローを図84に示す。第3の実施の形態に係る圧縮マップ生成処理2と異なる部分は、ステップS183及びS185が存在せず、エントリ追加処理3を実施するステップS199の代わりにエントリ追加処理4を実施するステップS199bを実施する点、設定処理を実施するステップS201の代わりに設定処理2を実施するステップS201bを実施する点が異なっている。   FIG. 84 shows a process flow of the compression map generation process 3 according to the present embodiment. The difference from the compression map generation process 2 according to the third embodiment is that steps S183 and S185 do not exist, and step S199b that performs the entry addition process 4 is performed instead of step S199 that performs the entry addition process 3. The difference is that step S201b for performing the setting process 2 is performed instead of step S201 for performing the setting process.

次にエントリ追加処理4の処理フローを図85に示す。第3の実施の形態に係るエントリ追加処理3と異なる点は、配列の終端の場合に実行するステップS135(エントリ追加処理2で説明した処理)を実施する点と、ステップS133bの代わりにステップS133cを実施する点である。   Next, FIG. 85 shows a process flow of the entry addition process 4. The difference from the entry addition process 3 according to the third embodiment is that step S135 (the process described in the entry addition process 2) executed at the end of the array is performed, and step S133c instead of step S133b. It is a point to implement.

ステップS133cでは、圧縮マップ生成部120は、圧縮マップに、文字出現番号の配列における処理対象の配列番号(子ノードの文字コード)と階層カウンタの値(所属階層)とを対応付ける対応付けデータを追加する(ステップS133c)。ソート領域における処理対象の配列番号(親ノードの符号)を登録しなくなった点が異なる。   In step S133c, the compression map generation unit 120 adds association data that associates the processing target array number (the character code of the child node) in the array of character appearance numbers with the value of the hierarchy counter (affiliation hierarchy) in the compression map. (Step S133c). The difference is that the array element (the code of the parent node) to be processed in the sort area is no longer registered.

また、圧縮マップ生成処理3に含まれる設定処理2は、図77とは異なり、図86に示すような処理フローとなる。但し、図77との差は、ステップS220及びS222が追加され、ステップS223及びS225の代わりに、ステップS223b及びS225bが実施されるようになっている。   Also, the setting process 2 included in the compression map generation process 3 has a process flow as shown in FIG. 86, unlike FIG. However, the difference from FIG. 77 is that steps S220 and S222 are added, and steps S223b and S225b are executed instead of steps S223 and S225.

この設定処理2において、ステップS219においてカレントノードの符号+1が次階層先頭符号である場合、すなわち当該階層の最終ノードである場合には、圧縮マップ生成部120は、現在の階層カウンタの値が1であるか判断する(ステップS220)。現在の階層カウンタの値が1である場合には、階層情報にデータを追加しないので、圧縮マップ生成部120は、階層情報における次の階層の伸張文字列先頭オフセットに「0」を設定する(ステップS222)。そして処理はステップS225bに移行する。   In the setting process 2, when the code +1 of the current node is the next layer head code in step S219, that is, when it is the last node of the layer, the compression map generator 120 sets the current layer counter value to 1. (Step S220). When the value of the current hierarchy counter is 1, since no data is added to the hierarchy information, the compression map generation unit 120 sets “0” as the decompressed character string start offset of the next hierarchy in the hierarchy information ( Step S222). Then, the process proceeds to step S225b.

一方、現在の階層カウンタの値が1でない場合には、圧縮マップ生成部120は、階層情報の階層内ノード数に、ノード数カウンタの値を設定する(ステップS221)。また、圧縮マップ生成部120は、階層情報における次の階層の伸張文字列先頭オフセットとして、現階層の伸張文字列オフセット+ノード数カウンタ×階層数(階層カウンタの値)を設定する(ステップS223b)。この処理はステップS225と同じである。さらに圧縮マップ生成部120は、階層情報において、次階層の階層内先頭符号としてカレントノードの符号+1を設定する(ステップS225b)。このステップはステップS223と同じである。以降の処理は図77と同じである。   On the other hand, when the current hierarchy counter value is not 1, the compression map generation unit 120 sets the value of the node number counter to the number of nodes in the hierarchy of the hierarchy information (step S221). Further, the compression map generation unit 120 sets the decompressed character string offset of the current layer + node number counter × the number of layers (the value of the layer counter) as the decompressed character string start offset of the next layer in the layer information (step S223b). . This process is the same as step S225. Further, the compression map generation unit 120 sets the code +1 of the current node as the first code in the next hierarchy in the hierarchy information (step S225b). This step is the same as step S223. The subsequent processing is the same as in FIG.

次に、本実施の形態に係る圧縮処理4の処理フローを図87に示す。第2の実施の形態に係る圧縮処理2との差は、ステップS149bとステップS151bが、ステップS149dとステップS151dとに変更された点である。   Next, FIG. 87 shows a processing flow of compression processing 4 according to the present embodiment. The difference from the compression process 2 according to the second embodiment is that step S149b and step S151b are changed to step S149d and step S151d.

具体的には、圧縮処理部140は、カレントノードの符号が「0x0000」であるか否かを判断する(ステップS147b)。これは、「0x0000」のノードだけが、カレントノードより1つ前のノードの最大子ノードを取得できないためである。カレントノードの符号が「0x0000」である場合には、圧縮処理部140は、文字コード=取り出した文字となるノードについて、圧縮マップにおいて符号「0x0100」から最大子ノードの符号の範囲で二分探索を実施する(ステップS149d)。親ノードについてのデータが圧縮マップから削除されているため、このような処理になる。   Specifically, the compression processing unit 140 determines whether the code of the current node is “0x0000” (step S147b). This is because only the node “0x0000” cannot acquire the maximum child node of the node immediately before the current node. When the code of the current node is “0x0000”, the compression processing unit 140 performs a binary search in the compression map from the code “0x0100” to the code of the maximum child node for the node whose character code is the extracted character. Implement (step S149d). This is the process because the data about the parent node has been deleted from the compression map.

一方、カレントノードが「0x0000」でない場合には、圧縮処理部140は、文字コード=取り出した文字となるノードについて、圧縮マップにおいて、カレントノードの1つ前のノードの最大子ノードの符号+1から最大子ノードの符号の範囲で二分探索を実施する(ステップS151d)。そして処理はステップS153に移行する。   On the other hand, when the current node is not “0x0000”, the compression processing unit 140 determines, from the code +1 of the maximum child node of the node immediately before the current node in the compression map, for the node whose character code is the extracted character. A binary search is performed in the range of the code of the maximum child node (step S151d). Then, the process proceeds to step S153.

なお、伸張処理については、図79の伸張処理2の代わりに図88に示す伸張処理3を実施する。図88と図79の差については、ステップS237及びS239が追加されている点である。具体的には、伸張処理部150は、圧縮マップにおけるカレントノードの所属階層の値が「1」であるか判断する(ステップS237)。所属階層の値が「1」である場合には、伸張処理部150は、圧縮マップにおけるカレントノードにおける文字コードを出力し(ステップS239)、処理はステップS231に移行する。一方、所属階層の値が「2」以上であれば、処理はステップS235に移行する。このような処理を実施すれば、階層情報及び伸張マップのデータ量を削減しても伸張処理が高速化される。   As for the decompression process, the decompression process 3 shown in FIG. 88 is performed instead of the decompression process 2 in FIG. The difference between FIG. 88 and FIG. 79 is that steps S237 and S239 are added. Specifically, the decompression processing unit 150 determines whether the value of the hierarchy level of the current node in the compression map is “1” (step S237). If the value of the affiliation hierarchy is “1”, the decompression processing unit 150 outputs the character code at the current node in the compression map (step S239), and the process proceeds to step S231. On the other hand, if the value of the belonging hierarchy is “2” or more, the process proceeds to step S235. If such a process is performed, the decompression process can be accelerated even if the data amount of the hierarchy information and the decompression map is reduced.

以上本実施の形態を説明したが、本技術はこれに限定されるものではない。   Although the present embodiment has been described above, the present technology is not limited to this.

例えば、上で述べた機能ブロック図は必ずしも実際のプログラムモジュール構成とは一致しない。また、処理フローについても処理結果が変わらない限り、処理順番を入れ替えたり、並列実行するようにできる。   For example, the functional block diagram described above does not necessarily match the actual program module configuration. As for the processing flow, as long as the processing result does not change, the processing order can be changed or executed in parallel.

さらに上で述べた処理については1台のコンピュータで処理する例を示したが、複数のコンピュータで処理するようにしても良い。   Furthermore, although the above-described processing has been described with an example in which processing is performed by one computer, processing may be performed by a plurality of computers.

なお、上で述べた情報処理装置100は、コンピュータ装置であって、図89に示すように、メモリ2501とCPU(Central Processing Unit)2503とハードディスク・ドライブ(HDD:Hard Disk Drive)2505と表示装置2509に接続される表示制御部2507とリムーバブル・ディスク2511用のドライブ装置2513と入力装置2515とネットワークに接続するための通信制御部2517とがバス2519で接続されている。オペレーティング・システム(OS:Operating System)及び本実施例における処理を実施するためのアプリケーション・プログラムは、HDD2505に格納されており、CPU2503により実行される際にはHDD2505からメモリ2501に読み出される。CPU2503は、アプリケーション・プログラムの処理内容に応じて表示制御部2507、通信制御部2517、ドライブ装置2513を制御して、所定の動作を行わせる。また、処理途中のデータについては、主としてメモリ2501に格納されるが、HDD2505に格納されるようにしてもよい。本技術の実施例では、上で述べた処理を実施するためのアプリケーション・プログラムはコンピュータ読み取り可能なリムーバブル・ディスク2511に格納されて頒布され、ドライブ装置2513からHDD2505にインストールされる。インターネットなどのネットワーク及び通信制御部2517を経由して、HDD2505にインストールされる場合もある。このようなコンピュータ装置は、上で述べたCPU2503、メモリ2501などのハードウエアとOS及びアプリケーション・プログラムなどのプログラムとが有機的に協働することにより、上で述べたような各種機能を実現する。   Note that the information processing apparatus 100 described above is a computer apparatus, and as shown in FIG. 89, a memory 2501, a CPU (Central Processing Unit) 2503, a hard disk drive (HDD: Hard Disk Drive) 2505, and a display device. A display control unit 2507 connected to 2509, a drive device 2513 for the removable disk 2511, an input device 2515, and a communication control unit 2517 for connecting to a network are connected by a bus 2519. An operating system (OS) and an application program for executing the processing in this embodiment are stored in the HDD 2505, and are read from the HDD 2505 to the memory 2501 when executed by the CPU 2503. The CPU 2503 controls the display control unit 2507, the communication control unit 2517, and the drive device 2513 according to the processing content of the application program, and performs a predetermined operation. Further, data in the middle of processing is mainly stored in the memory 2501, but may be stored in the HDD 2505. In an embodiment of the present technology, an application program for performing the above-described processing is stored in a computer-readable removable disk 2511 and distributed, and installed from the drive device 2513 to the HDD 2505. In some cases, the HDD 2505 may be installed via a network such as the Internet and the communication control unit 2517. Such a computer apparatus realizes various functions as described above by organically cooperating hardware such as the CPU 2503 and the memory 2501 described above and programs such as the OS and application programs. .

以上述べた本実施の形態をまとめると、以下のようになる。   The above-described embodiment can be summarized as follows.

本実施の形態に係るデータ構造生成方法は、(A)文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と上記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に当該文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字について生成し、(B)入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において入力文字列において着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数が今回閾値を超えることになることを検出すると、第3の領域において当該出現順番のデータとして、着目する文字又は文字列と次に出現した文字とからなる第2の文字列に対応する符号を格納し、(C)第2の文字列についてのデータブロックを生成する処理を含む。   In the data structure generation method according to the present embodiment, (A) a first area for holding a code corresponding to a character or a character string, and the appearance order of characters appearing next to the character or character string are set for each character. If the number of appearances or the number of appearances exceeds the threshold according to the appearance order of the second region to hold and the character or the character that appears next to the character string, the character or character string and the character that has appeared this time A data block including a third area for holding a code corresponding to the character string consisting of is generated for each character that may be used, and (B) a plurality of characters included in the input character string In the second area of the data block for the character or character string of interest in which the appearance order of the character that appears next to the character or character string of interest in the input character string is held, and the third area If the number of appearances is held as the data of the appearance order and the number of appearances exceeds the current threshold, the character or character string of interest as the data of the order of appearance in the third area The code | cord | chord corresponding to the 2nd character string which consists of the character which appeared next is stored, and the process which produces | generates the data block about the (C) 2nd character string is included.

このような処理を実施することによって得られる複数のデータブロックを用いれば、メモリ使用量が削減されている。   If a plurality of data blocks obtained by performing such processing are used, the memory usage is reduced.

なお、上で述べたデータ構造生成方法は、(D)入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において、入力文字列において着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数を増分しても閾値を超えないことを検出すると、次に出現した文字を、着目する文字に設定する処理をさらに含むようにしても良い。   Note that the data structure generation method described above includes (D) the character of interest in the input character string in the second area of the data block for the character or character string of interest among the plurality of characters included in the input character string. Alternatively, the appearance order of the character that appears next to the character string is held, and the number of appearances is held as data of the appearance order in the third area, and the threshold value is not exceeded even if the number of appearances is incremented When this is detected, the process may further include a process of setting a character that appears next as a focused character.

さらに、上で述べたデータ構造生成方法は、(E)入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において、入力文字列において着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして着目する文字又は文字列と次に出現した文字とからなる第2の文字列に対応する符号が保持されていることを検出すると、当該第2の文字列を、着目する文字列に設定する処理をさらに含むようにしても良い。   Furthermore, the data structure generation method described above is (E) a character of interest in the input character string in the second area of the data block for the character or character string of interest among the plurality of characters included in the input character string. Alternatively, the second character string that has the appearance order for the character that appears next to the character string, and that includes the character or character string of interest as data of the appearance order in the third area and the character that appears next If it is detected that a code corresponding to is held, the second character string may be further set to a character string of interest.

さらに、上で述べた第3の領域が、所定出現順番までの領域に限定されている場合もある。この場合、上で述べたデータブロックが、第3の領域の拡張領域を示すデータを保持する第4の領域をさらに含むようにしても良い。これにより、下位のデータブロックの数が多い場合にも対処できるようになる。   Furthermore, the third region described above may be limited to a region up to a predetermined appearance order. In this case, the data block described above may further include a fourth area that holds data indicating an extension area of the third area. As a result, it is possible to cope with a case where the number of lower data blocks is large.

また、上で述べたデータ構造生成方法は、(F)入力文字列について生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造における第1階層の各データブロックについては最上位階層を表すデータと当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードとを対応付ける第1の対応付けデータと、上記状態における複数のデータブロックで表される木構造における第2階層以降の各データブロックについては当該データブロックの親データブロックの第1の領域に保持されている第2の符号と当該データブロックで追加された文字のコードとを対応付ける第2の対応付けデータとを含むデータを生成する生成処理をさらに含むようにしても良い。   In the data structure generation method described above, (F) each data block of the plurality of data blocks is held in the first area of the data block from the plurality of data blocks generated for the input character string. In the tree structure represented by a plurality of data blocks in a state where the code held in the third area and the code held in the third area are reassigned to the second code based on the character or character string code corresponding to the code For each data block of one layer, first association data that associates data representing the highest layer with a character code corresponding to the second code held in the first area of the data block; For each data block in the second and subsequent layers in the tree structure represented by a plurality of data blocks in the state, the parent data of the data block A generation process for generating data including the second code held in the first area of the lock and the second association data for associating the character code added in the data block may be further included. .

このようにすれば、ディスクに格納できる形式でさらに圧縮処理及び伸張処理に好適なデータ構造(例えば実施の形態に係る圧縮マップ)が生成される。   In this way, a data structure suitable for compression processing and decompression processing (for example, a compression map according to the embodiment) is generated in a format that can be stored on the disk.

また、第1の対応付けデータ及び第2の対応付けデータにおいて、当該データブロックについて第3の領域において保持されている最も大きい第2の符号をさらに対応付けられている場合もある。例えば圧縮処理における探索処理を高速化することができるようになる。   Further, in the first association data and the second association data, the largest second code held in the third area may be further associated with the data block. For example, the search process in the compression process can be speeded up.

なお、上で述べたデータ構造生成方法は、(G)入力文字列について生成された複数のデータブロックのうち使用される可能性がある文字についての第1のデータブロックの各々を、当該第1のデータブロックの符号の小さい順に処理対象に設定する処理と、(H)処理対象の第1のデータブロックの第2の領域において文字のコードの順番で出現順番を読み出し、当該処理対象の第1のデータブロックの第3の領域において当該出現順番のデータとして符号が保持されている場合には、当該出現順番のデータとして保持されている符号のデータブロックを第1のデータブロックの後に処理すべき第2のデータブロックに追加し、当該処理対象の第1のデータブロックの処理順番に相当する第2の符号と上記文字のコードとを対応付ける対応付けデータを順に格納する第1の格納処理と、(I)第1のデータブロックの後に処理すべき第2のデータブロックの各々を、追加された順番で処理対象に設定する処理と、(J)処理対象の第2のデータブロックの第2の領域において文字のコードの順番で出現順番を読み出し、当該処理対象の第2のデータブロックの第3の領域において当該出現順番のデータとして符号が保持されている場合には、当該出現順番のデータとして保持されている符号のデータブロックを上記後に処理すべき第2のデータブロックに追加し、当該処理対象の第2のデータブロックの処理順番に相当する第2の符号と上記文字のコードとを対応付ける対応付けデータを順に格納する第2の格納処理とをさらに含むようにしても良い。   In the data structure generation method described above, each of the first data blocks for the characters that may be used among the plurality of data blocks generated for the input character string (G) (H) a process of setting the data blocks in order of increasing codes, (H) reading out the appearance order in the order of the character codes in the second area of the first data block to be processed, and If the code is held as the data in the appearance order in the third area of the data block, the data block of the code held as the data in the appearance order should be processed after the first data block Correspondence that is added to the second data block and associates the second code corresponding to the processing order of the first data block to be processed with the character code (I) a process of setting each of the second data blocks to be processed after the first data block as a processing target in the added order; and (J ) The appearance order is read in the order of the character codes in the second area of the second data block to be processed, and the code is retained as the data in the appearance order in the third area of the second data block to be processed If it is, the data block of the code held as the data in the appearance order is added to the second data block to be processed later, which corresponds to the processing order of the second data block to be processed And a second storage process for sequentially storing association data for associating the second code and the character code.

さらに、上で述べたデータ構造生成方法は、(K)入力文字列について生成された複数のデータブロックのうち使用される可能性がある文字についての第1のデータブロックの各々について、最上位のデータブロックを表すデータと当該第1のデータブロックについての文字のコードとを対応付ける対応付けデータを文字のコードの順に格納する処理をさらに含むようにしても良い。この場合、第1の格納処理又は第2の格納処理において、最後に上記対応付けデータを格納した際の第2の符号を、処理対象の第1のデータブロックについての文字のコード又は処理対象の第2のデータブロックについての文字列の最終文字のコードに対応付けて格納するようにしても良い。   Furthermore, the above-described data structure generation method (K) performs the top-level processing for each of the first data blocks for characters that may be used among the plurality of data blocks generated for the input character string. You may make it further include the process which stores the matching data which matches the data showing a data block and the character code about the said 1st data block in order of the character code. In this case, in the first storage process or the second storage process, the second code when the association data is stored last is used as the character code or the processing target of the first data block to be processed. The second data block may be stored in association with the last character code of the character string.

本実施の形態の第2の態様に係るデータ構造生成方法は、(A)文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字と、既にデータブロックが生成されている、入力文字列内の文字又は文字列の次に所定の出現回数以上出現する文字とについて生成する第1生成処理と、(B)第1生成処理により生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造の第1階層の各データブロックについては最上位階層を表すデータ又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードと階層番号とを対応付ける第1の対応付けデータと、上記状態における複数のデータブロックで表される木構造の第2階層以降の各データブロックについては当該データブロックの親データブロックの第1の領域に保持されている第2の符号又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックで追加された文字のコードと階層番号とを対応付ける第2の対応付けデータとを含むデータを生成する第2生成処理と、(C)上記状態における複数のデータブロックで表される木構造の第2階層以降の各階層に属する各データブロックの第1の領域に保持されている第2の符号に対応する文字列のコードを含む第1のデータを生成する第3生成処理と、(D)上記状態における複数のデータブロックで表される木構造の第2階層以降の各階層について当該階層内のデータブロック数と当該階層内のデータブロックの第1の領域に保持されている最小の第2の符号と第1のデータにおいて当該最小の第2の符号に対応する文字列の配置位置の、先頭からのオフセット値とを対応付ける階層情報を生成する第4生成処理とを含む。   In the data structure generation method according to the second aspect of the present embodiment, (A) a first area for holding a code corresponding to a character or character string, and a character appearing next to the character or character string The second area for holding the appearance order for each character and the number of appearances or the number of appearances according to the appearance order of the character that appears next to the character or character string Each character that may be used as a data block including a third area for holding a code corresponding to a character string made up of characters that have appeared, and an input character for which a data block has already been generated A first generation process for generating a character in the column or a character that appears more than a predetermined number of times next to the character string, and (B) a plurality of data blocks from the plurality of data blocks generated by the first generation process Each of For the data block, the code held in the first area of the data block and the code held in the third area are reassigned to the second code based on the character or character string code corresponding to the code. For each data block of the first hierarchy of the tree structure represented by a plurality of data blocks in the state that has been made, data representing the highest hierarchy or the largest second code held in the third area for the data block First association data for associating a character code corresponding to a second code held in the first area of the data block with a hierarchy number, and a tree structure represented by a plurality of data blocks in the above state For each data block in the second layer and after, the second code held in the first area of the parent data block of the data block or the data block The second generation for generating the data including the largest second code held in the third area for the data block and the second association data for associating the character code added in the data block with the layer number Processing and (C) a character corresponding to the second code held in the first area of each data block belonging to each hierarchy after the second hierarchy of the tree structure represented by the plurality of data blocks in the above state A third generation process for generating the first data including the code of the column; and (D) the number of data blocks in the hierarchy for each hierarchy after the second hierarchy of the tree structure represented by the plurality of data blocks in the above state. And the minimum second code held in the first area of the data block in the hierarchy and the arrangement position of the character string corresponding to the minimum second code in the first data And a fourth generation process for generating hierarchical information for associating the offset value from the head.

これによって生成されるデータを用いれば、圧縮処理及び伸張処理の処理速度を上げることができる。   By using the data generated thereby, the processing speed of the compression process and the expansion process can be increased.

本実施の形態の第3の態様に係るデータ構造は、文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と上記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に上記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを各ノードのデータとして含む文節木のデータ構造である。これによってメモリ使用量を大幅に削減できるようになる。   The data structure according to the third aspect of the present embodiment includes a first area for holding a code corresponding to a character or a character string, and an appearance order of characters appearing next to the character or character string. The character or the character string and the character that has appeared this time when the number of appearances or the number of appearances exceeds the threshold according to the appearance order of the character that appears next to the second region and the character or the character string. A data structure including a data block including a third area for holding a code corresponding to a character string consisting of As a result, the memory usage can be greatly reduced.

本実施の形態の第4の態様に係るデータ構造は、文節木に対応するデータ構造であって、文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたものである。このようなデータであれば、そのままディスクに格納して後に使用することも可能である。   The data structure according to the fourth aspect of the present embodiment is a data structure corresponding to a phrase tree, and for each node of the phrase tree, the code of the parent node of the node and the character represented by the node The association data for associating the codes are arranged in the order of the codes of the nodes. Such data can be stored in a disk as it is and used later.

本実施の形態の第4の態様に係るデータ構造において、上で述べた対応付けデータが、さらに当該ノードの子ノードの符号のうち最大の符号をさらに対応付けている場合もある。これによって、圧縮処理の処理効率を上げることができるようになる。   In the data structure according to the fourth aspect of the present embodiment, the association data described above may further associate the maximum code among the codes of the child nodes of the node. As a result, the processing efficiency of the compression process can be increased.

また、本実施の形態の第5の態様に係るデータ構造は、文節木に対応する第1のデータと、文節木の各ノードに対応する文字又は文字列についての第2のデータと、文節木の階層についての第3のデータとを有する。そして、第1のデータにおいて、文節木の各ノードについて、当該ノードの親ノードの符号又は当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられている。また、第2のデータは、文節木の第2階層以降の各階層の各ノードについて当該ノードに対応する文字又は文字列のコードを当該ノードの符号の順に含む。さらに、第3のデータは、文節木の第2階層以降の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号と、第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む。   The data structure according to the fifth aspect of the present embodiment includes first data corresponding to a phrase tree, second data regarding a character or character string corresponding to each node of the phrase tree, and a phrase tree. And the third data for the hierarchy. In the first data, for each node of the phrase tree, the maximum code among the code of the parent node of the node or the code of the child node of the node, the code of the character represented by the node, and the node Data that associates with the hierarchy to which the node belongs is arranged in the order of the codes of the nodes. In addition, the second data includes, for each node in each hierarchy after the second hierarchy of the phrase tree, a character or character string code corresponding to the node in the order of the code of the node. Further, the third data includes, for each hierarchy after the second hierarchy of the phrase tree, the number of nodes belonging to the hierarchy, the smallest code among the codes of the nodes belonging to the hierarchy, and the minimum in the second data. The data which matches the offset value from the head of the arrangement position of the character or character string corresponding to the code of.

このようにすれば圧縮処理及び伸張処理の処理速度を向上させることができる。   In this way, the processing speed of compression processing and decompression processing can be improved.

さらに、本実施の形態の第6の態様に係る圧縮方法は、(A)文節木に対応するデータ構造であって、文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、(B)親ノードの符号が第1の文字に対応する符号となっており且つノードで表される文字のコードが入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、データ構造において探索する探索処理と、(C)対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、(D)対応付けデータが検出されない場合には、参照している対応付けデータの符号を出力し、第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、(E)探索処理と第1参照処理と第2参照処理とを、入力文字列の最後の文字を処理するまで、第2の文字を入力文字列の文字の順に移動させつつ実施し、入力文字列の最後の文字を処理した後に、参照している対応付けデータの符号を出力する処理とを含む。   Furthermore, the compression method according to the sixth aspect of the present embodiment is (A) a data structure corresponding to a phrase tree, and for each node of the phrase tree, the code of the parent node of the node and the node A process of referring to the association data of the code corresponding to the first character included in the input character string in the data structure in which the association data for associating the represented character code is arranged in the order of the code of each node (B) Correspondence in which the code of the parent node is a code corresponding to the first character, and the code of the character represented by the node is the code of the second character that appears next in the input character string A search process for searching for attached data in the data structure; (C) when association data is detected, a first reference process for referring to the association data; and (D) association data is not detected. In this case, a code of the association data being referred to is output, a second reference process for referring to the association data of the code corresponding to the second character, (E) the search process, the first reference process, and the first 2 The reference process is performed by moving the second character in the order of the characters of the input character string until the last character of the input character string is processed, and the reference is made after the last character of the input character string is processed. And processing for outputting the code of the associated data.

このように上で述べたデータ構造を用いて圧縮処理を実施できる。   Thus, the compression process can be performed using the data structure described above.

本実施の形態の第6の態様に係る圧縮方法の探索処理において、データ構造の第1階層についての対応付けデータを参照している場合には、第2階層以降の対応付けデータを探索し、データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの符号より後ろの対応付けデータを探索するようにしても良い。   In the search process of the compression method according to the sixth aspect of the present embodiment, when referring to the association data for the first hierarchy of the data structure, the association data for the second hierarchy and thereafter are searched, When referring to the association data for the second and subsequent layers of the data structure, the association data after the code of the referenced association data may be searched.

また、上で述べた対応付けデータが、さらに上記ノードの子ノードの符号のうち最大の符号をさらに対応付けるようにしても良い。この場合、上で述べた探索処理において、データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索するようにしても良い。これによって、探索範囲が狭められ、圧縮処理の高速化が図られる。   Further, the association data described above may further associate the maximum code among the codes of the child nodes of the node. In this case, in the search process described above, when the association data for the first hierarchy of the data structure is referred to, the association data referred to from the first association data belonging to the second hierarchy If the association data of the second and subsequent hierarchies of the data structure is referenced up to the maximum code association data included in the You may make it search from the correlation data of the largest code | cord | chord contained in matching data to the correlation data of the largest code | cord | chord contained in the reference | corresponding correlation data. This narrows the search range and speeds up the compression process.

また、上で述べた対応付けデータが、さらに当該ノードの属する階層の階層番号をさらに対応付けるようにしても良い。この場合、上で述べた探索処理において、データ構造において参照している対応付けデータの階層番号の次の階層番号が対応付けられている対応付けデータを探索するようにしても良い。このようにしても、探索範囲が狭められ、圧縮処理の高速化が図られる。   Further, the association data described above may further associate the hierarchy number of the hierarchy to which the node belongs. In this case, in the search processing described above, the association data associated with the next hierarchical number of the hierarchical number of the association data referenced in the data structure may be searched. This also narrows the search range and speeds up the compression process.

本実施の形態の第7の態様に係る圧縮方法は、文節木に対応する第1のデータと文節木の階層についての第2のデータとを有するデータ構造であって、第1のデータにおいて、文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられており、第2のデータは、文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含むデータ構造を用いる。そして、上記圧縮方法は、(A)上記データ構造に含まれる第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、(B)親ノードの符号が、参照している対応付けデータに対応するノードの符号となっており且つ上記ノードで表される文字のコードが入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び最小の符号とから特定される範囲を第1のデータについて探索する探索処理と、(C)対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、(D)対応付けデータが検出されない場合には、参照している対応付けデータの符号を出力し、第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、(E)探索処理と第1参照処理と第2参照処理とを、入力文字列の最後の文字を処理するまで、第2の文字を入力文字列の文字の順に移動させつつ実施し、入力文字列の最後の文字を処理した後に、参照している対応付けデータの符号を出力する処理と含む。このような処理でも伸張処理を高速化できる。   The compression method according to the seventh aspect of the present embodiment is a data structure having first data corresponding to a phrase tree and second data on the hierarchy of the phrase tree, For each node in the phrase tree, data that associates the code of the parent node of the node, the character code represented by the node, and the hierarchy to which the node belongs are arranged in the order of the code of each node. The second data uses a data structure including data that associates the number of nodes belonging to the hierarchy with the minimum code among the codes of the nodes belonging to the hierarchy for each hierarchy of the phrase tree. The compression method includes (A) a process of referring to association data of a code corresponding to the first character included in the input character string in the first data included in the data structure, and (B) a parent. The code of the node is the code of the node corresponding to the referenced association data, and the character code represented by the node is the code of the second character that appears next in the input character string. In the second data, in the second data, the range specified by the number of nodes belonging to the hierarchy one level below the hierarchy of the node corresponding to the reference data to be referred to and the minimum code is the first data. Search processing for searching for (C) association data is detected, first reference processing for referring to the association data, and (D) reference data if association data is not detected A second reference process for outputting the code of the corresponding association data and referring to the association data of the code corresponding to the second character, (E) a search process, a first reference process, and a second reference process, Until the last character of the input character string is processed, the second character is moved in the order of the character of the input character string, and after the last character of the input character string is processed, Including a process of outputting a code. Even with such processing, the decompression processing can be accelerated.

さらに、本実施の形態の第8の態様に係る伸張方法は、(A)文節木に対応するデータ構造であって、文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する処理と、(B)特定された対応付けデータに含まれる文字のコードをメモリに格納する格納処理と、(C)特定された対応付けデータに含まれる親ノードの符号が文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照処理と、(D)特定された対応付けデータに含まれる親ノードの符号が文節木の根ノードの符号を示している場合には、メモリに格納されている文字のコードを逆順に出力する出力処理と、(E)格納処理と参照処理と出力処理とを、入力符号のうち第1の符号より後ろの各符号について順番に実施する処理とを含む。   Furthermore, the decompression method according to the eighth aspect of the present embodiment is (A) a data structure corresponding to a phrase tree, and for each node of the phrase tree, the code of the parent node of the node and the node In the data structure in which the association data for associating the represented character codes are arranged in the order of the codes of the nodes, the process of identifying the association data in the order of the first code among the input codes, (B ) A storage process for storing the character code included in the specified association data in the memory; and (C) the code of the parent node included in the specified association data indicates the code of a node other than the root node of the phrase tree. The reference processing of referring to the association data of the code of the parent node, and (D) the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree. In this case, an output process for outputting the codes of characters stored in the memory in reverse order, and (E) a storage process, a reference process, and an output process are performed for each code after the first code among the input codes. And processing performed in order.

このように上で述べたデータ構造を用いて伸張処理を行うことができる。   In this manner, the decompression process can be performed using the data structure described above.

本実施の形態の第9の態様に係る圧縮方法は、文節木に対応するデータ構造であって、文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造を用いる。そして、本圧縮方法は、(A)入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、(B)上記ノードで表される文字のコードが入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、データ構造において探索する探索処理と、(C)対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、(D)対応付けデータが検出されない場合には、参照している対応付けデータの符号を出力し、第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、(E)探索処理と第1参照処理と第2参照処理とを、入力文字列の最後の文字を処理するまで、第2の文字を入力文字列の文字の順に移動させつつ実施し、入力文字列の最後の文字を処理した後に、参照している対応付けデータの符号を出力する処理と含む。そして、上記探索処理においては、データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する、また、データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する。このようにすれば、探索範囲が狭められているので高速に圧縮できるようになる。   The compression method according to the ninth aspect of the present embodiment is a data structure corresponding to a phrase tree, and for each node of the phrase tree, the maximum code among the codes of child nodes of the node and the node Associating data for associating the represented character codes with each other uses a data structure arranged in the order of the codes of the nodes. The compression method includes (A) a process of referring to the association data of the code corresponding to the first character included in the input character string, and (B) the character code represented by the node is the input character string. In the data structure, and (C) when the association data is detected, the association data that is the code of the second character that appears next in FIG. 1 reference process, and (D) when the association data is not detected, the code of the association data being referred to is output, and the second reference process of referring to the association data of the code corresponding to the second character And (E) performing the search process, the first reference process, and the second reference process while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Process last character of input string After the, including the process for outputting the sign of the mapping data to which reference is made. In the search process, when the association data for the first hierarchy of the data structure is referred to, it is included in the associated association data from the first association data belonging to the second hierarchy. Search up to the association data with the maximum code, and when referring to the association data for the second and subsequent layers of the data structure, the correspondence immediately before the referenced association data Search is performed from the association data of the maximum code included in the attached data to the association data of the maximum code included in the referenced association data. In this way, since the search range is narrowed, it can be compressed at high speed.

また、本実施の形態の第10の態様に係る伸張方法は、文節木に対応する第1のデータと、文節木の各ノードに対応する文字又は文字列についての第2のデータと、文節木の階層についての第3のデータとを有し且つデータ格納部に格納されているデータ構造を用いる。そして、第1のデータにおいて、文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられている。さらに、第2のデータは、文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含む。さらに、第3のデータは、文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む。そして、本伸張方法は、(A)上記データ構造に含まれる第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、(B)特定されたエントリに含まれる階層番号に従って第3のデータにおいて上記最小の符号とオフセット値とを特定する特定処理と、(C)第2のデータから、特定されたオフセット値に対して、特定されたエントリの符号と特定された最小の符号との差に階層番号を乗じた値を加算することで得られる配置位置から階層番号分の文字又は文字列を読み出す読み出し処理と、(D)入力符号のうち第1の符号の後ろの第2の符号以降の各符号について、第1のデータにおけるエントリを特定し、特定処理と読み出し処理とを実施する処理とを含む。   The decompression method according to the tenth aspect of the present embodiment includes first data corresponding to a phrase tree, second data for a character or character string corresponding to each node of the phrase tree, and a phrase tree. And a data structure stored in the data storage unit. In the first data, for each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the codes of the nodes. Further, the second data includes a character or a character string corresponding to the node in order of the code of the node for each node in each hierarchy of the phrase tree. Further, the third data includes, for each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the arrangement position of the character or character string corresponding to the minimum code in the second data, Includes data that associates offset values from the beginning. In this decompression method, (A) the first data included in the data structure includes processing for specifying an entry in the order of the first code among the input codes, and (B) included in the specified entry. A specifying process for specifying the minimum code and the offset value in the third data according to the hierarchy number; and (C) the code of the specified entry is specified for the specified offset value from the second data. A read process for reading a character or a character string corresponding to a hierarchical number from an arrangement position obtained by adding a value obtained by multiplying the difference from the minimum code by a hierarchical number, and (D) the first code of the input code For each code after the second second code, the process includes specifying an entry in the first data and performing a specifying process and a reading process.

このようにすれば、伸張処理が高速化される。   In this way, the decompression process is speeded up.

また、本実施の形態の第11の態様に係る伸張方法は、文節木に対応する第1のデータと、文節木の各ノードに対応する文字又は文字列についての第2のデータと、文節木の階層についての第3のデータとを有し且つデータ格納部に格納されているデータ構造を用いる。そして、第1のデータにおいて、文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられている。また、第2のデータは、文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含む。さらに、第3のデータは、文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む。そして本伸張方法は、(A)上記データ構造に含まれる第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、(B)特定されたエントリが第1の階層におけるエントリであれば、特定されたエントリの符号に対応する文字を出力する出力処理と、(C)特定されたエントリが第2の階層以降のエントリであれば、特定されたエントリに含まれる階層番号に従って第3のデータにおいて最小の符号とオフセット値とを特定する特定処理と、(D)第2のデータにおいて、特定されたオフセット値に対して、特定されたエントリの符号と特定された最小の符号との差に階層番号を乗じた値を加算することで得られる配置位置から階層番号分の文字又は文字列を読み出す読み出し処理と、(E)入力符号のうち第1の符号の後ろの第2の符号以降の各符号について、第1のデータにおけるエントリを特定し、出力処理と特定処理と読み出し処理とを実施する処理とを含む。   The decompression method according to the eleventh aspect of the present embodiment includes first data corresponding to a phrase tree, second data for a character or character string corresponding to each node of the phrase tree, and a phrase tree. And a data structure stored in the data storage unit. In the first data, for each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the codes of the nodes. Further, the second data includes a character string corresponding to the node in the order of the code of the node for each node in each layer after the second layer of the phrase tree. Further, the third data includes, for each hierarchy after the second hierarchy of the phrase tree, a character or a character corresponding to the minimum code among the codes of the nodes belonging to the hierarchy and the minimum code in the second data. It contains data that associates the offset value from the beginning of the column placement position. The decompression method includes (A) a process of specifying an entry in the order of the first code among the input codes in the first data included in the data structure, and (B) the specified entry is the first data If it is an entry in the hierarchy, an output process for outputting a character corresponding to the code of the identified entry, and (C) if the identified entry is an entry in the second hierarchy or later, it is included in the identified entry A specifying process for specifying a minimum code and an offset value in the third data according to the layer number; and (D) a code for the specified entry is specified for the specified offset value in the second data. A read process for reading out characters or character strings corresponding to the layer number from the arrangement position obtained by adding a value obtained by multiplying the difference from the minimum code by the layer number; For the second of each code after code behind the code, and a process for identifying an entry in the first data, to implement a particular process and the reading process and the output process.

このようにデータ構造のデータ量を削減しても伸張処理を高速化することができる。   Thus, even if the data amount of the data structure is reduced, the decompression process can be accelerated.

なお、上で述べたような処理をコンピュータに実施させるためのプログラムを作成することができ、当該プログラムは、例えばフレキシブル・ディスク、CD−ROMなどの光ディスク、光磁気ディスク、半導体メモリ(例えばROM)、ハードディスク等のコンピュータ読み取り可能な記憶媒体又は記憶装置に格納される。   It is possible to create a program for causing a computer to carry out the processing described above, such as a flexible disk, an optical disk such as a CD-ROM, a magneto-optical disk, and a semiconductor memory (for example, ROM). Or a computer-readable storage medium such as a hard disk or a storage device.

以上の実施例を含む実施形態に関し、さらに以下の付記を開示する。   The following supplementary notes are further disclosed with respect to the embodiments including the above examples.

(付記1)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字について生成し、
入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において前記入力文字列において前記着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数が今回閾値を超えることになることを検出すると、前記第3の領域において当該出現順番のデータとして、前記着目する文字又は文字列と前記次に出現した文字とからなる第2の文字列に対応する符号を格納し、
前記第2の文字列についてのデータブロックを生成する
処理をコンピュータに実行させるためのプログラム。
(Appendix 1)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data block containing three regions for each character that may be used,
Of the plurality of characters included in the input character string, in the second area of the data block for the character or character string of interest, the appearance order of the character that appears next to the character or character string of interest in the input character string is If it is detected that the number of appearances is held as data of the appearance order in the third area and the number of appearances exceeds the current threshold, the appearance order of the third area is detected. As data, a code corresponding to a second character string consisting of the character or character string of interest and the next appearing character is stored,
A program for causing a computer to execute a process for generating a data block for the second character string.

(付記2)
前記入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において前記入力文字列において前記着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数を増分しても閾値を超えないことを検出すると、前記次に出現した文字を、着目する文字に設定する
処理をさらに前記コンピュータに実行させるための付記1記載のプログラム。
(Appendix 2)
Appearance order of the character or character string that appears next to the character or character string of interest in the second area of the data block for the character or character string of interest of the plurality of characters included in the input character string And the number of occurrences is held as data of the appearance order in the third area, and it is detected that the threshold value is not exceeded even if the number of appearances is increased, the next appearing character is The program according to appendix 1, for causing the computer to further execute a process of setting a character of interest.

(付記3)
前記入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において前記入力文字列において前記着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ前記第3の領域において当該出現順番のデータとして前記着目する文字又は文字列と前記次に出現した文字とからなる第2の文字列に対応する符号が保持されていることを検出すると、当該第2の文字列を、着目する文字列に設定する
処理をさらに前記コンピュータに実行させるための付記1又は2記載のプログラム。
(Appendix 3)
Appearance order of the character or character string that appears next to the character or character string of interest in the second area of the data block for the character or character string of interest of the plurality of characters included in the input character string And a code corresponding to the second character string including the character or character string of interest and the next appearing character is retained as the data of the appearance order in the third area. The program according to appendix 1 or 2, for causing the computer to further execute a process of setting the second character string as a focused character string when the second character string is detected.

(付記4)
前記第3の領域が、所定出現順番までの領域に限定されており、
前記データブロックが、前記第3の領域の拡張領域を示すデータを保持する第4の領域をさらに含む、
付記1乃至3のいずれか1つ記載のプログラム。
(Appendix 4)
The third region is limited to a region up to a predetermined order of appearance;
The data block further includes a fourth area holding data indicating an extension area of the third area;
The program according to any one of appendices 1 to 3.

(付記5)
前記入力文字列について生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造における第1階層の各データブロックについては最上位階層を表すデータと当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードとを対応付ける第1の対応付けデータと、前記状態における複数のデータブロックで表される木構造における第2階層以降の各データブロックについては当該データブロックの第1の領域に保持されている第2の符号と当該データブロックの第3の領域に保持されている第2の符号に関連付けられている前記次に出現する文字のコードとを対応付ける第2の対応付けデータとを含むデータを生成する生成処理
をさらに前記コンピュータに実行させるための付記1乃至4のいずれか1つ記載のプログラム。
(Appendix 5)
From the plurality of data blocks generated for the input character string, for each data block of the plurality of data blocks, the code held in the first area of the data block and the code held in the third area Data representing the highest hierarchy for each data block of the first hierarchy in the tree structure represented by a plurality of data blocks in the state reassigned to the second code based on the character or character string code corresponding to the code And the first association data that associates the character code corresponding to the second code held in the first area of the data block, and the tree structure represented by the plurality of data blocks in the state For each data block in the second and subsequent layers, the second code and the data held in the first area of the data block Generation processing for generating data including second association data that associates the code of the next appearing character associated with the second code held in the third area of the lock; The program according to any one of supplementary notes 1 to 4 for causing the program to be executed.

(付記6)
前記第1の対応付けデータ及び前記第2の対応付けデータにおいて、
当該データブロックについて第3の領域において保持されている最も大きい第2の符号をさらに対応付けられている
付記5記載のプログラム。
(Appendix 6)
In the first association data and the second association data,
The program according to claim 5, further associated with the largest second code held in the third region for the data block.

(付記7)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字と、既にデータブロックが生成されている、入力文字列内の文字又は文字列の次に所定の出現回数以上出現する文字とについて生成する第1生成処理と、
前記第1生成処理により生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造の第1階層の各データブロックについては最上位階層を表すデータ又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードと階層番号とを対応付ける第1の対応付けデータと、前記状態における複数のデータブロックで表される木構造の第2階層以降の各データブロックについては当該データブロックの第1の領域に保持されている第2の符号又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第3の領域に保持されている第2の符号に関連付けられている前記次に出現する文字のコードと階層番号とを対応付ける第2の対応付けデータとを含むデータを生成する第2生成処理と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層に属する各データブロックの第1の領域に保持されている第2の符号に対応する文字列のコードを含む第1のデータを生成する第3生成処理と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層について当該階層内のデータブロック数と当該階層内のデータブロックの第1の領域に保持されている最小の第2の符号と前記第1のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付ける階層情報を生成する第4の生成処理と、
をコンピュータに実行させるためのプログラム。
(Appendix 7)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data block including three areas, each character that may be used, and a character that has already been generated for a predetermined number of occurrences after the character in the input character string or the character string. A first generation process for generating
From the plurality of data blocks generated by the first generation process, for each data block of the plurality of data blocks, a code held in the first area of the data block and a code held in the third area Represents the highest layer for each data block in the first layer of the tree structure represented by a plurality of data blocks in a state where the symbol is reassigned to the second code based on the character or character string code corresponding to the code The largest second code held in the third area for the data or the data block, the code of the character corresponding to the second code held in the first area of the data block, and the layer number The first association data to be associated with each data block in the second and subsequent layers of the tree structure represented by the plurality of data blocks in the state. The second code held in the first area of the data block or the largest second code held in the third area for the data block and held in the third area of the data block A second generation process for generating data including second association data for associating the code of the next appearing character associated with the second code being performed and the hierarchy number;
A first character string code corresponding to the second code held in the first area of each data block belonging to each hierarchy after the second hierarchy of the tree structure represented by the plurality of data blocks in the state; A third generation process for generating one data;
For each hierarchy after the second hierarchy of the tree structure represented by a plurality of data blocks in the state, the number of data blocks in the hierarchy and the minimum second stored in the first area of the data block in the hierarchy A generation process for generating hierarchical information that associates an offset value from the beginning of an arrangement position of a character or character string corresponding to the minimum second code in the first data;
A program that causes a computer to execute.

(付記8)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを各ノードのデータとして含む文節木のデータ構造。
(Appendix 8)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data structure of a phrase tree including a data block including three areas as data of each node.

(付記9)
文節木に対応するデータ構造であって、
前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられた
データ構造。
(Appendix 9)
A data structure corresponding to a phrase tree,
A data structure in which, for each node of the phrase tree, association data that associates the code of the parent node of the node with the code of the character represented by the node is arranged in the order of the codes of the nodes.

(付記10)
前記対応付けデータが、さらに当該ノードの子ノードの符号のうち最大の符号をさらに対応付けている付記9記載のデータ構造。
(Appendix 10)
The data structure according to appendix 9, wherein the association data further associates a maximum code among codes of child nodes of the node.

(付記11)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有するデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードの親ノードの符号又は当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2階層以降の各階層の各ノードについて当該ノードに対応する文字又は文字列のコードを当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2階層以降の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
データ構造。
(Appendix 11)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
A data structure having
In the first data,
For each node of the phrase tree, the maximum code among the code of the parent node of the node or the code of the child node of the node, the character code represented by the node, and the hierarchy to which the node belongs are associated with each other The data is arranged in the order of the sign of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character or character string code corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the number of nodes belonging to the hierarchy, the smallest code among the codes of the nodes belonging to the hierarchy, and the smallest second code in the second data A data structure that contains data that correlates the offset value from the beginning of the corresponding character or character string location.

(付記12)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
を、コンピュータに実行させるための圧縮プログラム。
(Appendix 12)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, a process of referring to the association data of the code corresponding to the first character included in the input character string;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string A search process for searching the corresponding data in the data structure;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
Is a compression program that causes a computer to execute.

(付記13)
前記探索処理において、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層以降の対応付けデータを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの符号より後ろの対応付けデータを探索する
付記12記載の圧縮プログラム。
(Appendix 13)
In the search process,
When referring to the association data for the first hierarchy of the data structure, search the association data for the second hierarchy and thereafter,
13. The compression program according to claim 12, wherein when referring to the association data for the second and subsequent layers of the data structure, the association data after the code of the referenced association data is searched.

(付記14)
前記対応付けデータが、さらに前記ノードの子ノードの符号のうち最大の符号をさらに対応付けており、
前記探索処理において、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
付記12記載の圧縮プログラム。
(Appendix 14)
The association data further associates the maximum code among the codes of child nodes of the node;
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
When referring to the association data for the second and subsequent layers of the data structure, from the association data of the maximum code included in the association data immediately before the referenced association data The compression program according to appendix 12, wherein the search is performed up to the association data of the maximum code included in the association data being referred to.

(付記15)
前記対応付けデータが、さらに当該ノードの属する階層の階層番号をさらに対応付けており、
前記探索処理において、
前記データ構造において参照している対応データの階層番号の次の階層番号が対応付けられている対応付けデータを探索する
付記12記載の圧縮プログラム。
(Appendix 15)
The association data further associates a hierarchy number of a hierarchy to which the node belongs,
In the search process,
The compression program according to appendix 12, wherein the correspondence data associated with the hierarchical number next to the hierarchical number of the corresponding data referred to in the data structure is searched.

(付記16)
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
をコンピュータに実行させるための圧縮プログラム。
(Appendix 16)
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node, and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree In the first data included in the data structure including the data for associating the number of nodes belonging to the hierarchy with the minimum code among the codes of the nodes belonging to the hierarchy, A process of referring to the association data of the code corresponding to the first character
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. A search process for searching for a range of the first data;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
A compression program that causes a computer to execute.

(付記17)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
を、コンピュータに実行させ、
前記探索処理においては、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
圧縮プログラム。
(Appendix 17)
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, In the data structure arranged in the order of the code of each node, a process of referring to the association data of the code corresponding to the first character included in the input character string;
A search process for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
To the computer,
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
When referring to the association data for the second and subsequent layers of the data structure, from the association data of the maximum code included in the association data immediately before the referenced association data A compression program that searches up to association data of the maximum code included in the association data being referenced.

(付記18)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する処理と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力処理と、
前記格納処理と前記参照処理と前記出力処理とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に実施する処理と、
を、コンピュータに実行させるための伸張プログラム。
(Appendix 18)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, the process of identifying the association data in the order of the first code among the input codes;
A storing process for storing a code of a character included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates the code of a node other than the root node of the phrase tree, a reference process for referring to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, an output process for outputting the codes of the characters stored in the memory in reverse order;
A process of sequentially performing the storage process, the reference process, and the output process for each code after the first code among the input codes;
Is a decompression program for causing a computer to execute.

(付記19)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定処理と前記読み出し処理とを実施する処理と、
を、コンピュータに実行させるための伸張プログラム。
(Appendix 19)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy and the position of the character or character string corresponding to the minimum second code in the second data from the beginning In the first data included in the data structure including data that associates an offset value, a process of specifying an entry in the order of the first code among the input codes;
A specifying process for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code among the input codes, and performing the specifying process and the reading process;
Is a decompression program for causing a computer to execute.

(付記20)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力処理と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力処理と前記特定処理と前記読み出し処理とを実施する処理と、
を、コンピュータに実行させるためのプログラム。
(Appendix 20)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the smallest code among the codes of the nodes belonging to the hierarchy, and the arrangement of characters or character strings corresponding to the smallest second code in the second data Processing for specifying an entry in the order of the first code among the input codes in the first data included in the data structure, including data that associates an offset value from the head of the position;
If the specified entry is an entry in the first hierarchy, an output process for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second layer, a specifying process for specifying the minimum code and the offset value in the third data according to the layer number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code, and performing the output process, the specifying process, and the reading process When,
A program that causes a computer to execute.

(付記21)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字について生成し、
入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において前記入力文字列において前記着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数が今回閾値を超えることになることを検出すると、前記第3の領域において当該出現順番のデータとして、前記着目する文字又は文字列と前記次に出現した文字とからなる第2の文字列に対応する符号を格納し、
前記第2の文字列についてのデータブロックを生成する
処理がコンピュータにより実行される情報処理方法。
(Appendix 21)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data block containing three regions for each character that may be used,
Of the plurality of characters included in the input character string, in the second area of the data block for the character or character string of interest, the appearance order of the character that appears next to the character or character string of interest in the input character string is If it is detected that the number of appearances is held as data of the appearance order in the third area and the number of appearances exceeds the current threshold, the appearance order of the third area is detected. As data, a code corresponding to a second character string consisting of the character or character string of interest and the next appearing character is stored,
An information processing method in which a process of generating a data block for the second character string is executed by a computer.

(付記22)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字について生成する手段と、
入力文字列に含まれる複数の文字のうち着目する文字又は文字列についてのデータブロックの第2の領域において前記入力文字列において前記着目する文字又は文字列の次に出現した文字についての出現順番が保持されており且つ第3の領域において当該出現順番のデータとして出現回数が保持されており且つ当該出現回数が今回閾値を超えることになることを検出すると、前記第3の領域において当該出現順番のデータとして、前記着目する文字又は文字列と前記次に出現した文字とからなる第2の文字列に対応する符号を格納する手段と、
前記第2の文字列についてのデータブロックを生成する手段と、
を有する情報処理装置。
(Appendix 22)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time Means for generating a data block comprising three regions for each character that may be used;
Of the plurality of characters included in the input character string, in the second area of the data block for the character or character string of interest, the appearance order of the character that appears next to the character or character string of interest in the input character string is If it is detected that the number of appearances is held as data of the appearance order in the third area and the number of appearances exceeds the current threshold, the appearance order of the third area is detected. Means for storing, as data, a code corresponding to a second character string made up of the character or character string of interest and the next appearing character;
Means for generating a data block for the second character string;
An information processing apparatus.

(付記23)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字と、既にデータブロックが生成されている、入力文字列内の文字又は文字列の次に所定の出現回数以上出現する文字とについて生成する第1生成処理と、
前記第1生成処理により生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造の第1階層の各データブロックについては最上位階層を表すデータ又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードと階層番号とを対応付ける第1の対応付けデータと、前記状態における複数のデータブロックで表される木構造の第2階層以降の各データブロックについては当該データブロックの第1の領域に保持されている第2の符号又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第3の領域に保持されている第2の符号に関連付けられている前記次に出現する文字のコードと階層番号とを対応付ける第2の対応付けデータとを含むデータを生成する第2生成処理と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層に属する各データブロックの第1の領域に保持されている第2の符号に対応する文字列のコードを含む第1のデータを生成する第3生成処理と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層について当該階層内のデータブロック数と当該階層内のデータブロックの第1の領域に保持されている最小の第2の符号と前記第1のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付ける階層情報を生成する第4の生成処理と、
がコンピュータにより実行される情報処理方法。
(Appendix 23)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data block including three areas, each character that may be used, and a character that has already been generated for a predetermined number of occurrences after the character in the input character string or the character string. A first generation process for generating
From the plurality of data blocks generated by the first generation process, for each data block of the plurality of data blocks, a code held in the first area of the data block and a code held in the third area Represents the highest layer for each data block in the first layer of the tree structure represented by a plurality of data blocks in a state where the symbol is reassigned to the second code based on the character or character string code corresponding to the code The largest second code held in the third area for the data or the data block, the code of the character corresponding to the second code held in the first area of the data block, and the layer number The first association data to be associated with each data block in the second and subsequent layers of the tree structure represented by the plurality of data blocks in the state. The second code held in the first area of the data block or the largest second code held in the third area for the data block and held in the third area of the data block A second generation process for generating data including second association data for associating the code of the next appearing character associated with the second code being performed and the hierarchy number;
A first character string code corresponding to the second code held in the first area of each data block belonging to each hierarchy after the second hierarchy of the tree structure represented by the plurality of data blocks in the state; A third generation process for generating one data;
For each hierarchy after the second hierarchy of the tree structure represented by a plurality of data blocks in the state, the number of data blocks in the hierarchy and the minimum second stored in the first area of the data block in the hierarchy A generation process for generating hierarchical information that associates an offset value from the beginning of an arrangement position of a character or character string corresponding to the minimum second code in the first data;
Is an information processing method executed by a computer.

(付記24)
文字又は文字列に対応する符号を保持するための第1の領域と当該文字又は文字列の次に出現する文字の出現順番を各文字について保持するための第2の領域と前記文字又は文字列の次に出現する文字の出現順番に応じて出現回数又は当該出現回数が閾値を超えた場合に前記文字又は文字列と今回出現した文字とからなる文字列に対応する符号を保持するための第3の領域とを含むデータブロックを、使用される可能性のある各文字と、既にデータブロックが生成されている、入力文字列内の文字又は文字列の次に所定の出現回数以上出現する文字とについて生成する手段と、
前記第1生成手段により生成された複数のデータブロックから、当該複数のデータブロックの各データブロックについて当該データブロックの第1の領域に保持されている符号及び第3の領域に保持されている符号を当該符号に対応する文字又は文字列のコードに基づき第2の符号に付与し直した状態における複数のデータブロックで表される木構造の第1階層の各データブロックについては最上位階層を表すデータ又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第1の領域に保持されている第2の符号に対応する文字のコードと階層番号とを対応付ける第1の対応付けデータと、前記状態における複数のデータブロックで表される木構造の第2階層以降の各データブロックについては当該データブロックの第1の領域に保持されている第2の符号又は当該データブロックについて第3の領域に保持されている最も大きい第2の符号と当該データブロックの第3の領域に保持されている第2の符号に関連付けられている前記次に出現する文字のコードと階層番号とを対応付ける第2の対応付けデータとを含むデータを生成する手段と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層に属する各データブロックの第1の領域に保持されている第2の符号に対応する文字列のコードを含む第1のデータを生成する手段と、
前記状態における複数のデータブロックで表される木構造の第2階層以降の各階層について当該階層内のデータブロック数と当該階層内のデータブロックの第1の領域に保持されている最小の第2の符号と前記第1のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付ける階層情報を生成する手段と、
を有する情報処理装置。
(Appendix 24)
A first area for holding a code corresponding to a character or character string, a second area for holding the appearance order of the character that appears next to the character or character string, and the character or character string The number of times of appearance according to the appearance order of the character that appears next to the number of times, or when the number of times of occurrence exceeds a threshold, a code for holding a code corresponding to the character string consisting of the character or character string and the character that has appeared this time A data block including three areas, each character that may be used, and a character that has already been generated for a predetermined number of occurrences after the character in the input character string or the character string. Means for generating and
From the plurality of data blocks generated by the first generation means, for each data block of the plurality of data blocks, a code held in the first area of the data block and a code held in the third area Represents the highest layer for each data block in the first layer of the tree structure represented by a plurality of data blocks in a state where the symbol is reassigned to the second code based on the character or character string code corresponding to the code The largest second code held in the third area for the data or the data block, the code of the character corresponding to the second code held in the first area of the data block, and the layer number First correspondence data to be associated with each data block in the second and subsequent layers of the tree structure represented by a plurality of data blocks in the state The second code held in the first area of the data block or the largest second code held in the third area for the data block and held in the third area of the data block Means for generating data including second association data for associating the code of the next appearing character associated with the second code being made and the hierarchy number;
A first character string code corresponding to the second code held in the first area of each data block belonging to each hierarchy after the second hierarchy of the tree structure represented by the plurality of data blocks in the state; Means for generating one data;
For each hierarchy after the second hierarchy of the tree structure represented by a plurality of data blocks in the state, the number of data blocks in the hierarchy and the minimum second stored in the first area of the data block in the hierarchy Generating hierarchical information that associates an offset value from the head of the arrangement position of the character or character string corresponding to the minimum second code in the first data,
An information processing apparatus.

(付記25)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行される圧縮方法。
(Appendix 25)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, a process of referring to the association data of the code corresponding to the first character included in the input character string;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string A search process for searching the corresponding data in the data structure;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
A compression method executed by a computer.

(付記26)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有する情報処理装置。
(Appendix 26)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node Means for referring to the association data of the code corresponding to the first character included in the input character string in the data structure arranged in order;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string Search means for searching the corresponding data in the data structure;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for outputting a code of the association data referred to after processing the last character of the input character;
An information processing apparatus.

(付記27)
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行される圧縮方法。
(Appendix 27)
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node, and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree In the first data included in the data structure including the data for associating the number of nodes belonging to the hierarchy with the minimum code among the codes of the nodes belonging to the hierarchy, A process of referring to the association data of the code corresponding to the first character
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. A search process for searching for a range of the first data;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
A compression method executed by a computer.

(付記28)
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有する情報処理装置。
(Appendix 28)
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node, and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree In the first data included in the data structure including the data for associating the number of nodes belonging to the hierarchy with the minimum code among the codes of the nodes belonging to the hierarchy, Means for referring to the association data of the code corresponding to the first character
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. Search means for searching for a range for the first data;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for outputting a code of the association data referred to after processing the last character of the input character;
An information processing apparatus.

(付記29)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行され、
前記探索処理においては、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
圧縮方法。
(Appendix 29)
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, In the data structure arranged in the order of the code of each node, a process of referring to the association data of the code corresponding to the first character included in the input character string;
A search process for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character, processing to output the code of the association data referred to,
Is executed by the computer,
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
When referring to the association data for the second and subsequent layers of the data structure, from the association data of the maximum code included in the association data immediately before the referenced association data A compression method for searching up to the association data of the maximum code included in the referenced association data.

(付記30)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有し、
前記探索手段が、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
情報処理装置。
(Appendix 30)
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, Means for referring to the association data of the code corresponding to the first character included in the input character string in the data structure arranged in the order of the code of each node;
Search means for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for outputting a code of the association data referred to after processing the last character of the input character;
Have
The search means
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
When referring to the association data for the second and subsequent layers of the data structure, from the association data of the maximum code included in the association data immediately before the referenced association data An information processing apparatus that searches up to the association data of the maximum code included in the associated association data.

(付記31)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する処理と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力処理と、
前記格納処理と前記参照処理と前記出力処理とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に実施する処理と、
が、コンピュータにより実行される伸張方法。
(Appendix 31)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, the process of identifying the association data in the order of the first code among the input codes;
A storing process for storing a code of a character included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates the code of a node other than the root node of the phrase tree, a reference process for referring to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, an output process for outputting the codes of the characters stored in the memory in reverse order;
A process of sequentially performing the storage process, the reference process, and the output process for each code after the first code among the input codes;
Is a decompression method executed by a computer.

(付記32)
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する手段と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理手段と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照手段と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力手段と、
前記格納処理手段と前記参照手段と前記出力手段とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に動作させる手段と、
を有する情報処理装置。
(Appendix 32)
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, means for identifying the association data in the order of the first code among the input codes;
Storage processing means for storing a character code included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates a code of a node other than the root node of the phrase tree, a reference unit that refers to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, output means for outputting the codes of the characters stored in the memory in reverse order;
Means for operating the storage processing means, the reference means, and the output means in turn for each code after the first code among the input codes;
An information processing apparatus.

(付記33)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定処理と前記読み出し処理とを実施する処理と、
が、コンピュータにより実行される伸張方法。
(Appendix 33)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy and the position of the character or character string corresponding to the minimum second code in the second data from the beginning In the first data included in the data structure including data that associates an offset value, a process of specifying an entry in the order of the first code among the input codes;
A specifying process for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code among the input codes, and performing the specifying process and the reading process;
Is a decompression method executed by a computer.

(付記34)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する手段と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定手段と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し手段と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定手段と前記読み出し手段とを動作させる手段と、
を有する情報処理装置。
(Appendix 34)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy and the position of the character or character string corresponding to the minimum second code in the second data from the beginning Means for identifying an entry in the order of the first code among the input codes in the first data included in the data structure including data that associates an offset value;
Specifying means for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Reading means for reading out characters or character strings corresponding to the hierarchical number from the arrangement position;
A means for specifying an entry in the first data for each code after the second code after the first code among the input codes, and operating the specifying means and the reading means;
An information processing apparatus.

(付記35)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力処理と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力処理と前記特定処理と前記読み出し処理とを実施する処理と、
が、コンピュータにより実行される伸張方法。
(Appendix 35)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the smallest code among the codes of the nodes belonging to the hierarchy, and the arrangement of characters or character strings corresponding to the smallest second code in the second data Processing for specifying an entry in the order of the first code among the input codes in the first data included in the data structure, including data that associates an offset value from the head of the position;
If the specified entry is an entry in the first hierarchy, an output process for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second layer, a specifying process for specifying the minimum code and the offset value in the third data according to the layer number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code, and performing the output process, the specifying process, and the reading process When,
Is a decompression method executed by a computer.

(付記36)
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の第2の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する手段と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力手段と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定手段と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し手段と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力手段と前記特定手段と前記読み出し手段とを動作させる処理と、
を有する情報処理装置。
(Appendix 36)
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the smallest code among the codes of the nodes belonging to the hierarchy, and the arrangement of characters or character strings corresponding to the smallest second code in the second data Means for identifying an entry in the order of the first code among the input codes in the first data included in the data structure, including data that associates an offset value from the head of the position;
If the specified entry is an entry in the first hierarchy, output means for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second hierarchy, a specifying means for specifying the minimum code and the offset value in the third data according to the hierarchy number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Reading means for reading out characters or character strings corresponding to the hierarchical number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code and operating the output means, the specifying means, and the reading means When,
An information processing apparatus.

100 情報処理装置
110 文節木生成部
120 圧縮マップ生成部
130 データ格納部
140 圧縮処理部
150 伸張処理部
160 入出力部
100 Information Processing Device 110 Phrase Tree Generation Unit 120 Compression Map Generation Unit 130 Data Storage Unit 140 Compression Processing Unit 150 Decompression Processing Unit 160 Input / Output Unit

Claims (23)

文節木に対応するデータ構造であって、
前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードの子ノードの符号のうち最大の符号とを対応付ける対応付けデータが、各ノードの符号の順番に並べられ、
前記各ノードの符号が、前記文節木における各階層内において連続するように付与されており、
情報処理装置が、
前記文節木におけるあるノードの子ノードを探索する際に、前記あるノードの1つ前のノードについての対応付けデータから前記あるノードの1つ前のノードの子ノードの符号のうち最大の符号を読み出して当該最大の符号の次の符号を特定し、前記あるノードについての対応付けデータから当該あるノードの子ノードのうち最大の符号を読み出すことに用いることが可能である
データ構造。
A data structure corresponding to a phrase tree,
For each node of the phrase tree, the association data that associates the code of the parent node of the node, the code of the character represented by the node, and the maximum code among the codes of the child nodes of the node, Are arranged in the order of the signs of
The code of each node is given to be continuous in each hierarchy in the phrase tree ,
Information processing device
When searching for a child node of a node in the phrase tree, the maximum code among the codes of the child nodes of the node immediately before the certain node is obtained from the association data for the node immediately before the certain node. A data structure that can be used to read and specify a code next to the maximum code and to read the maximum code among the child nodes of the certain node from the association data for the certain node .
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有するデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードの親ノードの符号又は当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層の番号とを対応付ける対応付けデータが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2階層以降の各階層の各ノードについて当該ノードに対応する文字列に含まれる文字のコードを当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2階層以降の各階層について、該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
データ構造であって、
情報処理装置が、
前記第1のデータにおいて、入力符号のうちある符号の順番の対応付けデータを特定し、
特定された前記対応付けデータが前記第2階層以降についての対応付けデータであれば、特定された前記対応付けデータに含まれる階層の番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定し、
前記第2のデータにおいて、特定された前記最小の符号と前記オフセット値と前記階層の番号とに基づき特定される文字のコードを読み出す
処理に用いることが可能である
データ構造
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
A data structure having
In the first data,
For each node of the phrase tree, the maximum code among the code of the parent node of the node or the code of the child node of the node, the character code represented by the node, and the number of the hierarchy to which the node belongs mapping data associating the found are arranged in order of code for each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, the character code included in the character string corresponding to the node is included in the order of the code of the node,
The third data is:
For the second and subsequent layers in each layer of the phrase tree, a minimum code among codes of nodes belonging to those hierarchical layers, the arrangement position of the character string corresponding in the second data to the minimum of the code, from the beginning a data structure containing data associating the offset value,
Information processing device
In the first data, specify the association data in the order of a certain code among the input codes,
If the identified association data is association data for the second and subsequent layers, the minimum code and the offset value in the third data according to the layer number included in the identified association data And identify
In the second data, the code of the character specified based on the specified minimum code, the offset value, and the hierarchy number is read.
Can be used for processing
Data structure .
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
を、コンピュータに実行させるための圧縮プログラム。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, a process of referring to the association data of the code corresponding to the first character included in the input character string;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string A search process for searching the corresponding data in the data structure;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
Is a compression program that causes a computer to execute.
前記探索処理において、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層以降の対応付けデータを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの符号より後ろの対応付けデータを探索する
請求項記載の圧縮プログラム。
In the search process,
When referring to the association data for the first hierarchy of the data structure, search the association data for the second hierarchy and thereafter,
The compression program according to claim 3 , wherein when referring to association data for a hierarchy after the second hierarchy of the data structure, the association data after the code of the association data being referred to is searched.
前記対応付けデータが、さらに前記ノードの子ノードの符号のうち最大の符号をさらに対応付けており、
前記探索処理において、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータの次の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
請求項記載の圧縮プログラム。
The association data further associates the maximum code among the codes of child nodes of the node;
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
Wherein the second layer of the subsequent hierarchical data structure in the case that reference the correspondence data, the previous one of the mapping data that refers to the maximum code included in the mapping data of the mapping data The compression program according to claim 3 , wherein the search is performed from the next association data to the association data having the maximum code included in the referenced association data.
前記対応付けデータが、さらに当該ノードの属する階層の階層番号をさらに対応付けており、
前記探索処理において、
前記データ構造において参照している対応データの階層番号の次の階層番号が対応付けられている対応付けデータを探索する
請求項記載の圧縮プログラム。
The association data further associates a hierarchy number of a hierarchy to which the node belongs,
In the search process,
The compression program according to claim 3, wherein association data associated with a hierarchy number next to a hierarchy number of corresponding data referred to in the data structure is searched.
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
をコンピュータに実行させるための圧縮プログラム。
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree For each layer, the first data included in the data structure including data that associates the number of nodes belonging to the layer with the minimum code among the codes of the nodes belonging to the layer is included in the input character string. A process of referring to the association data of the code corresponding to the first character;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. A search process for searching for a range of the first data;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
A compression program that causes a computer to execute.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
を、コンピュータに実行させ、
前記探索処理においては、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータの次の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
圧縮プログラム。
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, In the data structure arranged in the order of the code of each node, a process of referring to the association data of the code corresponding to the first character included in the input character string;
A search process for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
To the computer,
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
Wherein the second layer of the subsequent hierarchical data structure in the case that reference the correspondence data, the previous one of the mapping data that refers to the maximum code included in the mapping data of the mapping data A compression program that searches from the next association data to the association data with the maximum code included in the association data being referred to.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する処理と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力処理と、
前記格納処理と前記参照処理と前記出力処理とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に実施する処理と、
を、コンピュータに実行させるための伸張プログラム。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, the process of identifying the association data in the order of the first code among the input codes;
A storing process for storing a code of a character included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates the code of a node other than the root node of the phrase tree, a reference process for referring to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, an output process for outputting the codes of the characters stored in the memory in reverse order;
A process of sequentially performing the storage process, the reference process, and the output process for each code after the first code among the input codes;
Is a decompression program for causing a computer to execute.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定処理と前記読み出し処理とを実施する処理と、
を、コンピュータに実行させるためのプログラム。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the offset value from the beginning of the arrangement position of the character or character string corresponding to the minimum code in the second data In the first data included in the data structure including the data corresponding to
A specifying process for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code among the input codes, and performing the specifying process and the reading process;
A program that causes a computer to execute.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力処理と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力処理と前記特定処理と前記読み出し処理とを実施する処理と、
を、コンピュータに実行させるためのプログラム。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the arrangement position of the character or character string corresponding to the minimum code in the second data, In the first data included in the data structure including data that associates an offset value from the head, a process of specifying an entry in the order of the first code among the input codes;
If the specified entry is an entry in the first hierarchy, an output process for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second layer, a specifying process for specifying the minimum code and the offset value in the third data according to the layer number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code, and performing the output process, the specifying process, and the reading process When,
A program that causes a computer to execute.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行される圧縮方法。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, a process of referring to the association data of the code corresponding to the first character included in the input character string;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string A search process for searching the corresponding data in the data structure;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
A compression method executed by a computer.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有する情報処理装置。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node Means for referring to the association data of the code corresponding to the first character included in the input character string in the data structure arranged in order;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string Search means for searching the corresponding data in the data structure;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for processing the last character of the input character string and then outputting a code of the association data referred to;
An information processing apparatus.
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行される圧縮方法。
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node, and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree In the first data included in the data structure including the data for associating the number of nodes belonging to the hierarchy with the minimum code among the codes of the nodes belonging to the hierarchy, A process of referring to the association data of the code corresponding to the first character
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. A search process for searching for a range of the first data;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
A compression method executed by a computer.
文節木に対応する第1のデータと前記文節木の階層についての第2のデータとを有するデータ構造であって、前記第1のデータにおいて、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードと、当該ノードが所属する階層とを対応付けるデータが、各ノードの符号の順番に並べられており、前記第2のデータは、前記文節木の各階層について、当該階層に属するノードの数と、当該階層に属するノードの符号のうち最小の符号とを対応付けるデータを含む前記データ構造に含まれる前記第1のデータにおいて、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記親ノードの符号が、参照している前記対応付けデータに対応するノードの符号となっており且つ前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記第2のデータにおいて、参照している対応付けデータに対応するノードの階層の1階層下の階層に属するノードの数及び前記最小の符号とから特定される範囲を前記第1のデータについて探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有する情報処理装置。
A data structure having first data corresponding to a phrase tree and second data for a hierarchy of the phrase tree, wherein each node of the phrase tree in the first data is a parent node of the node , The code of the character represented by the node and the hierarchy to which the node belongs are arranged in the order of the code of each node, and the second data is the phrase tree For each layer, the first data included in the data structure including data that associates the number of nodes belonging to the layer with the minimum code among the codes of the nodes belonging to the layer is included in the input character string. Means for referring to the association data of the code corresponding to the first character;
The code of the second node in which the code of the parent node is the code of the node corresponding to the association data being referred to and the character code represented by the node appears next in the input character string In the second data, the number of nodes belonging to a layer one level below the level of the node corresponding to the referenced association data and the minimum code are specified. Search means for searching for a range for the first data;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for processing the last character of the input character string and then outputting a code of the association data referred to;
An information processing apparatus.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する処理と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索処理と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照処理と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照処理と、
前記探索処理と前記第1参照処理と前記第2参照処理とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ実施し、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する処理と、
が、コンピュータにより実行され、
前記探索処理においては、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータの次の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
圧縮方法。
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, In the data structure arranged in the order of the code of each node, a process of referring to the association data of the code corresponding to the first character included in the input character string;
A search process for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
When the association data is detected, a first reference process for referring to the association data;
If the association data is not detected, a second reference process for outputting the code of the association data referred to and referring to the association data of the code corresponding to the second character;
The search process, the first reference process, and the second reference process are performed while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. , After processing the last character of the input character string, a process of outputting the code of the association data referred to,
Is executed by the computer,
In the search process,
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
Wherein the second layer of the subsequent hierarchical data structure in the case that reference the correspondence data, the previous one of the mapping data that refers to the maximum code included in the mapping data of the mapping data A compression method for searching from the next association data to the association data having the maximum code included in the associated association data.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの子ノードの符号のうち最大の符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力文字列に含まれる第1の文字に対応する符号の対応付けデータを参照する手段と、
前記ノードで表される文字のコードが前記入力文字列において次に現れる第2の文字のコードとなっている対応付けデータを、前記データ構造において探索する探索手段と、
対応付けデータが検出された場合には、当該対応付けデータを参照する第1参照手段と、
対応付けデータが検出されない場合には、参照している前記対応付けデータの符号を出力し、前記第2の文字に対応する符号の対応付けデータを参照する第2参照手段と、
前記探索手段と前記第1参照手段と前記第2参照手段とを、前記入力文字列の最後の文字を処理するまで、前記第2の文字を前記入力文字列の文字の順に移動させつつ動作させ、前記入力文字列の最後の文字を処理した後に、参照している前記対応付けデータの符号を出力する手段と、
を有し、
前記探索手段が、
前記データ構造の第1階層についての対応付けデータを参照している場合には、第2階層に属する最初の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索し、
前記データ構造の第2階層以降の階層についての対応付けデータを参照している場合には、参照している対応付けデータの1つ前の対応付けデータに含まれる最大の符号の対応付けデータの次の対応付けデータから、参照している対応付けデータに含まれる最大の符号の対応付けデータまでを探索する
情報処理装置。
A data structure corresponding to a phrase tree, for each node of the phrase tree, association data that associates the maximum code among the codes of the child nodes of the node with the code of the character represented by the node, Means for referring to the association data of the code corresponding to the first character included in the input character string in the data structure arranged in the order of the code of each node;
Search means for searching in the data structure for correspondence data in which the code of the character represented by the node is the code of the second character that appears next in the input character string;
A first reference means for referring to the association data when the association data is detected;
A second reference means for outputting a code of the association data referred to and referring to the association data of the code corresponding to the second character when the association data is not detected;
The search means, the first reference means, and the second reference means are operated while moving the second character in the order of the characters of the input character string until the last character of the input character string is processed. Means for processing the last character of the input character string and then outputting a code of the association data referred to;
Have
The search means
When referring to the association data for the first hierarchy of the data structure, the association data of the maximum code included in the association data being referred to from the first association data belonging to the second hierarchy Explore until
Wherein the second layer of the subsequent hierarchical data structure in the case that reference the correspondence data, the previous one of the mapping data that refers to the maximum code included in the mapping data of the mapping data An information processing apparatus that searches from the next association data to the association data having the maximum code included in the associated association data.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する処理と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照処理と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力処理と、
前記格納処理と前記参照処理と前記出力処理とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に実施する処理と、
が、コンピュータにより実行される伸張方法。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, the process of identifying the association data in the order of the first code among the input codes;
A storing process for storing a code of a character included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates the code of a node other than the root node of the phrase tree, a reference process for referring to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, an output process for outputting the codes of the characters stored in the memory in reverse order;
A process of sequentially performing the storage process, the reference process, and the output process for each code after the first code among the input codes;
Is a decompression method executed by a computer.
文節木に対応するデータ構造であって、前記文節木の各ノードについて、当該ノードの親ノードの符号と、当該ノードで表される文字のコードとを対応付ける対応付けデータが、各ノードの符号の順番に並べられたデータ構造において、入力符号のうち第1の符号の順番の対応付けデータを特定する手段と、
特定された前記対応付けデータに含まれる文字のコードをメモリに格納する格納処理手段と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノード以外のノードの符号を示している場合には、当該親ノードの符号の対応付けデータを参照する参照手段と、
特定された前記対応付けデータに含まれる親ノードの符号が前記文節木の根ノードの符号を示している場合には、前記メモリに格納されている文字のコードを逆順に出力する出力手段と、
前記格納処理手段と前記参照手段と前記出力手段とを、前記入力符号のうち前記第1の符号より後ろの各符号について順番に動作させる手段と、
を有する情報処理装置。
A data structure corresponding to a phrase tree, and for each node of the phrase tree, association data that associates a code of a parent node of the node with a code of a character represented by the node includes a code of each node In the data structure arranged in order, means for identifying the association data in the order of the first code among the input codes;
Storage processing means for storing a character code included in the identified association data in a memory;
When the code of the parent node included in the identified association data indicates a code of a node other than the root node of the phrase tree, a reference unit that refers to the association data of the code of the parent node;
When the code of the parent node included in the identified association data indicates the code of the root node of the phrase tree, output means for outputting the codes of the characters stored in the memory in reverse order;
Means for operating the storage processing means, the reference means, and the output means in turn for each code after the first code among the input codes;
An information processing apparatus.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定処理と前記読み出し処理とを実施する処理と、
が、コンピュータにより実行される伸張方法。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the offset value from the beginning of the arrangement position of the character or character string corresponding to the minimum code in the second data In the first data included in the data structure including the data corresponding to
A specifying process for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code among the input codes, and performing the specifying process and the reading process;
Is a decompression method executed by a computer.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の各階層の各ノードについて当該ノードに対応する文字又は文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する手段と、
特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定手段と、
前記第2のデータから、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し手段と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記特定手段と前記読み出し手段とを動作させる手段と、
を有する情報処理装置。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy of the phrase tree, the character or character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the offset value from the beginning of the arrangement position of the character or character string corresponding to the minimum code in the second data In the first data included in the data structure including the data corresponding to
Specifying means for specifying the minimum code and the offset value in the third data according to the hierarchical number included in the specified entry;
Obtained by adding a value obtained by multiplying the difference between the code of the specified entry and the specified minimum code to the specified offset value from the second data by the hierarchy number. Reading means for reading out characters or character strings corresponding to the hierarchical number from the arrangement position;
A means for specifying an entry in the first data for each code after the second code after the first code among the input codes, and operating the specifying means and the reading means;
An information processing apparatus.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する処理と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力処理と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定処理と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し処理と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力処理と前記特定処理と前記読み出し処理とを実施する処理と、
が、コンピュータにより実行される伸張方法。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the arrangement position of the character or character string corresponding to the minimum code in the second data, In the first data included in the data structure including data that associates an offset value from the head, a process of specifying an entry in the order of the first code among the input codes;
If the specified entry is an entry in the first hierarchy, an output process for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second layer, a specifying process for specifying the minimum code and the offset value in the third data according to the layer number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Read processing for reading out characters or character strings corresponding to the hierarchy number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code, and performing the output process, the specifying process, and the reading process When,
Is a decompression method executed by a computer.
文節木に対応する第1のデータと、
前記文節木の各ノードに対応する文字又は文字列についての第2のデータと、
前記文節木の階層についての第3のデータと、
を有し且つデータ格納部に格納されているデータ構造であって、
前記第1のデータにおいて、
前記文節木の各ノードについて、当該ノードが所属する階層の階層番号を含むエントリが、各ノードの符号の順番に並べられており、
前記第2のデータは、
前記文節木の第2の階層以降の各階層の各ノードについて当該ノードに対応する文字列を当該ノードの符号の順に含み、
前記第3のデータは、
前記文節木の第2の階層以降の各階層について、当該階層に属するノードの符号のうち最小の符号と、前記第2のデータにおいて当該最小の符号に対応する文字又は文字列の配置位置の、先頭からのオフセット値とを対応付けるデータを含む
前記データ構造に含まれる前記第1のデータにおいて、入力符号のうち第1の符号の順番のエントリを特定する手段と、
特定された前記エントリが第1の階層におけるエントリであれば、特定された前記エントリの符号に対応する文字を出力する出力手段と、
特定された前記エントリが第2の階層以降のエントリであれば、特定された前記エントリに含まれる階層番号に従って前記第3のデータにおいて前記最小の符号と前記オフセット値とを特定する特定手段と、
前記第2のデータにおいて、特定された前記オフセット値に対して、特定された前記エントリの符号と特定された前記最小の符号との差に前記階層番号を乗じた値を加算することで得られる配置位置から前記階層番号分の文字又は文字列を読み出す読み出し手段と、
前記入力符号のうち前記第1の符号の後ろの第2の符号以降の各符号について、前記第1のデータにおけるエントリを特定し、前記出力手段と前記特定手段と前記読み出し手段とを動作させる処理と、
を有する情報処理装置。
First data corresponding to the phrase tree;
Second data about characters or character strings corresponding to each node of the phrase tree;
Third data about the hierarchy of the phrase tree;
And a data structure stored in the data storage unit,
In the first data,
For each node of the phrase tree, entries including the hierarchy number of the hierarchy to which the node belongs are arranged in the order of the code of each node,
The second data is:
For each node in each hierarchy after the second hierarchy of the phrase tree, a character string corresponding to the node is included in the order of the code of the node,
The third data is:
For each hierarchy after the second hierarchy of the phrase tree, the minimum code among the codes of the nodes belonging to the hierarchy, and the arrangement position of the character or character string corresponding to the minimum code in the second data, Means for identifying an entry in the order of the first code among the input codes in the first data included in the data structure including data associated with an offset value from the head;
If the specified entry is an entry in the first hierarchy, output means for outputting a character corresponding to the code of the specified entry;
If the specified entry is an entry after the second hierarchy, a specifying means for specifying the minimum code and the offset value in the third data according to the hierarchy number included in the specified entry;
In the second data, it is obtained by adding a value obtained by multiplying a difference between the code of the specified entry and the specified minimum code to the specified offset value by the hierarchy number. Reading means for reading out characters or character strings corresponding to the hierarchical number from the arrangement position;
A process of specifying an entry in the first data for each code after the second code after the first code in the input code and operating the output means, the specifying means, and the reading means When,
An information processing apparatus.
JP2015238737A 2015-12-07 2015-12-07 Code processing program and data structure Active JP6296044B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015238737A JP6296044B2 (en) 2015-12-07 2015-12-07 Code processing program and data structure

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015238737A JP6296044B2 (en) 2015-12-07 2015-12-07 Code processing program and data structure

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2012145224A Division JP5966673B2 (en) 2012-06-28 2012-06-28 Code processing program and data structure

Publications (2)

Publication Number Publication Date
JP2016034158A JP2016034158A (en) 2016-03-10
JP6296044B2 true JP6296044B2 (en) 2018-03-20

Family

ID=55452840

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015238737A Active JP6296044B2 (en) 2015-12-07 2015-12-07 Code processing program and data structure

Country Status (1)

Country Link
JP (1) JP6296044B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2952068B2 (en) * 1991-03-20 1999-09-20 富士通株式会社 Data compression and decompression method
US5861827A (en) * 1996-07-24 1999-01-19 Unisys Corporation Data compression and decompression system with immediate dictionary updating interleaved with string search
JP3593244B2 (en) * 1997-09-29 2004-11-24 シャープ株式会社 Data compression device
JP3425143B2 (en) * 2001-12-28 2003-07-07 富士通株式会社 Data compression method, data decompression method, data compression device, and data decompression device
JP5544998B2 (en) * 2010-04-12 2014-07-09 富士通株式会社 Text processing apparatus, text processing method, and text processing program

Also Published As

Publication number Publication date
JP2016034158A (en) 2016-03-10

Similar Documents

Publication Publication Date Title
JP5966673B2 (en) Code processing program and data structure
CN104283567B (en) A kind of compression of name data, decompression method and equipment
US20160321282A1 (en) Extracting method, information processing method, computer product, extracting apparatus, and information processing apparatus
CN107924410A (en) For the relevant technology of binary coding with individual-layer data object for supporting the highly effective path of individual-layer data object to navigate
US9916314B2 (en) File extraction method, computer product, file extracting apparatus, and file extracting system
CN108287877B (en) FPGA (field programmable Gate array) compression/decompression system and hardware decompression method for RIB (run in Box) rendering compressed file
US8316041B1 (en) Generation and processing of numerical identifiers
US20130226885A1 (en) Path-decomposed trie data structures
US8947272B2 (en) Decoding encoded data
CN110263043A (en) Date storage method, data query method, apparatus and storage medium
CN101727499B (en) Method and system for storage word library, and method and system for searching words
CN108628907B (en) Method for matching Trie tree with multiple keywords based on Aho-Corasick
US10884982B2 (en) Hash-based mount point lookup in virtual file systems
JP6296044B2 (en) Code processing program and data structure
JP5544998B2 (en) Text processing apparatus, text processing method, and text processing program
CN117254820A (en) Data compression method, device, equipment and storage medium
Gawrychowski et al. LZ77 factorisation of trees
JPH0936747A (en) Data compression method and data compressor
CN113495901B (en) Quick retrieval method for variable-length data blocks
WO2009001174A1 (en) System and method for data compression and storage allowing fast retrieval
US10541708B1 (en) Decompression engine for executable microcontroller code
CN109815225B (en) Parallel prefix data retrieval method and system based on prefix tree structure
JP5245908B2 (en) Search method and apparatus
CN114443866A (en) Data processing method, device, computing equipment and medium
Cao et al. Frequent statistics of link-layer bit stream data based on AC-IM algorithm

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20151208

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160902

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20161025

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20161226

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170606

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170803

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: 20180123

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180205

R150 Certificate of patent or registration of utility model

Ref document number: 6296044

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150