JP3115066B2 - Dictionary search method - Google Patents

Dictionary search method

Info

Publication number
JP3115066B2
JP3115066B2 JP03324706A JP32470691A JP3115066B2 JP 3115066 B2 JP3115066 B2 JP 3115066B2 JP 03324706 A JP03324706 A JP 03324706A JP 32470691 A JP32470691 A JP 32470691A JP 3115066 B2 JP3115066 B2 JP 3115066B2
Authority
JP
Japan
Prior art keywords
character
address
dictionary
character string
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP03324706A
Other languages
Japanese (ja)
Other versions
JPH05158987A (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 JP03324706A priority Critical patent/JP3115066B2/en
Publication of JPH05158987A publication Critical patent/JPH05158987A/en
Application granted granted Critical
Publication of JP3115066B2 publication Critical patent/JP3115066B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明はデータ圧縮における辞書
検索方法に係わり、特に既に符号化済みの文字列を相異
なる部分文字列に分け、該部分文字列を辞書に登録して
おき、入力文字列と最長に一致する部分文字列を辞書か
ら検索し、該最長一致文字列の番号を指定して符号化す
るデータ圧縮における辞書検索方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a dictionary search method in data compression, and in particular, divides an already encoded character string into different partial character strings, registers the partial character strings in a dictionary, and stores input character strings in a dictionary. The present invention relates to a dictionary search method in data compression that searches a dictionary for a partial character string that matches the longest string and a string, and specifies and codes the number of the longest matching character string.

【0002】近年、文字コード、ベクトル情報、画像な
どの様々な種類のデータがコンピュータで扱われるよう
になっており、扱われるデータ量も急速に増加してきて
いる。大量のデータを扱う時は、データの中の冗長な部
分を省いてデータ量を圧縮することで、記憶容量を減ら
したり、速く伝送したりできるようになる。様々なデー
タを1つの方式でデータ圧縮できる方法としてユニバー
サル符号化が提案されている。
In recent years, various types of data such as character codes, vector information, and images have been handled by computers, and the amount of data handled has been rapidly increasing. When dealing with a large amount of data, by compressing the amount of data by omitting redundant portions in the data, it becomes possible to reduce the storage capacity or to transmit data at high speed. Universal coding has been proposed as a method that can compress various data in one system.

【0003】[0003]

【従来の技術】このユニバーサル符号は、情報保存型の
データ圧縮方法であり、データ圧縮時に情報源の統計的
な性質を予め仮定しないため、種々のタイプ(文字コー
ド、オブジェクトコードなど)のデータに適用すること
ができる。文書画像では、文字の輪郭等や文字間隔に類
似性があり、又、網点画像は網点周期性、網点形状の同
一性等が類似している。この類似性の持つ冗長性をユニ
バーサル符号により削減し、有効な圧縮を行うことがで
きる。尚、以下では、情報理論で用いられている呼称を
踏襲し、データの1ワード単位を文字と呼び、データが
任意ワードつながったものを文字列と呼ぶことにする。
2. Description of the Related Art This universal code is an information preserving type data compression method. Since statistical properties of an information source are not assumed in advance at the time of data compression, various types (character codes, object codes, etc.) can be used for data. Can be applied. Document images have similarities in character outlines and character intervals, and halftone images have similar dot periodicity and halftone dot shape. Redundancy having this similarity can be reduced by the universal code, and effective compression can be performed. In the following, following the name used in information theory, one word unit of data will be called a character, and data connected with an arbitrary word will be called a character string.

【0004】ユニバーサル符号の代表的な方法として、
ジブ−レンペル(Ziv-Lempel)符号がある。例えば、宗像
「Ziv-Lempelのデータ圧縮法」、情報処理、Vol.26,No.
1,1985年参照。このZiv-Lempel符号では、ユニバーサ
ル型と、増分分解型(Incremental parsing) の2つの
アルゴリズムが提案されており、ユニバーサル型アルゴ
リズムを用いた実用的な方法として、LZSS符号(T.
C. Bell,"Better OMP/LText Compression", IEEE Tran
s. on Commun., Vol. COM-34, No.12, Dec.1986)があ
り、又、増分分解型アルゴリズムを用いた実用的な方法
として、LZW(Lempel- Ziv- Welch)符号がある(T.A.
Welch, " A Technique for High-Performance Data Co
mpression" , Computer, June 1984)。これらの符号の
内、高速処理できることと、アルゴリズムの簡単さから
LZW符号が記憶装置のファイル圧縮などで使われるよ
うになっている。
[0004] As a typical method of the universal code,
There is a Ziv-Lempel code. For example, Munakata "Ziv-Lempel Data Compression Method", Information Processing, Vol. 26, No.
See 1,1985. In this Ziv-Lempel code, two algorithms of a universal type and an incremental decomposition type (Incremental parsing) have been proposed.As a practical method using the universal type algorithm, an LZSS code (T.
C. Bell, "Better OMP / LText Compression", IEEE Tran
s. on Commun., Vol. COM-34, No. 12, Dec. 1986), and a practical method using an incremental decomposition type algorithm is an LZW (Lempel-Ziv-Welch) code ( TA
Welch, "A Technique for High-Performance Data Co
mpression ", Computer, June 1984) Among these codes, the LZW code is used for file compression of a storage device because of its high-speed processing and the simplicity of the algorithm.

【0005】LZW符号化 LZW符号化においては、書き換え可能な辞書を設け、
入力文字列を相異なる文字列に分け、この文字列を出現
した順に番号を付けて辞書に登録すると共に、現在入力
している文字列を辞書に登録してある最長一致文字列の
辞書番号だけで表して符号化する。
[0005] LZW encoding In LZW encoding, a rewritable dictionary is provided,
Divides the input character string into different character strings, assigns numbers to the character strings in the order in which they appear, and registers them in the dictionary, and stores only the dictionary number of the longest matching character string registered in the dictionary with the currently input character string. And encode it.

【0006】図8はLZW符号化説明図、図9は辞書構
成の説明図、図10はLZW符号化処理の流れ図であ
る。尚、説明を簡単にするために、a,b,c3文字か
らなる文字列をLZW符号化してデータ圧縮するものと
する。予め、全文字につき一文字からなる文字列(a,
b,c)に登録番号を付して辞書に初期登録すると共
に、辞書の登録数Nを文字種数Mとする(M→N)。・
・ステップ101
FIG. 8 is an explanatory diagram of LZW encoding, FIG. 9 is an explanatory diagram of a dictionary configuration, and FIG. 10 is a flowchart of LZW encoding processing. For the sake of simplicity, it is assumed that a character string composed of three characters a, b, and c is subjected to LZW encoding and data compression. In advance, a character string (a,
b, c) is given a registration number and is initially registered in the dictionary, and the number N of registrations in the dictionary is set to the number M of character types (M → N).・
・ Step 101

【0007】かかる状態で、最初の文字Kを入力し、該
文字の登録番号を参照番号ωとし、これを語頭文字列(p
refix string)とする(ステップ102)。ついで、入
力データの次の文字Kを読み込み(ステップ103)、
ステップ102で求めた語等文字列ωにステップ103
で読み込んだ文字Kを加えた文字列(ωK)が現在の辞
書にあるか否かを検索する(ステップ104)。
In such a state, the first character K is inputted, the registration number of the character is set as the reference number ω, and this is referred to as the initial character string (p
refix string) (step 102). Next, the next character K of the input data is read (step 103),
Step 103 is applied to the word string ω obtained in step 102.
A search is performed to determine whether or not the character string (ωK) to which the character K read in (1) is added in the current dictionary (step 104).

【0008】文字列(ωK)が辞書に存在すれば、文字
列(ωK)をωに置き換え(ステップ105)、しかる
後、入力データが終了したか判断し(ステップ10
6)、データが終了してなければステップ103に戻り
以降の処理を繰返し、文字列(ωK)が辞書から捜せな
くなるまで最大一致長文字列の検索を続ける。一方、ス
テップ106において、入力データが終了していれば、
参照番号ωを符号語 code(ω)として出力して(ステ
ップ107)、符号化処理を終了する。
If the character string (ωK) exists in the dictionary, the character string (ωK) is replaced with ω (step 105), and thereafter, it is determined whether the input data has been completed (step 10).
6) If the data is not completed, the process returns to step 103 and the subsequent processing is repeated, and the search for the maximum matching length character string is continued until the character string (ωK) cannot be searched from the dictionary. On the other hand, if the input data is completed in step 106,
The reference number ω is output as the code word code (ω) (step 107), and the encoding process ends.

【0009】最長一致文字列の検索が続行して、ステッ
プ104において、文字列(ωK)が辞書に存在しなく
なれば、参照番号ωを符号語 code(ω)として出力
し、又、文字列(ωK)を辞書アドレスNに登録し、更
にステップ103で読み込んだ文字Kを参照番号ωに置
き換えると共に、辞書アドレスNを1インクリメントす
る(ステップ108)。次いで、ステップ106により
入力データが終了したか判断し、判断結果に応じて以降
の処理を繰り返す。
If the search for the longest matching character string continues and the character string (ωK) does not exist in the dictionary in step 104, the reference number ω is output as a code word code (ω), and the character string (ω ωK) is registered in the dictionary address N, the character K read in step 103 is replaced with the reference number ω, and the dictionary address N is incremented by 1 (step 108). Next, it is determined in step 106 whether the input data has been completed, and the subsequent processing is repeated according to the determination result.

【0010】図8及び図9を参照してLZW符号化を具
体的に説明すると、以下のようになる。すなわち、図8
の入力データを左から右に向けて1文字づつ読み込む。
最初の文字aを読み込んだ時、辞書にはaの他に一致す
る文字列はないから、aの登録番号「1」(参照番号ω
=1)を符号語(code(ω))として出力する。そし
て、拡張した文字列abに登録番号4を付けて辞書に登
録する。実際の登録は文字列「1b」の形となる。続い
て、2番目の文字bが入力文字列の先頭になる。辞書に
はbの他に一致する文字列がないので、bの登録番号
(参照番号)2を符号語として出力し、拡張した文字列
baを実際には2aの形で登録番号5を付けて辞書に登
録する。
[0010] The LZW encoding will be specifically described below with reference to FIGS. 8 and 9. That is, FIG.
Is read one character at a time from left to right.
When the first character a is read, there is no matching character string other than a in the dictionary, so the registration number “1” of a (reference number ω
= 1) as a codeword (code (ω)). Then, the extended character string ab is assigned a registration number 4 and registered in the dictionary. The actual registration is in the form of a character string "1b". Subsequently, the second character b becomes the head of the input character string. Since there is no matching character string other than b in the dictionary, the registration number (reference number) 2 of b is output as a code word, and the expanded character string ba is actually assigned a registration number 5 in the form of 2a. Register in the dictionary.

【0011】以上により、3番目の文字aが入力文字列
の先頭になる。辞書には先頭文字aが存在するから、該
文字の登録番号1に次の文字bを付した文字列「1b」
が存在するか調べる。文字列「1b」が存在するから、
該文字列の登録番号4に次の文字cを付した文字列「4
c」が存在するか調べる。文字列「4c」は存在しない
から、最長一致文字列「1b」の登録番号「4」を符号
語として出力し、拡張した文字列「4c」を登録番号6
に辞書登録し、以後同様に符号化と辞書登録を繰り返し
て全入力文字のLZW符号化処理を実行する。
As described above, the third character a becomes the head of the input character string. Since the first character a exists in the dictionary, a character string “1b” obtained by adding the next character b to the registration number 1 of the character
Check if exists. Since the character string "1b" exists,
A character string “4” in which the following character c is added to the registration number 4 of the character string
c "is present. Since the character string “4c” does not exist, the registration number “4” of the longest matching character string “1b” is output as a code word, and the expanded character string “4c” is registered number 6
Then, the encoding and dictionary registration are repeated in the same manner to execute the LZW encoding process for all input characters.

【0012】図11はLZW復号化処理の流れ図であ
り、復号化処理では、符号化の逆の操作が行われる。す
なわち、復号化に際しては、符号化と同様に、全文字に
つき一文字からなる文字列(a,b,c)に登録番号を
付して辞書に初期登録すると共に、辞書の登録数Nを文
字種数Mとする(M→N)。・・ステップ201 ついで、最初の符号CODEを読み込み、該符号CODEをOLDc
odeとする。又、最初の符号は既に辞書に登録された一
文字の登録番号のいずれかに該当することから、入力符
号CODE(=登録番号)が示す文字Kを出力する。又、出力
した文字Kは後の例外処理のためにcharとして設定す
る。・・以上ステップ202
FIG. 11 is a flowchart of the LZW decoding process. In the decoding process, the reverse operation of the encoding is performed. That is, at the time of decoding, as in the case of encoding, a character string (a, b, c) consisting of one character for every character is assigned a registration number and initially registered in the dictionary, and the number N of registered dictionary is changed to the number of character types. Let M be (M → N). ..Step 201 Then, the first code CODE is read and the code OLDc is read.
ode. Further, since the first code corresponds to one of the registration numbers of one character already registered in the dictionary, the character K indicated by the input code CODE (= registration number) is output. The output character K is set as char for later exception processing. ..Step 202 above

【0013】しかる後、次の符号CODEを読み込んでNEWc
odeとしてセットすると共に(ステップ203)、符号CO
DE(=登録番号)が辞書に定義(登録)されているか否かを
チェックする(ステップ204)。通常、入力した符号C
ODE(=登録番号)は前回までの処理で辞書に登録されて
いるから、ステップ204において「NO」となるか
ら、次に、符号CODE(=登録番号)が指示する辞書の登録
文字列が(ωK)か判断する。すなわち、符号CODEが指
示する辞書の登録文字列が(ωK)のように、参照番号
ωと文字Kの結合文字列であるか判断する(ステップ2
05)。
Thereafter, the next code CODE is read and NEWc is read.
ode (step 203) and code CO
It is checked whether DE (= registration number) is defined (registered) in the dictionary (step 204). Normally, input code C
Since the ODE (= registration number) has been registered in the dictionary in the processing up to the previous time, "NO" is obtained in step 204. Next, the registered character string of the dictionary indicated by the code CODE (= registration number) is ( ωK). That is, it is determined whether the registered character string of the dictionary indicated by the code CODE is a combined character string of the reference number ω and the character K, such as (ωK) (step 2).
05).

【0014】参照番号ωと文字Kの結合文字列であれ
ば、文字Kを一時的にスタックし、参照番号ωの符号語
code(ω)(実際にはcode(ω)=ω)を新たなCODEと
し、かつ文字数Cを1カウントアップし(ステップ20
6)、ステップ205に戻る。以後、ステップ205、
206の処理をCODEが示す登録文字列が一文字に至るま
で再帰的に繰り返す。
If the character string is a combination of the reference number ω and the character K, the character K is temporarily stacked and the code word of the reference number ω is
code (ω) (actually code (ω) = ω) is set as a new CODE, and the number of characters C is incremented by 1 (step 20).
6) Return to step 205. Thereafter, step 205,
Step 206 is recursively repeated until the registered character string indicated by CODE reaches one character.

