JP2003263461A - Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program - Google Patents

Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program

Info

Publication number
JP2003263461A
JP2003263461A JP2002063314A JP2002063314A JP2003263461A JP 2003263461 A JP2003263461 A JP 2003263461A JP 2002063314 A JP2002063314 A JP 2002063314A JP 2002063314 A JP2002063314 A JP 2002063314A JP 2003263461 A JP2003263461 A JP 2003263461A
Authority
JP
Japan
Prior art keywords
symbol string
identification code
stored
symbol
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002063314A
Other languages
Japanese (ja)
Inventor
Hiroshi Matsuda
寛 松田
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.)
JustSystems Corp
Original Assignee
JustSystems Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by JustSystems Corp filed Critical JustSystems Corp
Priority to JP2002063314A priority Critical patent/JP2003263461A/en
Publication of JP2003263461A publication Critical patent/JP2003263461A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data structure, etc., suitable for efficiently storing and retrieving symbol strings. <P>SOLUTION: The data structure 201, made up of a symbol string trial structure 202 and an identification code trial structure 203, stores therein symbol strings comprising prescribed kinds of symbols. The structure 202 stores therein symbol strings comprising prescribed kinds of symbols and the structure 203 stores therein prescribed identification codes. In the event that already-divided symbol strings are obtained by dividing symbol strings to be stored in the structure 201 by using prescribed division symbols, the structure 202 stores therein each of the already-divided symbol strings while associating different already-divided symbol strings with different identification codes. The structure 203 stores therein strings of 'identification codes to be stored in the symbol string trial structure associated with each of the already-divided symbol strings included therein' with respect to the already-divided symbol strings. If there is no branch in transition as far as a node, these are replaced by 'partial symbol strings to be matched therewith prior to the transition' and can be stored at the node in the structure 203. <P>COPYRIGHT: (C)2003,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、URL(Universa
l Resource Locator)文字列等の記号列を効率良く格納
し検索するのに好適なデータ構造、登録装置、検索装
置、登録方法、検索方法、ならびに、これらをコンピュ
ータに実現させるためのプログラムに関する。
TECHNICAL FIELD The present invention relates to a URL (Universa
(Resource Locator) The present invention relates to a data structure suitable for efficiently storing and retrieving a symbol string such as a character string, a registration device, a search device, a registration method, a search method, and a program for realizing these in a computer.

【0002】[0002]

【従来の技術】従来から、所定の種類の記号からなる記
号列が登録されているか否かを高速に判断するため、当
該記号列を格納する辞書をトライ(trie)構造のデータ
構造により構成する手法が提案されている。
2. Description of the Related Art Conventionally, in order to quickly determine whether or not a symbol string consisting of a predetermined type of symbol is registered, a dictionary storing the symbol string is constructed by a data structure of a trie structure. A method has been proposed.

【0003】言語処理では、共通接頭辞検索(Common P
refix Search)を用いることが多いが、トライ構造は、
この共通接頭辞検索を高速に実行できるような索引構造
である。
In language processing, a common prefix search (Common P
refix search) is often used, but the trie structure is
The index structure is such that this common prefix search can be executed at high speed.

【0004】トライ構造は、基本的には、現在位置のノ
ードに対してある記号が与えられると別のノードに遷移
できる木構造をなしている。ある記号列が与えられる
と、当該記号列に含まれる記号を先頭から順に走査し、
当該記号に対応付けられたノードに順に遷移することに
よって、当該記号列がすでにそのトライ構造に格納され
ているか否かを高速に判定することができ、また、格納
されていない場合には、その記号列を直ちに登録するこ
とができる。
The trie structure is basically a tree structure in which when a certain symbol is given to the node at the current position, the node can transit to another node. Given a symbol string, scan the symbols contained in the symbol sequence from the beginning,
By sequentially transiting to the node associated with the symbol, it is possible to quickly determine whether or not the symbol string is already stored in the trie structure, and if it is not stored, The symbol string can be registered immediately.

【0005】一方で、記号列を記号単位に分解して木構
造を構成すると、メモリ(本願においては、コンピュー
タが有するRAM(Random Access Memory)やROM
(ReadOnly Memory)のほか、CD−ROM(Compact D
isk ROM)、フレキシブルディスク(flexible disk;F
D)、ハードディスクなどの記録媒体における記憶域を
含む。)の使用効率が落ちることがある。そこで、最小
接頭辞トライ構造という技術が提案されている。
On the other hand, when a tree structure is formed by decomposing a symbol string into symbol units, a memory (in the present application, a RAM (Random Access Memory) or a ROM of a computer is provided.
(ReadOnly Memory), CD-ROM (Compact D
isk ROM), flexible disk (F)
D), a storage area in a recording medium such as a hard disk. ) May be less efficient to use. Therefore, a technique called a minimum prefix trie structure has been proposed.

【0006】最小接頭辞トライ構造は、他のノードへの
遷移が起きない区間をまとめて最小接頭辞とし、当該最
小接頭辞を部分記号列としてまとめて格納することによ
って、メモリの使用効率の向上を図るものである。
The minimum prefix trie structure improves the efficiency of use of memory by collectively storing intervals in which no transition to another node occurs, and storing the minimum prefix as a partial symbol string. Is intended.

【0007】一方、URL文字列など、特定の記号列群
においては、同じ部分記号列が頻出する場合も多い。
On the other hand, the same partial symbol string often appears in a specific symbol string group such as a URL character string.

【0008】[0008]

【発明が解決しようとする課題】したがって、登録され
るべき記号列の部分記号列の分布に応じてトライ構造の
登録・検索の高速性を維持したまま、さらにメモリ使用
効率を向上させたいという要望は大きい。
Therefore, it is desired to further improve the memory usage efficiency while maintaining the high speed of registration / retrieval of the trie structure according to the distribution of the partial symbol strings of the symbol string to be registered. Is big.

【0009】本発明は、上記の課題を解決するもので、
記号列を効率良く格納し検索するのに好適なデータ構
造、登録装置、検索装置、登録方法、検索方法、ならび
に、これらをコンピュータに実現させるためのプログラ
ムを提供することを目的とする。
The present invention is to solve the above-mentioned problems.
It is an object of the present invention to provide a data structure suitable for efficiently storing and retrieving a symbol string, a registration device, a retrieval device, a registration method, a retrieval method, and a program for realizing these in a computer.

【0010】[0010]

【課題を解決するための手段】以上の目的を達成するた
め、本発明の原理にしたがって、下記の発明を開示す
る。
In order to achieve the above object, the following invention is disclosed according to the principle of the present invention.

【0011】本発明の第1の観点に係るデータ構造は、
所定の種類の記号からなる記号列を格納する記号列トラ
イ構造と、所定の識別符号を格納する識別符号トライ構
造と、により、当該所定の種類の記号からなる記号列を
格納するデータ構造であり、以下のように構成する。
A data structure according to the first aspect of the present invention is
It is a data structure for storing a symbol string consisting of a symbol of a predetermined type by a symbol string trie structure storing a symbol string consisting of a predetermined type of symbol and an identification code trie structure storing a prescribed identification code. , And is configured as follows.

【0012】すなわち、当該データ構造に格納されるべ
き記号列を所定の区切記号で区切ると区切済記号列の列
が得られる場合、(a)記号列トライ構造は、当該区切
済記号列のそれぞれを、異なる区切済記号列には異なる
識別符号を対応付けて、格納し、(b)識別符号トライ
構造は、当該区切済記号列の列について、「これに含ま
れる区切済記号列のそれぞれに対応付けられて記号列ト
ライ構造に格納される識別符号」の列を、格納する。
That is, when a sequence of delimited symbol strings is obtained by delimiting a symbol string to be stored in the data structure with a predetermined delimiter symbol, (a) the symbol string trie structure has each of the delimited symbol strings. Different identification codes are associated with different delimited symbol strings and stored, and (b) the identification code trie structure describes “for each delimited symbol string included in the delimited symbol string in the column of the delimited symbol string. The column of “identification code which is associated and stored in the symbol string trie structure” is stored.

【0013】URL文字列など、記号列によっては、共
通する部分記号列が頻出することがある。たとえば、U
RL文字列を格納・登録する場合を考えると、区切記号
として「/」を用いた場合、「http:」「index.html」
「cgi-bin」等の文字列が頻出する。
Depending on symbol strings such as URL character strings, common partial symbol strings may appear frequently. For example, U
Considering the case of storing / registering the RL character string, if "/" is used as the delimiter, "http:""index.html"
Character strings such as "cgi-bin" appear frequently.

【0014】これらは、WEB環境で標準的に用いられ
る機能に対応づけられたキーワードであり、URLの部
分文字列として、かなり高頻度に出現する。さらに、
「/」で区切られるディレクトリ名やファイル名は、そ
の内容を表現する単語や、機能を表現する拡張子との組
み合わせで表現されることが多く、キーワードや拡張子
などの語彙の使用頻度は、自然言語の場合と同様に、そ
の一部に集中する傾向が強い。
These are keywords associated with the functions normally used in the WEB environment, and appear as a partial character string of the URL at a fairly high frequency. further,
Directory names and file names separated by "/" are often expressed in combination with words that express their contents and extensions that express functions. The usage frequency of vocabulary such as keywords and extensions is As in natural language, there is a strong tendency to concentrate on that part.

【0015】そこで、まず記号列を区切って、これを記
号列トライ構造に識別記号とともに格納し、さらに、当
該記号列トライ構造は、当該識別記号のトライ構造とす
ることにより、高頻度の部分文字列が識別符号に圧縮さ
れて、メモリ効率を向上させることができる。
Therefore, first, the symbol string is divided and stored in the symbol string trie structure together with the identification symbol. Further, the symbol string trie structure is made to be the trie structure of the identification symbol, so that the high frequency partial character The columns can be compressed into an identification code to improve memory efficiency.

【0016】また、本発明のデータ構造は、以下のよう
に構成することができる。
Further, the data structure of the present invention can be configured as follows.

【0017】すなわち、識別符号トライ構造の各ノード
は、識別符号と、遷移先のノードと、を対応付けて格納
する遷移表のほか、当該遷移に先立ってマッチすべき部
分記号列を格納することができる。
That is, each node of the identification code trie structure must store a transition table that stores the identification code and the transition destination node in association with each other, as well as a partial symbol string to be matched prior to the transition. You can

【0018】また、識別符号トライ構造においてあるノ
ードAの遷移表に格納された遷移先がノードBの一つの
みであり、所定の置換条件が満たされた場合、識別符号
トライ構造は、当該ノードAと当該ノードBとをノード
Cに置き換えたものであり、当該ノードCに格納される
部分記号列は、当該ノードAに格納されていた部分記号
列と、当該ノードAからの唯一の遷移に対応する識別符
号に対応付けて記号列トライ構造に格納された区切済記
号列と、当該ノードBに格納されていた部分記号列と、
を、連結したものであり、当該ノードCに格納される遷
移表は、当該ノードBに格納されていた遷移表である。
In addition, when the transition destination stored in the transition table of a node A in the identification code trie structure is only one of the nodes B and a predetermined replacement condition is satisfied, the identification code trie structure determines that the node A and the relevant node B are replaced by the node C, and the partial symbol string stored in the relevant node C becomes the partial symbol string stored in the relevant node A and the only transition from the relevant node A. A delimited symbol string stored in the symbol string trie structure in association with the corresponding identification code, a partial symbol string stored in the node B,
And the transition table stored in the node C is the transition table stored in the node B.

【0019】さらに、記号列トライ構造において所定の
削除条件が満たされた場合、記号列トライ構造は、これ
から、当該ノードAからの唯一の遷移に対応する識別符
号と、これに対応付けて格納された区切済記号列と、
を、削除したものである。
Further, when a predetermined deletion condition is satisfied in the symbol string trie structure, the symbol string trie structure is stored from now on in association with the identification code corresponding to the only transition from the node A concerned. Separated character strings,
Is deleted.

