JP2769057B2 - Data compression device - Google Patents

Data compression device

Info

Publication number
JP2769057B2
JP2769057B2 JP3254540A JP25454091A JP2769057B2 JP 2769057 B2 JP2769057 B2 JP 2769057B2 JP 3254540 A JP3254540 A JP 3254540A JP 25454091 A JP25454091 A JP 25454091A JP 2769057 B2 JP2769057 B2 JP 2769057B2
Authority
JP
Japan
Prior art keywords
byte
mode
data
compression
hexadecimal
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 - Lifetime
Application number
JP3254540A
Other languages
Japanese (ja)
Other versions
JPH0566919A (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.)
Alps Alpine Co Ltd
Original Assignee
Alps Electric Co 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 Alps Electric Co Ltd filed Critical Alps Electric Co Ltd
Priority to JP3254540A priority Critical patent/JP2769057B2/en
Publication of JPH0566919A publication Critical patent/JPH0566919A/en
Application granted granted Critical
Publication of JP2769057B2 publication Critical patent/JP2769057B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Document Processing Apparatus (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 an apparatus for compressing character data, and more particularly to an apparatus for compressing Japanese character data.

【0002】[0002]

【従来の技術】JISコード体系やシフトJIS体系な
どにより、日本語の文字データは2バイトコードで表現
されているが、これらの2バイトコードを記録、伝送す
る際には、データ量を極力少なくすることがメモリ効率
上及びデータ伝送効率上望ましい。このため、漢字、ひ
らがな、片かな、記号の各文字種毎に制御コードを用意
し、同一文字種が連続するテキストデータの場合には、
同一文字種の先頭の文字データに制御コードを付加し、
この制御コードにより連続する同一文字種の第1バイト
を省略して、データ量を減少させるデータ圧縮装置が用
いられることが多い。
2. Description of the Related Art According to the JIS code system and the shift JIS system, Japanese character data is represented by two-byte codes. When recording and transmitting these two-byte codes, the data amount is minimized. It is desirable in terms of memory efficiency and data transmission efficiency. For this reason, a control code is prepared for each character type of kanji, hiragana, katakana, and symbol, and in the case of text data of the same character type,
A control code is added to the first character data of the same character type,
In many cases, a data compression device that reduces the amount of data by omitting consecutive first bytes of the same character type using this control code is often used.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、日本語
の文章はひらがな,漢字等の文字種が混在する率が高
く、同一文字種の連続性が乏しいので、従来装置では文
字種が代わるたびに異なる制御コードを付加する必要が
あり、このため、データの圧縮効率は低下する。
However, Japanese sentences have a high rate of mixture of character types such as hiragana and kanji, and the continuity of the same character type is poor. Therefore, in the conventional apparatus, a different control code is used each time the character type is changed. It is necessary to add data, and the data compression efficiency is reduced.

【0004】本発明は上記従来の事情に鑑みてなされた
ものであり、その目的は、文字種の混在度が高く、同一
文字種の連続性が乏しい日本語の文章であっても、高い
データ圧縮効率を維持できるデータ圧縮装置を提供する
ことにある。
SUMMARY OF THE INVENTION The present invention has been made in view of the above-mentioned circumstances, and has as its object to provide a high data compression efficiency even for Japanese sentences having a high degree of mixture of character types and poor continuity of the same character type. It is an object of the present invention to provide a data compression device capable of maintaining the data compression.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するため
に,請求項1記載のデータ圧縮装置は図1のように構成
されている。すなわち,順次入力されるひらがなまたは
記号を示す2バイトデータの第1バイトを圧縮モードが
切り替わるまで省略し第2バイトを数値変換して送出
,漢字を示す2バイトデータをそのまま送出する第1
圧縮モード10と,順次入力される片かなまたは記号を
示す2バイトデータの第1バイトを圧縮モードが切り替
わるまで省略し第2バイトを数値変換して送出し,漢字
を示す2バイトデータをそのまま送出する第2圧縮モー
ド12と,漢字を示す2バイトデータまたは1バイトデ
ータが入力されたときに2バイトデータまたは1バイト
データのまま送出する第3圧縮モード14と,を備えた
圧縮手段16と,ひらがなまたは記号を示す2バイトデ
ータが入力されたときに第1制御コードを送出し,片か
なまたは記号を示す2バイトデータが入力されたときに
第2制御コードを送出し,1バイトデータが入力された
ときに第3制御コードを送出して圧縮モードを切り替え
る切替手段18とを有して構成される。
In order to achieve the above object, a data compression apparatus according to the present invention is configured as shown in FIG. That is, the first byte of 2-byte data indicating a hiragana or a symbol that is sequentially input is omitted until the compression mode is switched, and the second byte is converted to a numerical value and transmitted.
And the two-byte data indicating the kanji is sent as it is.
In the compression mode 10, the first byte of 2-byte data indicating a sequentially input kana or symbol is omitted until the compression mode is switched , the second byte is converted to a numerical value and transmitted , and the 2-byte data representing a kanji is transmitted as it is. A compression means 16 having a second compression mode 12 for performing a second compression mode and a third compression mode 14 for transmitting two-byte data or one-byte data as kanji when the two-byte data or one-byte data is input. A first control code is transmitted when 2-byte data indicating a hiragana or a symbol is input, and a second control code is transmitted when 2-byte data indicating a hiragana or a symbol is input, and 1-byte data is input. And a switching means 18 for transmitting the third control code when the operation is performed to switch the compression mode.

【0006】[0006]

【作用】本発明では、記号を示す2バイトデータを複数
の圧縮モードで圧縮することができるので、ひらがなま
たは片かなの圧縮モードのときに、記号が入力されても
制御コードが送出されることがない。また、漢字を示す
2バイトデータも圧縮モードに関係なくそのまま送出さ
れるので、漢字が入力されたことに対する制御コードを
省略できる。
According to the present invention, two-byte data representing a symbol can be compressed in a plurality of compression modes. Therefore, in the hiragana or katakana compression mode, a control code is transmitted even if a symbol is input. There is no. Further, since the 2-byte data indicating the kanji is transmitted as it is regardless of the compression mode, the control code for the input of the kanji can be omitted.

【0007】[0007]

【実施例】以下、図に基づいて本発明にかかる装置の好
適な実施例について説明する。図2にはデータ圧縮装置
20が示されており、データ圧縮装置20には入力部2
2、モード切替部24、圧縮部26、出力部34が設け
られている。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A preferred embodiment of the apparatus according to the present invention will be described below with reference to the drawings. FIG. 2 shows a data compression device 20.
2, a mode switching unit 24, a compression unit 26, and an output unit 34 are provided.

【0008】圧縮部26には、順次入力されるひらがな
または記号を示す2バイトデータの第1バイトを圧縮モ
ードが切り替わるまで省略して送出し、漢字を示す2バ
イトデータをそのまま送出する第1圧縮モード28と、
順次入力される片かなまたは記号を示す2バイトデータ
の第1バイトを圧縮モードが切り替わるまで省略して送
出し、漢字を示す2バイトデータをそのまま送出する第
2圧縮モード30と、漢字を示す2バイトデータまたは
1バイトデータが入力されたときに2バイトデータまた
は1バイトデータのまま送出する第3圧縮モード32と
が備えらている。
[0008] The first compression unit 26 sends the first byte of the two-byte data indicating the hiragana or the symbol, which is sequentially input, until the compression mode is switched, and sends the two-byte data indicating the kanji as it is. Mode 28,
A second compression mode 30 in which the first byte of two-byte data indicating a sequentially input one-byte or symbol is omitted until the compression mode is switched, and a two-byte data indicating a kanji is directly transmitted; A third compression mode 32 is provided in which, when byte data or 1-byte data is inputted, 2-byte data or 1-byte data is transmitted as it is.

【0009】そして、これらの第1圧縮モード28、第
2圧縮モード30、第3圧縮モード32は、ひらがな,
漢字等の文字種毎がコード領域に区分されている入力デ
ータに応じてモード切替部24により切り替えられる。
The first compression mode 28, the second compression mode 30, and the third compression mode 32 correspond to hiragana,
Each mode is switched by the mode switching unit 24 in accordance with input data that is divided into code areas for each character type such as kanji.

【0010】例えば、図3で示される日本語漢字シフト
JISのコード体系のように、ひらがな(829F〜8
2F1)、片かな(8341〜8393)、記号(81
40〜817F)毎にコード領域が各々設定されてお
り、これらの設定領域に基づいて、ひらがなまたは記号
を示す2バイトデータが入力されたときに第1制御コ−
ド0F(16進)が、片かなまたは記号を示す2バイト
データが入力されたときに第2制御コ−ド13(16
進)が、1バイトデータが入力されたときは第3制御コ
−ドがモード切替部24から圧縮部26へ送出され、圧
縮部26ではこれらの制御データによりに第1圧縮モー
ド28、第2圧縮モード30、第3圧縮モード32が切
り替えられる。。
For example, as shown in the Japanese Kanji Shift JIS code system shown in FIG. 3, hiragana (829F-8
2F1), one-sided kana (8341-8393), symbol (81
40 to 817F), a code area is set for each of them, and based on these set areas, the first control code is input when 2-byte data indicating a hiragana or a symbol is input.
When 2-byte data indicating a one-sided kana or a symbol is input to the second control code 13 (16 hexadecimal),
When one byte data is input, a third control code is sent from the mode switching unit 24 to the compression unit 26, and the compression unit 26 uses the control data to perform the first compression mode 28 and the second compression mode. The compression mode 30 and the third compression mode 32 are switched. .

【0011】図4ではデータ圧縮装置20のデータ圧縮
作用が説明されており、入力部22を介してモード切替
部24に入力データの先頭の1バイトが与えられ(ステ
ップ401)、この1バイトが日本語シフトJISコー
ド体系で設定されている2バイト表現データの第1バイ
トを示すデータか否かが判断される(ステップ40
3)。
FIG. 4 illustrates the data compression operation of the data compression device 20. The first byte of input data is given to the mode switching unit 24 via the input unit 22 (step 401), and this one byte is It is determined whether or not the data indicates the first byte of the 2-byte representation data set in the Japanese shift JIS code system (step 40).
3).