【0015】ステップ205において、CODEが示す文字
列が一文字の場合には、すなわち、符号CODEが指示する
辞書の登録文字列が(K)の場合には、Kを出力し、し
かる後、スタックしたC個の文字列をLIFO(Last i
n Fast Out)形式でポップアップして出力する。又、前
回の復号化において使用した符号OLDcodeに、今回復号
した文字列の先頭文字Kを付加した文字列(OLDcode,
K)を登録番号Nとして辞書に登録し、次にNを1イン
クリメントする(N+1→N)。更に、復号文字列の先
頭文字Kをcharとし、かつNEWcodeをOLDcodeとする。・
・以上ステップ207
In step 205, if the character string indicated by the CODE is one character, that is, if the registered character string in the dictionary indicated by the code CODE is (K), K is output, and then the stack is executed. LIFO (Last i
n Pop up and output in Fast Out) format. A character string (OLDcode, OLDcode, OLDcode) obtained by adding the first character K of the character string decoded this time to the code OLDcode used in the previous decoding.
K) is registered in the dictionary as a registration number N, and then N is incremented by 1 (N + 1 → N). Further, the first character K of the decoded character string is set to char, and NEWcode is set to OLDcode.・
・ Step 207

【0016】以後、符号入力が終了したか判断し(ステ
ップ208)、終了してなければステップ203に戻り
次の符号を読み込んで復号処理を繰り返す。ところで、
符号化処理においては、ある文字列の符号化と、該文字
列に次の先頭文字を付加した文字列の辞書登録とを同時
に行うため、次の符号化処理において直前に符号化した
文字列の符号語を使用できる。しかし、復号化処理にお
いては、直前に復号した文字列に、今回復号した文字列
の先頭文字列を付加した文字列を辞書登録するため、辞
書登録が符号化処理に比べて1回遅れる。このため、符
号化処理において、直前に符号化した文字列の符号語を
使用すると、復号化処理において、該符号語が登録(定
義)されていない場合を生じる。この場合がステップ2
04においてCODEが定義されていない状態になり、「Y
ES」となる。
Thereafter, it is determined whether code input has been completed (step 208). If not completed, the process returns to step 203 to read the next code and repeat the decoding process. by the way,
In the encoding process, since the encoding of a certain character string and the dictionary registration of the character string in which the next leading character is added to the character string are performed at the same time, in the next encoding process, Codewords can be used. However, in the decoding process, since the character string obtained by adding the head character string of the currently decoded character string to the character string decoded immediately before is registered in the dictionary, dictionary registration is delayed by one time as compared with the encoding process. For this reason, if the code word of the character string coded immediately before is used in the encoding process, the code word may not be registered (defined) in the decoding process. This is step 2
In 04, no code is defined, and "Y
ES ”.

【0017】例えば、図12に示すように符号化に際し
て、文字列「a・・・z」に対してOLDcodeを出力する
と共に、文字列「a・・・za」をNEWcodeとして辞書
登録し、次の文字列「a・・・za」をNEWcodeで出力
し、文字列「a・・・zab」を辞書登録する。さて、
復号側で符号語NEWcodeを読み込んだ時、該符号語は復
号側で辞書登録されていないので、復号ができない。し
かし、NEWcodeとOLDcodeを比較すると、以下の関係 NEWcodeの文字列=OLDcodeの文字列+OLDcodeの文字列
の先頭文字(char) がある。このため、ステップ204で「NO」となれ
ば、セットされているcharをスタックすると共に、OLDc
odeをCODEとみなし、かつ、OLDcodeにcharを付加した文
字列をNEWcodeとし(ステップ209)、以後CODEを用い
てステップ205以降の処理を行う。
For example, at the time of encoding, as shown in FIG. 12, an OLD code is output for a character string "a... Z", and the character string "a. Is output by NEWcode, and the character string "a ... zab" is registered in the dictionary. Now,
When the decoding side reads the code word NEWcode, the decoding cannot be performed because the code word is not registered in the dictionary on the decoding side. However, comparing NEWcode and OLDcode, there is the following relationship: NEWcode character string = OLDcode character string + OLDcode character string first character (char). For this reason, if "NO" in step 204, the set char is stacked and OLDc
The character string in which ode is regarded as CODE and OLDcode is added with char is set as NEWcode (step 209), and the processing from step 205 onward is performed using CODE thereafter.

【0018】図13を参照して復号化処理を具体的に説
明すると以下のようになる。最初の入力符号は「1」で
あり、一文字a,b,cについては既に登録番号1、
2、3として辞書登録されているから(図9と同様)、
辞書の参照により符号「1」に一致する登録番号の文字
列aに置き換えて出力する。次に、符号「2」について
も同様にして文字bに置き換えて出力する。この時、前
回処理した符号「1」と今回復号した最初の一文字bと
を組み合わせた「1b」を新たな登録番号4に辞書登録
する。
The decoding process will be described below in detail with reference to FIG. The first input code is “1”, and one character a, b, c is already registered with the registration number 1,
Since the dictionary is registered as 2, 3 (similar to FIG. 9),
By referring to the dictionary, it is replaced with the character string a of the registration number that matches the code “1” and output. Next, the code "2" is similarly replaced with the character b and output. At this time, “1b”, which is a combination of the previously processed code “1” and the first character “b” decoded this time, is registered in a new registration number 4 in the dictionary.

【0019】3番目の符号「4」は辞書の検索により、
「1b」から「ab」と置き換えて文字列「ab」を出
力する。同時に、前回処理した符号「2」と今回復号し
た1番目の文字aとを組み合わせた文字列「2a(=a
b)」を新たな登録番号5に辞書登録する。以下、同様
に、復号処理を繰り返す。尚、図11のステップ209
の例外処理は、第6番目の入力符号「8」の復号で生じ
る。符号「8」は復号時に辞書に定義されておらず、復
号できない。この場合には、前回処理した符号「5」に
前回復号した文字列「ba」の最初の一文字bを加えた
文字列「5b」を求め、更に「2ab」、「bab」と
置き換えられて出力される。そして、前回の符号語
「5」に今回復号した文字列の文字bを加えた文字列
「5b」に登録番号「8」を付加して辞書登録する。
The third code "4" is obtained by searching the dictionary.
The character string “ab” is output by replacing “1b” with “ab”. At the same time, the character string “2a (= a) is obtained by combining the code“ 2 ”processed last time and the first character a decoded this time.
b) is registered in a dictionary with a new registration number 5. Hereinafter, similarly, the decoding process is repeated. Step 209 in FIG.
Exception processing occurs in the decoding of the sixth input code “8”. The code “8” is not defined in the dictionary at the time of decoding and cannot be decoded. In this case, a character string "5b" is obtained by adding the first character b of the character string "ba" decoded last time to the code "5" processed last time, and further replaced with "2ab" and "bab". Is output. Then, a registration number "8" is added to the character string "5b" obtained by adding the character b of the character string decoded this time to the previous code word "5", and the dictionary is registered in the dictionary.

【0020】以上のように、ユニバーサル符号は、符号
化対象の性質が未知でも、それを学習しながら符号化し
てゆく圧縮法であり、既出のデータ列を辞書に登録して
行き、同じデータ列が表れた時には、その登録番号を符
号化データ(符号語)として送出するというシンプルな
ものである。しかし、図10の流れ図に従って符号化す
ると、1つの文字列を辞書検索する際、最悪、辞書全体
をサーチしなければならず、このため、符号化処理に時
間がかかる問題があった。そこで、従来は、辞書検索に
外部ハッシュ法(open hashingまたはchaining)を用い
て処理速度を上げている(例えば、オーム社刊、情報処
理学会編、情報処理ハンドブック参照)。
As described above, the universal code is a compression method in which, even if the property of the object to be encoded is unknown, the encoding is performed while learning it. Is displayed, the registration number is transmitted as encoded data (codeword). However, when encoding is performed in accordance with the flowchart of FIG. 10, when searching a dictionary for one character string, the entire dictionary must be searched in the worst case, and there is a problem that the encoding process takes time. Therefore, conventionally, the processing speed is increased by using an external hashing method (open hashing or chaining) for dictionary search (for example, see Ohmsha, edited by Information Processing Society of Japan, Information Processing Handbook).

【0021】外部ハッシュ法 文字列からなる集合Sを考えた時、集合Sにおける文字
列xの格納位置のアドレスを文字列xより直接計算でき
る仕組になっていると高速の検索ができる。これを実現
するのがハッシュ法である。記憶場所(ハッシュ表)に
0〜(m-1)までのアドレスが付加されているとすると、
ハッシュ法では、関数 h:S→[0,1,2,・・・(m-1)] を1つ定めて、Sの文字列xのアドレスをh(x)で求め
る。関数hをハッシュ関数、値h(x)をxのハッシュ・
アドレスといっている。ハッシュ法は、通常、文字列の
集合Sの大きさがアドレス数mに比べて遥かに大きい場
合に用いられる。そこで、ハッシュ関数hをどのように
選んだとしても、集合Sにおける相異なる文字列x1
2に対してh(x1)=h(x2)となる場合が起こり得る。
これを衝突と呼び、衝突に対する対策の一つとして外部
ハッシュ法が用いられる。外部ハッシュ法は、図14に
示すように、ハッシュアドレスi毎に連結リスト(name
next)LSTを用意し、h(x)=iとなるxはその連結リ
ストの先頭から順に格納する。尚、同じハッシュアドレ
スを有するそれぞれのリストはバケット(bucket)と呼ば
れる。
Considering a set S composed of external hash character strings, a high-speed search can be performed if the address of the storage position of the character string x in the set S can be directly calculated from the character string x. The hash method realizes this. If addresses from 0 to (m-1) are added to the storage location (hash table),
In the hash method, one function h: S → [0, 1, 2,... (M−1)] is determined, and the address of the character string x of S is obtained by h (x). The function h is a hash function, and the value h (x) is a hash function of x.
It is called an address. The hash method is usually used when the size of a character string set S is much larger than the number of addresses m. Therefore, no matter how the hash function h is selected, different character strings x 1 ,
x 2 with respect to h (x 1) = h ( x 2) and the case may occur made.
This is called a collision, and an external hash method is used as one of the measures against the collision. In the external hash method, as shown in FIG. 14, a linked list (name
next) An LST is prepared, and x where h (x) = i is stored sequentially from the head of the linked list. Note that each list having the same hash address is called a bucket.

【0022】図15はLZW符号の辞書作成及び辞書検
索に外部ハッシュ法を採用した時のハッシュ表(辞書)
のデータ構造であり、ある文字列xにより指定されるハ
ッシュアドレスiに、文字列xに続く文字K(イクステ
ンションextension)と、文字列xに続く文字K以外の文
字を格納するアドレス(nextアドレス)と、文字Kに更
に続く文字の格納アドレス(firstアドレス)が記憶さ
れるようになっている。尚、firstアドレスは図14の
索引dictionaryに対応し、nextアドレスは連結リスト(n
ame next) に対応する。
FIG. 15 is a hash table (dictionary) when the external hash method is used for creating a dictionary of the LZW code and searching the dictionary.
In a hash address i specified by a certain character string x, an address (next address) for storing a character K (extension extension) following the character string x and a character other than the character K following the character string x ) And the storage address (first address) of the character further following the character K. The first address corresponds to the index dictionary in FIG. 14, and the next address is the linked list (n
ame next).