【0020】識別符号トライ構造において分岐が発生し
ないような部分識別記号列がある場合には、特定条件が
満たされる場合、具体的にはメモリ効率が向上すると予
想される場合に、当該部分識別記号列を「遷移に先立っ
てマッチすべき部分記号列」として採用することによ
り、識別符号トライ構造を最小接頭辞トライ構造に類す
る構造に構成するものである。これにより、さらにメモ
リ効率を向上させることができる。
When there is a partial identification symbol string in the identification code trie structure in which no branch occurs, when the specific condition is satisfied, specifically, when the memory efficiency is expected to improve, the partial identification symbol is concerned. By adopting a sequence as a "subsymbol sequence to be matched before transition", the identification code trie structure is constructed into a structure similar to the minimum prefix trie structure. Thereby, the memory efficiency can be further improved.

【0021】また、本発明のデータ構造において、所定
の種類の記号からなる記号列は、URL(Universal Re
source Locator)文字列であり、当該所定の区切記号
は、URL文字列の区切記号、特にスラッシュ記号であ
るように構成することができる。
Further, in the data structure of the present invention, a symbol string consisting of a predetermined type of symbol is a URL (Universal Res
source Locator) character string, and the predetermined delimiter can be configured to be a delimiter of the URL character string, particularly a slash mark.

【0022】これは、本発明の好適実施形態の一つであ
る。
This is one of the preferred embodiments of the present invention.

【0023】本発明の他の観点に係る登録装置は、所定
の種類の記号からなる記号列を格納する記号列トライ構
造と、所定の識別符号を格納する識別符号トライ構造
と、により、当該所定の種類の記号からなる記号列を格
納するデータ構造に、記号列を登録する登録装置であっ
て、区切部と、記号列格納部と、識別符号格納部と、を
備え、以下のように構成する。
A registration device according to another aspect of the present invention uses a symbol string trie structure that stores a symbol string consisting of a predetermined type of symbol and an identification code trie structure that stores a predetermined identification code. A registration device for registering a symbol string in a data structure for storing a symbol string consisting of symbols of the following types, which includes a partitioning part, a symbol string storage part, and an identification code storage part, and is configured as follows. To do.

【0024】すなわち、区切部は、当該データ構造に格
納されるべき記号列を所定の区切記号で区切って区切済
記号列の列を得る。
That is, the delimiter section delimits the symbol string to be stored in the data structure with a predetermined delimiter symbol to obtain a delimited symbol string sequence.

【0025】一方、記号列格納部は、区切られて得られ
た区切済記号列の列に含まれる区切済記号列のそれぞれ
を、異なる区切済記号列には異なる識別符号を対応付け
て、記号列トライ構造に、格納する。
On the other hand, the symbol string storage unit associates each of the delimited symbol strings included in the delimited symbol string obtained by delimiting with a different identification code to a different delimited symbol string, Store in a column trie structure.

【0026】さらに、識別符号格納部は、区切られて得
られた区切済記号列の列について、「これに含まれる区
切済記号列のそれぞれに対応付けられて記号列格納部に
より記号列トライ構造に格納された識別符号」の列を、
識別符号トライ構造に、格納する。
Further, the identification code storage unit stores a symbol string trie structure associated with each of the separated symbol sequences included in the sequence of the delimited symbol sequences obtained by the delimiter by the symbol sequence storage unit. The "identification code stored in
Store in the identification code trie structure.

【0027】本発明により、記号列が格納される辞書を
上記のデータ構造によって作成することができる。
According to the present invention, a dictionary in which symbol strings are stored can be created with the above data structure.

【0028】また、本発明の登録装置は、推測部をさら
に備えるように構成することができる。
Further, the registration device of the present invention can be configured so as to further include an estimation unit.

【0029】ここで、推測部は、置換条件が成立するか
否か、ならびに、削除条件が成立するか否かを推測す
る。
Here, the estimation unit estimates whether or not the replacement condition is satisfied and whether or not the deletion condition is satisfied.

【0030】一方、識別符号トライ構造は、識別符号
と、遷移先のノードと、を対応付けて格納する遷移表の
ほか、当該遷移に先立ってマッチすべき部分記号列を格
納することができる。
On the other hand, the identification code trie structure can store not only the transition table that stores the identification code and the node at the transition destination in association with each other, but also the partial symbol string to be matched prior to the transition.

【0031】さらに、識別符号格納部は、識別符号トラ
イ構造においてあるノードAの遷移表に格納された遷移
先がノードBの一つのみであり、置換条件が満たされる
と推測された場合、当該ノードAと当該ノードBとをノ
ードCに置き換えて格納し、当該ノードCに格納される
部分記号列は、当該ノードAに格納されていた部分記号
列と、当該ノードAからの唯一の遷移に対応する識別符
号に対応付けて記号列トライ構造に格納された区切済記
号列と、当該ノードBに格納されていた部分記号列と、
を、連結したものであり、当該ノードCに格納される遷
移表は、当該ノードBに格納されていた遷移表であり、
識別符号格納部による当該置き換えをするとした場合に
当該データ構造の大きさが小さくなる場合に、置換条件
は成立する。
Further, if the transition code stored in the transition table of the node A in the identification code trie structure is only one of the node B and it is estimated that the replacement condition is satisfied, the identification code storage unit stores the transition condition. The node A and the node B are replaced with the node C and stored, and the partial symbol string stored in the node C becomes the partial symbol string stored in the node A and the only transition from the node A. A delimited symbol string stored in the symbol string trie structure in association with the corresponding identification code, a partial symbol string stored in the node B,
And the transition table stored in the node C is the transition table stored in the node B.
When the size of the data structure is reduced when the replacement is performed by the identification code storage unit, the replacement condition is satisfied.

【0032】そして、記号列格納部は、記号列トライ構
造において削除条件が満たされると推測された場合、こ
れから、当該ノードAからの唯一の遷移に対応する識別
符号と、これに対応付けて格納された区切済記号列と、
を、削除し、記号列格納部による当該削除をするとした
場合に当該データ構造の大きさが小さくなる場合に、削
除条件は成立する。
When it is estimated that the deletion condition is satisfied in the symbol string trie structure, the symbol string storage unit stores the identification code corresponding to the only transition from the node A and the identification code corresponding thereto. The separated delimited symbol string,
Is deleted and the deletion is performed by the symbol string storage unit, the deletion condition is satisfied when the size of the data structure becomes small.

【0033】本発明により、識別記号トライ構造を最小
接頭辞トライに類する構造として構成し、メモリ効率が
向上すると推測される場合には、遷移を表現する木構造
により部分識別符号列を格納するのではなく、そのまま
部分識別符号列を「遷移に先立ってマッチすべき部分記
号列」として格納することにより、メモリ効率の向上を
図ることができる。
According to the present invention, the identification symbol trie structure is constructed as a structure similar to the minimum prefix trie, and when it is estimated that the memory efficiency is improved, the partial identification code string is stored by the tree structure expressing the transition. Instead, the partial identification code string is stored as it is as the “partial symbol string to be matched prior to the transition”, so that the memory efficiency can be improved.

【0034】また、本発明の登録装置において、所定の
種類の記号からなる記号列は、URL(Universal Reso
urce Locator)文字列であり、所定の区切記号は、UR
L文字列の区切記号、特にスラッシュ記号であるように
構成することができる。
Further, in the registration device of the present invention, a symbol string consisting of symbols of a predetermined type is URL (Universal Reso
urce Locator) character string, and the prescribed delimiter is UR
It can be configured to be a delimiter in the L string, especially a slash symbol.

【0035】本発明の他の観点に係る検索装置は、所定
の種類の記号からなる記号列を互いに重複しない所定の
識別符号に対応付けて格納する記号列トライ構造と、当
該所定の識別符号を格納する識別符号トライ構造と、に
より、当該所定の種類の記号からなる記号列を格納する
データ構造から、記号列を検索する検索装置であって、
区切部と、検索部と、を備え、以下のように構成する。
A retrieval apparatus according to another aspect of the present invention stores a symbol string trie structure in which a symbol string consisting of symbols of a predetermined type is stored in association with a predetermined identification code that does not overlap each other, and the predetermined identification code. An identification code trie structure to be stored, which is a search device for searching a symbol string from a data structure storing a symbol string composed of the predetermined type of symbol,
The partitioning section and the search section are provided and configured as follows.

【0036】すなわち、区切部は、検索対象となる記号
列を所定の記号で区切って区切済記号列の列を得る。
That is, the delimiter section delimits the symbol string to be searched by a predetermined symbol to obtain a delimited symbol string sequence.

【0037】一方、検索部は、区切られた結果の区切済
記号列の列に含まれる区切済記号列について、順に、 (a)当該区切済記号列が識別符号に対応付けて記号列
トライ構造に格納されていない場合、当該検索対象の記
号列は登録されていない旨を報告し、 (b)当該区切済記号列が識別符号に対応付けて記号列
トライ構造に格納されている場合、これまでに得られた
識別符号の列についで当該識別符号が識別符号トライ構
造に格納されていない場合、当該検索対象の記号列は登
録されていない旨を報告し、 (c)得られるすべての識別符号の列が識別符号トライ
構造に格納されている場合、当該検索対象の記号列は登
録されている旨を報告する。
On the other hand, the retrieval unit sequentially (a) associates the delimited symbol string with the identification code with respect to the delimited symbol string included in the column of the delimited symbol string as a result of the delimitation, and If it is not stored in the symbol string, it is reported that the symbol string to be searched is not registered. (B) If the delimited symbol string is stored in the symbol string trie structure in association with the identification code, If the identification code sequence obtained up to is not stored in the identification code trie structure, report that the symbol sequence to be searched is not registered, and (c) obtain all the identification numbers. When the code string is stored in the identification code trie structure, it reports that the symbol string to be searched is registered.

【0038】また、本発明の検索装置において、識別符
号トライ構造は、識別符号と、遷移先のノードと、を対
応付けて格納する遷移表のほか、当該遷移に先立ってマ
ッチすべき部分記号列を格納することができ、検索部
は、(a)〜(c)にかえて、以下の(p)〜(q)の
ように構成することができる。 (p)「当該区切済記号列が識別符号に対応付けて記号
列トライ構造に格納されておらず」、かつ、「これまで
に得られた識別符号もしくは接頭辞の列についで当該区
切済記号列が部分記号列として識別符号トライ構造に格
納されていない」場合、当該検索対象の記号列は登録さ
れていない旨を報告する。 (q)「当該区切済記号列が識別符号に対応付けて記号
列トライ構造に格納されており」、かつ、「これまでに
得られた識別符号もしくは接頭辞の列についで当該識別
符号による遷移先のノードが識別符号トライ構造に格納
されておらず」、かつ、「これまでに得られた識別符号
もしくは接頭辞の列についで当該区切済記号列が部分記
号列として識別符号トライ構造に格納されていない」場
合、当該検索対象の記号列は登録されていない旨を報告
する。 (r)得られるすべての識別符号もしくは部分記号列の
列が、識別符号トライ構造に格納されている場合、当該
検索対象の記号列は登録されている旨を報告する。
Further, in the retrieval apparatus of the present invention, the identification code trie structure has a transition table which stores the identification code and the node at the transition destination in association with each other, and a partial symbol string to be matched prior to the transition. Can be stored, and the search unit can be configured as in the following (p) to (q) instead of (a) to (c). (P) “The delimited symbol string is not stored in the symbol string trie structure in association with the identification code”, and “the delimited symbol is obtained after the sequence of the identification code or the prefix obtained so far. If the string is not stored as a partial symbol string in the identification code trie structure ”, it reports that the symbol string to be searched is not registered. (Q) “The delimited symbol string is stored in the symbol string trie structure in association with the identification code”, and “the sequence of the identification code or the prefix obtained so far is followed by the identification code. The previous node is not stored in the identification code trie structure ", and" the delimited symbol string is stored in the identification code trie structure as a partial symbol string after the sequence of the identification code or prefix obtained so far. If not ”, it reports that the symbol string to be searched is not registered. (R) If all the obtained identification codes or partial symbol string sequences are stored in the identification code trie structure, report that the symbol string to be searched is registered.