【0012】入力された1バイトデータが日本語シフト
JISコード体系で設定された2バイトデータの第1バ
イトを示す場合(ステップ403でYES),さらにも
う1バイト読み込まれる(ステップ405)。そして,
読み込まれた2バイトはひらがなを示すデータであるか
否かが設定されているコード領域に従ってモード切替部
24で判断される(ステップ407)。ひらがなを示す
データであった場合で(ステップ407でYES),現
在の圧縮モードが第1圧縮モード28以外のときには,
モード切替部24から第1制御コード0F(16進)が
圧縮部26に送出され,圧縮部26の圧縮モードが第1
圧縮モード28に切り替えられる。さらに,圧縮部26
ではひらがなを示す入力データの第1バイトが省略さ
れ,第1制御コード0F(16進)と第2バイト−7
E(16進)のデータ(第2バイト値から7E(16
進)を減算した値)とが出力される(ステップ40
9)。また,現在の圧縮モードが第1圧縮モード28の
ときには,圧縮部26では入力データの第1バイトが省
略され,第2バイト−7E(16進)のデータのみが
出力される(ステップ409)。この第2バイトの値を
演算することにより,9F(16進)〜F1(16進)
の値のものが,21(16進)〜73(16進)に変換
される。これらの変換後の値は漢字を示す2バイトデー
タの第1バイトとは異なるため,第1圧縮モード28の
場合でもひらがなと漢字とは区別が可能となる。
If the input 1-byte data indicates the first byte of 2-byte data set in the Japanese shift JIS code system (YES in step 403), another 1-byte is read (step 405). And
The mode switching unit 24 determines whether the read two bytes are data indicating hiragana or not according to the set code area (step 407). If the data indicates hiragana (YES in step 407) and the current compression mode is other than the first compression mode 28,
The first control code 0F (hexadecimal) is transmitted from the mode switching unit 24 to the compression unit 26, and the compression mode of the compression unit 26 is set to the first mode.
The mode is switched to the compression mode 28. Further, the compression unit 26
The first byte of the input data indicating Hiragana is omitted, and the first control code 0F (hexadecimal) and the second byte value -7 are omitted.
E (hexadecimal) data (from the second byte value to 7E (16
) Is output (step 40).
9). Further, the current compression mode when <br/> of the first compression mode 28 is omitted first byte of the input data in the compression section 26, only the data of the second byte value -7E (16 hex) is It is output (step 409). The value of this second byte
By calculation, 9F (hexadecimal) to F1 (hexadecimal)
Is converted to 21 (hexadecimal) to 73 (hexadecimal)
Is done. These converted values are 2-byte data indicating Kanji.
Since it is different from the first byte of the data,
Even in this case, it is possible to distinguish between hiragana and kanji.