【0023】図16は外部ハッシュ法による辞書構造説
明図で、(a)は従来のLZW符号化による辞書、(b)は外
部ハッシュ法による辞書、(c)は外部ハッシュ法を用い
た辞書の木構造図であり、それぞれ図8に示す順序で、
a,b,cの3文字よりなる入力文字列が発生した場合
である。図16(b)のアドレスiにはfirst欄、next欄、
extension欄が対応付けされており、図15で示した構
造でデータを記憶するようになっている。すなわち、ア
ドレスiのextension欄にはアドレスiを指示する文字
列xに連結する文字Kが書き込まれ、next欄には文字列
xに連結する文字K以外の文字を格納するアドレスが書
き込まれ、first欄には文字Kに更に連結する文字の格
納アドレス(firstアドレス)が記憶されるようになっ
ている。例えば、アドレス4の文字bに着目すると、該
アドレス4はアドレス1の文字(1文字からなる文字
列)aのfirstアドレスにより指示され、アドレス4のe
xtension欄には文字列aに連結する文字bが書き込ま
れ、next欄には文字列aに連結する別の文字aを格納す
るアドレス10が書き込まれ、first欄には文字bに更
に続く文字cのアドレス6が書き込まれている。
FIGS. 16A and 16B are explanatory diagrams of a dictionary structure using the external hash method. FIG. 16A shows a dictionary using the conventional LZW encoding, FIG. 16B shows a dictionary using the external hash method, and FIG. It is a tree structure diagram, in the order shown in FIG.
This is a case where an input character string consisting of three characters a, b, and c occurs. In the address i of FIG. 16B, the first column, the next column,
An extension column is associated with the extension column, and stores data in the structure shown in FIG. That is, a character K linked to the character string x indicating the address i is written in the extension field of the address i, an address storing characters other than the character K linked to the character string x is written in the next field, The column stores a storage address (first address) of a character further linked to the character K. For example, if attention is paid to the character b of the address 4, the address 4 is designated by the first address of the character (a character string composed of one character) of the address 1 and the e of the address 4
The character b connected to the character string a is written in the xtension field, the address 10 for storing another character a connected to the character string a is written in the next field, and the character c further following the character b is written in the first field. Address 6 is written.

【0024】初期時、アドレス1、2、3のextension
欄には全1文字列a,b,cが初期登録され、その他の
欄は「空(=0)」になっており、以後、後述する外部ハ
ッシュ法による符号処理が行われ、図16(c)に示す木
構造状に辞書(図16(b))が作成される。尚、(c)におい
て、□で囲んだ番号はアドレスである。以上により、例
えば、アドレス1の文字aを参照すると、該文字aに
は、アドレス4の文字bがfirst方向に連結し、該文字
bにはfirst方向に更にアドレス6の文字cが連結し、
更に、前記文字aにはアドレス10の文字aが連結し、
アドレス10の文字aには順次アドレス11、12の文
字aが連結していることが示される。また、アドレス2
の文字bに着目すると、該文字bにはアドレス5の文字
aがfirst方向に連結し、以後、アドレス8、9の文字
b,aが順次連結していることが示される。更に、アド
レス3の文字cに着目すると、該文字cにはアドレス7
の文字bがfirst方向に連結していることが示される。
Initially, the extensions of addresses 1, 2, and 3
In the column, all the one-character strings a, b, and c are initially registered, and the other columns are “empty (= 0)”, and thereafter, code processing by the external hash method described later is performed, and FIG. A dictionary (FIG. 16B) is created in a tree structure shown in c). In (c), the numbers enclosed by squares are addresses. Thus, for example, referring to the character a at the address 1, the character a at the address 4 is linked to the character b at the first direction, the character b is further linked to the character c at the address 6 at the first direction,
Further, the character a of the address 10 is linked to the character a,
It is shown that the character a at the address 10 is sequentially connected to the character a at the addresses 11 and 12. Address 2
Focusing on the character b, the character b of the address 5 is connected to the character b in the first direction, and thereafter, the characters b and a of the addresses 8 and 9 are sequentially connected. Further focusing on the character c at the address 3, the character c has the address 7
Is connected in the first direction.

【0025】外部ハッシュ法による符号化処理 図17は外部ハッシュ法によるLZW符号化処理の流れ
図である。この符号化処理においては、外部ハッシュ法
により参照番号iの文字列に一文字を付加した文字列の
アドレスをハッシュアドレス(索引)として引く。連結
リストには、参照番号iの文字列に付加される文字を格
納するfirst,nextアドレスが格納してあり、該文字と入
力文字Kの一致を検査し、不一致ならば逐次連結リスト
を手繰ることによって、これまで出現した全ての一文字
付加文字列を検索することができる。もし、バケット中
に付加した文字列が存在しない場合には、最終的にリス
トの連結アドレスから0が得られ、該当する文字列が登
録されていないことを知ることができる。
Encoding Process Using External Hash Method FIG. 17 is a flowchart of LZW encoding process using the external hash method. In this encoding process, an address of a character string obtained by adding one character to the character string of the reference number i by the external hash method is subtracted as a hash address (index). The linked list stores first and next addresses for storing a character to be added to the character string of reference number i, and checks whether the character and the input character K match, and if they do not match, sequentially processes the linked list. As a result, all the one-character additional character strings that have appeared so far can be searched. If the added character string does not exist in the bucket, 0 is finally obtained from the linked address of the list, and it can be known that the corresponding character string is not registered.

【0026】予め、全文字につき一文字からなる文字列
(a,b,c,・・・)を、辞書アドレス1〜Mのextension欄に初
期登録すると共に(Mは文字種数)、辞書の先頭アドレ
スnを文字種数M+1とする(M+1→n)。また、最
初の文字Kを入力して該文字を記憶するアドレス(該文
字の参照番号)をiとし、これを語頭文字列(prefix st
ring)とする。更に、辞書における全アドレスのfirst欄
の内容first[1,NMAX]、next欄の内容next[1,NMAX]及び
アドレスM+1〜NMAXのextension欄の内容を全て
0に初期化する。・・ステップ301
A character string consisting of one character for all characters in advance
(a, b, c,...) are initially registered in the extension fields of dictionary addresses 1 to M (M is the number of character types), and the leading address n of the dictionary is set to the number of character types M + 1 (M + 1 → n). Further, an address (a reference number of the character) at which the first character K is inputted and the character is stored is defined as i, and this is represented by a prefix string (prefix st).
ring). Further, the contents first [1, NMAX] of the first field of all addresses, the contents next [1, NMAX] of the next field, and the contents of the extension fields of the addresses M + 1 to NMAX are all initialized to 0. ..Step 301

【0027】かかる状態で、次の文字Kを入力し(ステ
ップ302)、ωにiを代入すると共に(i→ω、Kの
直前までの文字列の参照番号をωとする)、j=0とす
る(ステップ303)。また、現アドレスiの候補文字
ext(i)にfirst方向に連結する候補文字を格納するアド
レスを示すデータfirst(i)をiとする(ステップ30
4)。尚、現アドレスiの候補文字ext(i)にfirst方向
に連結する文字がなければfirst(i)=0であり、i=0
となる。
In this state, the next character K is inputted (step 302), i is substituted into ω (i → ω, the reference number of the character string up to immediately before K is ω), and j = 0. (Step 303). Also, the candidate character of the current address i
The data first (i) indicating the address for storing the candidate character to be connected to ext (i) in the first direction is set to i (step 30).
4). If the candidate character ext (i) at the current address i does not include a character connected in the first direction, first (i) = 0 and i = 0
Becomes

【0028】ついで、i=0であるか判断し、換言すれ
ば、first方向に連結する候補文字が存在するかチェッ
クし(ステップ305)、存在しなければステップ30
3で保存した参照番号(アドレス)ωを符号語 code
(ω)として出力する(ステップ306)。
Next, it is determined whether or not i = 0, in other words, it is checked whether or not there is a candidate character to be connected in the first direction (step 305).
The reference number (address) ω saved in step 3 is the code word code
(Ω) (step 306).

【0029】しかる後、i=nとすると共に、nを1イ
ンクリメントし(n+1→n)、更にステップ302で
入力した文字Kをアドレスiのexstension欄に書き込む
(K→ext(i))。すなわち、続き文字Kを辞書登録する
(ステップ307)。次いで、j=0であるかチェック
し(ステップ308)、j=0であれば、i→first
(ω)とする(ステップ309)。これにより、Kの直前
に入力した文字を記憶するアドレス(=Kの直前に入力
した文字迄の参照番号ωが指示するアドレス)のfirst欄
にi(今回の文字Kを格納するアドレス)が書き込まれ
ることになる。
Thereafter, i = n, n is incremented by 1 (n + 1 → n), and the character K input in step 302 is written in the extension field of the address i.
(K → ext (i)). That is, the subsequent character K is registered in the dictionary (step 307). Next, it is checked whether j = 0 (step 308). If j = 0, i → first
(ω) (step 309). As a result, i (address for storing the current character K) is written in the first column of the address for storing the character input immediately before K (= the address indicated by the reference number ω to the character input immediately before K). Will be.

【0030】以後、ステップ302で入力した文字Kの
アドレスをiとし(ステップ310)、データが終了し
たかチェックし(ステップ311)、終了していればi
→ωとした後、ωを符号語 code(ω)として出力して
(ステップ312)、符号化処理を終了し、データが終
了してなければステップ302に戻り以降の処理を繰り
返す。
Thereafter, the address of the character K input in step 302 is set as i (step 310), and it is checked whether the data is completed (step 311).
After setting ω, ω is output as a code word code (ω) (step 312), and the encoding process is terminated. If the data is not completed, the process returns to step 302 and the subsequent processes are repeated.

【0031】一方、ステップ305においてi≠0であ
れば、換言すればfirst方向に連結する候補文字が存在
すれば、該文字(アドレスiのextension欄に書き込ま
れている文字ext(i))がステップ302で入力した文字
Kと一致するか調べる(ステップ313)。一致してい
ればステップ311に飛び、データ終了していれば、i
→ωとした後、ωを符号語 code(ω)として出力して
(ステップ312)、符号化処理を終了し、データが終
了してなければステップ302に戻り、更に次の文字を
入力して以降の最長一致文字列の検索処理を繰り返す。
On the other hand, if i ≠ 0 in step 305, in other words, if there is a candidate character to be connected in the first direction, the character (the character ext (i) written in the extension field of the address i) is It is checked whether it matches the character K input in step 302 (step 313). If they match, the process jumps to step 311. If the data ends, i
After setting ω, ω is output as a code word code (ω) (step 312), and the encoding process is terminated. If the data is not completed, the process returns to step 302, and the next character is input. The subsequent search processing for the longest matching character string is repeated.

【0032】ステップ313において、first方向に連
結する候補文字がステップ302で入力した文字Kと一
致してなければ、jにiを代入すると共に、アドレスi
のnext欄に書き込まれているアドレスデータnext(i)を
新たなiとし(ステップ314)、ステップ305に戻
る。尚、next方向に連結する文字がなければアドレスi
のnext欄には0が書き込まれており、i=0となる。
In step 313, if the candidate character to be connected in the first direction does not match the character K input in step 302, i is substituted for j and the address i
The address data next (i) written in the “next” column is set as a new i (step 314), and the process returns to step 305. If there are no characters connected in the next direction, the address i
0 is written in the next column of, and i = 0.

【0033】以後、i≠0であればステップ313に移
行し同様の最長一致文字列の検索処理が繰り返えされ、
最早一致文字が存在しなくなるとステップ305におい
てi=0となり、ステップ303で保存した参照番号
(アドレス)ωを符号語 code(ω)として出力し、前
述の処理を繰り返す。尚、ステップ314の処理の直後
のステップ305でi=0が判断されると、ステップ3
08においてj≠0となり、i→next(ω)とされる(ス
テップ315)。これにより、Kの直前に入力した文字
迄の参照番号ωが指示するアドレスのnext欄にi(今回
の文字Kを格納するアドレス)が書き込まれることにな
る。
Thereafter, if i ≠ 0, the flow shifts to step 313 to repeat the same longest matching character string search process.
When the matching character is no longer present, i = 0 in step 305, the reference number (address) ω stored in step 303 is output as the code word code (ω), and the above-described processing is repeated. Incidentally, if i = 0 is determined in step 305 immediately after the processing of step 314, step 3
At 08, j ≠ 0, and i → next (ω) is set (step 315). As a result, i (address for storing the current character K) is written in the next column of the address indicated by the reference number ω up to the character input immediately before K.

【0034】以上要約すれば、新たな文字Kを入力した
時、それ迄の文字列に連結する候補文字をfirst方向に
求め、見つかればfirst方向に同様に求めて行き、見つ
からなくなればnext方向に調べ、見つかれば、再びfirs
t方向に調べて行き、以後同様な処理を繰り返して見つ
からなくなった時の参照番号iをωとして最長一致文字
列の符号語code(ω)を出力すると共に、アドレスiに最
新の入力文字についてのfirst, next, extension等を登
録するものである。以上の流れ図に従って、図8の最上
段に示す文字列を符号化出力してゆくと、最下段の如く
文字列が辞書登録されて行き、図18、図19、図20
の斜線で示すように辞書登録量が増加して行く。尚、図
18(a)は初期化された後の状態である。
In summary, when a new character K is input, candidate characters to be connected to the previous character string are obtained in the first direction. If found, the same characters are obtained in the first direction. Examine, if found, firs again
In the direction t, the same process is repeated to output the code word code (ω) of the longest matching character string with ω being the reference number i when no more characters are found. First, next, extension, etc. are registered. When the character string shown at the top of FIG. 8 is coded and output according to the above flow chart, the character string is registered in the dictionary as shown at the bottom, and FIG. 18, FIG. 19, and FIG.
, The dictionary registration amount increases. FIG. 18A shows a state after the initialization.