【0039】これらの検索装置により、記号列が上記の
データ構造に登録されているか否かを高速に調べること
ができる。
With these search devices, it is possible to quickly check whether or not the symbol string is registered in the above data structure.

【0040】本発明の他の観点に係る登録方法は、所定
の種類の記号からなる記号列を格納する記号列トライ構
造と、所定の識別符号を格納する識別符号トライ構造
と、により、当該所定の種類の記号からなる記号列を格
納するデータ構造に、記号列を登録する登録方法であっ
て、区切工程と、記号列格納工程と、識別符号格納工程
と、を備え、以下のように構成する。
A registration method according to another aspect of the present invention uses a symbol string trie structure that stores a symbol string composed of a predetermined type of symbol and an identification code trie structure that stores a predetermined identification code. A registration method for registering a symbol string in a data structure for storing a symbol string consisting of symbols of the following types, which includes a partitioning step, a symbol string storing step, and an identification code storing step, and is configured as follows. To do.

【0041】すなわち、区切工程では、当該データ構造
に格納されるべき記号列を所定の区切記号で区切って区
切済記号列の列を得る。
That is, in the delimitation step, the symbol string to be stored in the data structure is delimited by a predetermined delimiter symbol to obtain a delimited symbol string sequence.

【0042】一方、記号列格納工程では、区切られて得
られた区切済記号列の列に含まれる区切済記号列のそれ
ぞれを、異なる区切済記号列には異なる識別符号を対応
付けて、記号列トライ構造に、格納する。
On the other hand, in the symbol string storing step, each of the delimited symbol strings included in the delimited symbol string obtained by the delimitation is associated with a different identification code to a different delimited symbol string, Store in a column trie structure.

【0043】さらに、識別符号格納工程では、区切られ
て得られた区切済記号列の列について、「これに含まれ
る区切済記号列のそれぞれに対応付けられて記号列格納
工程にて記号列トライ構造に格納された識別符号」の列
を、識別符号トライ構造に、格納する。
Further, in the identification code storing step, regarding the sequence of the delimited symbol strings obtained by delimitation, the symbol string tries are associated with each of the delimited symbol strings included in the delimited symbol string in the symbol string storing step. The “identification code stored in the structure” column is stored in the identification code trie structure.

【0044】また、本発明の登録方法において、推測工
程をさらに備え、以下のように構成することができる。
Further, the registration method of the present invention can further comprise an inference step, and can be configured as follows.

【0045】すなわち、推測工程では、置換条件が成立
するか否か、ならびに、削除条件が成立するか否かを推
測する。
That is, in the estimation step, it is estimated whether or not the replacement condition is satisfied and whether or not the deletion condition is satisfied.

【0046】一方、識別符号トライ構造は、識別符号
と、遷移先のノードと、を対応付けて格納する遷移表の
ほか、当該遷移に先立ってマッチすべき部分記号列を格
納することができる。
On the other hand, the identification code trie structure can store not only the transition table that stores the identification code and the node of the transition destination in association with each other, but also the partial symbol string to be matched prior to the transition.

【0047】さらに、識別符号格納工程では、識別符号
トライ構造においてあるノードAの遷移表に格納された
遷移先がノードBの一つのみであり、置換条件が満たさ
れると推測された場合、当該ノードAと当該ノードBと
をノードCに置き換えて格納し、当該ノードCに格納さ
れる部分記号列は、当該ノードAに格納されていた部分
記号列と、当該ノードAからの唯一の遷移に対応する識
別符号に対応付けて記号列トライ構造に格納された区切
済記号列と、当該ノードBに格納されていた部分記号列
と、を、連結したものであり、当該ノードCに格納され
る遷移表は、当該ノードBに格納されていた遷移表であ
り、識別符号格納工程にて当該置き換えをするとした場
合に当該データ構造の大きさが小さくなる場合に、置換
条件は成立する。
Furthermore, in the identification code storing step, when it is estimated that the transition condition stored in the transition table of the node A in the identification code trie structure is only one of the nodes B and the replacement condition is satisfied, The node A and the node B are replaced with the node C and stored, and the partial symbol string stored in the node C becomes the partial symbol string stored in the node A and the only transition from the node A. The delimited symbol string stored in the symbol string trie structure in association with the corresponding identification code is a concatenation of the partial symbol string stored in the node B and is stored in the node C. The transition table is the transition table stored in the node B, and the replacement condition is satisfied when the size of the data structure is reduced when the replacement is performed in the identification code storage step.

【0048】さらに、記号列格納工程では、記号列トラ
イ構造において削除条件が満たされると推測された場
合、これから、当該ノードAからの唯一の遷移に対応す
る識別符号と、これに対応付けて格納された区切済記号
列と、を、削除し、記号列格納工程にて当該削除をする
とした場合に当該データ構造の大きさが小さくなる場合
に、削除条件は成立する。
Further, in the symbol string storing step, when it is estimated that the deletion condition is satisfied in the symbol string trie structure, the identification code corresponding to the only transition from the node A and the associated identification code are stored. If the deleted delimited symbol string is deleted and the deletion is performed in the symbol string storing step, and the size of the data structure becomes small, the deletion condition is satisfied.

【0049】本発明の他の観点に係る検索方法は、所定
の種類の記号からなる記号列を互いに重複しない所定の
識別符号に対応付けて格納する記号列トライ構造と、当
該所定の識別符号を格納する識別符号トライ構造と、に
より、当該所定の種類の記号からなる記号列を格納する
データ構造から、記号列を検索する検索方法であって、
区切工程と、検索工程と、を備え、以下のように構成す
る。
A search method according to another aspect of the present invention is a symbol string trie structure in which symbol strings composed of symbols of a predetermined type are stored in association with a predetermined identification code that does not overlap with each other, and the predetermined identification code. An identification code trie structure to be stored is a retrieval method for retrieving a symbol string from a data structure storing a symbol string consisting of the predetermined type of symbol,
A partitioning process and a searching process are provided and configured as follows.

【0050】すなわち、区切工程では、検索対象となる
記号列を所定の記号で区切って区切済記号列の列を得
る。
That is, in the delimitation step, the symbol string to be searched is delimited by a predetermined symbol to obtain a delimited symbol string sequence.

【0051】一方、検索工程では、区切られた結果の区
切済記号列の列に含まれる区切済記号列について、順
に、 (a)当該区切済記号列が識別符号に対応付けて記号列
トライ構造に格納されていない場合、当該検索対象の記
号列は登録されていない旨を報告し、 (b)当該区切済記号列が識別符号に対応付けて記号列
トライ構造に格納されている場合、これまでに得られた
識別符号の列についで当該識別符号が識別符号トライ構
造に格納されていない場合、当該検索対象の記号列は登
録されていない旨を報告し、 (c)得られるすべての識別符号の列が識別符号トライ
構造に格納されている場合、当該検索対象の記号列は登
録されている旨を報告する。
On the other hand, in the search step, for the delimited symbol strings included in the delimited symbol string sequence of the delimited result, (a) the delimited symbol string is associated with the identification code, and the symbol string trie structure is associated. If it is not stored in the symbol string, it is reported that the symbol string to be searched is not registered. (B) If the delimited symbol string is stored in the symbol string trie structure in association with the identification code, If the identification code sequence obtained up to is not stored in the identification code trie structure, report that the symbol sequence to be searched is not registered, and (c) obtain all the identification numbers. When the code string is stored in the identification code trie structure, it reports that the symbol string to be searched is registered.

【0052】また、本発明の検索方法において、識別符
号トライ構造は、識別符号と、遷移先のノードと、を対
応付けて格納する遷移表のほか、当該遷移に先立ってマ
ッチすべき部分記号列を格納することができ、検索工程
では、(a)〜(c)にかえて、以下の(p)〜(q)
のように構成することができる。 (p)「当該区切済記号列が識別符号に対応付けて記号
列トライ構造に格納されておらず」、かつ、「これまで
に得られた識別符号もしくは接頭辞の列についで当該区
切済記号列が部分記号列として識別符号トライ構造に格
納されていない」場合、当該検索対象の記号列は登録さ
れていない旨を報告する。 (q)「当該区切済記号列が識別符号に対応付けて記号
列トライ構造に格納されており」、かつ、「これまでに
得られた識別符号もしくは接頭辞の列についで当該識別
符号による遷移先のノードが識別符号トライ構造に格納
されておらず」、かつ、「これまでに得られた識別符号
もしくは接頭辞の列についで当該区切済記号列が部分記
号列として識別符号トライ構造に格納されていない」場
合、当該検索対象の記号列は登録されていない旨を報告
する。 (r)得られるすべての識別符号もしくは部分記号列の
列が、識別符号トライ構造に格納されている場合、当該
検索対象の記号列は登録されている旨を報告する。
Further, in the search method of the present invention, the identification code trie structure includes a transition table that stores the identification code and the node of the transition destination in association with each other, and a partial symbol string to be matched prior to the transition. Can be stored, and in the search step, instead of (a) to (c), the following (p) to (q)
Can be configured as follows. (P) “The delimited symbol string is not stored in the symbol string trie structure in association with the identification code”, and “the delimited symbol is obtained after the sequence of the identification code or the prefix obtained so far. If the string is not stored as a partial symbol string in the identification code trie structure ”, it reports that the symbol string to be searched is not registered. (Q) “The delimited symbol string is stored in the symbol string trie structure in association with the identification code”, and “the sequence of the identification code or the prefix obtained so far is followed by the identification code. The previous node is not stored in the identification code trie structure ", and" the delimited symbol string is stored in the identification code trie structure as a partial symbol string after the sequence of the identification code or prefix obtained so far. If not ”, it reports that the symbol string to be searched is not registered. (R) If all the obtained identification codes or partial symbol string sequences are stored in the identification code trie structure, report that the symbol string to be searched is registered.

【0053】本発明の他の観点に係るプログラムは、コ
ンピュータを、上記の登録装置、もしくは、検索装置、
として機能させ、あるいは、コンピュータに、上記の登
録方法、もしくは、検索方法を実行させるように構成す
る。
A program according to another aspect of the present invention is a computer, which uses the above registration device or search device,
Alternatively, the computer is configured to execute the above registration method or search method.

【0054】上記のプログラムや、上記のデータ構造
は、CD−ROMやFDなどの各種の記録媒体に記録す
ることができるほか、インターネットなどのコンピュー
タ通信網を介して配布することができる。
The above program and the above data structure can be recorded in various recording media such as CD-ROM and FD, and can be distributed via a computer communication network such as the Internet.

【0055】[0055]

【発明の実施の形態】以下、添付図面を参照して、本発
明の実施の形態について説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of the present invention will be described below with reference to the accompanying drawings.

【0056】(情報処理装置の概要構成)図1は、本発
明のデータ構造が記録された記録媒体を処理して、本発
明の登録装置ならびに検索装置として機能しうる典型的
な情報処理装置の概要構成を示す模式図である。以下、
図1を参照して説明する。
(Schematic Configuration of Information Processing Apparatus) FIG. 1 shows a typical information processing apparatus capable of processing a recording medium in which the data structure of the present invention is recorded and functioning as a registration apparatus and a retrieval apparatus of the present invention. It is a schematic diagram which shows a schematic structure. Less than,
This will be described with reference to FIG.