【0013】読み込まれた2バイトがひらがなではない
場合(ステップ407でNO),そのデータが片かなを
示すデータであるか否かが設定されているコード領域に
従ってモード切替部24で判断される(ステップ41
1)。そして,片かなを示すデータであった場合で(ス
テップ411でYES),現在の圧縮モードが第2圧縮
モード30以外のときには,モード切替部24から第2
制御コード13(16進)が圧縮部26に送出され,圧
縮部26の圧縮モードが切り替えられる。さらに,圧縮
部26で入力データの第1バイトが省略され,第2制御
コード13(16進)と第2バイト−20(16進)
データ(第2バイト値から20(16進)を減算した
値)とが出力される(ステップ413)。また,現在の
圧縮モードが第2圧縮モード30のときには,圧縮部2
6で入力データの第1バイトが省略され,第2バイト
−20(16進)のみが出力される(ステップ41
3)。この第2バイトの値を演算することにより,41
(16進)〜93(16進)の値のものが,21(16
進)〜73(16進)に変換され,ひらがなにおける第
2バイト値の変換後のものと共有される。しかしながら
それぞれは第1圧縮モード28ならひらがな,第2圧縮
モード30なら片かなと明確に区別される。さらに,第
1圧縮モード28と同様に第2圧縮モード30の場合で
も片かなと漢字とは区別が可能である。
If the two bytes read are not hiragana (NO in step 407), the mode switching unit 24 determines whether or not the data is data indicating one-sided kana according to the set code area ( Step 41
1). If the data indicates one-sided kana (YES in step 411) and the current compression mode is other than the second compression mode 30, the mode switching unit 24
The control code 13 (hexadecimal) is sent to the compression unit 26, and the compression mode of the compression unit 26 is switched. Further, the first byte of the input data is omitted in the compression unit 26, and the second control code 13 (hexadecimal) and the second byte value -20 (hexadecimal)
Data (20 (hexadecimal) is subtracted from the second byte value)
Values) are output (step 413). Also, when the compression mode the current is in the second compression mode 30, the compression section 2
In step 6, the first byte of the input data is omitted, and only the second byte value -20 (hexadecimal) is output (step 41).
3). By calculating the value of the second byte, 41
(Hexadecimal) to 93 (hexadecimal)
Hex) to 73 (hexadecimal).
Shared with the two byte value after conversion. However
Hiragana for the first compression mode 28, second compression
In mode 30, it is clearly distinguished as a one-piece. In addition,
In the case of the second compression mode 30 as in the case of the first compression mode 28,
It is possible to distinguish Mochikana from Kanji.