【0035】図21は従来の外部ハッシュ法による辞書
検索回路の構成図である。MPU(マイクロ・プロセッ
サ・ユニット)1は入力文字Kを読み込んで一致検査部
2のレジスタ2aに格納すると共に、辞書メモリ3より
候補文字K′とそれに繋がるfirstアドレスfωとnext
アドレスnωを読み出し、それぞれ読み込み部4のレジ
スタ4a,4b,4cにラッチする。一致検査部2の比
較回路2bは入力文字Kとレジスタ4aにラッチされた
候補文字K′が一致するか比較検査を行う。一致しない
場合には、コントローラ5をしてマルチプレクサ(MP
X)4dにより、レジスタ4cにラッチされているnext
アドレスnωを選択させる。これにより、MPU1はne
xtアドレスnωで辞書検索を行い、新たな候補文字K′
とそれに繋がるfirstアドレスfωとnextアドレスnω
を読み出し、それぞれ読み込み部4のレジスタ4a,4
b,4cにラッチして比較検査を行う。
FIG. 21 is a block diagram of a conventional dictionary search circuit using the external hash method. The MPU (microprocessor unit) 1 reads the input character K and stores it in the register 2a of the match checking unit 2, and also stores the candidate character K 'and the first address fω and next connected to it from the dictionary memory 3.
The address nω is read and latched in the registers 4a, 4b, 4c of the reading unit 4, respectively. The comparison circuit 2b of the match checking unit 2 performs a comparison check whether the input character K matches the candidate character K 'latched in the register 4a. If they do not match, the controller 5 controls the multiplexer (MP
X) The next latched in the register 4c by 4d
The address nω is selected. Thereby, MPU1 ne
A dictionary search is performed at the xt address nω, and a new candidate character K ′ is searched.
And the first address fω and the next address nω connected to it
Are read, and the registers 4a and 4
b and 4c to perform a comparison test.

【0036】一方、比較回路2bにおいて、入力文字K
と候補K′が一致した場合には、コントローラ5をして
マルチプレクサ4dにより、レジスタ4bにラッチされ
ているfirstアドレスfω選択させる。これにより、M
PU1はfirstアドレスfωで辞書検索を行い、新たな
候補文字K′とそれに繋がるfirstアドレスfωとnext
アドレスnωを読み出し、それぞれ読み込み部4のレジ
スタ4a,4b,4cにラッチすると共に、次の入力文
字Kを読み取ってレジスタ2aに格納し、以後上記の比
較検査を行う。
On the other hand, in the comparison circuit 2b, the input character K
And the candidate K ', the controller 5 causes the multiplexer 4d to select the first address fω latched in the register 4b. This gives M
PU1 performs a dictionary search using the first address fω, and finds a new candidate character K ′ and the first address fω and the next
The address nω is read out and latched in the registers 4a, 4b, 4c of the reading unit 4, and the next input character K is read out and stored in the register 2a.

【0037】以後、上記処理が行われ、比較回路2bで
一致が取れず、しかも、マルチプレクサ4dの出力が0
となれば、換言すれば連結検出部6において検索すべき
firstアドレスfωとnextアドレスnωがもうないと確
認されると、最長一致文字列の検索が終了し、この時点
で辞書検索をストップし、以後次の入力文字に対して最
長一致文字列の検索を行う。
Thereafter, the above processing is performed, and no match is obtained in the comparison circuit 2b.
In other words, search should be performed in the connection detection unit 6
When it is confirmed that the first address fω and the next address nω are no longer present, the search for the longest matching character string is completed. At this point, the dictionary search is stopped, and the search for the longest matching character string is performed for the next input character. Do.

【0038】[0038]

【発明が解決しようとする課題】以上のように、外部ハ
ッシュ法によるLZW符号化処理においては、ある文字
列の末尾に連結する候補文字K′のアドレスが指定さ
れ、該アドレスに候補文字K′とfirstアドレスとnext
アドレスが格納されているため、従来の外部ハッシュ法
によらないLZW符号化に比べて辞書検索を高速に行え
る利点がある。しかし、上記外部ハッシュ法による辞書
検索では、1度の辞書アクセスに対して1つの候補文字
K′と1組のfirstアドレスとnextアドレスしか読み出
すことができないため、候補文字が多い場合検索一致に
時間が掛かる問題がある。
As described above, in the LZW encoding process using the external hash method, the address of the candidate character K 'to be connected to the end of a certain character string is specified, and the candidate character K' is added to the address. And first address and next
Since the address is stored, there is an advantage that the dictionary search can be performed at a higher speed than the conventional LZW coding that does not use the external hash method. However, in the dictionary search by the external hash method, only one candidate character K 'and one set of the first address and the next address can be read for one dictionary access. Is a problem.

【0039】以上から本発明の目的は、外部ハッシュ法
による辞書検索を高速に行える辞書検索方法を提供する
ことである。本発明の別の目的は、外部ハッシュ法によ
るLZW符号化の辞書検索において、一度の辞書検索に
より複数の候補文字を読み出し、複数の候補文字と1つ
の入力文字とを一度に照合して辞書検索を高速に行える
辞書検索方法を提供することである。
Accordingly, it is an object of the present invention to provide a dictionary search method capable of performing a high-speed dictionary search by the external hash method. Another object of the present invention is to perform a dictionary search by reading a plurality of candidate characters by a single dictionary search and collating the plurality of candidate characters with one input character at a time in a dictionary search of LZW encoding by an external hash method. The purpose of the present invention is to provide a dictionary search method that can perform the search at high speed.