【0057】情報処理装置101は、CPU(Central
Processing Unit;中央処理ユニット)102によって
制御される。情報処理装置101に電源を投入すると、
CPU102は、ROM103に記憶されたIPL(In
itial Program Loader;初期プログラムローダ)を実行
する。
The information processing apparatus 101 has a CPU (Central
Processing Unit (Central Processing Unit) 102. When the information processing apparatus 101 is powered on,
The CPU 102 uses the IPL (In
Execute the itial Program Loader (initial program loader).

【0058】IPLは、ハードディスク104、FDド
ライブ110に装着されたFD、CD−ROMドライブ
111に装着されたCD−ROMなどの記録媒体に記憶
されたOS(Operating System;オペレーティング・シ
ステム)プログラムを読み出して実行するプログラムで
ある。
The IPL reads an OS (Operating System) program stored in a recording medium such as the hard disk 104, the FD installed in the FD drive 110, and the CD-ROM installed in the CD-ROM drive 111. It is a program to be executed.

【0059】OSを起動した後、CPU102は、キー
ボード105やマウス106などにより入力されたユー
ザの指示にしたがって、あるいは、ハードディスクなど
にあらかじめ記述された設定ファイルの内容にしたがっ
て、ハードディスクなどに記憶されたアプリケーション
プログラムを実行する。
After booting the OS, the CPU 102 is stored in the hard disk or the like according to a user's instruction input through the keyboard 105 or the mouse 106 or according to the contents of a setting file previously described in the hard disk or the like. Run the application program.

【0060】当該アプリケーションプログラムを実行す
ることにより、情報処理装置101は、記号列検索装置
ならびに記号列格納装置として機能することとなる。ハ
ードディスク104、FDドライブ110に装着された
FD、CD−ROMドライブ111に装着されたCD−
ROMなど記憶媒体に、本発明のミニマルトライデータ
構造が記録されることになる。なお、情報処理装置10
1が記号列格納装置として機能する場合には、当該記憶
媒体は書き込みが可能である必要があるため、CD−R
OMを利用することはできない。
By executing the application program, the information processing device 101 functions as a symbol string search device and a symbol string storage device. Hard disk 104, FD mounted in FD drive 110, CD-mounted in CD-ROM drive 111
The minimal trial data structure of the present invention will be recorded in a storage medium such as a ROM. The information processing device 10
If the storage medium 1 functions as a symbol string storage device, the storage medium must be writable, so that the CD-R
OM cannot be used.

【0061】CPU102は、これらのプログラムの実
行の際に、RAM107を一時的な作業用記憶領域とし
て用いる。このほか、一時的な作業用記憶領域として、
CPU102内に設けられたレジスタやキャッシュ(図
示せず)が使われる。
The CPU 102 uses the RAM 107 as a temporary work storage area when executing these programs. In addition, as a temporary work storage area,
A register or cache (not shown) provided in the CPU 102 is used.

【0062】プログラムの実行に伴ない、ユーザに結果
を報告したり、途中経過を見せるため、CPU102
は、液晶ディスプレイやCRT(Cathode Ray Tube)な
どの表示装置108に当該情報を表示することができ
る。マウス106による指示操作では、マウス106を
移動することにより、画面に表示されたカーソルが移動
し、マウス106をクリックすることにより、カーソル
が指すメニュー項目を選択することができる。
In order to report the result to the user and show the progress along with the execution of the program, the CPU 102
Can display the information on a display device 108 such as a liquid crystal display or a CRT (Cathode Ray Tube). In the instruction operation by the mouse 106, the cursor displayed on the screen is moved by moving the mouse 106, and the menu item pointed by the cursor can be selected by clicking the mouse 106.

【0063】情報処理装置101は、NIC(Network
Interface Card)やモデムなどのインターフェース10
9を介してインターネットなどのコンピュータ通信網と
通信を行うことができる。インターフェース109を介
して受信した文書データを処理の対象としたり、処理し
た結果をインターフェース109を介して送信したり、
インターフェース109を介して受信したプログラムを
実行したり、などができる。
The information processing apparatus 101 has a NIC (Network
Interface card, interface such as modem 10
9 can communicate with a computer communication network such as the Internet. The document data received via the interface 109 is processed, the processed result is transmitted via the interface 109,
The program received via the interface 109 can be executed and so on.

【0064】(データ構造)図2は、本発明の実施形態
に係るデータ構造の概念的な概要構成を示す模式図であ
る。以下、本図を参照して説明する。
(Data Structure) FIG. 2 is a schematic diagram showing a conceptual schematic structure of the data structure according to the embodiment of the present invention. Hereinafter, description will be given with reference to this figure.

【0065】記号列を格納するデータ構造201は、記
号列トライ構造202と、識別符号トライ構造203
と、を有する。
A data structure 201 for storing a symbol string has a symbol string trie structure 202 and an identification code trie structure 203.
And.

【0066】記号列204が当該データ構造201に格
納される場合には、まず、当該記号列204を所定の区
切記号により区切った区切済記号列205のそれぞれが
記号列トライ構造202に格納される。
When the symbol string 204 is stored in the data structure 201, each of the delimited symbol strings 205 obtained by dividing the symbol string 204 by a predetermined delimiter is first stored in the symbol string trie structure 202. .

【0067】記号列トライ構造202は、区切済記号列
205と、その識別符号(異なる区切済記号列205に
は異なる識別符号)と、を対応付けて格納するトライ構
造である。
The symbol string trie structure 202 is a trie structure for storing the delimited symbol string 205 and its identification code (different identification code for different delimited symbol strings 205) in association with each other.

【0068】記号列トライ構造202としては、基本的
なトライ構造のほか、最小接頭辞トライ構造、ミニマル
トライ構造など、種々のトライ構造を採用することがで
きる。
As the symbol string trie structure 202, in addition to the basic trie structure, various trie structures such as a minimum prefix trie structure and a minimal trie structure can be adopted.

【0069】尚、記号列トライ構造202においては、
トライ構造にかえて、ハッシュデータ構造、完全ハッシ
ュデータ構造など、記号列とその識別符号とを対応付け
て格納・登録・検索できるような他のデータ構造を採用
してもよい。
In the symbol string trie structure 202,
Instead of the trie structure, another data structure such as a hash data structure or a complete hash data structure that can store, register, and retrieve a symbol string and its identification code in association with each other may be adopted.

【0070】区切済記号列205のそれぞれに対応付け
られた識別符号206を列にしたものが、識別符号トラ
イ構造203に格納される。識別符号トライ構造203
は、識別符号206の列と、元の記号列204全体の登
録ID(IDentifier)208と、を対応付けて格納する
ものである。
The identification code 206, which is associated with each of the delimited symbol strings 205, is stored in the identification code trie structure 203. Identification code trie structure 203
Stores the sequence of the identification code 206 and the registration ID (IDentifier) 208 of the entire original symbol sequence 204 in association with each other.

【0071】識別符号トライ構造203としても、最小
接頭辞トライ構造、ミニマルトライ構造など、種々のト
ライ構造を採用することができる。ただし、最小接頭辞
トライ構造を採用する場合には、以下のような構成にす
ることが望ましい。
As the identification code trie structure 203, various trie structures such as a minimum prefix trie structure and a minimal trie structure can be adopted. However, when adopting the minimum prefix trie structure, the following configuration is desirable.

【0072】すなわち、ある識別符号206の列が最小
接頭辞となる場合、当該識別符号206の列を最小接頭
辞としてそのまま識別符号トライ構造203のノードに
格納するのではなく、当該識別符号206の列に対応す
る区切済記号列205の部分記号列を識別符号トライ構
造203のノードに格納し、この部分記号列を当該ノー
ドに格納される遷移に先立ってマッチすべき部分記号列
として取り扱うのである。この際に、当該部分記号列に
含まれる区切済記号列205は、できるだけ記号列トラ
イ構造202には格納しない。
That is, when the sequence of a certain identification code 206 has the minimum prefix, the sequence of the identification code 206 is not stored as a minimum prefix in the node of the identification code trie structure 203 as it is, but the sequence of the identification code 206 is not stored. The partial symbol string of the separated symbol string 205 corresponding to the column is stored in the node of the identification code trie structure 203, and this partial symbol string is treated as the partial symbol string to be matched prior to the transition stored in the node. . At this time, the delimited symbol string 205 included in the partial symbol string is not stored in the symbol string trie structure 202 as much as possible.

【0073】このように、トライ構造を2段階にするこ
とにより、データ構造のサイズを小さくし、メモリ使用
効率を向上することができる。
As described above, since the trie structure has two stages, the size of the data structure can be reduced and the memory use efficiency can be improved.

【0074】このほか、一部については識別符号206
の列を「遷移に先立ってマッチすべき識別符号の列」と
してそのままノードに格納してもよい。この場合、当該
識別符号の列のそれぞれに対応する記号列を連結したも
のを、遷移に先立ってマッチすべき部分記号列として格
納した場合と等価である。これは、識別符号206の列
を展開して元に戻した部分記号列を遷移に先立ってマッ
チすべき部分記号列としてノードに格納する手法と同時
に利用することができる。このような実施形態も本発明
の範囲に含まれる。
In addition, the identification code 206 is used for a part of them.
May be stored in the node as it is as a “sequence of identification codes to be matched before transition”. In this case, it is equivalent to the case where the concatenation of the symbol strings corresponding to the respective strings of the identification code is stored as the partial symbol string to be matched prior to the transition. This can be used simultaneously with the technique of expanding the sequence of the identification code 206 and storing the restored partial symbol string in the node as a partial symbol string to be matched prior to the transition. Such embodiments are also included in the scope of the present invention.

【0075】(識別符号トライ構造の詳細)以下では、
識別符号トライ構造203として遷移に先立ってマッチ
すべき部分記号列を各ノードに格納できるような最小接
頭辞トライに類するデータ構造を採用した場合について
説明する。図3は、識別符号トライ構造203が有する
ノードの概要構成を示す模式図である。以下、本図を参
照しつつ説明する。
(Details of Identification Code Trie Structure) In the following,
A case will be described in which the identification code trie structure 203 adopts a data structure similar to the minimum prefix trie so that a partial symbol string to be matched before transition can be stored in each node. FIG. 3 is a schematic diagram showing a schematic configuration of a node included in the identification code trie structure 203. Hereinafter, description will be given with reference to this figure.

【0076】識別符号トライ構造203のノード301
は、以下の情報を格納する。
Node 301 of identification code trie structure 203
Stores the following information.

【0077】登録ID領域302は、元の記号列全体の
登録IDを格納する。典型的には、登録IDとして正の
整数を採用し、値0により当該ノードまでの遷移で終了
するような記号列が格納されていないことを表現する。
The registration ID area 302 stores the registration ID of the entire original symbol string. Typically, a positive integer is adopted as the registration ID, and a value of 0 represents that a symbol string that ends with a transition to the node is not stored.

【0078】なお、これらの符号を反転した値を以下に
説明するいずれかの領域に格納することにより、ノード
内の領域を共用してメモリ効率を向上することができ
る。
By storing a value obtained by inverting these signs in any of the areas described below, the area in the node can be shared and the memory efficiency can be improved.

【0079】部分記号列参照領域303は、そこまでの
遷移に継続する部分記号列(もしくはその文字列表現の
参照情報、典型的には文字列表現が記憶されるアドレス
と当該文字列の長さ)を格納する。
The partial symbol string reference area 303 includes a partial symbol string (or reference information of its character string representation, which is a reference to the character string representation, typically the address at which the character string representation is stored, and the length of the character string, which continues to that point. ) Is stored.

【0080】遷移先参照領域304は、識別符号206
と、当該識別符号206による遷移先ノードのアドレス
情報207と、を記憶する。
The transition destination reference area 304 has an identification code 206.
And the address information 207 of the transition destination node by the identification code 206.

【0081】一般のトライ構造では、記号の種類がw種
の場合は、遷移先ノードのアドレス情報をサイズwの配
列で表現して検索の高速化を図ることが多いが、本実施
形態では、識別符号206とアドレス情報207の対を
記憶することになる。当該ノード301に継続しうる識
別符号206がc種類の場合は、遷移先参照領域304
に記憶される対の数はc個になる。このc個の対をまと
めて「遷移表」と呼ぶ。
In the general trie structure, when the type of symbol is w, the address information of the transition destination node is often expressed by an array of size w to speed up the search. However, in the present embodiment, A pair of the identification code 206 and the address information 207 will be stored. If there are c types of identification codes 206 that can be continued in the node 301, the transition destination reference area 304
The number of pairs stored in will be c. The c pairs are collectively called a "transition table".

【0082】なお、識別符号206とアドレス情報20
7の対をまとめて記憶する領域を別途用意しておき、こ
こに対する参照情報をノード301に記憶するような実
施形態を採用してもよい。このような実施形態の様子を
図4に示す。
The identification code 206 and the address information 20
An embodiment may be adopted in which a region for collectively storing the 7 pairs is separately prepared and reference information for the region is stored in the node 301. The state of such an embodiment is shown in FIG.

【0083】図4に示す実施形態では、ノード301の
部分記号列参照領域303は、部分記号列が記憶されて
いる記号配列401内のアドレス(インデックス)と、
当該記号列の長さと、を格納する。遷移先参照領域30
4は、識別符号206と遷移先ノードのアドレス情報2
07の対が記憶されている対配列402内のアドレス
(インデックス)と、当該対の数と、を格納する。
In the embodiment shown in FIG. 4, the partial symbol string reference area 303 of the node 301 has an address (index) in the symbol array 401 in which the partial symbol string is stored.
The length of the symbol string is stored. Transition destination reference area 30
4 is the identification code 206 and the address information 2 of the transition destination node
The address (index) in the pair array 402 storing the 07 pairs and the number of the pairs are stored.

【0084】なお、元の記号列204内の部分記号列に
戻して部分記号列参照領域303に記憶するか、識別符
号206の列として展開したまま遷移先参照領域304
に記憶するか、は、後述するように、ある種の推測を行
うことによりメモリの使用効率が良いと予想される方を
選択して決定する。
The partial symbol sequence in the original symbol sequence 204 is restored and stored in the partial symbol sequence reference area 303, or the transition destination reference area 304 is expanded as a sequence of the identification code 206.
As will be described later, whether or not to store is determined by selecting one that is expected to have high memory usage efficiency by performing some kind of estimation.

【0085】(検索処理)図5は、本発明の実施形態に
係る検索装置の概要構成を示す模式図であり、図6は、
当該検索装置において実行される検索処理の流れを示す
フローチャートである。以下、これらの図を参照し、識
別符号トライ構造203として、上記図3や図4に示し
たノードを有する場合について説明する。
(Search Processing) FIG. 5 is a schematic diagram showing a schematic configuration of the search device according to the embodiment of the present invention, and FIG.
It is a flow chart which shows a flow of search processing performed in the search device concerned. Hereinafter, a case where the identification code trie structure 203 has the nodes shown in FIGS. 3 and 4 will be described with reference to these drawings.

【0086】検索装置501は、データ構造201を参
照し、当該データ構造201に記号列502が格納され
ているか否かを検索する。
The retrieval device 501 refers to the data structure 201 and retrieves whether or not the symbol string 502 is stored in the data structure 201.

【0087】まず、検索装置501の区切部503は、
記号列502を所定の区切記号で区切って区切済記号列
の列を得る(ステップS601)。データ構造201に
登録されている記号列がURL文字列である場合は、
「/」(スラッシュ記号)で区切ることが望ましい。
First, the partition section 503 of the search device 501
The symbol string 502 is delimited by a predetermined delimiter symbol to obtain a delimited symbol string sequence (step S601). If the symbol string registered in the data structure 201 is a URL character string,
It is desirable to separate by "/" (slash mark).

【0088】たとえば、記号列502としてURL文字
列「http://www.justsystem.co.jp/cgi-bin/version/20
01/09/28/10/24/search.cgi」を採用した場合には、区
切済記号列は、「http:」「」「www.justsystem.co.j
p」「cgi-bin」「version」「2001」「09」「28」「1
0」「24」「search.cgi」となる。
For example, as the symbol string 502, the URL character string "http://www.justsystem.co.jp/cgi-bin/version/20" is used.
If you adopt "01/09/28/10/24 / search.cgi", the delimited symbol string is "http:""""www.justsystem.co.j
"p""cgi-bin""version""2001""09""28""1"
It will be 0, 24, and search.cgi.

【0089】一方、検索部504は、区切済記号列の列
を処理して、元の記号列502がデータ構造201に格
納されているか否かを調べる。
On the other hand, the search unit 504 processes the delimited symbol string sequence to check whether the original symbol string 502 is stored in the data structure 201.

【0090】具体的には、まず、識別符号トライ構造の
開始ノードを注目ノードに設定する(ステップS60
2)。
Specifically, first, the start node of the identification code trie structure is set as the target node (step S60).
2).

【0091】ついで、当該区切済記号列の列の先頭の区
切済記号列を注目記号列に設定する(ステップS60
3)。
Next, the delimited symbol string at the head of the delimited symbol string is set as the noticed symbol string (step S60).
3).

【0092】そして、注目記号列と、これに継続する区
切済記号列の列と、が、注目ノードの部分記号列参照領
域303に格納されている記号列とマッチするか否かを
調べる(ステップS604)。上記の例で考えると、注
目記号列が「2001」であり、部分記号列参照領域303
に「2001/09/20/10/24」が格納されている場合、「200
1」「09」「20」「10」「24」がマッチすることにな
る。
Then, it is checked whether or not the symbol string of interest and the sequence of the delimited symbol strings that follow the symbol string match the symbol string stored in the partial symbol string reference area 303 of the node of interest (step S604). Considering the example above, the symbol string of interest is “2001”, and the partial symbol string reference area 303
If "2001/09/20/10/24" is stored in,
"1", "09", "20", "10", "24" will match.

【0093】具体的には、以下のように考える。注目記
号列と、これに継続する区切済記号列の列と、を順に区
切記号で接続してできる記号列は、以下のようになる。 「2001」 「2001/09」 「2001/09/28」 「2001/09/28/10」 「2001/09/28/10/24」 「2001/09/28/10/24/search.cgi」
Specifically, the following is considered. The following is a symbol string that can be formed by connecting the symbol string of interest and the sequence of delimited symbol strings that follow it with delimiter symbols in order. "2001""2001/09""2001/09/28""2001/09/28/10""2001/09/28/10/24""2001/09/28/10/24 / search.cgi"

【0094】これらのうちに、部分記号列参照領域30
3に格納されている記号列(本例では「2001/09/28/10/
24」)と一致するものがある場合にマッチが成功する。
Among these, the partial symbol string reference area 30
The symbol string stored in 3 (in this example, "2001/09/28/10 /
The match succeeds if there is a match with 24 ").

【0095】一致するものがない場合、すなわち、順に
接続していった途中で異なる記号が見つかった場合や、
記号列の長さが整合しない場合は、マッチは失敗するこ
とになる。
When there is no match, that is, when a different symbol is found in the course of connecting in sequence,
If the string lengths do not match, the match will fail.

【0096】また、当該ノードの部分記号列参照領域3
03に記号列が格納されていない場合もマッチは失敗す
る。
The partial symbol string reference area 3 of the node
The match also fails if the symbol string is not stored in 03.

【0097】マッチする場合(ステップS604;Ye
s)、マッチした範囲の区切済記号列の次の区切済記号
列が残っているか否かを調べる(ステップS605)。
本例では、区切済記号列「search.cgi」が残っている。
In case of a match (step S604; Ye)
s), it is checked whether or not there is a delimited symbol string next to the delimited symbol string in the matched range (step S605).
In this example, the separated symbol string "search.cgi" remains.

【0098】残っている場合(ステップS605;Ye
s)、当該次の区切済記号列を注目記号列に設定し(ス
テップS606)、注目記号列が記号列トライ構造20
2に登録されているか否かを調べる(ステップS60
7)。登録されていない場合(ステップS607;N
o)、検索結果を「未登録」として(ステップS62
1)、本処理を終了する。本実施形態では、検索結果と
して、値0を返すことになる。
If there is any left (step S605; Yes)
s), the next delimited symbol string is set as the symbol string of interest (step S606), and the symbol string of interest is the symbol string trie structure 20.
Check whether it is registered in No. 2 (step S60
7). If not registered (step S607; N)
o), the search result is set as "unregistered" (step S62).
1) and this process is completed. In this embodiment, the value 0 is returned as the search result.

【0099】一方、登録されている場合(ステップS6
07;Yes)、当該注目記号列の識別符号を取得して
(ステップS608)、注目ノードの遷移先参照領域3
04に当該識別符号が格納されているか否かを調べる
(ステップS609)。格納されていない場合(ステッ
プS609;No)、ステップS621に進む。この場
合は、「未登録」ということになる。
On the other hand, if registered (step S6)
07; Yes), the identification code of the target symbol string is acquired (step S608), and the transition destination reference region 3 of the target node is acquired.
It is checked whether or not the identification code is stored in 04 (step S609). If not stored (step S609; No), the process proceeds to step S621. In this case, it means “unregistered”.

【0100】格納されている場合(ステップS609;
Yes)、当該識別符号に対応付けられた遷移先ノード
を取得し(ステップS610)、これを注目ノードに設
定して(ステップS611)、未処理の区切済記号列が
残っているか否かを調べ(ステップS612)、残って
いれば(ステップS612;Yes)、次の区切済記号
列を注目記号列に設定し(ステップS613)、ステッ
プS604に戻る。
If it is stored (step S609;
Yes), the transition destination node associated with the identification code is acquired (step S610), this is set as the attention node (step S611), and it is checked whether or not an unprocessed delimited symbol string remains. (Step S612), if there is any remaining (Step S612; Yes), the next delimited symbol string is set as the focused symbol string (Step S613), and the process returns to Step S604.

【0101】未処理の区切済記号列が残っていない場合
(ステップS612;No)、注目ノードの登録ID領
域302に格納されている値を取得し(ステップS61
4)、取得した値を検索結果として(ステップS61
5)、本処理を終了する。本実施形態では、登録ID領
域302に正整数が格納されていれば、当該記号列50
2がデータ構造201に登録されていることになり、0
が格納されていれば、当該記号列502はデータ構造2
01に登録されていないことになる。
When no unprocessed delimited symbol string remains (step S612; No), the value stored in the registration ID area 302 of the target node is acquired (step S61).
4) The acquired value is used as the search result (step S61).
5) Then, this process ends. In the present embodiment, if a positive integer is stored in the registration ID area 302, the symbol string 50
2 is registered in the data structure 201, and 0
Is stored, the symbol string 502 has the data structure 2
It means that it is not registered in 01.

【0102】一方、マッチしない場合(ステップS60
4;No)、ステップS607に進む。
On the other hand, if there is no match (step S60)
4; No), and proceeds to step S607.

【0103】一方、残っていない場合(ステップS60
5;No)、ステップS614に進む。
On the other hand, when there is no remaining (step S60
5; No), and proceeds to step S614.

【0104】このような処理を行うことにより、データ
構造のメモリ効率を向上させる一方で、従来のトライ構
造と同様の高速な検索が可能になる。
By performing such processing, the memory efficiency of the data structure is improved, while the high-speed search similar to the conventional trie structure is possible.

【0105】なお、上記処理から部分記号列参照領域3
03とのマッチの処理を除けば、識別符号トライ構造2
03を基本的なトライ構造として構成した場合の検索処
理が実現できる。
From the above processing, the partial symbol string reference area 3
Except for the process of matching with 03, the identification code trie structure 2
A search process can be realized when 03 is configured as a basic trie structure.

【0106】(登録処理)以下では、上記のデータ構造
201を実現するための登録処理の一実施形態について
説明する。図7は、一実施形態に係る登録処理の流れを
示すフローチャートである。
(Registration Processing) An embodiment of registration processing for realizing the above data structure 201 will be described below. FIG. 7 is a flowchart showing the flow of registration processing according to the embodiment.

【0107】最初に、登録すべき記号列のすべてについ
て、順に以下の処理(ステップS702〜S705)を
繰り返して実行する(ステップS701)。
First, the following processes (steps S702 to S705) are sequentially repeated for all of the symbol strings to be registered (step S701).

【0108】すなわち、まず、当該記号列を所定の区切
記号で区切って、区切済記号列の列を得る(ステップS
702)。
That is, first, the symbol string is delimited by a predetermined delimiter symbol to obtain a delimited symbol string sequence (step S).
702).

【0109】次に、当該区切済記号列の列に含まれる区
切済記号列のすべてについて、順に以下の処理(ステッ
プS704〜S705)を繰り返して実行する(ステッ
プS703)。
Next, the following processes (steps S704 to S705) are sequentially repeated for all of the delimited symbol strings included in the column of the delimited symbol string (step S703).

【0110】すなわち、当該区切済記号列を記号列トラ
イ構造202に登録する(ステップS704)。
That is, the delimited symbol string is registered in the symbol string trie structure 202 (step S704).

【0111】そして、当該区切済記号列に対応する識別
符号を取得する(ステップS705)。
Then, the identification code corresponding to the delimited symbol string is obtained (step S705).

【0112】ついで、ステップS705で順に得られた
識別符号を列とし、当該識別符号の列を、識別符号トラ
イ構造203に、各ノードの部分記号列参照領域303
を空文字列にしたまま登録する(ステップS706)。
Next, the identification codes sequentially obtained in step S705 are used as a sequence, and the sequence of the identification code is stored in the identification code trie structure 203 in the partial symbol sequence reference area 303 of each node.
Is registered as an empty character string (step S706).

【0113】このようにして、登録すべき記号列の最も
簡単な登録が完了する。さらに、以下の処理により、デ
ータ構造201のメモリ使用効率の向上を図る。
Thus, the simplest registration of the symbol string to be registered is completed. Further, the following processing will improve the memory usage efficiency of the data structure 201.

【0114】すなわち、識別符号トライ構造203内を
調べ、遷移先が1つしかないノードで以下の処理(ステ
ップS712〜S715)で未処理のものを探す(ステ
ップS711)。見つかった場合(ステップS711;
Yes)、理解を容易にするため、このノードをAと、
さらにノードAからの遷移先ノードをBと、それぞれ呼
ぶこととする。
That is, the inside of the identification code trie structure 203 is examined, and an unprocessed node is searched for in a node having only one transition destination (steps S712 to S715) (step S711). If found (step S711;
Yes), to make it easier to understand, call this node A,
Further, the transition destination node from the node A will be referred to as B, respectively.

【0115】ノードAとノードBを、以下のようなノー
ドCにまとめることにより置換することを考える。 ・ノードCに格納される部分記号列は、「ノードAに格
納されていた部分記号列」と、「ノードAからの唯一の
遷移に対応する識別符号に対応付けて記号列トライ構造
に格納された区切済記号列」と、「ノードBに格納され
ていた部分記号列」と、を、連結したものである。 ・ノードCに格納される遷移表は、ノードBに格納され
ていた遷移表である。
Consider replacing node A and node B by grouping them into node C as follows. The partial symbol string stored in the node C is stored in the symbol string trie structure in association with “the partial symbol string stored in the node A” and “the identification code corresponding to the only transition from the node A”. The “separated symbol string” and the “partial symbol string stored in the node B” are concatenated. The transition table stored in the node C is the transition table stored in the node B.

【0116】そして、このような置換によりメモリの使
用効率が良くなる(以下、適宜「置換条件が成立する」
という。)か否かを推測する(ステップS712)。
Then, such a replacement improves the efficiency of use of the memory (hereinafter, "the replacement condition is appropriately satisfied").
Say. ) Or not (step S712).

【0117】置換条件が成立しないと推測された場合
(ステップS712;No)、ノードAに対する処理は
終了する。
When it is estimated that the replacement condition is not satisfied (step S712; No), the process for node A ends.

【0118】置換条件が成立すると推測された場合(ス
テップS712;Yes)、ノードAとノードBをノー
ドCで置換する(ステップS713)。
When it is estimated that the replacement condition is satisfied (step S712; Yes), the node A and the node B are replaced by the node C (step S713).

【0119】さらに、このような置換をするとノードA
からノードBへの唯一の遷移に対応する識別符号の登録
が不要になる場合がある。このように、識別符号の登録
が不要である場合に、記号列トライ構造202から当該
識別符号の登録を削除することを考え、このような削除
により、メモリの使用効率が良くなる(以下、適宜「削
除条件が成立する」という。)か否かを推測する(ステ
ップS714)。
Furthermore, if such replacement is performed, node A
It may be unnecessary to register the identification code corresponding to the only transition from the node to the node B. As described above, when the registration of the identification code is unnecessary, the registration of the identification code may be deleted from the symbol string trie structure 202, and such deletion improves the memory use efficiency (hereinafter, as appropriate. It is inferred whether or not "the deletion condition is satisfied") (step S714).

【0120】削除条件が成立しないと推測された場合
(ステップS714;No)、ノードAに対する処理は
終了する。
When it is estimated that the deletion condition is not satisfied (step S714; No), the process for node A ends.

【0121】削除条件が成立すると推測された場合(ス
テップS714;Yes)、当該識別符号とこれに対応
する区切済記号列とを、記号列トライ構造202から削
除して(ステップS715)、ノードAに対する処理は
終了する。
When it is estimated that the deletion condition is satisfied (step S714; Yes), the identification code and the corresponding delimited symbol string are deleted from the symbol string trie structure 202 (step S715), and the node A is deleted. The process for is ended.

【0122】このようにして、データ構造201のメモ
リの使用効率を向上させる。これにて、登録処理を終了
してもよいが、さらに、図示するように、以下のような
後処理を行うことが望ましい。すなわち、上記のような
処理を行うと、記号列トライ構造202に登録される識
別符号の整数値がとびとびの値になってしまう。したが
って、これが連続値となるように、記号列トライ構造2
02内の識別符号の値と、識別符号トライ構造203内
の識別符号の値と、を付け替える(ステップS71
6)。
In this way, the use efficiency of the memory of the data structure 201 is improved. Although the registration process may be completed at this point, it is desirable to further perform the following post-process as shown in the drawing. That is, when the above-described processing is performed, the integer value of the identification code registered in the symbol string trie structure 202 becomes a discontinuous value. Therefore, so that this is a continuous value, the symbol string trie structure 2
The value of the identification code in 02 and the value of the identification code in the identification code trie structure 203 are replaced (step S71).
6).

【0123】ここでは理解を容易にするため、一旦すべ
ての記号列を単純に格納してからメモリの使用効率を向
上する手法について説明したが、記号列を登録しようと
するたびに置換条件や削除条件の成立を適宜推測して、
当該記号列内の部分記号列をどのように格納するかを判
別し、登録毎にメモリ使用効率を向上させるような態様
を採用することもできる。
Here, for ease of understanding, the method of simply storing all the symbol strings and then improving the memory usage efficiency has been described. However, the replacement condition or deletion is performed each time the symbol string is registered. Assuming that the conditions are met,
It is also possible to adopt a mode in which how to store a partial symbol string in the symbol string is determined and the memory usage efficiency is improved for each registration.

【0124】[0124]

【発明の効果】以上説明したように、本発明によれば、
記号列を効率良く格納し検索するのに好適なデータ構
造、登録装置、検索装置、登録方法、検索方法、ならび
に、これらをコンピュータに実現させるためのプログラ
ムを提供することができる。
As described above, according to the present invention,
It is possible to provide a data structure, a registration device, a search device, a registration method, a search method suitable for efficiently storing and searching a symbol string, and a program for causing a computer to realize these.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明のデータ構造を処理する典型的な情報処
理装置の概要構成を示す模式図である。
FIG. 1 is a schematic diagram showing a schematic configuration of a typical information processing apparatus that processes a data structure of the present invention.

【図2】本発明に係るデータ構造の概念的な概要構成を
示す模式図である。
FIG. 2 is a schematic diagram showing a conceptual schematic configuration of a data structure according to the present invention.

【図3】識別符号トライ構造中の各ノードの概念的な概
要構成を示す模式図である。
FIG. 3 is a schematic diagram showing a conceptual schematic configuration of each node in an identification code trie structure.

【図4】識別符号トライ構造中の各ノードの他の実施形
態の概要構成を示す模式図である。
FIG. 4 is a schematic diagram showing a schematic configuration of another embodiment of each node in the identification code trie structure.

【図5】検索装置の概要構成を示す模式図である。FIG. 5 is a schematic diagram showing a schematic configuration of a search device.

【図6】検索処理の処理の流れを示すフローチャートで
ある。
FIG. 6 is a flowchart showing a processing flow of search processing.

【図7】登録処理の処理の流れを示すフローチャートで
ある。
FIG. 7 is a flowchart showing a processing flow of registration processing.

【符号の説明】[Explanation of symbols]

101 情報処理装置 102 CPU 103 ROM 104 HD 105 キーボード 106 マウス 107 RAM 108 表示装置 109 インターフェース 110 FDドライブ 111 CD−ROMドライブ 201 データ構造 202 記号列トライ構造 203 識別符号トライ構造 204 記号列 205 区切済記号列 206 識別符号 207 アドレス情報 208 登録ID 301 ノード 302 登録ID領域 303 部分記号列参照領域 401 記号配列 402 対配列 501 検索装置 502 処理対象の記号列 503 区切部 504 検索部 101 Information processing device 102 CPU 103 ROM 104 HD 105 keyboard 106 mice 107 RAM 108 display device 109 interface 110 FD drive 111 CD-ROM drive 201 data structure 202 Symbol string trie structure 203 identification code trie structure 204 symbol string 205 Separated symbol string 206 identification code 207 Address information 208 Registration ID 301 node 302 registration ID area 303 Partial symbol string reference area 401 Symbol array 402 Pair array 501 search device 502 Symbol string to be processed 503 division 504 Search Department

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】所定の種類の記号からなる記号列を格納す
る記号列トライ構造と、所定の識別符号を格納する識別
符号トライ構造と、により、当該所定の種類の記号から
なる記号列を格納するデータ構造であって、 当該データ構造に格納されるべき記号列を所定の区切記
号で区切ると区切済記号列の列が得られる場合、 (a)前記記号列トライ構造は、当該区切済記号列のそ
れぞれを、異なる区切済記号列には異なる識別符号を対
応付けて、格納し、 (b)前記識別符号トライ構造は、当該区切済記号列の
列について、「これに含まれる区切済記号列のそれぞれ
に対応付けられて前記記号列トライ構造に格納される識
別符号」の列を、格納することを特徴とするもの。
1. A symbol string trie structure for storing a symbol string composed of a predetermined type of symbol and an identification code trie structure for storing a predetermined identification code store a symbol string composed of the predetermined type of symbol. In the case of a data structure to be stored, when a string of delimited symbols is obtained by delimiting a symbol string to be stored in the data structure with a predetermined delimiter, (a) the symbol string trie structure has the delimited symbol. Each of the columns is stored by associating a different identification code with a different delimited symbol string, and (b) the identification code trie structure describes “a delimited symbol included in the delimited symbol string as to the column of the delimited symbol string. A column of "identification code stored in the symbol string trie structure in association with each of the columns" is stored.
【請求項2】請求項1に記載のデータ構造であって、 前記識別符号トライ構造の各ノードは、識別符号と、遷
移先のノードと、を対応付けて格納する遷移表のほか、
当該遷移に先立ってマッチすべき部分記号列を格納する
ことができ、 前記識別符号トライ構造においてあるノードAの遷移表
に格納された遷移先がノードBの一つのみであり、所定
の置換条件が満たされた場合、前記識別符号トライ構造
は、当該ノードAと当該ノードBとをノードCに置き換
えたものであり、 当該ノードCに格納される部分記号列は、当該ノードA
に格納されていた部分記号列と、当該ノードAからの唯
一の遷移に対応する識別符号に対応付けて前記記号列ト
ライ構造に格納された区切済記号列と、当該ノードBに
格納されていた部分記号列と、を、連結したものであ
り、 当該ノードCに格納される遷移表は、当該ノードBに格
納されていた遷移表であり、 さらに前記記号列トライ構造において所定の削除条件が
満たされた場合、前記記号列トライ構造は、これから、
当該ノードAからの唯一の遷移に対応する識別符号と、
これに対応付けて格納された区切済記号列と、を、削除
したものであることを特徴とするもの。
2. The data structure according to claim 1, wherein each node of the identification code trie structure stores an identification code and a transition destination node in association with each other,
A partial symbol string to be matched can be stored prior to the transition, and only one node B is the transition destination stored in the transition table of the node A in the identification code trie structure, and the predetermined replacement condition is satisfied. Is satisfied, the identification code trie structure is obtained by replacing the node A and the node B with the node C, and the partial symbol string stored in the node C is the node A.
Stored in the node B, the delimited symbol string stored in the symbol string trie structure in association with the identification code corresponding to the only transition from the node A, and the partial symbol string stored in the node B. The transition table stored in the node C is a transition table stored in the node B, and a predetermined deletion condition is satisfied in the symbol string trie structure. If so, the symbol string trie structure is
An identification code corresponding to the only transition from the node A,
A character string in which the separated symbol string stored in association with this is deleted.
【請求項3】請求項1または2に記載のデータ構造であ
って、 前記所定の種類の記号からなる記号列は、URL(Univ
ersal Resource Locator)文字列であり、当該所定の区
切記号は、URL文字列の区切記号、特にスラッシュ記
号であることを特徴とするもの。
3. The data structure according to claim 1, wherein the symbol string composed of the symbols of the predetermined type is a URL (Univ
ersal Resource Locator) character string, and the predetermined delimiter is a delimiter of the URL character string, particularly a slash mark.
【請求項4】所定の種類の記号からなる記号列を格納す
る記号列トライ構造と、所定の識別符号を格納する識別
符号トライ構造と、により、当該所定の種類の記号から
なる記号列を格納するデータ構造に、記号列を登録する
登録装置であって、 当該データ構造に格納されるべき記号列を所定の区切記
号で区切って区切済記号列の列を得る区切部と、 前記区切られて得られた区切済記号列の列に含まれる区
切済記号列のそれぞれを、異なる区切済記号列には異な
る識別符号を対応付けて、前記記号列トライ構造に、格
納する記号列格納部と、 前記区切られて得られた区切済記号列の列について、
「これに含まれる区切済記号列のそれぞれに対応付けら
れて前記記号列格納部により前記記号列トライ構造に格
納された識別符号」の列を、前記識別符号トライ構造
に、格納する識別符号格納部と、を備えることを特徴と
するもの。
4. A symbol string trie structure for storing a symbol string of a predetermined type of symbol and an identification code trie structure for storing a predetermined identification code store a symbol string of the predetermined type of symbol. A registration device for registering a symbol string in a data structure, wherein the symbol string to be stored in the data structure is delimited by a predetermined delimiter to obtain a delimited symbol string sequence, Each of the separated symbol strings included in the column of the obtained separated symbol string, different identification code is associated with a different separated symbol string, in the symbol string trie structure, a symbol string storage unit to store, Regarding the column of the separated symbol string obtained by the separation,
An identification code storage for storing, in the identification code trie structure, a column of "identification code stored in the symbol string trie structure by the symbol string storage unit in association with each of the delimited symbol strings included therein" And a section.
【請求項5】請求項4に記載の登録装置であって、 置換条件が成立するか否か、ならびに、削除条件が成立
するか否かを推測する推測部をさらに備え、 (1)前記識別符号トライ構造は、識別符号と、遷移先
のノードと、を対応付けて格納する遷移表のほか、当該
遷移に先立ってマッチすべき部分記号列を格納すること
ができ、 (2)前記識別符号格納部は、前記識別符号トライ構造
においてあるノードAの遷移表に格納された遷移先がノ
ードBの一つのみであり、前記置換条件が満たされると
推測された場合、当該ノードAと当該ノードBとをノー
ドCに置き換えて格納し、 当該ノードCに格納される部分記号列は、当該ノードA
に格納されていた部分記号列と、当該ノードAからの唯
一の遷移に対応する識別符号に対応付けて前記記号列ト
ライ構造に格納された区切済記号列と、当該ノードBに
格納されていた部分記号列と、を、連結したものであ
り、 当該ノードCに格納される遷移表は、当該ノードBに格
納されていた遷移表であり、 前記識別符号格納部による当該置き換えをするとした場
合に当該データ構造の大きさが小さくなる場合に、前記
置換条件は成立し、 (3)前記記号列格納部は、前記記号列トライ構造にお
いて前記削除条件が満たされると推測された場合、これ
から、当該ノードAからの唯一の遷移に対応する識別符
号と、これに対応付けて格納された区切済記号列と、
を、削除し、 前記記号列格納部による当該削除をするとした場合に当
該データ構造の大きさが小さくなる場合に、前記削除条
件は成立することを特徴とするもの。
5. The registration device according to claim 4, further comprising: an inferring unit inferring whether or not a replacement condition is satisfied and whether or not a deletion condition is satisfied, (1) The identification The code trie structure can store not only a transition table that stores an identification code and a node of a transition destination in association with each other, but also a partial symbol string to be matched prior to the transition, (2) the identification code When it is estimated that the transition destination stored in the transition table of a node A in the identification code trie structure is only one of the nodes B and the replacement condition is satisfied, the storage unit stores the node A and the node. B and B are replaced and stored, and the partial symbol string stored in the node C is the node A
Stored in the node B, the delimited symbol string stored in the symbol string trie structure in association with the identification code corresponding to the only transition from the node A, and the partial symbol string stored in the node B. The partial symbol string and the partial symbol string are concatenated, and the transition table stored in the node C is the transition table stored in the node B. When the replacement by the identification code storage unit is performed, When the size of the data structure becomes small, the replacement condition is satisfied, and (3) when it is estimated that the deletion condition is satisfied in the symbol string trie structure, An identification code corresponding to the only transition from the node A, a delimited symbol string stored in association with this,
Is deleted, and the deletion is performed by the symbol string storage unit, the deletion condition is satisfied when the size of the data structure becomes small.
【請求項6】請求項4または5に記載の登録装置であっ
て、 前記所定の種類の記号からなる記号列は、URL(Univ
ersal Resource Locator)文字列であり、前記所定の区
切記号は、URL文字列の区切記号、特にスラッシュ記
号であることを特徴とするもの。
6. The registration device according to claim 4, wherein the symbol string composed of the symbols of the predetermined type is URL (Univ
ersal Resource Locator) character string, and the predetermined delimiter is a delimiter of a URL character string, particularly a slash mark.
【請求項7】所定の種類の記号からなる記号列を互いに
重複しない所定の識別符号に対応付けて格納する記号列
トライ構造と、当該所定の識別符号を格納する識別符号
トライ構造と、により、当該所定の種類の記号からなる
記号列を格納するデータ構造から、記号列を検索する検
索装置であって、 検索対象となる記号列を所定の記号で区切って区切済記
号列の列を得る区切部と、 検索部であって、前記区切られた結果の区切済記号列の
列に含まれる区切済記号列について、順に、 (a)当該区切済記号列が識別符号に対応付けて前記記
号列トライ構造に格納されていない場合、当該検索対象
の記号列は登録されていない旨を報告し、 (b)当該区切済記号列が識別符号に対応付けて前記記
号列トライ構造に格納されている場合、これまでに得ら
れた識別符号の列についで当該識別符号が前記識別符号
トライ構造に格納されていない場合、当該検索対象の記
号列は登録されていない旨を報告し、 (c)得られるすべての識別符号の列が前記識別符号ト
ライ構造に格納されている場合、当該検索対象の記号列
は登録されている旨を報告するものと、を備えることを
特徴とするもの。
7. A symbol string trie structure for storing a symbol string consisting of a predetermined type of symbol in association with a predetermined identification code that does not overlap with each other, and an identification code trie structure for storing the predetermined identification code. A delimiter that retrieves a symbol string from a data structure that stores a symbol string consisting of the prescribed type of symbol and that delimits the symbol string to be searched by a prescribed symbol to obtain a delimited symbol string sequence. Section and search section, in regard to the delimited symbol strings included in the delimited symbol string sequence of the delimited result, in order: (a) the delimited symbol string is associated with an identification code; If not stored in the trie structure, it reports that the symbol string to be searched is not registered, and (b) the delimited symbol string is stored in the symbol string trie structure in association with the identification code. If ever If the identification code is not stored in the identification code trie structure after the obtained identification code sequence, it is reported that the symbol string to be searched is not registered, and (c) all the obtained identification codes Is stored in the identification code trie structure, it reports that the symbol string to be searched is registered.
【請求項8】請求項7に記載の検索装置であって、 前記識別符号トライ構造は、識別符号と、遷移先のノー
ドと、を対応付けて格納する遷移表のほか、当該遷移に
先立ってマッチすべき部分記号列を格納することがで
き、 前記検索部は、前記(a)〜(c)にかえて、 (p)「当該区切済記号列が識別符号に対応付けて前記
記号列トライ構造に格納されておらず」、かつ、「これ
までに得られた識別符号もしくは接頭辞の列についで当
該区切済記号列が部分記号列として前記識別符号トライ
構造に格納されていない」場合、当該検索対象の記号列
は登録されていない旨を報告し、 (q)「当該区切済記号列が識別符号に対応付けて前記
記号列トライ構造に格納されており」、かつ、「これま
でに得られた識別符号もしくは接頭辞の列についで当該
識別符号による遷移先のノードが前記識別符号トライ構
造に格納されておらず」、かつ、「これまでに得られた
識別符号もしくは接頭辞の列についで当該区切済記号列
が部分記号列として前記識別符号トライ構造に格納され
ていない」場合、当該検索対象の記号列は登録されてい
ない旨を報告し、 (r)得られるすべての識別符号もしくは部分記号列の
列が、前記識別符号トライ構造に格納されている場合、
当該検索対象の記号列は登録されている旨を報告するこ
とを特徴とするもの。
8. The search device according to claim 7, wherein the identification code trie structure stores a transition table in which an identification code and a transition destination node are associated and stored, and prior to the transition. A partial symbol string to be matched can be stored, and the retrieval unit replaces (a) to (c) with (p) "the delimited symbol string is associated with an identification code and the symbol string trie If not stored in the structure ", and" the delimited symbol string that has been obtained so far and the delimited symbol string is not stored as a partial symbol string in the discrimination code trie structure ", Report that the symbol string to be searched is not registered, and (q) "the delimited symbol string is stored in the symbol string trie structure in association with the identification code", and "until now. For the obtained identification code or prefix sequence, , The node of the transition destination by the identification code is not stored in the identification code trie structure ", and" the sequence of the identification code or the prefix obtained so far is followed by the delimited symbol string is a partial symbol string. Is not stored in the identification code trie structure as ", it reports that the symbol string to be searched is not registered, and (r) all the obtained identification codes or partial symbol string sequences are the identification codes. If stored in a trie structure,
It is characterized by reporting that the symbol string of the search target is registered.
【請求項9】所定の種類の記号からなる記号列を格納す
る記号列トライ構造と、所定の識別符号を格納する識別
符号トライ構造と、により、当該所定の種類の記号から
なる記号列を格納するデータ構造に、記号列を登録する
登録方法であって、 当該データ構造に格納されるべき記号列を所定の区切記
号で区切って区切済記号列の列を得る区切工程と、 前記区切られて得られた区切済記号列の列に含まれる区
切済記号列のそれぞれを、異なる区切済記号列には異な
る識別符号を対応付けて、前記記号列トライ構造に、格
納する記号列格納工程と、 前記区切られて得られた区切済記号列の列について、
「これに含まれる区切済記号列のそれぞれに対応付けら
れて前記記号列格納工程にて前記記号列トライ構造に格
納された識別符号」の列を、前記識別符号トライ構造
に、格納する識別符号格納工程と、を備えることを特徴
とする方法。
9. A symbol string trie structure for storing a symbol string of a predetermined type of symbol and an identification code trie structure for storing a predetermined identification code store a symbol string of the predetermined type of symbol. A delimitation step of registering a symbol string in a data structure, wherein a delimiter process is performed to delimit the symbol string to be stored in the data structure with a predetermined delimiter symbol to obtain a delimited symbol string sequence; Each of the separated symbol strings included in the column of the obtained separated symbol string, a different identification code is associated with a different separated symbol string, in the symbol string trie structure, a symbol string storage step of storing, Regarding the column of the separated symbol string obtained by the separation,
An identification code to be stored in the identification code trie structure is a column of “an identification code stored in the symbol string trie structure in the symbol string storage step in association with each of the delimited symbol strings included in the delimiter code string”. A storing step.
【請求項10】請求項9に記載の登録方法であって、 置換条件が成立するか否か、ならびに、削除条件が成立
するか否かを推測する推測工程をさらに備え、 (1)前記識別符号トライ構造は、識別符号と、遷移先
のノードと、を対応付けて格納する遷移表のほか、当該
遷移に先立ってマッチすべき部分記号列を格納すること
ができ、 (2)前記識別符号格納工程では、前記識別符号トライ
構造においてあるノードAの遷移表に格納された遷移先
がノードBの一つのみであり、前記置換条件が満たされ
ると推測された場合、当該ノードAと当該ノードBとを
ノードCに置き換えて格納し、 当該ノードCに格納される部分記号列は、当該ノードA
に格納されていた部分記号列と、当該ノードAからの唯
一の遷移に対応する識別符号に対応付けて前記記号列ト
ライ構造に格納された区切済記号列と、当該ノードBに
格納されていた部分記号列と、を、連結したものであ
り、 当該ノードCに格納される遷移表は、当該ノードBに格
納されていた遷移表であり、 前記識別符号格納工程にて当該置き換えをするとした場
合に当該データ構造の大きさが小さくなる場合に、前記
置換条件は成立し、 (3)前記記号列格納工程では、前記記号列トライ構造
において前記削除条件が満たされると推測された場合、
これから、当該ノードAからの唯一の遷移に対応する識
別符号と、これに対応付けて格納された区切済記号列
と、を、削除し、 前記記号列格納工程にて当該削除をするとした場合に当
該データ構造の大きさが小さくなる場合に、前記削除条
件は成立することを特徴とする方法。
10. The registration method according to claim 9, further comprising an estimation step of estimating whether or not a replacement condition is satisfied and whether or not a deletion condition is satisfied, (1) The identification The code trie structure can store not only a transition table that stores an identification code and a node of a transition destination in association with each other, but also a partial symbol string to be matched prior to the transition, (2) the identification code In the storing step, when the transition table stored in the transition table of the node A in the identification code trie structure is only one of the nodes B and it is estimated that the replacement condition is satisfied, the node A and the node B and B are replaced and stored, and the partial symbol string stored in the node C is the node A
Stored in the node B, the delimited symbol string stored in the symbol string trie structure in association with the identification code corresponding to the only transition from the node A, and the partial symbol string stored in the node B. In the case where the transition table stored in the node C is the transition table stored in the node B, which is a concatenation of the partial symbol strings, and the replacement is performed in the identification code storing step. When the size of the data structure becomes small, the replacement condition is satisfied. (3) In the symbol string storing step, when it is estimated that the deletion condition is satisfied in the symbol string trie structure,
In the case where the identification code corresponding to the only transition from the node A and the delimited symbol string stored in association with this are deleted and the deletion is performed in the symbol string storing step, The method characterized in that the deletion condition is satisfied when the size of the data structure becomes small.
【請求項11】所定の種類の記号からなる記号列を互い
に重複しない所定の識別符号に対応付けて格納する記号
列トライ構造と、当該所定の識別符号を格納する識別符
号トライ構造と、により、当該所定の種類の記号からな
る記号列を格納するデータ構造から、記号列を検索する
検索方法であって、 検索対象となる記号列を所定の記号で区切って区切済記
号列の列を得る区切工程と、 検索工程であって、前記区切られた結果の区切済記号列
の列に含まれる区切済記号列について、順に、 (a)当該区切済記号列が識別符号に対応付けて前記記
号列トライ構造に格納されていない場合、当該検索対象
の記号列は登録されていない旨を報告し、 (b)当該区切済記号列が識別符号に対応付けて前記記
号列トライ構造に格納されている場合、これまでに得ら
れた識別符号の列についで当該識別符号が前記識別符号
トライ構造に格納されていない場合、当該検索対象の記
号列は登録されていない旨を報告し、 (c)得られるすべての識別符号の列が前記識別符号ト
ライ構造に格納されている場合、当該検索対象の記号列
は登録されている旨を報告する工程と、を備えることを
特徴とする方法。
11. A symbol string trie structure for storing a symbol string consisting of a predetermined type of symbol in association with a predetermined identification code that does not overlap with each other, and an identification code trie structure for storing the predetermined identification code, A search method for searching for a symbol string from a data structure that stores a symbol string consisting of the prescribed type of symbol, wherein the symbol string to be searched is delimited by a prescribed symbol to obtain a delimited symbol string sequence. In the process and the search process, the delimited symbol strings included in the delimited symbol string column of the delimited result are (a) the symbol string in which the delimited symbol string is associated with an identification code. If not stored in the trie structure, it reports that the symbol string to be searched is not registered, and (b) the delimited symbol string is stored in the symbol string trie structure in association with the identification code. If this If the identification code sequence obtained up to the present is not stored in the identification code trie structure, report that the symbol sequence to be searched is not registered, and (c) obtain all If a string of identification codes is stored in the identification code trie structure, the step of reporting that the symbol string to be searched is registered is included.
【請求項12】請求項11に記載の検索方法であって、 前記識別符号トライ構造は、識別符号と、遷移先のノー
ドと、を対応付けて格納する遷移表のほか、当該遷移に
先立ってマッチすべき部分記号列を格納することがで
き、 前記検索工程では、前記(a)〜(c)にかえて、 (p)「当該区切済記号列が識別符号に対応付けて前記
記号列トライ構造に格納されておらず」、かつ、「これ
までに得られた識別符号もしくは接頭辞の列についで当
該区切済記号列が部分記号列として前記識別符号トライ
構造に格納されていない」場合、当該検索対象の記号列
は登録されていない旨を報告し、 (q)「当該区切済記号列が識別符号に対応付けて前記
記号列トライ構造に格納されており」、かつ、「これま
でに得られた識別符号もしくは接頭辞の列についで当該
識別符号による遷移先のノードが前記識別符号トライ構
造に格納されておらず」、かつ、「これまでに得られた
識別符号もしくは接頭辞の列についで当該区切済記号列
が部分記号列として前記識別符号トライ構造に格納され
ていない」場合、当該検索対象の記号列は登録されてい
ない旨を報告し、 (r)得られるすべての識別符号もしくは部分記号列の
列が、前記識別符号トライ構造に格納されている場合、
当該検索対象の記号列は登録されている旨を報告するこ
とを特徴とする方法。
12. The search method according to claim 11, wherein the identification code trie structure includes a transition table that stores an identification code and a transition destination node in association with each other, and prior to the transition. A partial symbol string to be matched can be stored, and in the search step, instead of (a) to (c), (p) “the delimited symbol string is associated with an identification code and the symbol string trie If not stored in the structure ", and" the delimited symbol string that has been obtained so far and the delimited symbol string is not stored as a partial symbol string in the discrimination code trie structure ", Report that the symbol string to be searched is not registered, and (q) "the delimited symbol string is stored in the symbol string trie structure in association with the identification code", and "until now. Of the obtained identification code or prefix The node after the transition by the identification code is not stored in the identification code trie structure next to the column, "and" the column of the delimited symbol is a part of the column of the identification code or prefix obtained so far. If it is not stored in the identification code trie structure as a symbol string ”, it reports that the symbol string of the search target is not registered, and (r) all the obtained identification codes or partial symbol strings are If stored in the identification code trie structure,
A method of reporting that the symbol string to be searched is registered.
【請求項13】コンピュータを、請求項4から6のいず
れか1項に記載の登録装置として機能させることを特徴
とするプログラム。
13. A program for causing a computer to function as the registration device according to any one of claims 4 to 6.
【請求項14】コンピュータを、請求項7または8に記
載の検索装置として機能させることを特徴とするプログ
ラム。
14. A program for causing a computer to function as the search device according to claim 7.
JP2002063314A 2002-03-08 2002-03-08 Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program Pending JP2003263461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002063314A JP2003263461A (en) 2002-03-08 2002-03-08 Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002063314A JP2003263461A (en) 2002-03-08 2002-03-08 Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program

Publications (1)

Publication Number Publication Date
JP2003263461A true JP2003263461A (en) 2003-09-19

Family

ID=29196647

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002063314A Pending JP2003263461A (en) 2002-03-08 2002-03-08 Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program

Country Status (1)

Country Link
JP (1) JP2003263461A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1153349A (en) * 1997-08-05 1999-02-26 Fujitsu Ltd Device and method for compressing and restoring as well as compressing restoring tag document and computer readable recording medium recorded with compressing, restoring of compressing/restoring program
JP2000200288A (en) * 1999-01-07 2000-07-18 Nec Corp Retrieval result analysis system
JP2002024233A (en) * 2000-07-04 2002-01-25 Just Syst Corp Recording medium with recorded dictionary data structure, dictionary consulting method, word and phrase acquiring method, dictionary consulting device, word and phrase acquiring device, and recording medium with recorded program

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1153349A (en) * 1997-08-05 1999-02-26 Fujitsu Ltd Device and method for compressing and restoring as well as compressing restoring tag document and computer readable recording medium recorded with compressing, restoring of compressing/restoring program
JP2000200288A (en) * 1999-01-07 2000-07-18 Nec Corp Retrieval result analysis system
JP2002024233A (en) * 2000-07-04 2002-01-25 Just Syst Corp Recording medium with recorded dictionary data structure, dictionary consulting method, word and phrase acquiring method, dictionary consulting device, word and phrase acquiring device, and recording medium with recorded program

Similar Documents

Publication Publication Date Title
US7818303B2 (en) Web graph compression through scalable pattern mining
JP4698738B2 (en) Multi-segment string search
KR100414236B1 (en) A search system and method for retrieval of data
JP4740060B2 (en) Duplicate data detection program, duplicate data detection method, and duplicate data detection apparatus
WO2018200294A1 (en) Parser for schema-free data exchange format
JP5469244B2 (en) Selective content extraction
EP2245836B1 (en) Determining a property of a communication device
JP2007226452A (en) Structured document management device, structured document management program and structured document management method
JP2008516347A (en) Saving and restoring the interlock tree data store
JP2005165598A (en) Device and method for searching variable-length character string, and program
JP4261299B2 (en) Data compression device, data restoration device, and data management device
JP2008198237A (en) Structured document management system
JPWO2013111287A1 (en) SPARQL query optimization method
JP2011100208A (en) Action estimation device, action estimation method, and action estimation program
JP2012059212A (en) Extraction apparatus, extraction method and extraction program
JP2007323182A (en) System and method for searching chemical structure from large-scale chemical structure database at high speed
JP2003263461A (en) Data structure for storing symbol string, registration device, retrieval device, registering method, retrieval method, and program
JP5555238B2 (en) Information processing apparatus and program for Bayesian network structure learning
JP2010272006A (en) Relation extraction apparatus, relation extraction method and program
JP2008026964A (en) Retrieval processor and program
Köppl Exploring regular structures in strings
JP5494066B2 (en) SEARCH DEVICE, SEARCH METHOD, AND SEARCH PROGRAM
JP7322500B2 (en) SEARCH METHOD, SEARCH PROGRAM, AND INFORMATION PROCESSING DEVICE
JP2008209996A (en) Retrieval index preparation apparatus/retrieval index preparation method and retrieval index preparation program
JP5903372B2 (en) Keyword relevance score calculation device, keyword relevance score calculation method, and program

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050614

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060131