【0014】入力された2バイトがひらがな及び片かな
ではない場合(ステップ407でNO,ステップ411
でNO),その入力データは記号を示すデータであるか
否かが判断され(ステップ415),記号を示すデータ
である場合で(ステップ415でYES),第1圧縮モ
ード28または第2圧縮モード30のときには,その第
1バイトが省略されて第2バイト値+60(16進)の
データ(第2バイト値に60(16進)を加算した値)
のみが出力される(ステップ417)。現在の圧縮モー
ドが第1圧縮モード28及び第2圧縮モード30以外の
ときには,モード切替部24から第1制御コード0F
(16進)が送出されて圧縮部26の圧縮モードが第1
圧縮モード28に切り替えられ,第1制御コード0F
(16進)と第2バイト値+60(16進)のデータが
出力される(ステップ417)。この第2バイトの値を
演算することにより,40(16進)〜7F(16進)
の値のものが,A0(16進)〜DF(16進)に変換
される。この記号を示すデータは第1圧縮モード28あ
るいはまた第2圧縮モード30として扱いながらも,第
2バイト値の変換後の値はひらがな及び片かなの第2バ
イト値の変換後の値とはオーバーラップしないため,ひ
らがな及び片かなとは明確に区別される。さらには,こ
れらの変換後の値は漢字を示す2バイトデータの第1バ
イトとは異なるため,記号と漢字とは区別が可能とな
る。
If the input 2 bytes are not hiragana or katakana (NO in step 407, step 411)
NO), it is determined whether or not the input data is data indicating a symbol (step 415). If the input data is data indicating a symbol (YES in step 415), the first compression mode 28 or the second compression mode is determined. In the case of 30, the first byte is omitted and the second byte value + 60 (hexadecimal)
Data (value obtained by adding 60 (hexadecimal) to the second byte value)
Is output (step 417). When the current compression mode is other than the first compression mode 28 and the second compression mode 30, the first control code 0F
(Hexadecimal) is transmitted and the compression mode of the compression unit 26 is set to the first
Switching to the compression mode 28, the first control code 0F
(Hexadecimal) and the data of the second byte value +60 (hexadecimal) are output (step 417). The value of this second byte
By calculation, 40 (hex) to 7F (hex)
Is converted from A0 (hexadecimal) to DF (hexadecimal)
Is done. The data indicating this symbol is in the first compression mode 28
Or, while treating as the second compression mode 30,
The converted value of the 2-byte value is the second byte of Hiragana and Katakana.
Since the value does not overlap with the converted value,
It is clearly distinguished from kana and kana. Furthermore, this
These converted values are the first byte of 2-byte data indicating Kanji.
It is possible to distinguish between symbols and kanji
You.

【0015】入力された2バイトがひらがな、片かな及
び記号ではない場合(ステップ407でNO、ステップ
411でNO、ステップ415でNO)、その入力デー
タは他の2バイト系の文字(例えば漢字)なので、現在
の圧縮モードと関係なく2バイトがそのまま出力される
(ステップ419)。なお、現在の圧縮モードが第1圧
縮モード28及び第2圧縮モード30のときには、モー
ド切替部24から第3制御コ−ド0E(16進)が送出
されて圧縮部26の圧縮モードが第3圧縮モードに切り
替えられる(ステップ419)。
If the input 2 bytes are not hiragana, katakana or symbol (NO in step 407, NO in step 411, NO in step 415), the input data is another 2-byte character (for example, kanji). Therefore, 2 bytes are output as they are regardless of the current compression mode (step 419). When the current compression mode is the first compression mode 28 or the second compression mode 30, a third control code 0E (hexadecimal) is transmitted from the mode switching unit 24, and the compression mode of the compression unit 26 is set to the third compression mode. The mode is switched to the compression mode (step 419).