【0040】本発明の更に別の目的は、一度の辞書検索
により複数の候補文字と共に、複数のアドレスを読み出
し、複数の候補文字と1つの入力文字との比較照合結果
(第1候補と一致、第2候補と一致、いずれの候補とも
一致せず等)に基づいて次に参照すべき複数の候補文字
を直ちに前記所定アドレスから読み出して比較照合して
辞書検索を高速に行える辞書検索方法を提供することで
ある。
Still another object of the present invention is to read out a plurality of addresses together with a plurality of candidate characters by a single dictionary search, and compare and match the plurality of candidate characters with one input character (coincidence with the first candidate, A plurality of candidate characters to be referred next are immediately read out from the predetermined address based on the second candidate or not matched with any of the candidates, and compared and compared to provide a dictionary search method capable of high-speed dictionary search. It is to be.

【0041】[0041]

【課題を解決するための手段】図1は本発明の原理説明
図である。11は検索済文字列に連結する複数の候補文
字が検索可能となるように複数のデータ要素を前記検索
済文字列が指定するアドレスに格納して符号化済みの部
分文字列を記憶する辞書メモリ、12は入力文字を読み
込んだり、辞書メモリより候補文字、アドレス等を読み
出したり、新規文字列を辞書メモリに登録するMPU
(プロセッサ)、13は辞書メモリより同時に読み出し
た複数のデータを記憶するレジスタ部、14は1つの入
力文字と複数の候補文字との一致照合を行う比較照合
部、15は比較結果に基づいて次の複数の候補文字のア
ドレスを選択するアドレス選択部(マルチプレクサMP
X)である。前記複数のデータ要素は、例えば、 (1) 検索済文字列に連結する第1文字(ext1)と、(2) 第
1文字迄の文字列の番号(ω1)と、(3) 前記検索済文
字列に連結する文字であって第1文字とは別の第2文字
(ext 2)と、 (4) 第2文字までの文字列の番号(ω2
と、(5) 前記検索済文字列に連結する第1、第2文字と
は別の第3文字の格納アドレス(next2)と、(6) 第1文
字に連結する第4文字の格納アドレス(first1)と、(7)
第2文字に連結する第5文字の格納アドレス(first2)
と、(8) 第1、第2文字のうち幾つ記憶されているかを
示すフラグ(flag)を有している。
FIG. 1 illustrates the principle of the present invention.
FIG. 11 is a plurality of candidate sentences connected to the searched character string
Search for multiple data elements so that characters can be searched
Part encoded and stored at the address specified by the
A dictionary memory for storing minute character strings;
Or read candidate characters, addresses, etc. from the dictionary memory.
MPU to output or register new character strings in dictionary memory
(Processor), 13 read out simultaneously from dictionary memory
A register section 14 for storing a plurality of pieces of data.
Comparison matching that matches characters and multiple candidate characters
, 15 based on the result of the comparison.
Address selection section (multiplexer MP)
X). The plurality of data elements include, for example, (1) a first character (ext1) And (2)
Character string number up to one character (ω1) And (3) the searched sentence
The second character that is connected to the character string and is different from the first character
(Ext Two) And (4) the number of the character string up to the second character (ωTwo)
And (5) first and second characters connected to the searched character string.
Is the storage address of another third character (nextTwo) And (6) First sentence
Storage address of the fourth character connected to the character (first1) And (7)
The storage address of the fifth character connected to the second character (firstTwo)
And (8) how many of the first and second characters are stored
It has a flag (flag) shown.

【0042】[0042]

【作用】検索済文字列に連結する複数の候補文字が検索
可能となるように複数のデータ要素を前記検索済文字列
が指定する辞書メモリ11のアドレスに記憶して辞書を
作成し、最長一致文字列の検索に際して、MPU12は
検索済文字列の次の1つの入力文字を読み込むと共に、
該検索済文字列に連結する複数の候補文字及び次の候補
文字の位置を指定するアドレスデータを含むデータ要素
を辞書メモリ11より一括して読み出してレジスタ部1
3に格納する。比較照合部14は、複数個の候補文字と
1つの入力文字とを比較して一致照合を行い、一致する
候補文字が存在する場合には、アドレスデータに基づい
て次の複数の候補文字を含むデータ要素を辞書メモリか
ら読み出してレジスタ部13に格納し、以後次の入力文
字と次の複数の候補文字とを比較して最長一致検索処理
を続行する。このように、一度の辞書検索により複数の
候補文字を読み出し、複数の候補文字と1つの入力文字
とを一度に照合して辞書検索を行うようにしたから、辞
書検索を高速に行うことができる。又、一度の辞書検索
により複数の候補文字と共に、複数のアドレスを読み出
し、複数の候補文字と1つの入力文字との比較照合結果
(第1候補と一致、第2候補と一致、いずれの候補とも
一致せず等)に基づいて次に参照すべき複数の候補文字
を直ちに前記所定アドレスから読み出して比較照合して
辞書検索を高速に行うことができる。
A plurality of data elements are stored in an address of the dictionary memory 11 specified by the searched character string so that a plurality of candidate characters connected to the searched character string can be searched, and a dictionary is created. When searching for a character string, the MPU 12 reads the next input character following the searched character string,
A plurality of candidate characters to be linked to the searched character string and data elements including address data designating the position of the next candidate character are collectively read out from the dictionary memory 11 and registered in the register unit 1.
3 is stored. The comparison / matching unit 14 compares a plurality of candidate characters with one input character to perform matching and, if there is a matching candidate character, includes the next plurality of candidate characters based on the address data. The data element is read from the dictionary memory and stored in the register unit 13. Thereafter, the next input character is compared with the next plurality of candidate characters, and the longest match search process is continued. As described above, a plurality of candidate characters are read out by one dictionary search, and the plurality of candidate characters are collated with one input character at a time to perform a dictionary search, so that a dictionary search can be performed at high speed. . Also, a plurality of addresses are read together with a plurality of candidate characters by a single dictionary search, and the result of comparison and comparison between the plurality of candidate characters and one input character (matching with the first candidate, matching with the second candidate, matching with any of the candidates) A plurality of candidate characters to be referred next can be immediately read out from the predetermined address based on the non-coincidence, and compared and collated to perform a dictionary search at high speed.

【0043】更に、前記データ要素は、検索済文字列に
連結する第1文字(ext1)と、前記検索文字に連結する文
字であって第1文字とは別の第2文字(ext2)と、前記
検索文字列に連結する第1、第2文字とは別の第3文字
の格納アドレス(next2)と、第1文字に連結する第4文
字の格納アドレス(first1)と、第2文字に連結する第5
文字の格納アドレス(first2)と、第1、第2文字のうち
幾つ記憶されているかを示すフラグ(flag)を少なくとも
有し、(1)1つの入力文字と複数の候補文字である前記
第1、第2文字の一致照合に際して、入力文字と第1、
第2文字が共に異なる場合にはアドレス(next2)に基づ
き次のデータ要素を読み出して該データ要素が指示する
複数の候補文字と入力文字との一致照合を行い、(2)入
力文字と第1文字が一致する場合には、アドレス(firs
t1)に基づいて次の入力文字に対するデータ要素を読み
出し、該データ要素が指示する複数の候補文字と次の入
力文字との一致照合を行い、(3)入力文字と第2文字が
一致する場合には、アドレス(first2)に基づいて次の入
力文字に対するデータ要素を読み出し、該データ要素が
指示する複数の候補文字と次の入力文字との一致照合を
行って最長一致検索処理を続行する。このようにすれ
ば、一度の辞書検索により複数の候補文字と共に、複数
のアドレスを読み出し、複数の候補文字と1つの入力文
字との比較照合結果(第1候補と一致、第2候補と一
致、いずれの候補とも一致せず等)に基づいて次に参照
すべき複数の候補文字を直ちに前記所定アドレスから読
み出して比較照合を連続的に行え、辞書検索を高速に行
うことができる。
Further, the data element includes a first character (ext 1 ) connected to the searched character string and a second character (ext 2 ) connected to the search character and different from the first character. A storage address (next 2 ) of a third character different from the first and second characters linked to the search character string, a storage address of a fourth character linked to the first character (first 1 ), Fifth concatenation of two characters
It has at least a character storage address (first 2 ) and a flag (flag) indicating how many of the first and second characters are stored. (1) One input character and a plurality of candidate characters When matching the first and second characters, the input character and the first and second characters are compared.
If the second character is different, the next data element is read out based on the address (next 2 ), and a plurality of candidate characters indicated by the data element are matched with the input character, and (2) the input character and the second If one character matches, the address (firs
The data element for the next input character is read based on t 1 ), and a plurality of candidate characters specified by the data element are matched with the next input character, and (3) the input character matches the second character In this case, the data element for the next input character is read based on the address (first 2 ), and a plurality of candidate characters indicated by the data element are matched and matched with the next input character to continue the longest match search processing. I do. With this configuration, a plurality of addresses are read together with a plurality of candidate characters by a single dictionary search, and the result of comparison and comparison between the plurality of candidate characters and one input character (matching the first candidate, matching the second candidate, A plurality of candidate characters to be referred to next are immediately read out from the predetermined address based on the result of the comparison, and the comparison and comparison can be continuously performed, and the dictionary search can be performed at high speed.

【0044】[0044]

【実施例】図2は本発明に係わる辞書メモリの1つのア
ドレスに格納されるデータの構造説明図である。ある文
字列xにより指定されるアドレスi(=ω1)には、 (1) 文字列xの最終文字に連結する第1文字(ext1)と、
(2) 第1文字迄の文字列の番号(ω1)と、(3) 前記最
終文字に連結する文字であって第1文字とは別の第2文
字(ext2)と、 (4) 第2文字までの文字列の番号
(ω2)と、(5) 前記最終文字に連結する第1、第2文
字とは別の第3文字の格納アドレス(next2)と、(6) 第
1文字に連結する第4文字の格納アドレス(first1)と、
(7) 第2文字に連結する第5文字の格納アドレス(first
2)と、(8) 第1、第2文字のうち幾つ記憶されているか
を示すフラグ(flag)が記憶されて、辞書が作成される。
FIG. 2 is an explanatory view of the structure of data stored at one address of a dictionary memory according to the present invention. The address i (= ω 1 ) specified by a certain character string x includes: (1) the first character (ext 1 ) connected to the last character of the character string x;
(2) a character string number up to the first character (ω 1 ), (3) a second character (ext 2 ) which is a character connected to the last character and is different from the first character, (4) A character string number up to the second character (ω 2 ), (5) a storage address (next 2 ) of a third character different from the first and second characters connected to the last character, and (6) The storage address (first 1 ) of the fourth character linked to one character,
(7) The storage address of the fifth character linked to the second character (first
2 ) and (8) flags indicating how many of the first and second characters are stored are stored, and a dictionary is created.

【0045】図3は本発明による辞書メモリの内容説明
図であり、(a)は符号化説明図、(b)は本発明の辞書であ
り、辞書メモリの各アドレスにはにはflag欄、first
1欄、first2欄、next2欄、ext1欄、ext2欄、ω1欄、ω2
欄が設けられている。図3(a)の上段に示す順序でa,
b,cの3文字よりなる入力文字列が発生すると、後述
する符号化処理により符号語が中段に示すように出力さ
れ、又、下段に示すように文字列が辞書登録される。こ
の辞書登録において、文字列は図2のデータ構造で辞書
メモリの各アドレスに登録され、その内容は図3(b)に
示すようになり、図2の表記法により表現すると図3
(c)に示す木構造状になる。
FIG. 3 is a diagram for explaining the contents of a dictionary memory according to the present invention. FIG. 3 (a) is a diagram for explaining encoding, and FIG. 3 (b) is a dictionary according to the present invention. first
Column 1 , first 2 column, next 2 column, ext 1 column, ext 2 column, ω 1 column, ω 2
A column is provided. In the order shown in the upper part of FIG.
When an input character string consisting of three characters b and c is generated, a code word is output as shown in the middle part by an encoding process described later, and the character string is registered in a dictionary as shown in the lower part. In this dictionary registration, a character string is registered at each address of the dictionary memory in the data structure of FIG. 2, and its contents are as shown in FIG. 3 (b).
The tree structure shown in (c) is obtained.

【0046】例えば、アドレス1の第1文字a(ext1)
を参照すると、該第1文字aはfirst 1方向にアドレス4
(first1アドレス)のext1欄、ext2欄に格納された文字
等に連結し、該第1文字aまでの文字列(1文字列a)
の参照番号(=1)がω1欄に格納されていることが示
される。
For example, the first character a (ext1)
, The first character a is first 1Address 4 in direction
(First1Address) ext1Field, extTwoCharacter stored in field
Etc., and the character string up to the first character a (one character string a)
Reference number (= 1) is ω1Field indicates that
Is done.

【0047】又、アドレス1のfirst1欄で指示された第
4アドレスのext1欄には、アドレス1のext1欄の文字a
(1文字列aの最終文字)に連結する第1文字bが書き
込まれ、第4アドレスのext2欄には、アドレス1のext1
欄の文字aに連結する第2文字aが書き込まれ、第1文
字bにはfirst1方向にアドレス6(first1アドレス)の
ext1欄に格納された文字が連結し、第2文字aにはfirs
t2方向にアドレス11(first2アドレス)のext1欄に格
納された文字が連結し、第1文字bまでの文字列(2文
字列ab)の参照番号(=4)がω1欄に格納され、第
2文字a迄の文字列(2文字列aa)の参照番号(=1
0)がω2欄に格納されていることが示される。尚、第
4アドレスのnext2欄は「空(=0)」であるから、アドレス
1の文字a(ext1)には第1、第2文字b,a以外に連
結する文字列は存在しないことがわかる。
In the ext 1 column of the fourth address designated in the first 1 column of the address 1, the character a in the ext 1 column of the address 1 is stored.
The first character b to be linked to (the last character of one character string a) is written, and the ext 2 column of the fourth address contains the ext 1 of the address 1.
A second character a to be connected to the character a in the column is written, and the first character b is assigned an address 6 (first 1 address) in the first 1 direction.
The characters stored in the ext 1 column are concatenated, and the second character a is firs
The characters stored in the ext 1 column of address 11 (first 2 address) are connected in the t 2 direction, and the reference number (= 4) of the character string (2 character strings ab) up to the first character b is stored in the ω 1 column. The reference number (= 1) of the stored character string up to the second character a (two character strings aa)
0) are indicated as being stored in omega 2 column. Since the next 2 column of the fourth address is “empty (= 0)”, there is no character string connected to the character a (ext 1 ) of the address 1 other than the first and second characters b and a. You can see that.

【0048】アドレス4のfirst1欄で指示された第6ア
ドレスのext1欄には、アドレス4のext1欄の文字b(2
文字列abの最終文字)に連結する第1文字cが書き込
まれ、該第1文字cまでの文字列(3文字列abc)の
参照番号(=6)がω1欄に格納されていることが示さ
れる。尚、第6アドレスのflag欄の内容は1-0であるか
ら、アドレス4の第1文字b(ext1)には文字c以外に
連結する文字は存在しないことがわかる。又、第6アド
レスのfirst1欄は「空(=0)」であるから、3文字列abc
に連結する文字がないことがわかる。
[0048] The ext 1 column sixth address specified by the first 1 column address 4, the ext 1 column address 4 characters b (2
First character c for connecting to the last character) strings ab is written, first the reference number of the string to the character c (3 string abc) (= 6) is stored in the omega 1 column Is shown. Since the contents of the flag column of the sixth address are 1-0, it is understood that there is no character to be connected to the first character b (ext 1 ) of the address 4 other than the character c. Further, since the first 1 column sixth address is "empty (= 0)", 3 strings abc
It can be seen that there is no character linked to.

【0049】アドレス4のfirst2欄で指示された第11
アドレスのext1欄には、アドレス4のext2欄の文字a
(2文字列aaの最終文字)に連結する第1文字aが書
き込まれ、該第1文字aにはfirst1方向にアドレス12
(first1アドレス)のext1欄に格納された文字が連結
し、該第1文字aまでの文字列(3文字列aaa)の参
照番号(=11)がω1欄に格納されていることが示さ
れる。尚、第6アドレスのflag欄の内容は1-0であるか
ら、アドレス4の第2文字a(ext2)には他に連結する
文字は存在しないことがわかる。
The eleventh designated in the first 2 column of address 4
In the ext 1 column of the address, the character a in the ext 2 column of the address 4
The first letter a is written for coupling to (2 characters last character string aa), said first character address in the first 1 direction a 12
The characters stored in the ext 1 column of (first 1 address) are linked, and the reference number (= 11) of the character string (3 character strings aaa) up to the first character a is stored in the ω 1 column. Is shown. Since the contents of the flag column of the sixth address are 1-0, it can be seen that there is no other character to be connected to the second character a (ext 2 ) of the address 4.

【0050】アドレス11のfirst1欄で指示された第1
2アドレスのext1欄には、アドレス11のext1欄の文字
a(3文字列aaaの最終文字)に連結する第1文字a
が書き込まれ、第1文字aまでの文字列(4文字列aa
aa)の参照番号(=12)がω1欄に格納されている
ことが示される。尚、第12アドレスのflag欄の内容は
1-0であるから、アドレス11の第1文字a(ext1)には
他に連結する文字は存在しないことがわかる。又、第1
2アドレスのfirst1欄は「空(=0)」であるから、4文字列
aaaaに連結する文字がないことがわかる。以下同様
に、アドレス2の文字b,アドレス3の文字cに連結す
る文字列が辞書登録されている。
The first specified in the first 1 column of the address 11
The ext 1 column 2 address, first letter a coupling to ext 1 column of character a the address 11 (the last character of the three-character string aaa)
Is written, and the character string up to the first character a (4 character strings aa
aa) the reference number (= 12) is shown to be stored in the omega 1 column. The contents of the flag column of the twelfth address are
Since it is 1-0, it is understood that the first character a (ext 1 ) of the address 11 has no other characters to be linked. Also, the first
Since the first 1 column of the two addresses is "empty (= 0)", it can be seen that there are no characters linked to the four character string aaa. Similarly, a character string linked to the character b at address 2 and the character c at address 3 is registered in the dictionary.

【0051】図4及び図5は本発明による符号化処理
(辞書検索、辞書登録)の流れ図である。予め、辞書メ
モリのアドレス1〜Mのext1欄(ext1[1,M])に文字コ
ード(a,b,c,・・・)を初期登録すると共に(Mは文字種
数)、ω1欄(ω1[1,M])に文字コードに対応するアド
レス(参照番号)を初期登録し、更に、flag欄(flag
[1,M])に1-0(ext1欄のみに文字が登録されいることを
示す)を初期登録する。
FIGS. 4 and 5 are flowcharts of the encoding process (dictionary search and dictionary registration) according to the present invention. In advance, character codes (a, b, c,...) Are initially registered in the ext 1 column (ext 1 [1, M]) of addresses 1 to M of the dictionary memory (M is the number of character types) and ω 1 The address (reference number) corresponding to the character code is initially registered in the field (ω 1 [1, M]), and further, the flag field (flag)
Initially register 1-0 (indicating that characters are registered only in the ext 1 column) in [1, M]).

【0052】又、辞書の先頭アドレスnをM+1とする
(M+1→n)。更に、辞書における全アドレスの (1)first1欄の内容first1[1,NMAX]、(2)first2欄の内容
first2[1,NMAX]、(3)next2欄の内容next2[1,NMAX]、(4)
ext2欄の内容ext2[1,NMAX]、(5)ω2欄の内容ω2[1,NMA
X]を全て0に初期化すると共に、アドレスM+1〜NMA
Xの(6)ext1欄の内容ext1[M+1,NMAX]、(7)ω1欄の内容
ω1[N+1,NMAX]を全て0に初期化し、又、(8)flag欄flag
[N+1,NMAX]を全て0-0(ext1欄、ext2欄に文字が登録され
いないことを示す)に初期化する。
The head address n of the dictionary is set to M + 1 (M + 1 → n). In addition, the contents of the (1) first 1 column of all addresses in the dictionary first 1 [1, NMAX], (2) the contents of the first 2 column
first 2 [1, NMAX], (3) the content of the next 2 column next 2 [1, NMAX], (4)
ext 2 column content ext 2 [1, NMAX], (5) ω 2 column content ω 2 [1, NMA
X] are all initialized to 0, and addresses M + 1 to NMA
Initialize the contents ext 1 [M + 1, NMAX] of the (6) ext 1 column and (7) the contents ω 1 [N + 1, NMAX] of the ω 1 column of X to 0, and (8) flag Column flag
[N + 1, NMAX] are all initialized to 0-0 (indicating that no characters are registered in the ext 1 and ext 2 columns).

【0053】更に、検索切り替えパラメータT及び登録
切り替えパラメータUをそれぞれ0にし、又、最初の入
力文字Kを入力して該文字の参照番号をiとし、これを
語頭文字列(prefix string)とする。尚、T=0は、fir
st1欄のアドレスデータが示すアドレスから次の複数の
候補文字を読み出すこと及び符号語出力に際して第1候
補文字の参照番号を出力することを意味し、T=1は、
first2欄のアドレスデータが示すアドレスから次の複数
の候補文字を読み出すこと及び符号語出力に際して第1
候補文字の参照番号を出力することを意味する。また、
U=0は、辞書登録時に文字をext1欄に登録すること
を、U=1は、ext2欄に登録することを意味する。・・
以上ステップ401
Further, the search switching parameter T and the registration switching parameter U are set to 0, respectively, and the first input character K is input, the reference number of the character is set to i, and this is referred to as a prefix string. I do. Note that T = 0 is fir
means that from st 1 column address indicated by the address data and outputs the reference number of the candidate character when it and the code word output reading the following plurality of candidate characters, T = 1, the
reading the next plurality of candidate characters from the address indicated by the address data in the first 2 column;
This means to output the reference number of the candidate character. Also,
U = 0 is to register characters in ext 1 Box during dictionary registration, U = 1 means that register with ext 2 column.・ ・
Step 401