【0016】入力部22を介してモード切替部24に与
えられた1バイトが(ステップ401)、日本語シフト
JISコード体系で設定されている1バイト系のデータ
であると判断されると(ステップ403でNO)、その
1バイトが第1制御コード0F(16進)または第2制
御コード13(16進)と同一であるか否かが判断され
る(ステップ421)。このコードが第1制御コード0
F(16進)または第2制御コード13(16進)の場
合で(ステップ421でYES)、現在の圧縮モードが
第1圧縮モード28及び第2圧縮モード30のときに
は、モード切替部24から第3制御コ−ド0E(16
進)が圧縮部26に出力され、第3圧縮モード32に切
り替えられる。そして、同じ第3制御コード0E(16
進)が連続して2バイト分出力される(ステップ42
6)。これにより、圧縮モード切替データとしての第1
制御コ−ド0F(16進)及び第2制御コ−ド13(1
6進)と通常の1バイト文字データとしての0F(16
進)及び13(16進)とが区別される。
When one byte provided to the mode switching unit 24 via the input unit 22 (step 401) is determined to be 1-byte data set in the Japanese shift JIS code system (step 401). (NO in 403), it is determined whether or not the one byte is the same as the first control code 0F (hexadecimal) or the second control code 13 (hexadecimal) (step 421). This code is the first control code 0
In the case of F (hexadecimal) or the second control code 13 (hexadecimal) (YES in step 421), and when the current compression mode is the first compression mode 28 and the second compression mode 30, the mode switching unit 24 3 control code 0E (16
Hex) is output to the compression unit 26, and the mode is switched to the third compression mode 32. Then, the same third control code 0E (16
Hex) are continuously output for 2 bytes (step 42).
6). Thus, the first mode as the compression mode switching data
The control code 0F (hexadecimal) and the second control code 13 (1
Hexadecimal) and 0F (16
Hex) and 13 (hexadecimal).

【0017】また、与えられた1バイトが第1制御コー
ド0F(16進)または第2制御コード13(16進)
と同一でない場合(ステップ421でNO)、他の1バ
イト系の制御コ−ドであるか否かが判断され(ステップ
425)、他の制御コ−ド20(16進)以下であると
判断されると(ステップ425でYES)、データ圧縮
されないので、その1バイトはそのまま出力される(ス
テップ411)。
The given one byte is the first control code 0F (hexadecimal) or the second control code 13 (hexadecimal).
If it is not the same as the above (NO in step 421), it is determined whether or not it is another one-byte control code (step 425), and it is determined that it is equal to or less than another control code 20 (hexadecimal). If this is done (YES in step 425), since the data is not compressed, the one byte is output as it is (step 411).

【0018】さらに、与えらえた1バイトが第1制御コ
ード0F(16進)または第2制御コード13(16
進)と同一でない場合で(ステップ421でNO)、他
の1バイト系の制御コードでないとき(ステップ425
でNO)、データは一般の1バイト文字なので、第1圧
縮モード28または第2圧縮モード30であれば第3制
御コ−ド0E(16進)がモード切替部24から圧縮部
26に与えられ、第3圧縮モード32に切り替えられる
と共に、与えられた1バイトはそのまま出力される(ス
テップ429)。
Further, the given one byte is the first control code 0F (hexadecimal) or the second control code 13 (16
Hex) (NO in step 421) and when it is not another one-byte control code (step 425)
, NO), since the data is a general one-byte character, if the first compression mode 28 or the second compression mode 30, the third control code 0E (hexadecimal) is given from the mode switching unit 24 to the compression unit 26. Is switched to the third compression mode 32, and the given one byte is output as it is (step 429).

【0019】なお、これらのデータ圧縮は入力データの
先頭の1バイトが受け取られなくなるまで、繰り返し行
われる。また、ここでは、与えられた第2バイトが各圧
縮モードで、ひらがな等のデータをを21(16進)か
ら73(16進)までに整えており、これにより、他の
コード設定領域をより有効に利用することが可能とな
る。
These data compressions are repeated until the first byte of the input data is no longer received. Also, here, the given second byte arranges data such as hiragana from 21 (hexadecimal) to 73 (hexadecimal) in each compression mode, thereby making other code setting areas more compact. It can be used effectively.

【0020】図5では実施例による日本語文章のデータ
圧縮例が示されており、第5図(A)の『この「アルゴ
リズム」は日本語テキストに対し、かなりのデータ圧縮
を行う。』という全体で72バイトある文章が、図6
(B)のように50バイトまで圧縮される。
FIG. 5 shows an example of data compression of a Japanese sentence according to the embodiment. “This“ algorithm ”in FIG. 5A performs considerable data compression on Japanese text. The sentence with a total of 72 bytes is shown in FIG.
It is compressed to 50 bytes as shown in FIG.

【0021】図6はデータ圧縮装置20(図2参照)で
圧縮されたデータを伸長復元するデータ伸長装置40の
概略構成図である。図6において、データ伸長装置40
は入力部42、モード切替部44、伸長部46、出力部
64を備えており、伸長部46はデータ圧縮装置20の
第1圧縮モード28に対応した第1伸長モード48、第
2圧縮モード30に対応した第2伸長モード50、第3
圧縮モード32に対応した第3伸張モード52を選択実
行できるものとなっている。
FIG. 6 is a schematic block diagram of a data decompression device 40 for decompressing and decompressing data compressed by the data compression device 20 (see FIG. 2). In FIG. 6, the data decompression device 40
Has an input section 42, a mode switching section 44, an expansion section 46, and an output section 64. The expansion section 46 includes a first expansion mode 48 and a second compression mode 30 corresponding to the first compression mode 28 of the data compression device 20. Second decompression mode 50 corresponding to
The third decompression mode 52 corresponding to the compression mode 32 can be selectively executed.

【0022】図7ではデータ伸長装置40によるデータ
伸長作用が説明されており、与えられた圧縮データのう
ち先頭の1バイトがモード切替部44で受け取られ(ス
テップ701)、この1バイトが第1制御コ−ド0F
(16進)であるか否かが判断される(ステップ70
3)。そして、この1バイトが第1制御コ−ド0F(1
6進)であると判断されると(ステップ703でYE
S)、現在の伸長モードが第1伸長モード48以外のモ
ードの場合、第1伸長モード48に切替え、第1伸長モ
ード48である場合にはモード切替部44は第1バイト
を第1制御コ−ド0F(16進)として復元部46に出
力し、第3伸長モード52に切り替える(ステップ70
5)。
FIG. 7 illustrates the data decompression operation of the data decompression device 40. The first byte of the given compressed data is received by the mode switching unit 44 (step 701), and this one byte is the first byte. Control code 0F
(Hexadecimal) is determined (step 70).
3). This one byte is the first control code 0F (1
(Hexadecimal) (YE in step 703).
S) If the current decompression mode is a mode other than the first decompression mode 48, the mode is switched to the first decompression mode 48. If the current decompression mode is the first decompression mode 48, the mode switching unit 44 sets the first byte to the first control command. −0F (hexadecimal) to the restoring unit 46 and switch to the third decompression mode 52 (step 70).
5).

【0023】また、入力データの先頭1バイトが第1制
御コ−ド0F(16進)でないと判断されると(ステッ
プ703でNO)、その1バイトが第2制御コ−ド13
(16進)であるか否かが判断される(ステップ70
7)。そして、第2制御コ−ド13(16進)であると
判断されると(ステップ707でYES)、現在の伸長
モードが第2伸長モード50以外のモードの場合、第2
伸長モード50に切替えられ、第2伸長モード50であ
る場合には、モード切替部44はその第1バイトを第2
制御コ−ド13(16進)として伸長部46に出力し、
第3伸長モード52にモードに切り替える(ステップ7
09)。
If it is determined that the first byte of the input data is not the first control code 0F (hexadecimal) (NO in step 703), that one byte is used as the second control code 13.
(Hexadecimal) is determined (step 70).
7). If it is determined that the second control code is 13 (hexadecimal) (YES in step 707), and if the current decompression mode is a mode other than the second decompression mode 50, the second
When the mode is switched to the decompression mode 50 and the mode is the second decompression mode 50, the mode switching unit 44 stores the first byte in the second byte.
The control code 13 (hexadecimal) is output to the expansion unit 46,
The mode is switched to the third decompression mode 52 (step 7).
09).

【0024】また、1バイトが第2制御コ−ド13(1
6進)でないと判断されると(ステップ707でN
O)、その1バイトが第3制御コ−ド0E(16進)で
あるか否かが判断される(ステップ707)。この1バ
イトが第3制御コ−ド0E(16進)であると判断され
ると(ステップ711でYES)、現在の伸長モードが
第3伸長モード52以外の場合、第3伸長モード52に
切替えられ、第3伸長モード52である場合には第1バ
イトを復元部46に出力される(ステップ713)。
One byte is the second control code 13 (1
When it is determined that the value is not hexadecimal (N in step 707)
O) It is determined whether or not the one byte is the third control code 0E (hexadecimal) (step 707). If it is determined that this one byte is the third control code 0E (hexadecimal) (YES in step 711), if the current decompression mode is other than the third decompression mode 52, the mode is switched to the third decompression mode 52. In the third decompression mode 52, the first byte is output to the restoration unit 46 (step 713).

【0025】入力された1バイトが第1制御コード0F
(16進),第2制御コード13(16進),第3制御
コード0E(16進)のいづれでもない場合(ステップ
711でNO),現在の伸長モードが第1伸長モード4
8であるか否かが判断され(ステップ715),第1伸
長モード48である場合で(ステップ715でYE
S),第1バイトがひらがなのときには,日本語シフト
JISコード体系のひらがな第1バイトに相当する82
(16進)と第2バイトとして第1バイト値+7E(1
6進)を出力し,第1バイトが記号のときには,日本語
シフトJISコード体系の記号第1バイトに相当する8
1(16進)と第2バイトとして第1バイト値−60
(16進)を出力し,第1バイトがひらがな及び記号以
外のコードに相当するときには,そのまま第1バイトが
出力される(ステップ717)。
The input 1 byte is the first control code 0F.
(Hexadecimal), the second control code 13 (hexadecimal), when the third control code 0E (hexadecimal) also Izure of not Na (NO at step 711), the current extension mode first extending mode 4
8 is determined (step 715), and in the case of the first decompression mode 48 (YE in step 715).
S) When the first byte is Hiragana, it corresponds to the Hiragana first byte of the Japanese shift JIS code system.
(Hexadecimal) and the first byte value + 7E (1
Hexadecimal), and when the first byte is a symbol, 8 equivalent to the first byte of the symbol in the Japanese shift JIS code system
1 (hexadecimal) and the first byte value -60 as the second byte
(Hexadecimal) is output, and if the first byte corresponds to a code other than hiragana and a symbol, the first byte is output as it is (step 717).