【0054】かかる状態で、次の入力文字Kを入力し
(ステップ402)、ついで、iをωに代入すると共に
(i→ω、入力文字Kの直前の文字迄の参照番号をωと
する)、j=0とする(ステップ403)。ついで、T
=0かチェックし(ステップ404)、T=0であれ
ば、直前の文字を格納するアドレスiにおけるfirst1
ドレス(first1(i))を新たなiとし(ステップ40
5)、T=1であれば、直前の文字を格納するアドレス
iにおけるfirst2アドレス(first2(i))を新たにiとす
る(ステップ406)。
In this state, the next input character K is input (step 402), and i is substituted for ω (i → ω, and the reference number up to the character immediately before the input character K is ω). , J = 0 (step 403). Then T
= 0 (step 404), and if T = 0, the first 1 address (first 1 (i)) at the address i storing the immediately preceding character is set as a new i (step 40).
5) If T = 1, the first 2 address (first 2 (i)) at the address i for storing the immediately preceding character is newly set to i (step 406).

【0055】しかる後、i=0であるかチェックする
(ステップ407)。i≠0であれば、第iアドレスの
ext1欄の第1候補文字ext1(i)が入力文字Kと一致する
かチェックし(ステップ408)、一致すればT=0と
し(ステップ409)、ステップ410に飛ぶ。尚、一
致しない場合には後述するステップ421に飛び、入力
文字と第2候補文字との比較照合を行う。
Thereafter, it is checked whether i = 0 (step 407). If i ≠ 0, the i-th address
It is checked whether the first candidate character ext 1 (i) in the ext 1 column matches the input character K (step 408), and if it matches, T = 0 (step 409) and the process jumps to step 410. If they do not match, the process jumps to step 421 to be described later, where the input character is compared with the second candidate character.

【0056】ステップ409でT=0とした後、iをω
に代入する(ステップ410)。すなわち、入力文字と
一致する第1候補文字を記憶するアドレスiをωとす
る。ついで、データが終了したチェックする(ステップ
411)。データが終了してなければステップ402に
戻り、次の文字Kを入力して以降の処理を繰り返し、最
長一致文字列の検索を行う。一方、データが終了してい
れば、T=0かチェックし(ステップ412)、T=0
であればステップ410で保持した第1候補文字の参照
番号ωを符号語 code(ω)として出力し(ステップ4
13)、符号化処理を終了する。
After setting T = 0 in step 409, i is changed to ω
(Step 410). That is, the address i at which the first candidate character that matches the input character is stored is ω. Next, it is checked that the data has been completed (step 411). If the data is not completed, the process returns to step 402, the next character K is input, and the subsequent processing is repeated to search for the longest matching character string. On the other hand, if the data is completed, it is checked whether T = 0 (step 412), and T = 0
If so, the reference number ω of the first candidate character held in step 410 is output as a code word code (ω) (step 4
13), end the encoding process.

【0057】一方、ステップ408で、第iアドレスの
ext1欄の第1候補文字ext1(i)が入力文字Kと一致しな
ければ、第iアドレスのflag(i)が1-0か、すなわち、第
2候補文字が存在するかチェックする(ステップ42
1)。第2候補文字が存在すれば、第iアドレスのext2
欄の第2候補文字ext2(i)が入力文字Kと一致するかチ
ェックし(ステップ422)、一致すればT=1とし
(ステップ423)、ステップ410に飛ぶ。尚、一致
しない場合には後述するステップ425に飛び、入力文
字と更に別の候補文字との比較照合を行う。
On the other hand, at step 408, the i-th address
If the first candidate character ext 1 (i) in the ext 1 column does not match the input character K, it is checked whether flag (i) of the i-th address is 1-0, that is, whether a second candidate character exists ( Step 42
1). If the second candidate character exists, ext 2 of the i-th address
It is checked whether the second candidate character ext 2 (i) in the column matches the input character K (step 422), and if it matches, T = 1 (step 423), and the routine jumps to step 410. If they do not match, the process jumps to step 425 to be described later, where the input character is compared with another candidate character.

【0058】ステップ423でT=1とした後、iをω
に代入する(ステップ410)。すなわち、入力文字と
一致する第2候補文字を記憶するアドレスiをωとす
る。ついで、データが終了したチェックする(ステップ
411)。データが終了してなければステップ402に
戻り、次の文字Kを入力して以降の処理を繰り返し、最
長一致文字列の検索を行う。一方、データが終了してい
れば、T=0かチェックし(ステップ412)、T=1
であれば第2候補文字の参照番号ω2(ω)を符号語cod
e(ω2(ω))として出力し(ステップ414)、符号化
処理を終了する。
After setting T = 1 in step 423, i is changed to ω
(Step 410). That is, the address i for storing the second candidate character that matches the input character is ω. Next, it is checked that the data has been completed (step 411). If the data is not completed, the process returns to step 402, the next character K is input, and the subsequent processing is repeated to search for the longest matching character string. On the other hand, if the data is completed, it is checked whether T = 0 (step 412), and T = 1
, The reference number ω 2 (ω) of the second candidate character is replaced with the code word cod
Output as e (ω 2 (ω)) (step 414), and end the encoding process.

【0059】又、ステップ421で、第iアドレスのfl
ag(i)が1-0であれば、換言すれば、第2候補文字が存在
しなければ、入力文字と一致する候補文字は存在しない
ことになり、U=1とし(ステップ424)、以後、ス
テップ426以降の符号語の出力及び辞書登録処理を行
う。一方、ステップ422で第iアドレスのext2欄の第
2候補文字ext2(i)が入力文字Kと一致しなければ、換
言すれば、第1、第2候補文字が入力文字と一致しなけ
れば、iをjに代入すると共に、U=0とし、かつ、第
1、第2候補文字以外の候補文字の格納アドレスnext
2(i)を新たなiとする(next2(i)→i)。尚、別の候補
文字(next2方向に連結する候補文字)が存在しない場
合にはnext2(i)=0となり、i=0となる。・・ステッ
プ425
At step 421, the fl of the i-th address
If ag (i) is 1-0, in other words, if the second candidate character does not exist, there is no candidate character that matches the input character, and U = 1 (step 424). Then, the output of the code word and the dictionary registration processing after step 426 are performed. On the other hand, if the second candidate character ext 2 (i) in the ext 2 column of the i-th address does not match the input character K in step 422, in other words, the first and second candidate characters must match the input character. For example, i is substituted for j, U = 0, and the storage address next of candidate characters other than the first and second candidate characters
2 (i) as a new i (next 2 (i) → i). If there is no other candidate character (candidate character linked in the next 2 direction), next 2 (i) = 0 and i = 0. ..Step 425

【0060】以後、ステップ407に戻って、i=0か
チェックし、i≠0であれば、別の候補文字が存在する
から前述のステップ408以降の処理を繰り返す。しか
し、別の候補文字が存在しなければ、i=0となり、以
後、ステップ426以降の符号語の出力及び辞書登録処
理を行う。入力文字と一致する候補文字が存在しなくな
れば、ステップ426でT=0かチェックする。T=0
であれば、ステップ403で保持した第1候補文字の参
照番号ωを符号語 code(ω)として出力し(ステップ
427)、T=1であれば第2候補文字の参照番号ω2
(ω)を符号語 code(ω2(ω))として出力する(ステ
ップ428)。
Thereafter, the flow returns to step 407 to check whether i = 0, and if i ≠ 0, there is another candidate character, so that the processing from step 408 onward is repeated. However, if another candidate character does not exist, i = 0, and thereafter, the output of the code word and the dictionary registration processing after step 426 are performed. If there are no more candidate characters matching the input character, it is checked in step 426 whether T = 0. T = 0
If so, the reference number ω of the first candidate character held in step 403 is output as a codeword code (ω) (step 427), and if T = 1, the reference number ω 2 of the second candidate character
(Ω) is output as a code word code (ω 2 (ω)) (step 428).

【0061】符号語を出力後、iをpに代入し、又、n
をiに代入し、更にnを1インクリメントし(ステップ
429)、U=0であるかチェックする(ステップ43
0)。尚、flagが1-0で、第1候補文字のみが対象アド
レスに記憶されている場合のみ、U=1となる。ステッ
プ430でU=1であれば、入力文字Kを第pアドレス
(直前の入力文字が記憶されていたアドレス)のext2
に書き込み(K→ext2(p))、そのflag欄に1-1を書き込む
(1-1→flag(p))。これにより、直前の文字に入力文字
Kが連結していることが登録される。・・・ステップ4
31
After outputting the code word, i is substituted for p, and n
Is substituted for i, and n is further incremented by 1 (step 429), and it is checked whether U = 0 (step 43).
0). Note that U = 1 only when the flag is 1-0 and only the first candidate character is stored at the target address. If U = 1 in step 430, the input character K is assigned to the p-th address.
(K → ext 2 (p)) is written in the ext 2 column of (the address where the last input character was stored), and 1-1 is written in the flag column.
(1-1 → flag (p)). This registers that the input character K is linked to the immediately preceding character. ... Step 4
31

【0062】ついで、iを第pアドレス(直前の文字が
記憶されていたアドレス)のω2欄に書き込む(i→ω
2(p))。これにより、今回の入力文字K迄の文字列の参
照番号がω2欄に登録されたことになる(ステップ43
2)。以後、今回の文字Kの参照番号をiにし、又、i
をωに代入し、更に、T,Uを0にし(ステップ43
3)、しかる後、データが終了したチェックする(ステ
ップ411)。データが終了してなければステップ40
2に戻り、次の入力文字を読み込んで以降の処理を繰り
返す。一方、データが終了していれば、T=0かチェッ
クし(ステップ412)、T=0であるからステップ4
33で保持した最終文字のωを符号語 code(ω)とし
て出力して(ステップ413)、符号化処理を終了す
る。
Then, i is written in the ω 2 column of the p-th address (the address where the last character was stored) (i → ω
2 (p)). Thereby, the reference number of the string up to the current input character K is registered in the omega 2 column (Step 43
2). Hereinafter, the reference number of the character K is set to i, and
Is substituted for ω, and T and U are set to 0 (step 43).
3) Then, it is checked that the data is completed (step 411). If the data is not completed, step 40
Returning to step 2, the next input character is read, and the subsequent processing is repeated. On the other hand, if the data has been completed, it is checked whether T = 0 (step 412).
The final character ω held in 33 is output as the code word code (ω) (step 413), and the encoding process ends.

【0063】一方、ステップ430でU=0であれば、
今回の入力文字Kを第iアドレス(何も記憶されていな
い新たなアドレス)のext1欄に書き込み(K→ext
1(i))、そのflag欄に1-0を書き込む(1-0→flag(i))。
これにより、それ迄の文字列の最終文字(直前の入力文
字)に今回の入力文字Kを連結した文字列が登録され
る。・・・ステップ441 ついで、j=0かチェックする(ステップ442)。
尚、ステップ425の処理後にi=0となれば、すなわ
ち、第1、第2候補が存在し、いずれとも一致せず、ne
xt2欄が0の場合にj≠0となり、それ以外はj=0と
なる。
On the other hand, if U = 0 in step 430,
This input character K is written in the ext 1 column of the i-th address (a new address in which nothing is stored) (K → ext
1 (i)), 1-0 is written in the flag column (1-0 → flag (i)).
As a result, a character string in which the current input character K is linked to the last character of the previous character string (the immediately preceding input character) is registered. Step 441 Then, it is checked whether j = 0 (step 442).
If i = 0 after the process of step 425, that is, the first and second candidates exist, they do not match with each other, and ne
j ≠ 0 when the xt 2 column is 0, and j = 0 otherwise.

【0064】j≠0の場合には、i(今回の文字の格納
アドレス)を、アドレスjのnext2欄に書き込み(i→ne
xt2(j)、ステップ443)、以後ステップ433以降の
処理を繰り返す。j=0であれば、すなわち、第1候補
文字が存在しない場合、又は第1又は第2候補文字と一
致し、これら一致候補文字に連結する文字が存在しない
場合には、T=0かチェックし(ステップ444)、T
=0であれば、i(今回の文字の格納アドレス)を直前
の入力文字の格納アドレスωのfirst1欄に書き込み(i
→fitst1(ω)、ステップ445)、T=1であれば、i
(今回の文字の格納アドレス)を直前の入力文字の格納
アドレスωのfirst2欄に書き込み(i→fitst2(ω)、ス
テップ446)、以後ステップ433以降の処理を繰り
返す。
If j ≠ 0, i (the storage address of the current character) is written into the next 2 column of the address j (i → ne
xt 2 (j), step 443), and thereafter, the processing of step 433 and thereafter is repeated. If j = 0, that is, if the first candidate character does not exist, or if it matches the first or second candidate character and there is no character linked to these matching candidate characters, check if T = 0. (Step 444), T
If = 0, i (the storage address of the current character) is written in the first 1 column of the storage address ω of the immediately preceding input character (i
→ fitst 1 (ω), step 445), if T = 1, i
(The storage address of the current character) is written in the first 2 column of the storage address ω of the immediately preceding input character (i → fitst 2 (ω), step 446), and thereafter the processing of step 433 and thereafter is repeated.

【0065】以上要約すれば、一度の辞書検索により第
1、第2候補文字ext1、ext2と共に、複数の次に参照す
べき候補文字が格納されているアドレスnext2,first1,f
irst 2を読み出しておき、(1) 入力文字が第1候補文字
と一致した場合にはfirst1アドレスより次に参照すべき
複数の候補文字とアドレスを直ちに読み出して次の入力
文字との比較照合を行い、又、(2)入力文字が第2候補
文字と一致した場合にはfirst2アドレスより次に参照す
べき複数の候補文字とアドレスを直ちに読み出して次の
入力文字との比較照合を行い、更に、(3)入力文字が第
1、第2候補文字の両方と一致しない場合には、next2
アドレスより次に参照すべき複数候補文字とアドレスを
直ちに読み出して今回の入力文字との比較照合を行い、
first,next方向に一致文字が見つからなくなると、辞書
検索を終了して最長一致文字列の符号語を出力し、つい
で辞書登録し、しかる後、次の入力文字から再び辞書検
索を開始する。以上の流れ図に従って、図3(a)の最上
段に示す文字列を符号化出力してゆくと図3(b)の辞書
が作成される。
In summary, the first dictionary search allows
1, second candidate character ext1, ExtTwoTogether with multiple references
Address next where the candidate character to be stored is nextTwo, first1, f
irst TwoAnd (1) the input character is the first candidate character
First if matches1Should be referenced next to address
Read multiple candidate characters and addresses immediately and enter next
Performs comparison and comparison with characters, and (2) the input character is a second candidate
First if matches characterTwoRefer to next from address
Read multiple candidate characters and addresses immediately
The input character is compared and collated, and (3) the input character is
If they do not match both the first and second candidate characters, nextTwo
Multiple candidate characters and addresses to be referenced next to the address
Immediately read out and compare and match with this input character,
If no matching character is found in the first or next direction, the dictionary
Terminates the search and outputs the code word of the longest matching character string.
To register the dictionary.
Start searching. According to the above flow chart, the top of FIG.
As the character string shown in the column is encoded and output, the dictionary shown in FIG.
Is created.

【0066】図6は本発明に係わる辞書検索回路の第1
の実施例である。MPU(マイクロ・プロセッサ・ユニ
ット)12は図示しないDMA回路を介して入力文字K
を読み込んで比較照合部14の第1レジスタ14aに格
納すると共に、直前の入力文字の参照番号をアドレスと
して辞書メモリ11をアクセスし、以下のデータ (1) 所定文字に連結する第1文字(ext1)と、(2) 第1文
字迄の文字列の番号(ω1)と、(3) 前記所定文字に連
結する文字であって第1文字とは別の第2文字(ext2)
と、 (4) 第2文字までの文字列の番号(ω2)と、(5)
前記所定文字に連結する第1、第2文字とは別の第3文
字の格納アドレス(next2)と、(6) 第1文字に連結する
第4文字の格納アドレス(first1)と、(7) 第2文字に連
結する第5文字の格納アドレス(first2)と、(8) 第1、
第2文字のうち幾つ記憶されているかを示すフラグ(fla
g)を取り込むと共にコントローラ16に辞書検索の命令
を出す。これにより、コントローラ16は、上記データ
のうち所定のデータをレジスタ部13に一括して格納す
る。すなわち、flagデータをレジスタ13aに、first1
アドレスをレジスタ13bに、first2アドレスをレジス
タ13cに、next2アドレスをレジスタ13dに、第1
候補文字ext1(=K1)をレジスタ13eに、第2候補
文字ext2(=K2)をレジスタ13fに一度にラッチす
る。
FIG. 6 shows a first example of the dictionary search circuit according to the present invention.
This is an embodiment of the present invention. An MPU (microprocessor unit) 12 inputs an input character K via a DMA circuit (not shown).
Is read and stored in the first register 14a of the comparison and collation unit 14, and the dictionary memory 11 is accessed using the reference number of the immediately preceding input character as an address, and the following data (1) The first character (ext 1 ), (2) the number of the character string up to the first character (ω 1 ), and (3) the second character (ext 2 ) which is a character connected to the predetermined character and which is different from the first character
And (4) the number of the character string up to the second character (ω 2 ), and (5)
A storage address (next 2 ) of a third character different from the first and second characters connected to the predetermined character, (6) a storage address (first 1 ) of a fourth character connected to the first character, and ( 7) The storage address (first 2 ) of the fifth character to be connected to the second character, and (8) the first,
A flag (fla) indicating how many of the second characters are stored
g), and issues a dictionary search command to the controller 16. As a result, the controller 16 collectively stores predetermined data of the data in the register unit 13. That is, the flag data is stored in the register 13a, and the first 1
The address is stored in the register 13b, the first 2 address is stored in the register 13c, the next 2 address is stored in the register 13d, and the first
The candidate character ext 1 (= K 1 ) is latched in the register 13e and the second candidate character ext 2 (= K 2 ) is latched in the register 13f at a time.

【0067】ついで、コントローラ16の制御で、比較
照合部14の第1、第2比較回路14b,14cは、第
1、第2の候補文字K1,K2とレジスタ14aにラッチ
してある入力文字Kを同時に比較照合する。尚、比較回
路14b,14cは、flagデータが入力されており、
(1)第1、第2候補文字の両方が共に存在するか、(2)第
1候補文字のみが存在するか、(3)第1、第2候補文字
の両方共存在しないかを認識している。
Then, under the control of the controller 16, the first and second comparison circuits 14b and 14c of the comparison and collation unit 14 input the first and second candidate characters K 1 and K 2 and the input latched in the register 14a. The character K is compared and matched at the same time. Note that the comparison circuits 14b and 14c receive the flag data, and
It is recognized whether (1) both the first and second candidate characters exist, (2) only the first candidate character exists, and (3) whether both the first and second candidate characters do not exist. ing.

【0068】比較照合の結果、入力文字と第1候補文字
が一致する場合には、コントローラ16はアドレス選択
部(マルチプレクサ)15により、レジスタ13bに記
憶されているfirst1アドレスを選択・出力させる。
As a result of the comparison and collation, if the input character matches the first candidate character, the controller 16 causes the address selecting section (multiplexer) 15 to select and output the first 1 address stored in the register 13b.

【0069】連結検出部17はfirst1アドレスが0であ
るかどうかを判断し、0であれば最早first1方向に候補
文字は存在しないから、候補文字無しをMPU12に通
知し、first1アドレスが0でなければ、該アドレスをM
PU12に通知する。MPU12はfirst1アドレスが通
知されれば、次の入力文字を読み取ってレジスタ14a
に格納すると共に、前記first1アドレスを用いて辞書メ
モリ11をアクセスし、読み取ったデータをコントロー
ラ16の制御でレジスタ部13に格納し、以後前述の比
較照合動作を繰り返す。
[0069] connection detecting unit 17 determines whether the first 1 address is 0, since the candidate character is not present in the longer first 1 direction if 0, notifies the no candidate character MPU 12, first 1 addresses If not 0, the address is M
Notify PU12. When notified of the first 1 address, the MPU 12 reads the next input character, and
And the dictionary memory 11 is accessed using the first 1 address, and the read data is stored in the register unit 13 under the control of the controller 16, and thereafter the above-described comparison and collation operation is repeated.

【0070】一方、MPU12は連結検出部17より、
候補文字無しを受信すれば、コントローラ16に最長一
致文字列の検索が終了した旨を通知すると共に、符号語
を作成して図示しないI/Oポートより出力し、又、辞
書メモリ11に辞書登録を行う。しかる後、入力データ
が終了してなければ、コントローラ16に辞書検索を指
令して次の入力文字列に対して同様の動作を繰り返す。
On the other hand, the MPU 12 detects the
When receiving no candidate character, it notifies the controller 16 that the search for the longest matching character string has been completed, creates a code word and outputs it from an I / O port (not shown), and registers the dictionary in the dictionary memory 11. I do. Thereafter, if the input data is not completed, a dictionary search is instructed to the controller 16 and the same operation is repeated for the next input character string.

【0071】以上は、比較照合部14による比較動作に
おいて、入力文字と第1候補文字が一致した場合である
が、入力文字と第2候補文字が一致した場合には、コン
トローラ16はアドレス選択部15をしてレジスタ13
cに記憶されているfirst2アドレスを選択・出力させ
る。連結検出部17はfirst2アドレスが0であるかどう
かを判断し、0であれば最早first2方向に候補文字は存
在しないから、候補文字無しをMPU12に通知し、fi
rst2アドレスが0でなければ、該アドレスをMPU12
に通知する。MPU12はfirst2アドレスが通知されれ
ば、次の入力文字を読み取ってレジスタ14aに格納す
ると共に、前記first2アドレスを用いて辞書メモリ11
をアクセスし、読み取ったデータをコントローラ16の
制御でレジスタ部13に格納し、以後前述の比較照合動
作を繰り返す。
The above is the case where the input character matches the first candidate character in the comparison operation by the comparison / matching unit 14, but if the input character matches the second candidate character, the controller 16 sets the address selection unit. Do 15 and register 13
Select and output the first 2 address stored in c. The connection detecting unit 17 determines whether or not the first 2 address is 0. If the address is 0, there is no candidate character in the first 2 direction anymore, so the MPU 12 notifies the MPU 12 that there is no candidate character, and fi
If the rst 2 address is not 0, the address is
Notify. MPU12 is if it is notified first 2 address, dictionary memory 11 with stores read the next input character to the register 14a, the first 2 address
And the read data is stored in the register section 13 under the control of the controller 16, and thereafter the above-described comparison and collation operation is repeated.

【0072】一方、MPU12は連結検出部17より、
候補文字無しを受信すれば、コントローラ16に最長一
致文字列の検索が終了した旨を通知すると共に、符号語
を作成して図示しないI/Oポートより出力し、又、辞
書メモリ11に辞書登録を行う。しかる後、入力データ
が終了してなければ、コントローラ16に辞書検索を指
令して次の入力文字列に対して同様の動作を繰り返す。
On the other hand, the MPU 12 outputs
When receiving no candidate character, it notifies the controller 16 that the search for the longest matching character string has been completed, creates a code word and outputs it from an I / O port (not shown), and registers the dictionary in the dictionary memory 11. I do. Thereafter, if the input data is not completed, a dictionary search is instructed to the controller 16 and the same operation is repeated for the next input character string.

【0073】又、比較照合の結果、入力文字が第1、第
2候補文字の両方に一致しない場合には、コントローラ
16はアドレス選択部15をしてレジスタ13dに記憶
されているnext2アドレスを選択・出力させる。連結検
出部17はnext2アドレスが0であるかどうかを判断
し、0であれば最早next2方向に候補文字は存在しない
から、候補文字無しをMPU12に通知し、next2アド
レスが0でなければ、該next2アドレスをMPU12に
通知する。MPU12はnext2アドレスが通知されれ
ば、該アドレスを用いて辞書メモリ11をアクセスし、
読み取ったデータをコントローラ16の制御でレジスタ
部13に格納し、以後前述の照合動作を繰り返す。
If the input character does not match both the first and second candidate characters as a result of the comparison and collation, the controller 16 operates the address selecting section 15 to change the next 2 address stored in the register 13d. Select and output. The connection detecting unit 17 determines whether or not the next 2 address is 0. If it is 0, no candidate character exists in the next 2 direction, so the MPU 12 notifies the MPU 12 that there is no candidate character, and the next 2 address must be 0. If so, the MPU 12 is notified of the next 2 address. When notified of the next 2 address, the MPU 12 accesses the dictionary memory 11 using the address, and
The read data is stored in the register section 13 under the control of the controller 16, and thereafter, the above-described collating operation is repeated.

【0074】一方、MPU12は連結検出部17より、
候補文字無しを受信すれば、コントローラ16に最長一
致文字列の検索が終了した旨を通知すると共に、符号語
を作成・出力し、又、辞書メモリ11に辞書登録を行
う。しかる後、入力データが終了してなければ、コント
ローラ16に辞書検索を指令して以上の動作を繰り返
す。
On the other hand, the MPU 12 outputs
When receiving no candidate character, the controller 16 notifies the controller 16 that the search for the longest matching character string has been completed, creates and outputs a code word, and registers the dictionary in the dictionary memory 11. Thereafter, if the input data is not completed, a dictionary search is instructed to the controller 16 and the above operation is repeated.

【0075】図7は本発明に係わる辞書検索回路の別の
実施例で、図6と同一部分には同一符号を付している。
図6の構成と異なる点は、(1) 辞書メモリ11に第1候
補文字、第2候補文字の参照番号ω1,ω2を記憶しない
点、(2) firstアドレスから参照番号(アドレス)への変
換メモリ21が設けられている点、(3) MPU12の符
号語出力処理が楽になっている点である。first1欄に書
き込まれているアドレスデータ(first1(i))と、該アド
レスデータで指定される第1候補文字の参照番号
(ω1)は一致し、又、first2欄に書き込まれているア
ドレスデータ(first2(i))と、該アドレスデータで指定
される第2候補文字の参照番号(ω2)は一致してい
る。従って、辞書メモリ11に第1候補文字、第2候補
文字の参照番号ω1,ω2を記憶しなくてもアドレスデー
タfirst1(i),first2(i)より求めることができる。
FIG. 7 shows another embodiment of the dictionary search circuit according to the present invention, and the same parts as those in FIG. 6 are denoted by the same reference numerals.
The difference from the configuration of FIG. 6 is that (1) the reference numbers ω 1 and ω 2 of the first candidate character and the second candidate character are not stored in the dictionary memory 11, and (2) from the first address to the reference number (address). (3) that the MPU 12 can easily perform the code word output process. The address data (first 1 (i)) written in the first 1 column and the reference number (ω 1 ) of the first candidate character specified by the address data match, and the address data written in the first 2 column The address data (first 2 (i)) corresponding to the address matches the reference number (ω 2 ) of the second candidate character specified by the address data. Therefore, even if the reference numbers ω 1 and ω 2 of the first candidate character and the second candidate character are not stored in the dictionary memory 11, they can be obtained from the address data first 1 (i) and first 2 (i).