【0026】また,現在の伸長モードが第1伸長モード
48でない場合(ステップ715でNO),現在の伸長
モードが第2伸長モード50であるか否かが判断される
(ステップ719)。そして,第2伸長モード50であ
る場合で(ステップ719でYES),第1バイトが片
かなのときには,日本語シフトJISコード体系の片か
な第1バイトに相当する83(16進)と第2バイトと
して第1バイト値+20(16進)を出力し,第1バイ
トが記号のときには,日本語シフトJISコード体系の
記号第1バイトである81(16進)と第2バイトとし
て第1バイト値−60(16進)を出力し,第1バイト
片かな及び記号以外のときには,そのまま第1バイト
が出力される(ステップ721)。
If the current decompression mode is not the first decompression mode 48 (NO in step 715), it is determined whether the current decompression mode is the second decompression mode 50 (step 719). If the first decompression mode is the second decompression mode 50 (YES in step 719) and the first byte is one-sided, 83 (hexadecimal) corresponding to the one-sided first byte of the Japanese shift JIS code system and the second Bytes and
And outputs the first byte value +20 (hexadecimal). If the first byte is a symbol, the first byte is 81 (hexadecimal), which is the first byte of the Japanese Shift JIS code system, and the second byte.
To output the first byte value -60 (hexadecimal), and when the first byte is other than a one-byte kana or symbol, the first byte is output as it is (step 721).

【0027】現在の伸長モードが第1伸長モード48及
び第2伸長モード50でない場合(ステップ719でN
O)、そのまま第1バイトが出力される(ステップ72
3)。このように、前述したデータ圧縮と逆の作用によ
りデータの伸長を行うことができる。なお、データ圧縮
装置20及びデータ復元装置40では日本語シフトJI
Sコード体系に対応したデータの圧縮伸長について説明
したが、他のコード体系でもこのデータ圧縮伸長は可能
である。また、前述した制御コ−ドも適宜変更すること
ができる。
If the current decompression mode is not the first decompression mode 48 or the second decompression mode 50 (N in step 719)
O), the first byte is output as it is (step 72)
3). In this manner, data can be expanded by the reverse operation of the above-described data compression. In the data compression device 20 and the data decompression device 40, the Japanese shift JI
Although the data compression and decompression corresponding to the S code system has been described, the data compression and decompression can be performed with other code systems. Further, the above-described control codes can be appropriately changed.

【0028】以上説明したように本実施例によれば、記
号を示す2バイトデータを第1圧縮モード28と第2圧
縮モード30の圧縮モードで圧縮することができるの
で、日本語に多用される句読点等のデータが入力されて
も圧縮モードを切り替える必要がない。したがって、記
号が入力されるたびにそれらに対する特定の制御コード
を送出することがないので、データの圧縮効率を高く維
持することができる。また、漢字を示す2バイトコード
は圧縮モードに関係なくそのまま送出されるので、漢字
とひらがなまたは片かなが混在する文章であっても、漢
字に対する特定の制御コードを送出することがない。こ
のため、ひらなが,漢字等の文字種の混在度が高く、同
一文字種の連続性が乏しい日本語の文章であっても、デ
ータの圧縮効率を高く維持できる。
As described above, according to the present embodiment, two-byte data representing a symbol can be compressed in the first compression mode 28 and the second compression mode 30. Therefore, it is frequently used in Japanese. There is no need to switch the compression mode even if data such as punctuation is input. Therefore, a specific control code for symbols is not sent every time a symbol is input, so that high data compression efficiency can be maintained. Also, since the two-byte code indicating the kanji is sent as it is regardless of the compression mode, even if the sentence is a mixture of kanji and hiragana or katakana, no specific control code for the kanji is sent. For this reason, even in the case of Hiragana, a Japanese sentence with a high degree of mixture of character types such as kanji and poor continuity of the same character type, high data compression efficiency can be maintained.

【0029】[0029]

【発明の効果】以上説明したように本発明によれば、記
号を示す2バイトコードを複数の圧縮モードで圧縮する
ことができ、漢字を示す2バイトコードはそのまま送出
されるので、漢字または記号が入力されるたびにそれら
に対する特定の制御コードを送出することがない。した
がって、ひらなが,漢字等の文字種の混在度が高く、同
一文字種の連続性が乏しい日本語の文章であっても、高
いデータ圧縮効率を維持できる。
As described above, according to the present invention, a two-byte code representing a symbol can be compressed in a plurality of compression modes, and a two-byte code representing a kanji is transmitted as it is. Does not send out a specific control code for them each time they are entered. Accordingly, high data compression efficiency can be maintained even for Japanese sentences in which hiragana has a high degree of mixture of character types such as kanji and poor continuity of the same character type.

【図面の簡単な説明】[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 configuration of an embodiment.

【図3】シフトJISコード体系の概略説明図である。FIG. 3 is a schematic explanatory diagram of a shift JIS code system.

【図4】実施例のデータ圧縮作用を説明するフローチャ
ートである。
FIG. 4 is a flowchart illustrating a data compression operation of the embodiment.

【図5】データ圧縮された具体例の説明図である。FIG. 5 is an explanatory diagram of a specific example of data compression.

【図6】データ伸長装置の概略構成図である。FIG. 6 is a schematic configuration diagram of a data decompression device.

【図7】データ伸長装置のデータ伸長作用を説明するフ
ローチャートである。
FIG. 7 is a flowchart illustrating a data decompression operation of the data decompression device.

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

20 データ圧縮装置 22,42 入力部 24,44 モード切替部 26 圧縮部 28 第1圧縮モード 30 第2圧縮モード 32 第3圧縮モード 34,54 出力部 40 データ伸長装置 Reference Signs List 20 data compression device 22, 42 input unit 24, 44 mode switching unit 26 compression unit 28 first compression mode 30 second compression mode 32 third compression mode 34, 54 output unit 40 data decompression device

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 順次入力されるひらがなまたは記号を示
す2バイトデータの第1バイトを圧縮モードが切り替わ
るまで省略し第2バイトを数値変換して送出し,漢字を
示す2バイトデータをそのまま送出する第1圧縮モード
(10)と,順次入力される片かなまたは記号を示す2
バイトデータの第1バイトを圧縮モードが切り替わるま
省略し第2バイトを数値変換して送出し,漢字を示す
2バイトデータをそのまま送出する第2圧縮モード(1
2)と,漢字を示す2バイトデータまたは1バイトデー
タが入力されたときに2バイトデータまたは1バイトデ
ータのまま送出する第3圧縮モード(14)と,を備え
た圧縮手段(16)と,ひらがなまたは記号を示す2バ
イトデータが入力されたときに第1制御コードを送出
し,片かなまたは記号を示す2バイトデータが入力され
たときに第2制御コードを送出し,1バイトデータが入
力されたときに第3制御コードを送出して圧縮モードを
切り替える切替手段(18)と,を有することを特徴と
するデータ圧縮装置。
The first byte of 2-byte data indicating a hiragana or a symbol which is sequentially input is omitted until the compression mode is switched , the second byte is converted into a numerical value and transmitted , and the 2-byte data representing a kanji is transmitted as it is. 1st compression mode (10) and 2 indicating a sequentially input kana or symbol
The second compression mode (1) in which the first byte of the byte data is omitted until the compression mode is switched , the second byte is converted into a numerical value and transmitted , and the 2-byte data indicating the kanji is transmitted as it is
Compression means (16) having 2) and a third compression mode (14) for transmitting 2-byte data or 1-byte data as kanji when the 2-byte data or 1-byte data is input, without change; A first control code is transmitted when 2-byte data indicating a hiragana or a symbol is input, and a second control code is transmitted when 2-byte data indicating a hiragana or a symbol is input, and 1-byte data is input. And a switching means (18) for transmitting a third control code when switching is performed to switch the compression mode.
JP3254540A 1991-09-06 1991-09-06 Data compression device Expired - Lifetime JP2769057B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3254540A JP2769057B2 (en) 1991-09-06 1991-09-06 Data compression device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3254540A JP2769057B2 (en) 1991-09-06 1991-09-06 Data compression device

Publications (2)

Publication Number Publication Date
JPH0566919A JPH0566919A (en) 1993-03-19
JP2769057B2 true JP2769057B2 (en) 1998-06-25

Family

ID=17266464

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3254540A Expired - Lifetime JP2769057B2 (en) 1991-09-06 1991-09-06 Data compression device

Country Status (1)

Country Link
JP (1) JP2769057B2 (en)

Also Published As

Publication number Publication date
JPH0566919A (en) 1993-03-19

Similar Documents

Publication Publication Date Title
US5771010A (en) Apparatus for compressing data using a Lempel-Ziv-type algorithm
US6218970B1 (en) Literal handling in LZ compression employing MRU/LRU encoding
JPH088755A (en) High-speed variable-length decoder
JPH10341167A (en) Variable length code decoding circuit
JP2769057B2 (en) Data compression device
JPS63148717A (en) Data compression and restoration processor
JP2001245162A (en) Image processor
JP2769056B2 (en) Data compression device
JPH11161469A (en) Code expanding circuit
JP3386638B2 (en) Variable length code decoding method and apparatus
JPH0551943B2 (en)
JP2786161B2 (en) Data transfer method
JPS63137375A (en) Lsi for image processing
JP2966437B2 (en) Run length code encoder
US6653949B1 (en) Data compression apparatus and method utilizing tandem coupled matrices
US6812866B1 (en) Data decompressor utilizing sequentially coupled logic elements
JP2748718B2 (en) Synchronous terminal equipment control system
KR930002789B1 (en) Code extending circuit in 32-bit micro processor
JPH0199388A (en) Data expansion system
US6756923B1 (en) Data compressor utilizing switched input coincidence elements arranged in virtual levels
JPS6266315A (en) Input control system
JPS6224806B2 (en)
JPH0837602A (en) Data compression device/method
JPH0644039A (en) Variable-length code decoding device
JPS6141184A (en) Data processor

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