【0076】このため、入力文字が第1候補文字と一致
した場合には変換メモリにfirst1(i)を第1参照番号W1
として格納し、入力文字が第2候補文字と一致した場合
にはfirst2(i)を第1参照番号W1として格納する。そし
て、第1参照番号W1で指示された第1又は第2候補文
字が次の入力文字と一致した場合には、第1参照番号W
1を第2参照番号W2にし(W1→W2)、しかる後、前述
のやり方で新たな第1参照番号W1を求めて記憶する。
しかし、第1参照番号W1で指示された第1又は第2候
補文字が次の入力文字と一致しない場合には、それまで
の第2参照番号W 2を検索した最長一致文字列の符号語
としてMPU12に入力する。このようにすれば、MP
U12が毎回一致した参照番号ωを覚えておかなくて済
み、一致後の次の検索のための文字入力迄の時間を短縮
することができる。
Therefore, the input character matches the first candidate character.
The first in the conversion memory1(i) is the first reference number W1
And the input character matches the second candidate character
Has firstTwo(i) is the first reference number W1Stored as Soshi
And the first reference number W1First or second candidate sentence specified by
If the character matches the next input character, the first reference number W
1To the second reference number WTwoNishi (W1→ WTwo), And then,
New first reference number W in the manner of1Is searched for and memorized.
However, the first reference number W11st or 2nd weather indicated by
If the complement does not match the next input character,
Second reference number W TwoCodeword of the longest matching character string searched for
Is input to the MPU 12. In this way, MP
No need to remember the reference number ω that U12 matched each time
Only, shortens the time between entering characters for the next search after a match
can do.

【0077】以上、本発明を実施例により説明したが、
本発明は請求の範囲に記載した本発明の主旨に従い種々
の変形が可能であり、本発明はこれらを排除するもので
はない。
The present invention has been described with reference to the embodiments.
The present invention can be variously modified in accordance with the gist of the present invention described in the claims, and the present invention does not exclude these.

【0078】[0078]

【発明の効果】以上、本発明によれば、一度の辞書検索
により複数の候補文字を読み出し、複数の候補文字と1
つの入力文字とを一度に照合して辞書検索を行うように
したから、辞書検索を高速に行うことができる。又、本
発明によれば、一度の辞書検索により複数の候補文字と
共に、複数のアドレスを読み出し、複数の候補文字と1
つの入力文字との比較照合結果(第1候補と一致、第2
候補と一致、いずれの候補とも一致せず等)に基づいて
次に参照すべき複数の候補文字を直ちに前記所定アドレ
スから読み出して比較照合するように構成したから、連
続して動作が可能で辞書検索を高速に行うことができ
る。
As described above, according to the present invention, a plurality of candidate characters are read out by one dictionary search, and a plurality of candidate characters are
Since the dictionary search is performed by matching one input character at a time, the dictionary search can be performed at high speed. Further, according to the present invention, a plurality of addresses are read together with a plurality of candidate characters by a single dictionary search, and a plurality of candidate characters and one
Comparison result with two input characters (match with first candidate, second match
A plurality of candidate characters to be referred next are immediately read out from the predetermined address and compared and collated based on the candidate, matching none, etc. Search can be performed at high speed.

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

【図1】本発明の原理説明図である。FIG. 1 is a diagram illustrating the principle of the present invention.

【図2】本発明による辞書メモリの構造説明図である。FIG. 2 is a diagram illustrating the structure of a dictionary memory according to the present invention.

【図3】本発明による辞書内容説明図である。FIG. 3 is an explanatory diagram of dictionary contents according to the present invention.

【図4】本発明の符号化処理の第1の流れ図である。FIG. 4 is a first flowchart of an encoding process according to the present invention.

【図5】本発明の符号化処理の第2の流れ図である。FIG. 5 is a second flowchart of the encoding process of the present invention.

【図6】本発明による辞書検索回路の第1の構成図であ
る。
FIG. 6 is a first configuration diagram of a dictionary search circuit according to the present invention.

【図7】本発明による辞書検索回路の別の構成図であ
る。
FIG. 7 is another configuration diagram of the dictionary search circuit according to the present invention.

【図8】LZW符号化説明図である。FIG. 8 is an explanatory diagram of LZW encoding.

【図9】辞書構成の説明図である。FIG. 9 is an explanatory diagram of a dictionary configuration.

【図10】LZW符号化のフローチャートである。FIG. 10 is a flowchart of LZW encoding.

【図11】LZW復号化のフローチャートである。FIG. 11 is a flowchart of LZW decoding.

【図12】LZW復号化の例外時における説明図であ
る。
FIG. 12 is an explanatory diagram at the time of exception of LZW decoding.

【図13】LZW復号化説明図である。FIG. 13 is an explanatory diagram of LZW decoding.

【図14】外部ハッシュ法の説明図FIG. 14 is an explanatory diagram of an external hash method

【図15】外部ハッシュ法によるデータ構造説明図であ
る。
FIG. 15 is an explanatory diagram of a data structure by an external hash method.

【図16】外部ハッシュ法による辞書構造説明図であ
る。
FIG. 16 is an explanatory diagram of a dictionary structure by an external hash method.

【図17】外部ハッシュ法によるLZW復号化の辞書検
索、辞書登録のフローチャートである。
FIG. 17 is a flowchart of dictionary search and dictionary registration for LZW decoding by the external hash method.

【図18】辞書登録の様子を示す第1の説明図表であ
る。
FIG. 18 is a first explanatory chart showing a state of dictionary registration.

【図19】辞書登録の様子を示す第2の説明図表であ
る。
FIG. 19 is a second explanatory diagram showing a state of dictionary registration.

【図20】辞書登録の様子を示す第3の説明図表であ
る。
FIG. 20 is a third explanatory diagram showing a state of dictionary registration.

【図21】従来の外部ハッシュ法による辞書検索回路の
構成図である。
FIG. 21 is a configuration diagram of a conventional dictionary search circuit using an external hash method.

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

11 辞書メモリ 12 MPU 13 レジスタ部 14 比較照合部 15 アドレス選択部 DESCRIPTION OF SYMBOLS 11 Dictionary memory 12 MPU 13 Register part 14 Comparison collation part 15 Address selection part

───────────────────────────────────────────────────── フロントページの続き (72)発明者 千葉 広隆 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内 (56)参考文献 特開 昭60−116228(JP,A) 特開 平3−68219(JP,A) 特開 平3−204233(JP,A) 特開 昭59−231683(JP,A) 特開 昭58−155589(JP,A) 特開 昭61−13340(JP,A) (58)調査した分野(Int.Cl.7,DB名) H03M 7/40 ────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Hirotaka Chiba 1015 Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture Inside Fujitsu Limited (56) References JP-A-60-116228 (JP, A) JP-A-3-68219 (JP, A) JP-A-3-204233 (JP, A) JP-A-59-231683 (JP, A) JP-A-58-155589 (JP, A) JP-A-61-13340 (JP, A) ( 58) Field surveyed (Int.Cl. 7 , DB name) H03M 7/40

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 既に符号化済みの文字列を相異なる部分
文字列に分け、該部分文字列を辞書に登録しておき、入
力文字列と最長に一致する部分文字列を辞書から検索
し、該最長一致文字列の番号を指定して符号化するデー
タ圧縮における辞書検索方法において、 検索済文字列に連結する複数の候補文字が検索可能とな
るように複数のデータ要素を前記検索済文字列が指定す
る記憶域に記憶して部分文字列を辞書に登録し、 最長一致文字列の検索に際して、検索済文字列に応じた
前記データ要素を辞書より一括して読み出し、 前記データ要素に含まれる複数の候補文字と1つの入力
文字とを比較して一致照合を行い、 入力文字と一致する候補文字が存在する場合には、該候
補文字が指定する記憶域からデータ要素を読み出し、次
の入力文字と該データ要素に含まれる複数の候補文字と
を比較して最長一致検索処理を続行することを特徴とす
る辞書検索方法。
1. A character string that has already been encoded is divided into different partial character strings, the partial character strings are registered in a dictionary, and a partial character string that is the longest match with the input character string is searched from the dictionary. In the dictionary search method in data compression in which the number of the longest matching character string is designated and encoded, a plurality of data elements are added to the searched character string so that a plurality of candidate characters connected to the searched character string can be searched. Is stored in the storage area designated by the user, and the partial character string is registered in the dictionary. When searching for the longest matching character string, the data elements corresponding to the searched character string are collectively read from the dictionary and included in the data element. A plurality of candidate characters are compared with one input character for matching and, if there is a candidate character that matches the input character, a data element is read from the storage area specified by the candidate character and the next input character is read. Letters and Dictionary search method characterized by continuing the longest match search processing by comparing the plurality of candidate characters in the data element.
【請求項2】 前記データ要素は、検索済文字列に連結
する第1文字(ext1)と、前記検索済文字列に連結する文
字であって第1文字とは別の第2文字(ext2)と、前記
検索済文字列に連結する第1、第2文字とは別の第3文
字の格納アドレス(next2)と、第1文字に連結する第4
文字の格納アドレス(first1)と、第2文字に連結する第
5文字の格納アドレス(first2)と、第1、第2文字のう
ち幾つ記憶されているかを示すフラグ(flag)を有し、 1つの入力文字と複数の候補文字となる前記2つの第
1、第2文字の一致照合に際して、入力文字と第1、第
2文字が共に異なる場合にはアドレス(next2)に基づい
次のデータ要素を読み出して一致照合を行い、入力文字
と第1文字が一致する場合には、アドレス(first1)に
基づいて次の入力文字に対するデータ要素を読み出して
最長一致検索処理を続行し、入力文字と第2文字が一致
する場合には、アドレス(first2)に基づいて次の入力文
字に対するデータ要素を読み出して最長一致検索処理を
続行することを特徴とする請求項1記載の辞書検索方
法。
2. The data element includes a first character (ext 1 ) connected to a searched character string, and a second character (ext) connected to the searched character string and different from the first character. 2 ), a storage address (next 2 ) of a third character different from the first and second characters connected to the searched character string, and a fourth address connected to the first character.
It has a character storage address (first 1 ), a fifth character storage address (first 2 ) linked to the second character, and a flag (flag) indicating how many of the first and second characters are stored. When the input character and the first and second characters are different from each other in matching and matching one input character and the two first and second characters which are a plurality of candidate characters, the following is performed based on the address (next 2 ). The data element is read and matched for matching. If the input character matches the first character, the data element for the next input character is read based on the address (first 1 ), and the longest match search process is continued. 2. The dictionary search method according to claim 1, wherein when the character and the second character match, the data element for the next input character is read based on the address (first 2 ) and the longest match search process is continued. .
JP03324706A 1991-12-09 1991-12-09 Dictionary search method Expired - Fee Related JP3115066B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03324706A JP3115066B2 (en) 1991-12-09 1991-12-09 Dictionary search method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03324706A JP3115066B2 (en) 1991-12-09 1991-12-09 Dictionary search method

Publications (2)

Publication Number Publication Date
JPH05158987A JPH05158987A (en) 1993-06-25
JP3115066B2 true JP3115066B2 (en) 2000-12-04

Family

ID=18168804

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03324706A Expired - Fee Related JP3115066B2 (en) 1991-12-09 1991-12-09 Dictionary search method

Country Status (1)

Country Link
JP (1) JP3115066B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0551787U (en) * 1991-12-13 1993-07-09 株式会社三谷バルブ Ejector pump

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0551787U (en) * 1991-12-13 1993-07-09 株式会社三谷バルブ Ejector pump

Also Published As

Publication number Publication date
JPH05158987A (en) 1993-06-25

Similar Documents

Publication Publication Date Title
US4099257A (en) Markov processor for context encoding from given characters and for character decoding from given contexts
JP3038223B2 (en) Data compression method
JP3115066B2 (en) Dictionary search method
JPH10261969A (en) Data compression method and its device
JP3103172B2 (en) Dictionary search method
JP3038234B2 (en) Dictionary search method for data compression equipment
JP3130324B2 (en) Data compression method
JPH0628149A (en) Method for compressing plural kinds of data
JP2954749B2 (en) Data compression method
JP2952067B2 (en) Data compression method
JP2774350B2 (en) Data compression method and data restoration method of compressed data
JP3388768B2 (en) Data compression and decompression method
JP3053656B2 (en) Dictionary registration method in data compression
JPH05152971A (en) Data compressing/restoring method
JP2952068B2 (en) Data compression and decompression method
JP3236747B2 (en) Data decompression method
JP2825960B2 (en) Data compression method and decompression method
JP2535655B2 (en) Dictionary search method
JP3083550B2 (en) Data compression and decompression method
JPH05341953A (en) Method and device for compressing data
JP3088740B2 (en) Data compression and decompression method
JP2999561B2 (en) Data compression and decompression device
JP3012677B2 (en) ZL encoding method
JP3012678B2 (en) Data compression method
JP3058711B2 (en) Data compression and decompression method

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000912

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

Free format text: PAYMENT UNTIL: 20080929

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20080929

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20090929

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees