JP2017208644A - Decoding program, decoding method, and decoding apparatus - Google Patents

Decoding program, decoding method, and decoding apparatus Download PDF

Info

Publication number
JP2017208644A
JP2017208644A JP2016098753A JP2016098753A JP2017208644A JP 2017208644 A JP2017208644 A JP 2017208644A JP 2016098753 A JP2016098753 A JP 2016098753A JP 2016098753 A JP2016098753 A JP 2016098753A JP 2017208644 A JP2017208644 A JP 2017208644A
Authority
JP
Japan
Prior art keywords
code
byte
word
conversion unit
assignment table
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.)
Granted
Application number
JP2016098753A
Other languages
Japanese (ja)
Other versions
JP6665679B2 (en
Inventor
片岡 正弘
Masahiro Kataoka
正弘 片岡
樹一 山田
Kiichi Yamada
樹一 山田
晴康 上田
Haruyasu Ueda
晴康 上田
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 JP2016098753A priority Critical patent/JP6665679B2/en
Priority to US15/207,876 priority patent/US9779071B2/en
Priority to EP16179064.7A priority patent/EP3119003A3/en
Priority to CN201610545992.5A priority patent/CN106354699B/en
Priority to US15/722,203 priority patent/US20180052810A1/en
Publication of JP2017208644A publication Critical patent/JP2017208644A/en
Application granted granted Critical
Publication of JP6665679B2 publication Critical patent/JP6665679B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To assign two bytes or more of codes such as codes associated with characters or words of high frequency of occurrence that should be assigned to short codes to one byte code.SOLUTION: A code conversion unit 850 of a decoding apparatus 800 uses a plurality of automatons generated on the basis of a second code allocation table to decode coded data into character data by an automaton selected according to a value of first 4 bits of the data among the plurality of automata.SELECTED DRAWING: Figure 25

Description

本発明は、復号化プログラム等に関する。   The present invention relates to a decryption program and the like.

従来のテキストデータは、ASCIIコードおよびユニコード(Unicode)のコード割当表に基づいて所定のコードに置き換えられる。図30は、従来のASCIIコードおよびユニコードに基づくコード割当表を説明するための図である。図30に示すように、コード割当表の00h〜1Fhには、所定の制御記号が設定され、各制御記号には、1バイトのコードが割り当てられる。コード割当表の20h〜7Fhには、英数字が設定され、各英数字には、1バイトのコードが割り当てられる。コード割当表の80h〜FFhには、CJK文字が設定され、各CJK文字には、3バイトのコードが割り当てられる。   Conventional text data is replaced with a predetermined code based on an ASCII code and Unicode code assignment table. FIG. 30 is a diagram for explaining a code assignment table based on a conventional ASCII code and Unicode. As shown in FIG. 30, predetermined control symbols are set in 00h to 1Fh in the code assignment table, and a 1-byte code is assigned to each control symbol. Alphanumeric characters are set in 20h to 7Fh of the code assignment table, and a 1-byte code is assigned to each alphanumeric character. CJK characters are set in 80h to FFh of the code assignment table, and a 3-byte code is assigned to each CJK character.

ここで、従来技術1には、コード割当表の制御記号を割り当てる00h〜1Fhに空き領域が存在する場合に、係る空き領域に単語等を登録し、かかるコード割当表を用いてコード化を実行する技術がある。また、従来技術2には、コード割当表の英大文字の領域において、英大文字の代わりに他の文字を設定し、かかるコード割当表を用いて、コード化を実行する技術がある。   Here, in the prior art 1, when an empty area exists in 00h to 1Fh to which the control symbols of the code allocation table are allocated, a word or the like is registered in the empty area and the encoding is executed using the code allocation table. There is technology to do. Further, in the prior art 2, there is a technique in which other characters are set instead of uppercase letters in the uppercase area of the code assignment table, and encoding is executed using the code assignment table.

特開平7−287716号公報JP-A-7-287716 特開平11−143877号公報Japanese Patent Laid-Open No. 11-143877

しかしながら、上述した従来技術では、出現頻度が高い単語や一般記号に対して、短いバイトコードを割り当てることができないという問題がある。   However, the above-described conventional technique has a problem that short bytecodes cannot be assigned to words and general symbols that appear frequently.

例えば、テキストデータを送受信する者同士が、使用しない制御記号や英大文字とそのコード割当表を共有する場合に限り、従来技術1、2のように、制御記号の空き領域等に単語を割り当てることで、出現頻度が高い文字や単語に短いバイトコードに割り当てることができる。   For example, assigning a word to an empty area of a control symbol as in the prior arts 1 and 2 only when those who send and receive text data share a control symbol that is not used or an uppercase letter and its code assignment table Thus, it is possible to assign a short byte code to a character or word having a high appearance frequency.

一方、一般のテキストデータを構成する単語や一般記号の出現頻度に応じて可変長符号を割り当てると、約40種の符号長が5〜8ビット、約8千種の符号長が9〜16ビットである。そこで、単語や一般記号に対し、その出現頻度に応じて、32種以上に1バイトコード、8192種以上に2バイトコードを割り当てることで、高い圧縮率を達成する圧縮処理を行うことができる。しかし、かかる従来技術1,2では、多量な単語や一般記号にコード割当てすることができない。   On the other hand, when variable length codes are assigned according to the appearance frequency of words and general symbols constituting general text data, about 40 types of code lengths are 5 to 8 bits and about 8,000 types of code lengths are 9 to 16 bits. is there. Accordingly, by assigning 1 byte code to 32 or more types and 2 byte code to 8192 or more types according to the appearance frequency of words and general symbols, compression processing that achieves a high compression rate can be performed. However, in the related arts 1 and 2, codes cannot be assigned to a large number of words and general symbols.

1つの側面では、本発明は、短いコードに割り当てるべき、出現頻度が高い文字や単語に対応付けられたコード等の2バイト以上のコードを1バイトコードに割り当てることができる復号化プログラム、復号化方法および復号化装置を提供することを目的とする。   In one aspect, the present invention relates to a decoding program that can assign a code of 2 bytes or more, such as a code associated with a character or word having a high appearance frequency, that should be assigned to a short code, to a 1-byte code, It is an object to provide a method and a decoding device.

第1の案では、コンピュータに下記の処理を実行させる。コンピュータは、第2コード割当表を基にして生成された複数のオートマトンを利用し、コード化されたデータを複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化する。第2コード割当表は、第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当てた変換規則である。また、第2コード割当表は、2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則である。また、第2コード割当表の変換規則では、コード化された符号データの先頭4ビットの値が当該符号データのコード長に応じて異なる。   In the first plan, the computer executes the following processing. The computer uses a plurality of automata generated based on the second code allocation table, and uses the automaton selected from the plurality of automata according to the value of the first 4 bits of the data. Decrypt into character data. The second code assignment table is a conversion rule in which a part of the characters assigned to the 1-byte area of the first code assignment table is assigned to the 2-byte area. The second code allocation table is a conversion rule for encoding input character data by allocating a code of 2 bytes or more to at least a part of the character allocated to the 2-byte area. Further, according to the conversion rule of the second code allocation table, the value of the first 4 bits of the encoded code data differs depending on the code length of the code data.

出現頻度が高い文字や単語に対して、短いバイトコードを割り当てることができる。   Short byte codes can be assigned to characters and words that appear frequently.

図1aは、本実施例1に係る符号化装置の処理の一例を示す図である。FIG. 1A is a diagram illustrating an example of processing of the encoding apparatus according to the first embodiment. 図1bは、本実施例1に係る復号化装置の処理の一例を示す図である。FIG. 1B is a diagram illustrating an example of processing of the decoding apparatus according to the first embodiment. 図2aは、本実施例1に係る符号化装置の構成を示す機能ブロック図である。FIG. 2A is a functional block diagram illustrating the configuration of the encoding device according to the first embodiment. 図2bは、本実施例1に係る復号化装置の構成を示す機能ブロック図である。FIG. 2B is a functional block diagram illustrating the configuration of the decoding apparatus according to the first embodiment. 図3は、本実施例1に係るコード割当表の一例を示す図である。FIG. 3 is a diagram illustrating an example of a code assignment table according to the first embodiment. 図4は、本実施例1に係る2バイトコード割当表の一例を示す図である。FIG. 4 is a diagram illustrating an example of a 2-byte code allocation table according to the first embodiment. 図5は、本実施例1に係る3バイトコード割当表の一例を示す図である。FIG. 5 is a diagram illustrating an example of a 3-byte code allocation table according to the first embodiment. 図6aは、本実施例1に係る符号化装置の処理手順を示すフローチャートである。FIG. 6A is a flowchart illustrating the processing procedure of the encoding apparatus according to the first embodiment. 図6bは、本実施例1に係る復号化装置の処理手順を示すフローチャートである。FIG. 6B is a flowchart illustrating the processing procedure of the decoding apparatus according to the first embodiment. 図7aは、本実施例2に係る符号化装置の処理の一例を示す図である。FIG. 7A is a diagram illustrating an example of processing of the encoding apparatus according to the second embodiment. 図7bは、本実施例2に係る復号化装置の処理の一例を示す図である。FIG. 7B is a diagram illustrating an example of a process performed by the decoding apparatus according to the second embodiment. 図8aは、本実施例2に係る符号化装置の構成を示す機能ブロック図である。FIG. 8A is a functional block diagram illustrating the configuration of the encoding device according to the second embodiment. 図8bは、本実施例2に係る復号化装置の構成を示す機能ブロック図である。FIG. 8B is a functional block diagram illustrating the configuration of the decoding apparatus according to the second embodiment. 図9は、本実施例2に係るコード割当表の一例を示す図である。FIG. 9 is a diagram illustrating an example of a code assignment table according to the second embodiment. 図10は、本実施例2に係る2バイトコード割当表の一例を示す図である。FIG. 10 is a diagram illustrating an example of a 2-byte code allocation table according to the second embodiment. 図11は、本実施例2に係る3バイトコード割当表の一例を示す図である。FIG. 11 is a diagram illustrating an example of a 3-byte code allocation table according to the second embodiment. 図12aは、本実施例2に係る符号化装置の処理手順を示すフローチャートである。FIG. 12A is a flowchart illustrating the processing procedure of the encoding apparatus according to the second embodiment. 図12bは、本実施例2に係る復号化装置の処理手順を示すフローチャートである。FIG. 12B is a flowchart illustrating the processing procedure of the decoding apparatus according to the second embodiment. 図13aは、本実施例3に係る符号化装置の処理の一例を示す図である。FIG. 13A is a diagram illustrating an example of a process performed by the encoding apparatus according to the third embodiment. 図13bは、本実施例3に係る復号化装置の処理の一例を示す図である。FIG. 13B is a diagram illustrating an example of a process performed by the decoding apparatus according to the third embodiment. 図14aは、本実施例3に係る符号化装置の構成を示す機能ブロック図である。FIG. 14A is a functional block diagram illustrating the configuration of the encoding device according to the third embodiment. 図14bは、本実施例3に係る復号化装置の構成を示す機能ブロック図である。FIG. 14B is a functional block diagram illustrating the configuration of the decoding apparatus according to the third embodiment. 図15は、本実施例3に係るコード割当表の一例を示す図である。FIG. 15 is a diagram illustrating an example of a code assignment table according to the third embodiment. 図16は、本実施例3に係る英単語2バイトコード割当表の一例を示す図である。FIG. 16 is a diagram illustrating an example of an English word 2-byte code assignment table according to the third embodiment. 図17は、本実施例3に係る日本単語2バイト割当表の一例を示す図である。FIG. 17 is a diagram illustrating an example of a Japanese word 2-byte allocation table according to the third embodiment. 図18は、本実施例3に係る2・3バイト割当表の一例を示す図である。FIG. 18 is a diagram illustrating an example of the 2.3 byte allocation table according to the third embodiment. 図19aは、本実施例3に係る符号化装置の処理手順を示すフローチャートである。FIG. 19A is a flowchart illustrating the processing procedure of the encoding apparatus according to the third embodiment. 図19bは、本実施例3に係る復号化装置の処理手順を示すフローチャートである。FIG. 19B is a flowchart illustrating the processing procedure of the decoding apparatus according to the third embodiment. 図20aは、第1コード変換処理の処理手順を示すフローチャートである。FIG. 20A is a flowchart showing the processing procedure of the first code conversion processing. 図20bは、第2コード変換処理の処理手順を示すフローチャートである。FIG. 20B is a flowchart illustrating the processing procedure of the second code conversion processing. 図21は、本実施例4に係る復号化装置の処理の一例を示す図である。FIG. 21 is a diagram illustrating an example of processing of the decoding apparatus according to the fourth embodiment. 図22は、第1オートマトンの一例を示す図である。FIG. 22 is a diagram illustrating an example of the first automaton. 図23は、第2オートマトンの一例を示す図である。FIG. 23 is a diagram illustrating an example of the second automaton. 図24は、第3オートマトンの一例を示す図である。FIG. 24 is a diagram illustrating an example of the third automaton. 図25は、本実施例4に係る復号化装置の構成を示す機能ブロック図である。FIG. 25 is a functional block diagram of the configuration of the decoding apparatus according to the fourth embodiment. 図26は、本実施例4に係る復号化装置の処理手順を示すフローチャートである。FIG. 26 is a flowchart of the process procedure of the decoding apparatus according to the fourth embodiment. 図27は、コンピュータのハードウェア構成例を示す図である。FIG. 27 is a diagram illustrating a hardware configuration example of a computer. 図28は、コンピュータで動作するプログラムの構成例を示す図である。FIG. 28 is a diagram illustrating a configuration example of a program operating on a computer. 図29は、実施形態のシステムにおける装置の構成例を示す図である。FIG. 29 is a diagram illustrating a configuration example of an apparatus in the system according to the embodiment. 図30は、従来のASCIIコードおよびユニコードに基づくコード割当表を説明するための図である。FIG. 30 is a diagram for explaining a code assignment table based on a conventional ASCII code and Unicode.

以下に、本願の開示する復号化プログラム、復号化方法および復号化装置の実施例を図面に基づいて詳細に説明する。なお、この実施例によりこの発明が限定されるものではない。   Hereinafter, embodiments of a decoding program, a decoding method, and a decoding device disclosed in the present application will be described in detail with reference to the drawings. Note that the present invention is not limited to the embodiments.

図1aは、本実施例1に係る符号化装置の処理の一例を示す図である。本実施例1に係る符号化装置は、従来技術で用いていたコード割当表50の代わりに、コード割当表110を用いて、テキストデータ10aをコード変換することで、コード変換されたテキストデータ10bを生成する。   FIG. 1A is a diagram illustrating an example of processing of the encoding apparatus according to the first embodiment. The encoding apparatus according to the first embodiment transcodes the text data 10a by using the code allocation table 110 instead of the code allocation table 50 used in the prior art, thereby converting the text data 10b that has been subjected to code conversion. Is generated.

従来技術のコード割当表50の00h〜1Fhには、制御記号が設定され、各制御記号には、1バイトのコードが割り当てられる。「h」は16進数を示す記号である。コード割当表50の20h〜7Fhには、英数字が設定され、各英数字には、1バイトのコードが割り当てられる。コード割当表50の80h〜FFhには、CJK文字が設定され、各CJK文字には、3バイトのコードが割り当てられる。   Control symbols are set in 00h to 1Fh of the code allocation table 50 of the prior art, and a 1-byte code is allocated to each control symbol. “H” is a symbol indicating a hexadecimal number. Alphanumeric characters are set in 20h to 7Fh of the code assignment table 50, and a 1-byte code is assigned to each alphanumeric character. CJK characters are set in 80h to FFh of the code assignment table 50, and a 3-byte code is assigned to each CJK character.

これに対して、本実施例1に係るコード割当表110の00h〜2Fhには、後述する所定の単語が設定され、1バイトのコードが割り当てられる。コード割当表110の00h〜2Fhは、コード割当表50において、制御記号が割り当てられていた領域を含む。   On the other hand, predetermined words to be described later are set in 00h to 2Fh of the code assignment table 110 according to the first embodiment, and a 1-byte code is assigned. 00h to 2Fh in the code assignment table 110 includes an area to which a control symbol is assigned in the code assignment table 50.

コード割当表110の30h〜5Fhには、高頻度の単語等が設定される。また、コード割当表110の30h〜5Fhには、コード割当表50の00h〜1Fhに設定されていた制御記号や、コード割当表50の20h〜7Fhに設定されていた英数字が設定される。また、コード割当表110の30h〜5Fhには、コード割当表50の80h〜FFhに設定されていたCJK文字の一部が設定される。コード割当表110の30h〜5Fhに設定された高頻度の単語、制御記号、英数字、CJK文字には、2バイトのコードが割り当てられる。   A high-frequency word or the like is set in 30h to 5Fh of the code assignment table 110. In addition, the control symbols set in 00h to 1Fh in the code assignment table 50 and the alphanumeric characters set in 20h to 7Fh in the code assignment table 50 are set in 30h to 5Fh in the code assignment table 110. Also, a part of CJK characters set in 80h to FFh in the code assignment table 50 are set in 30h to 5Fh in the code assignment table 110. A 2-byte code is assigned to high-frequency words, control symbols, alphanumeric characters, and CJK characters set to 30h to 5Fh in the code assignment table 110.

すなわち、コード割当表50の00h〜7Fhに設定され、それまで1バイトのコードが割り当てられていた制御記号および英数字は、コード割当表110の30h〜5Fhの一部に割り当てられ、2バイトのコードが割り当てられる。   That is, the control symbols and alphanumeric characters that have been set to 00h to 7Fh in the code assignment table 50 and have been assigned a 1-byte code until then are assigned to a part of 30h to 5Fh in the code assignment table 110, and are assigned 2 bytes. A code is assigned.

コード割当表110の60h〜FFhには、低頻度の単語等が設定される。また、コード割当表110の60h〜FFhには、コード割当表50の80h〜FFhに設定されていたCJK文字の一部が設定される。   Infrequent words and the like are set in 60h to FFh of the code assignment table 110. Also, part of the CJK characters set in 80h to FFh in the code assignment table 50 are set in 60h to FFh in the code assignment table 110.

本実施例1について、以下の説明では、適宜、コード割当表110の00h〜2Fhの領域を「1バイト領域」と表記する。コード割当表110の30h〜5Fhの領域を「2バイト領域」と表記する。コード割当表110の60h〜FFhの領域を「3バイト領域」と表記する。   Regarding the first embodiment, in the following description, the area from 00h to 2Fh in the code assignment table 110 will be appropriately expressed as “1-byte area”. The area of 30h to 5Fh in the code assignment table 110 is expressed as “2-byte area”. The area from 60h to FFh in the code assignment table 110 is denoted as “3-byte area”.

コード変換部150は、コード割当表110に基づいて、テキストデータ10aを、テキストデータ10bに変換する。ここでは、テキストデータ10aを「・・・he△is△in△the△house△・・・」とする。テキストデータ10aの「△」はスペースを示すものである。   Based on the code assignment table 110, the code conversion unit 150 converts the text data 10a into text data 10b. Here, the text data 10a is assumed to be “..., He Δis Δ in Δ the Δ house Δ. “Δ” in the text data 10a indicates a space.

コード変換部150は、スペース「△」で区切られる単語と、コード割当表110とを比較して、単語をコードに変換する。テキストデータ10aに含まれる単語「he△」は、コード割当表110の1バイト領域に設定された単語であり、コード変換部150は、単語「he△」を1バイトのコード「12h」に変換する。   The code conversion unit 150 compares the word delimited by the space “Δ” with the code assignment table 110 and converts the word into a code. The word “heΔ” included in the text data 10a is a word set in the 1-byte area of the code assignment table 110, and the code conversion unit 150 converts the word “heΔ” into a 1-byte code “12h”. To do.

テキストデータ10aに含まれる単語「is△」は、コード割当表110の1バイト領域に設定された単語であり、コード変換部150は、単語「is△」を1バイトのコード「08h」に変換する。   The word “isΔ” included in the text data 10a is a word set in the 1-byte area of the code allocation table 110, and the code conversion unit 150 converts the word “isΔ” into a 1-byte code “08h”. To do.

テキストデータ10aに含まれる単語「in△」は、コード割当表110の1バイト領域に設定された単語であり、コード変換部150は、単語「in△」を1バイトのコード「07h」に変換する。   The word “inΔ” included in the text data 10a is a word set in the 1-byte area of the code assignment table 110, and the code conversion unit 150 converts the word “inΔ” into a 1-byte code “07h”. To do.

テキストデータ10aに含まれる単語「the△」は、コード割当表110の1バイト領域に設定された単語であり、コード変換部150は、単語「the△」を1バイトのコード「00h」に変換する。   The word “theΔ” included in the text data 10a is a word set in the 1-byte area of the code assignment table 110, and the code conversion unit 150 converts the word “theΔ” into a 1-byte code “00h”. To do.

テキストデータ10aに含まれる単語「house△」は、コード割当表110の2バイト領域に設定された単語であり、コード変換部150は、例えば、単語「house△」を2バイトのコード「4341h」に変換する。   The word “houseΔ” included in the text data 10a is a word set in the 2-byte area of the code assignment table 110. For example, the code conversion unit 150 converts the word “houseΔ” into a 2-byte code “4341h”. Convert to

コード変換部150は、テキストデータ10aに含まれる各単語に対して、上記処理を実行することで、テキストデータ10aをテキストデータ10bにコード化する。   The code conversion unit 150 encodes the text data 10a into the text data 10b by performing the above processing on each word included in the text data 10a.

図1bは、本実施例1に係る復号化装置の処理の一例を示す図である。本実施例1に係る復号化装置は、従来技術で用いていたコード割当表50の代わりに、コード割当表110を用いて、コード変換されたテキストデータ10bを、文字コード変換することで、テキストデータ10aを生成する。コード割当表110に関する説明は、上記の説明と同様である。   FIG. 1B is a diagram illustrating an example of processing of the decoding apparatus according to the first embodiment. The decoding apparatus according to the first embodiment uses the code assignment table 110 instead of the code assignment table 50 used in the prior art to perform character code conversion on the text data 10b that has been subjected to code conversion. Data 10a is generated. The description regarding the code assignment table 110 is the same as the above description.

コード変換部550は、コード割当表110に基づいて、テキストデータ10bを、テキストデータ10aに変換する。ここでは、テキストデータ10bを「・・・12h 08h 07h 00h 4341h・・・」とする。   The code conversion unit 550 converts the text data 10b into the text data 10a based on the code assignment table 110. Here, the text data 10b is assumed to be “... 12h 08h 07h 00h 4341h.

コード変換部550は、コードと、コード割当表110とを比較して、コードを単語に変換する。例えば、コード変換部550は、1バイトのコード「12h」を単語「he△」に変換する。コード変換部550は、1バイトのコード「08h」を単語「is△」に変換する。コード変換部550は、1バイトのコード「07h」を単語「in△」に変換する。コード変換部550は、1バイトのコード「00h」を単語「the△」に変換する。コード変換部550は、2バイトのコード「4341h」を単語「house△」に変換する。   The code conversion unit 550 compares the code with the code assignment table 110 and converts the code into a word. For example, the code conversion unit 550 converts the 1-byte code “12h” into the word “heΔ”. The code conversion unit 550 converts the 1-byte code “08h” into the word “isΔ”. The code conversion unit 550 converts the 1-byte code “07h” into the word “inΔ”. The code conversion unit 550 converts the 1-byte code “00h” into the word “theΔ”. The code conversion unit 550 converts the 2-byte code “4341h” into the word “houseΔ”.

コード変換部550は、テキストデータ10bに含まれる各コードに対して、上記処理を実行することで、テキストデータ10bをテキストデータ10aに変換する。   The code conversion unit 550 converts the text data 10b into the text data 10a by executing the above process on each code included in the text data 10b.

図2aは、本実施例1に係る符号化装置の構成を示す機能ブロック図である。図2aに示すように、この符号化装置100は、入力部101、出力部102、レジスタ105a,105b、記憶部106、コード変換部150を有する。   FIG. 2A is a functional block diagram illustrating the configuration of the encoding device according to the first embodiment. As shown in FIG. 2 a, the encoding device 100 includes an input unit 101, an output unit 102, registers 105 a and 105 b, a storage unit 106, and a code conversion unit 150.

入力部101は、コード変換を行うテキストデータを受け付ける処理部である。入力部101は、受け付けたテキストデータを、レジスタ105aに格納する。   The input unit 101 is a processing unit that receives text data for code conversion. The input unit 101 stores the received text data in the register 105a.

出力部102は、レジスタ105bに格納されるコード変換後のテキストデータを出力する処理部である。   The output unit 102 is a processing unit that outputs the text data after code conversion stored in the register 105b.

レジスタ105aは、コード変換を行う前のテキストデータを格納するものである。レジスタ105bは、コード変換後のテキストデータを格納するものである。   The register 105a stores text data before code conversion. The register 105b stores the text data after code conversion.

記憶部106は、コード割当表110と、2バイトコード割当表115aと、3バイトコード割当表115bとを有する。記憶部106は、例えば、RAM(Random Access Memory)、ROM(Read Only Memory)、フラッシュメモリ(Flash Memory)などの半導体メモリ素子などの記憶装置に対応する。   The storage unit 106 includes a code allocation table 110, a 2-byte code allocation table 115a, and a 3-byte code allocation table 115b. The storage unit 106 corresponds to a storage device such as a semiconductor memory element such as a random access memory (RAM), a read only memory (ROM), and a flash memory.

図3は、本実施例1に係るコード割当表の一例を示す図である。コード割当表110は、単語等と、所定のコードとを対応付けたテーブルであり、図1aで説明したコード割当表110に対応する。図3に示すように、このコード割当表110は、1バイト領域110Aと、2バイト領域110Bと、3バイト領域110Cとを有する。   FIG. 3 is a diagram illustrating an example of a code assignment table according to the first embodiment. The code assignment table 110 is a table in which words and the like are associated with predetermined codes, and corresponds to the code assignment table 110 described with reference to FIG. As shown in FIG. 3, the code allocation table 110 has a 1-byte area 110A, a 2-byte area 110B, and a 3-byte area 110C.

1バイト領域110Aは、コード割当表110の00h〜2Fhの領域である。この1バイト領域110Aには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度の高い上位48個の単語が設定される。   The 1-byte area 110A is an area from 00h to 2Fh in the code assignment table 110. In the 1-byte area 110A, the top 48 words having the highest appearance frequency are set based on the blue sky library, the Oxford English dictionary, and other general books.

1バイト領域110Aに設定された単語は、1バイト領域110Aの設定位置に応じた1バイトのコードが割り当てられる。単語「the△」は、1バイトのコード「00h」が割り当てられる。1バイト領域110Aに設定された残りの単語も同様に、1バイトのコードが割り当てられる。   A 1-byte code corresponding to the set position of the 1-byte area 110A is assigned to the word set in the 1-byte area 110A. The word “theΔ” is assigned a 1-byte code “00h”. Similarly, a 1-byte code is assigned to the remaining words set in the 1-byte area 110A.

2バイト領域110Bは、コード割当表110の30h〜5Fhの領域である。この2バイト領域110Bには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値以上となる単語が設定される。以下の説明では、適宜、出現頻度が所定値以上となる単語を高頻度単語と表記する。また、2バイト領域110Bには、英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文等も含まれる。   The 2-byte area 110B is an area of 30h to 5Fh in the code assignment table 110. In this 2-byte area 110B, words whose appearance frequency is equal to or higher than a predetermined value are set based on a blue sky library, an Oxford English dictionary, and other general books. In the following description, words whose appearance frequency is equal to or higher than a predetermined value will be referred to as high-frequency words as appropriate. The 2-byte area 110B includes alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, syntax, and the like.

ここで、2バイト領域110Bには、係る2バイト領域110Bに設定された高頻度単語等に割り当てる2バイトのコードのうち、前半の1バイトのコードのみが定義されている。2バイト領域110Bに設定された単語等に割り当てる2バイトのコードは、後述する2バイトコード割当表115aに定義されている。   Here, in the 2-byte area 110B, only the 1-byte code of the first half is defined among 2-byte codes assigned to the high-frequency word or the like set in the 2-byte area 110B. A 2-byte code assigned to a word or the like set in the 2-byte area 110B is defined in a 2-byte code assignment table 115a described later.

例えば、2バイト領域110Bの英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文に割り当てる2バイトのコードのうち、前半の1バイトのコードは「30h〜3Fh」となる。そして、前半の1バイトのコードと、残りの1バイトのコードは、2バイトコード割当表115aに定義されている。   For example, among the 2-byte codes assigned to alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, and syntax in the 2-byte area 110B, the first one-byte code is “30h to 3Fh”. The 1-byte code in the first half and the remaining 1-byte code are defined in the 2-byte code allocation table 115a.

2バイト領域110Bの高頻度単語に割り当てる2バイトのコードのうち、前半の1バイトのコードは「40h〜5Fh」となる。そして、前半の1バイトのコードと、残りの1バイトのコードは、2バイトコード割当表115aに定義されている。   Of the 2-byte codes assigned to the high-frequency words in the 2-byte area 110B, the 1-byte code in the first half is “40h to 5Fh”. The 1-byte code in the first half and the remaining 1-byte code are defined in the 2-byte code allocation table 115a.

3バイト領域110Cは、コード割当表110の60h〜FFhの領域である。この3バイト領域110Cには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値未満となる低頻度の単語が設定される。例えば、3バイト領域110Cには、CJK文字、英単語、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果等が含まれる。   The 3-byte area 110C is an area from 60h to FFh in the code assignment table 110. In this 3-byte area 110C, a low-frequency word whose appearance frequency is less than a predetermined value is set based on a blue sky library, an Oxford English dictionary, and other general books. For example, the 3-byte area 110C includes CJK characters, English words, Japanese words, third country words, numerical values, times, tags, results of syntactic and semantic analysis, and the like.

ここで、3バイト領域110Cには、係る3バイト領域110Cに設定された単語等に割り当てる3バイトのコードのうち、前半の1バイトのコードのみが定義されている。3バイト領域110Cに設定された単語等に割り当てる3バイトのコードは、後述する3バイトコード割当表115bに定義されている。   Here, in the 3-byte area 110C, only the 1-byte code of the first half is defined among 3-byte codes assigned to the word set in the 3-byte area 110C. A 3-byte code assigned to a word or the like set in the 3-byte area 110C is defined in a 3-byte code assignment table 115b described later.

例えば、3バイト領域110CのCJK文字、英単語、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果等に割り当てる3バイトのコードのうち、前半の1バイトのコードは「60h〜FFh」となる。そして、前半の1バイトのコードと、残りの2バイトのコードは、3バイトコード割当表115bに定義されている。   For example, among the 3-byte codes assigned to CJK characters, English words, Japanese words, third country words, numerical values, times, tags, syntax semantic analysis results, etc. in the 3-byte area 110C, the first half-byte code is “60h to FFh”. The 1-byte code in the first half and the remaining 2-byte code are defined in the 3-byte code allocation table 115b.

図4は、本実施例1に係る2バイトコード割当表の一例を示す図である。図4に示すように、2バイトコード割当表115aは、高頻度単語と、2バイトのコードとを対応付ける。また、2バイトコード割当表115aは、英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文と、2バイトのコードとを対応付ける。   FIG. 4 is a diagram illustrating an example of a 2-byte code allocation table according to the first embodiment. As shown in FIG. 4, the 2-byte code assignment table 115a associates high-frequency words with 2-byte codes. The 2-byte code assignment table 115a associates alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, syntax, and 2-byte codes.

2バイトコード割当表115aにおいて、「3000h〜3FFFh」には、英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文が設定され、設定位置に応じた2バイトのコードが割り当てられる。例えば、「NULL」には、2バイトのコード「3000h」が割り当てられる。   In the 2-byte code allocation table 115a, alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, and syntax are set in “3000h to 3FFFh”, and 2-byte codes corresponding to the set positions are allocated. . For example, a 2-byte code “3000h” is assigned to “NULL”.

2バイトコード割当表115aにおいて、「4000h〜5FFFh」には、高頻度単語が設定され、設定位置に応じた2バイトのコードが割り当てられる。例えば、設定位置「4000h」に設定された高頻度単語には、2バイトのコード「4000h」が割り当てられる。   In the 2-byte code assignment table 115a, a high-frequency word is set in “4000h to 5FFFh”, and a 2-byte code corresponding to the set position is assigned. For example, the 2-byte code “4000h” is assigned to the high-frequency word set at the setting position “4000h”.

図5は、本実施例1に係る3バイトコード割当表の一例を示す図である。図5に示すように、3バイトコード割当表115bは、CJK文字、英単語、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果と、3バイトのコードとを対応付ける。なお、3バイトコード割当表115bにおいて、例えば、「E00000h〜FFFFFFh」は、予備の領域となる。   FIG. 5 is a diagram illustrating an example of a 3-byte code allocation table according to the first embodiment. As shown in FIG. 5, the 3-byte code assignment table 115b associates CJK characters, English words, Japanese words, third country words, numerical values, times, tags, syntactic and semantic analysis results, and 3-byte codes. . In the 3-byte code allocation table 115b, for example, “E00000h to FFFFFFh” is a spare area.

3バイトコード割当表115bにおいて、「800000h〜DFFFFFh」には、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果が設定され、設定位置に応じた3バイトのコードが割り当てられる。例えば、設定位置「800000h」に設定された日本単語には、3バイトのコード「800000h」が割り当てられる。   In the 3-byte code allocation table 115b, “800000h to DFFFFFh” is set with a Japanese word, a third country word, a numerical value, a time, a tag, and a result of syntax semantic analysis, and a 3-byte code corresponding to the set position. Assigned. For example, a 3-byte code “800000h” is assigned to a Japanese word set at the set position “800000h”.

図2aの説明に戻る。コード変換部150は、コード割当表110、2バイトコード割当表115a、3バイトコード割当表115bを基にして、レジスタ105aに格納されたテキストデータをコード化する処理部である。コード変換部150は、コード化したテキストデータを、レジスタ105bに格納する。   Returning to the description of FIG. The code conversion unit 150 is a processing unit that encodes the text data stored in the register 105a based on the code allocation table 110, the 2-byte code allocation table 115a, and the 3-byte code allocation table 115b. The code conversion unit 150 stores the encoded text data in the register 105b.

以下において、コード変換部150の処理の一例について説明する。コード変換部150は、テキストデータから、スペース「△」で区切られる単語を取得し、取得した単語が、1バイト領域110Aに設定された単語か、2バイト領域110Bに設定された単語か、3バイト領域110Cに設定された単語かを判定する。   Hereinafter, an example of processing of the code conversion unit 150 will be described. The code conversion unit 150 acquires words delimited by a space “Δ” from the text data, and determines whether the acquired word is a word set in the 1-byte area 110A or a word set in the 2-byte area 110B. It is determined whether the word is set in the byte area 110C.

コード変換部150の取得した単語が1バイト領域110Aに設定された単語である場合について説明する。コード変換部150は、取得した単語と、1バイト領域110Aの各単語とを比較して、該当する設定位置の1バイトのコードを特定し、コード化する。例えば、コード変換部150は、取得した単語が「the△」である場合には、かかる単語「the△」を「00h」にコード化する。   A case where the word acquired by the code conversion unit 150 is a word set in the 1-byte area 110A will be described. The code conversion unit 150 compares the acquired word with each word in the 1-byte area 110A to identify and code a 1-byte code at the corresponding setting position. For example, if the acquired word is “theΔ”, the code converting unit 150 encodes the word “theΔ” into “00h”.

続いて、コード変換部150の取得した単語が2バイト領域110Bに設定された単語である場合について説明する。コード変換部150は、取得した単語と、2バイトコード割当表115aとを比較して、該当する設定位置の2バイトのコードを特定し、コード化する。例えば、コード変換部150は、取得した単語が、2バイトコード割当表115aの「4000h」に設定されたある高頻度単語である場合には、かかる高頻度単語を2バイトのコード「4000h」にコード化する。   Next, a case where the word acquired by the code conversion unit 150 is a word set in the 2-byte area 110B will be described. The code conversion unit 150 compares the acquired word with the 2-byte code assignment table 115a, identifies the 2-byte code at the corresponding setting position, and encodes it. For example, when the acquired word is a certain high-frequency word set to “4000h” in the 2-byte code assignment table 115a, the code conversion unit 150 converts the high-frequency word into a 2-byte code “4000h”. Encode.

なお、コード変換部150は、取得した情報が、2バイト領域110Bに設定された英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文である場合も、2バイトコード割当表115aと比較して、コード化する。例えば、コード変換部150は、「NULL」を取得した場合には、かかる「NULL」を「3000h」にコード化する。   The code conversion unit 150 also includes the 2-byte code assignment table 115a even when the acquired information is alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, and syntax set in the 2-byte area 110B. Compare with. For example, if “NULL” is acquired, the code conversion unit 150 encodes “NULL” into “3000h”.

続いて、コード変換部150の取得した単語が3バイト領域110Cに設定された単語である場合について説明する。コード変換部150は、取得した単語と、3バイトコード割当表115bとを比較して、該当する設定位置の3バイトのコードを特定し、コード化する。例えば、コード変換部150は、取得した単語が、3バイトコード割当表115bの「700000h」に設定されたある英単語である場合には、かかる英単語を3バイトのコード「700000h」にコード化する。   Next, a case where the word acquired by the code conversion unit 150 is a word set in the 3-byte area 110C will be described. The code conversion unit 150 compares the acquired word with the 3-byte code assignment table 115b to identify and code a 3-byte code at the corresponding setting position. For example, if the acquired word is an English word set to “700000h” in the 3-byte code assignment table 115b, the code conversion unit 150 encodes the English word into a 3-byte code “700000h”. To do.

なお、コード変換部150は、取得した情報が、3バイト領域110Cに設定された日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果である場合も、3バイトコード割当表115bと比較して、コード化する。例えば、コード変換部150は、取得した情報が、3バイトコード割当表115bの「800000h」に設定されたある日本単語である場合には、かかる日本単語を3バイトのコード「800000h」にコード化する。   Note that the code conversion unit 150 also assigns a 3-byte code even if the acquired information is a Japanese word, a third country word, a numerical value, a time, a tag, or a syntax semantic analysis result set in the 3-byte area 110C. Compare with Table 115b. For example, if the acquired information is a certain Japanese word set to “800000h” in the 3-byte code assignment table 115b, the code conversion unit 150 encodes the Japanese word into a 3-byte code “800000h”. To do.

コード変換部150は、レジスタ105aに格納されたテキストデータに対して、上記処理を繰り返し実行することで、テキストデータをコード化する。コード変換部150は、コード化したテキストデータを、レジスタ105bに格納する。   The code conversion unit 150 encodes the text data by repeatedly executing the above processing on the text data stored in the register 105a. The code conversion unit 150 stores the encoded text data in the register 105b.

図2bは、本実施例1に係る復号化装置の構成を示す機能ブロック図である。図2bに示すように、この復号化装置500は、入力部501、出力部502、レジスタ505a,505b、記憶部506、コード変換部550を有する。   FIG. 2B is a functional block diagram illustrating the configuration of the decoding apparatus according to the first embodiment. As illustrated in FIG. 2b, the decoding device 500 includes an input unit 501, an output unit 502, registers 505a and 505b, a storage unit 506, and a code conversion unit 550.

入力部501は、コード変換されたテキストデータを受け付ける処理部である。入力部501は、受け付けたテキストデータを、レジスタ505aに格納する。   The input unit 501 is a processing unit that receives code-converted text data. The input unit 501 stores the received text data in the register 505a.

出力部502は、レジスタ505bに格納されたテキストデータを出力する処理部である。   The output unit 502 is a processing unit that outputs the text data stored in the register 505b.

レジスタ505aは、コード変換されたテキストデータを格納するものである。レジスタ505bは、文字コード変換後のテキストデータを格納するものである。   The register 505a stores code-converted text data. The register 505b stores text data after character code conversion.

記憶部506は、コード割当表110と、2バイトコード割当表115aと、3バイトコード割当表115bとを有する。記憶部506は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 506 includes a code allocation table 110, a 2-byte code allocation table 115a, and a 3-byte code allocation table 115b. The storage unit 506 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

コード割当表110に関する説明は、図3で説明したコード割当表110に関する説明と同様である。2バイトコード割当表115aに関する説明は、図4で説明した2バイトコード割当表115aに関する説明と同様である。3バイトコード割当表115bに関する説明は、図5で説明した3バイトコード割当表115bに関する説明と同様である。   The description regarding the code allocation table 110 is the same as the description regarding the code allocation table 110 described with reference to FIG. The description regarding the 2-byte code allocation table 115a is the same as the description regarding the 2-byte code allocation table 115a described with reference to FIG. The description regarding the 3-byte code allocation table 115b is the same as the description regarding the 3-byte code allocation table 115b described with reference to FIG.

以下において、コード変換部550の処理の一例について説明する。例えば、コード変換部550は、テキストデータからコードを取得し、取得したコードが1バイト領域110Aに設定された単語に対応するものか、2バイト領域110Bに設定された単語に対応するものか、3バイト領域110Cに設定された単語に対応するものかを判定する。   Hereinafter, an example of processing of the code conversion unit 550 will be described. For example, the code conversion unit 550 acquires a code from text data, and whether the acquired code corresponds to a word set in the 1-byte area 110A or a word set in the 2-byte area 110B, It is determined whether the word corresponds to the word set in the 3-byte area 110C.

コード変換部550が取得したコードが1バイト領域110Aに設定された単語に対応するものである場合について説明する。1バイト領域110Aに設定された単語に対応するコードの1バイト目は「00h〜2Fh」に含まれる。コード変換部550は、コードに対応する単語を、1バイト領域110Aに設定された単語から選択し、選択した単語によって文字コード化する。例えば、コード変換部550は、取得したコードが「00h」である場合には、「00h」を「the△」に文字コード化する。   A case where the code acquired by the code conversion unit 550 corresponds to a word set in the 1-byte area 110A will be described. The first byte of the code corresponding to the word set in the 1-byte area 110A is included in “00h to 2Fh”. The code conversion unit 550 selects a word corresponding to the code from the words set in the 1-byte area 110A, and converts the word into a character code using the selected word. For example, if the acquired code is “00h”, the code conversion unit 550 converts “00h” into a character code “theΔ”.

コード変換部550が取得したコードが2バイト領域110Bに設定された単語に対応するものである場合について説明する。2バイト領域110Bに設定された単語に対応するコードの1バイト目は「30h〜5Fh」に含まれる。コード変換部550は、コードの1バイト目と続く2バイト目とを合わせたコードと、2バイトコード割当表115aとを比較して、単語を文字コード化する。例えば、コード変換部550は、2バイトのコードが「4000h」である場合には、2バイトコード割当表115aに設定された「4000h」に対応する単語に文字コード化する。   A case where the code acquired by the code conversion unit 550 corresponds to a word set in the 2-byte area 110B will be described. The first byte of the code corresponding to the word set in the 2-byte area 110B is included in “30h to 5Fh”. The code conversion unit 550 compares the code combining the first byte and the second byte of the code with the 2-byte code assignment table 115a, and converts the word into a character code. For example, when the 2-byte code is “4000h”, the code conversion unit 550 converts the character code into a word corresponding to “4000h” set in the 2-byte code assignment table 115a.

コード変換部550が取得したコードが3バイト領域110Cに設定された単語に対応するものである場合について説明する。3バイト領域110Cに設定された単語に対応するコードの1バイト目は「60h〜FFh」に含まれる。コード変換部550は、コードの1バイト目と続く2、3バイト目とを合わせたコードと、3バイトコード割当表115bとを比較して、単語を文字コード化する。例えば、コード変換部550は、3バイトのコードが「700000h」である場合には、3バイトコード割当表115bに設定された「700000h」に対応する単語に文字コード化する。   A case where the code acquired by the code conversion unit 550 corresponds to a word set in the 3-byte area 110C will be described. The first byte of the code corresponding to the word set in the 3-byte area 110C is included in “60h to FFh”. The code conversion unit 550 compares the first byte of the code with the subsequent second and third bytes, and the 3-byte code assignment table 115b to convert the word into a character code. For example, when the 3-byte code is “700000h”, the code conversion unit 550 converts the character code into a word corresponding to “700000h” set in the 3-byte code allocation table 115b.

図6aは、本実施例1に係る符号化装置の処理手順を示すフローチャートである。図6aに示すように、符号化装置100の入力部101は、テキストデータをレジスタ105aに格納する(ステップS101)。符号化装置100のコード変換部150は、レジスタ105aに格納されたテキストデータから単語を取得する(ステップS102)。ステップS102では、説明の便宜上、単語と表記するが、コード変換部150が取得するものは、単語の他に、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果等の場合もある。   FIG. 6A is a flowchart illustrating the processing procedure of the encoding apparatus according to the first embodiment. As shown in FIG. 6a, the input unit 101 of the encoding device 100 stores the text data in the register 105a (step S101). The code conversion unit 150 of the encoding device 100 acquires a word from the text data stored in the register 105a (step S102). In step S102, it is written as a word for convenience of explanation, but what the code conversion unit 150 acquires is a Japanese word, a third country word, a numerical value, a time, a tag, a result of syntax semantic analysis, etc. In some cases.

コード変換部150は、単語とコード割当表110とを比較する(ステップS103)。コード変換部150は、単語がコード割当表110の1バイト領域110Aの単語に対応する単語である場合には(ステップS104,Yes)、ステップS105に移行する。コード変換部150は、コード割当表110に基づいて、単語を1バイトのコードに変換し(ステップS105)、ステップS109に移行する。   The code conversion unit 150 compares the word with the code assignment table 110 (step S103). If the word is a word corresponding to the word in the 1-byte area 110A of the code assignment table 110 (Yes in step S104), the code conversion unit 150 proceeds to step S105. The code conversion unit 150 converts the word into a 1-byte code based on the code assignment table 110 (step S105), and proceeds to step S109.

一方、コード変換部150は、単語がコード割当表110の1バイト領域110Aの単語に対応する単語でない場合には(ステップS104,No)、ステップS106に移行する。コード変換部150は、単語がコード割当表110の2バイト領域110Bの単語に対応する単語である場合には(ステップS106,Yes)、ステップS107に移行する。コード変換部150は、2バイトコード割当表115aに基づいて、単語を2バイトのコードに変換し(ステップS107)、ステップS109に移行する。   On the other hand, if the word is not a word corresponding to the word in the 1-byte area 110A of the code assignment table 110 (No at Step S104), the code conversion unit 150 proceeds to Step S106. If the word is a word corresponding to the word in the 2-byte area 110B of the code assignment table 110 (Yes in step S106), the code conversion unit 150 proceeds to step S107. The code conversion unit 150 converts the word into a 2-byte code based on the 2-byte code assignment table 115a (step S107), and proceeds to step S109.

一方、コード変換部150は、単語がコード割当表110の2バイト領域110Bの単語に対応する単語でない場合には(ステップS106,No)、ステップS108に移行する。コード変換部150は、3バイトコード変換表115bに基づいて、単語を3バイトのコードに変換し(ステップS108)、ステップS109に移行する。   On the other hand, if the word is not a word corresponding to the word in the 2-byte area 110B of the code assignment table 110 (No at Step S106), the code conversion unit 150 proceeds to Step S108. The code conversion unit 150 converts the word into a 3-byte code based on the 3-byte code conversion table 115b (step S108), and proceeds to step S109.

コード変換部150は、テキストデータのコード化が終了したか否かを判定する(ステップS109)。コード変換部150は、テキストデータのコード化が終了していない場合には(ステップS109,No)、ステップS102に移行する。   The code conversion unit 150 determines whether or not the text data has been encoded (step S109). If the encoding of the text data has not been completed (No at Step S109), the code converting unit 150 proceeds to Step S102.

一方、コード変換部150は、テキストデータのコード化が終了した場合には(ステップS109,Yes)、コード化したテキストデータを、レジスタ105bに格納する(ステップS110)。   On the other hand, when the encoding of the text data is completed (step S109, Yes), the code conversion unit 150 stores the encoded text data in the register 105b (step S110).

図6bは、本実施例1に係る復号化装置の処理手順を示すフローチャートである。図6bに示すように、復号化装置500の入力部501は、テキストデータをレジスタ505aに格納する(ステップS501)。復号化装置500のコード変換部550は、レジスタ505aに格納されたテキストデータからコードを取得する(ステップS502)。   FIG. 6B is a flowchart illustrating the processing procedure of the decoding apparatus according to the first embodiment. As shown in FIG. 6b, the input unit 501 of the decryption apparatus 500 stores the text data in the register 505a (step S501). The code conversion unit 550 of the decryption apparatus 500 acquires a code from the text data stored in the register 505a (step S502).

コード変換部550は、コードとコード割当表110とを比較する(ステップS503)。コード変換部550は、コードがコード割当表110の1バイト領域110Aの単語に対応するコードである場合には(ステップS504,Yes)、ステップS505に移行する。コード変換部550は、コード割当表110に基づいて、1バイトのコードを単語に変換し(ステップS505)、ステップS509に移行する。   The code conversion unit 550 compares the code with the code assignment table 110 (step S503). If the code is a code corresponding to a word in the 1-byte area 110A of the code assignment table 110 (Yes in step S504), the code conversion unit 550 proceeds to step S505. The code conversion unit 550 converts the 1-byte code into a word based on the code assignment table 110 (step S505), and proceeds to step S509.

一方、コード変換部550は、コードがコード割当表110の1バイト領域110Aの単語に対応するコードでない場合には(ステップS504,No)、ステップS506に移行する。コード変換部550は、コードがコード割当表110の2バイト領域110Bの単語に対応するコードである場合には(ステップS506,Yes)、ステップS507に移行する。コード変換部550は、2バイトコード割当表115aに基づいて、2バイトのコードを単語に変換し(ステップS507)、ステップS509に移行する。   On the other hand, when the code is not a code corresponding to the word in the 1-byte area 110A of the code assignment table 110 (No at Step S504), the code conversion unit 550 proceeds to Step S506. If the code is a code corresponding to a word in the 2-byte area 110B of the code assignment table 110 (step S506, Yes), the code conversion unit 550 proceeds to step S507. Based on the 2-byte code assignment table 115a, the code conversion unit 550 converts the 2-byte code into a word (step S507), and proceeds to step S509.

一方、コード変換部550は、コードがコード割当表110の2バイト領域110Bの単語に対応するコードでない場合には(ステップS506,No)、ステップS508に移行する。コード変換部550は、3バイトコード変換表115bに基づいて、3バイトのコードを単語に変換し(ステップS508)、ステップS509に移行する。   On the other hand, when the code is not a code corresponding to the word in the 2-byte area 110B of the code assignment table 110 (No at Step S506), the code conversion unit 550 proceeds to Step S508. Based on the 3-byte code conversion table 115b, the code conversion unit 550 converts the 3-byte code into a word (step S508), and proceeds to step S509.

コード変換部550は、テキストデータの復号化が終了したか否かを判定する(ステップS509)。コード変換部550は、テキストデータの復号化が終了していない場合には(ステップS509,No)、ステップS502に移行する。   The code conversion unit 550 determines whether or not the text data has been decrypted (step S509). If the decoding of the text data is not completed (No at Step S509), the code conversion unit 550 proceeds to Step S502.

一方、コード変換部550は、テキストデータの復号化が終了した場合には(ステップS509,Yes)、復号化したテキストデータを、レジスタ505bに格納する(ステップS510)。   On the other hand, when the decoding of the text data is completed (Yes in step S509), the code conversion unit 550 stores the decoded text data in the register 505b (step S510).

次に、本実施例1に係る符号化装置100の効果について説明する。符号化装置100は、従来のコード割当表50の1バイト領域に割り当てられていた文字をコード割当表110の2バイト領域に退避させ、コード割当表110の1バイト領域には厳選した単語を割り当てた割当表を用いたコード変換を行う。係る処理を実行することで、出現頻度が高い文字や単語に対して、短いバイトコードを割り当てることができる。   Next, effects of the encoding device 100 according to the first embodiment will be described. The encoding apparatus 100 saves the characters assigned to the 1-byte area of the conventional code assignment table 50 to the 2-byte area of the code assignment table 110, and assigns carefully selected words to the 1-byte area of the code assignment table 110. Code conversion using the assigned table. By executing such processing, a short byte code can be assigned to a character or word having a high appearance frequency.

また、復号化装置500は、上記のコード割当表110を用いて、コード化されたテキストデータを復号化するため、出現頻度が高い単語や一般記号に対して、短いバイトコードを割り当てた場合でも、係るバイトコードを単語や一般記号に変換することができる。   In addition, since the decoding apparatus 500 uses the code allocation table 110 described above to decode the encoded text data, even when a short byte code is allocated to a word or general symbol having a high appearance frequency. , Such byte codes can be converted into words and general symbols.

図7aは、本実施例2に係る符号化装置の処理の一例を示す図である。本実施例2に係る符号化装置は、従来技術で用いていたコード割当表50の代わりに、コード割当表210を用いて、テキストデータ20aをコード変換することで、コード変換されたテキストデータ20bを生成する。従来技術のコード割当表50に関する説明は、実施例1で説明したものと同様である。   FIG. 7A is a diagram illustrating an example of processing of the encoding apparatus according to the second embodiment. The encoding apparatus according to the second embodiment performs code conversion on the text data 20a by using the code allocation table 210 instead of the code allocation table 50 used in the prior art, thereby converting the text data 20b subjected to code conversion. Is generated. The description regarding the code allocation table 50 of the prior art is the same as that described in the first embodiment.

本実施例2に係るコード割当表210について説明する。コード割当表210の00h〜1Fhには、後述する所定の単語が設定され、1バイトのコードが割り当てられる。コード割当表210の00h〜1Fhは、コード割当表50において、制御記号が割り当てられていた領域を含む。   The code allocation table 210 according to the second embodiment will be described. A predetermined word to be described later is set in 00h to 1Fh in the code assignment table 210, and a 1-byte code is assigned. 00h to 1Fh in the code assignment table 210 includes an area to which a control symbol is assigned in the code assignment table 50.

コード割当表210の20h〜7Fhには、英数字が設定され、1バイトのコードが割り当てられる。コード割当表210の20h〜7Fhに設定される英数字は、コード割当表50の20h〜7Fhに設定される英数字と同様である。   Alphanumeric characters are set in 20h to 7Fh of the code assignment table 210, and a 1-byte code is assigned. The alphanumeric characters set to 20h to 7Fh in the code assignment table 210 are the same as the alphanumeric characters set to 20h to 7Fh in the code assignment table 50.

コード割当表210の80h〜9Fhには、高頻度の単語等が設定される。また、コード割当表210の80h〜9Fhには、コード割当表50の00h〜1Fhに設定されていた制御記号や、コード割当表50の80h〜FFhに設定されていたCJK文字の一部が設定される。コード割当表210の80h〜9Fhに設定された高頻度の単語、制御記号、CJK文字には、2バイトのコードが割り当てられる。   Frequent words and the like are set in 80h to 9Fh of the code assignment table 210. In addition, in 80h to 9Fh of the code assignment table 210, control symbols set in 00h to 1Fh in the code assignment table 50 and a part of CJK characters set in 80h to FFh in the code assignment table 50 are set. Is done. A 2-byte code is assigned to high-frequency words, control symbols, and CJK characters set to 80h to 9Fh in the code assignment table 210.

コード割当表210のA0h〜FFhには、低頻度の単語等が設定される。また、コード割当表210のA0h〜FFhには、コード割当表50の80h〜FFhに設定されていたCJK文字の一部が設定される。   Infrequent words and the like are set in A0h to FFh of the code assignment table 210. A part of the CJK characters set in 80h to FFh in the code assignment table 50 are set in A0h to FFh in the code assignment table 210.

本実施例2について、以下の説明では、適宜、コード割当表210の00h〜1Fhの領域を「単語1バイト領域」と表記する。コード割当表210の20h〜7Fhの領域を「英数字1バイト領域」と表記する。コード割当表210の80h〜9Fhの領域を「2バイト領域」と表記する。コード割当表210のA0h〜FFhの領域を「3バイト領域」と表記する。   Regarding the second embodiment, in the following description, the area from 00h to 1Fh in the code assignment table 210 will be referred to as a “word 1-byte area” as appropriate. The area of 20h to 7Fh in the code assignment table 210 is expressed as “alphanumeric 1-byte area”. The area from 80h to 9Fh in the code allocation table 210 is expressed as “2-byte area”. The area from A0h to FFh in the code assignment table 210 is denoted as “3-byte area”.

コード変換部250は、コード割当表210に基づいて、テキストデータ20aを、テキストデータ20bに変換する。ここでは、テキストデータ20aを「・・・he△is△in△the△house△・・・」とする。テキストデータ20aの「△」はスペースを示すものである。   Based on the code assignment table 210, the code conversion unit 250 converts the text data 20a into text data 20b. Here, the text data 20a is assumed to be “..., He Δis Δ in Δ the Δ house Δ. “Δ” in the text data 20a indicates a space.

コード変換部250は、スペース「△」で区切られる単語と、コード割当表210とを比較して、単語をコードに変換する。テキストデータ20aに含まれる単語「he△」は、コード割当表210の単語1バイト領域に設定された単語であり、コード変換部250は、単語「he△」を1バイトのコード「12h」に変換する。   The code conversion unit 250 compares the word delimited by the space “Δ” with the code assignment table 210 and converts the word into a code. The word “heΔ” included in the text data 20a is a word set in the word 1-byte area of the code assignment table 210, and the code conversion unit 250 converts the word “heΔ” into a 1-byte code “12h”. Convert.

テキストデータ20aに含まれる単語「is△」は、コード割当表210の単語1バイト領域に設定された単語であり、コード変換部250は、単語「is△」を1バイトのコード「08h」に変換する。   The word “isΔ” included in the text data 20a is a word set in the word 1-byte area of the code assignment table 210, and the code conversion unit 250 converts the word “isΔ” into a 1-byte code “08h”. Convert.

テキストデータ20aに含まれる単語「in△」は、コード割当表210の単語1バイト領域に設定された単語であり、コード変換部250は、単語「in△」を1バイトのコード「07h」に変換する。   The word “inΔ” included in the text data 20a is a word set in the word 1-byte area of the code assignment table 210, and the code conversion unit 250 converts the word “inΔ” into a 1-byte code “07h”. Convert.

テキストデータ20aに含まれる単語「the△」は、コード割当表210の単語1バイト領域に設定された単語であり、コード変換部250は、単語「the△」を1バイトのコード「00h」に変換する。   The word “theΔ” included in the text data 20a is a word set in the word 1-byte area of the code assignment table 210, and the code conversion unit 250 converts the word “theΔ” into a 1-byte code “00h”. Convert.

テキストデータ20aに含まれる単語「house△」は、コード割当表210の2バイト領域に設定された単語であり、コード変換部250は、例えば、単語「house△」を2バイトのコード「8341h」に変換する。   The word “houseΔ” included in the text data 20a is a word set in the 2-byte area of the code assignment table 210. For example, the code conversion unit 250 converts the word “houseΔ” into a 2-byte code “8341h”. Convert to

コード変換部250は、テキストデータ20aに含まれる各単語に対して、上記処理を実行することで、テキストデータ20aをテキストデータ20bにコード化する。   The code conversion unit 250 encodes the text data 20a into the text data 20b by performing the above processing on each word included in the text data 20a.

図7bは、本実施例2に係る復号化装置の処理の一例を示す図である。本実施例2に係る復号化装置は、従来技術で用いていたコード割当表50の代わりに、コード割当表210を用いて、コード変換されたテキストデータ20bを、文字コード変換することで、テキストデータ20aを生成する。コード割当表210に関する説明は、上記の説明と同様である。   FIG. 7B is a diagram illustrating an example of a process performed by the decoding apparatus according to the second embodiment. The decoding apparatus according to the second embodiment uses the code assignment table 210 instead of the code assignment table 50 used in the prior art to perform character code conversion on the text data 20b that has been subjected to code conversion. Data 20a is generated. The description regarding the code assignment table 210 is the same as the above description.

コード変換部650は、コード割当表210に基づいて、テキストデータ20bを、テキストデータ20aに変換する。ここでは、テキストデータ20bを「・・・12h 08h 07h 00h 8341h・・・」とする。   The code conversion unit 650 converts the text data 20b into the text data 20a based on the code assignment table 210. Here, the text data 20b is assumed to be “... 12h 08h 07h 00h 8341h.

コード変換部650は、コードと、コード割当表210とを比較して、コードを単語に変換する。例えば、コード変換部650は、1バイトのコード「12h」を単語「he△」に変換する。コード変換部650は、1バイトのコード「08h」を単語「is△」に変換する。コード変換部650は、1バイトのコード「07h」を単語「in△」に変換する。コード変換部650は、1バイトのコード「00h」を単語「the△」に変換する。コード変換部650は、2バイトのコード「8341h」を単語「house△」に変換する。   The code conversion unit 650 compares the code with the code assignment table 210 and converts the code into a word. For example, the code conversion unit 650 converts the 1-byte code “12h” into the word “heΔ”. The code conversion unit 650 converts the 1-byte code “08h” into the word “isΔ”. The code conversion unit 650 converts the 1-byte code “07h” into the word “inΔ”. The code conversion unit 650 converts the 1-byte code “00h” into the word “theΔ”. The code conversion unit 650 converts the 2-byte code “8341h” into the word “houseΔ”.

コード変換部650は、テキストデータ20bに含まれる各コードに対して、上記処理を実行することで、テキストデータ20bをテキストデータ20aに変換する。   The code conversion unit 650 converts the text data 20b into the text data 20a by executing the above processing on each code included in the text data 20b.

図8aは、本実施例2に係る符号化装置の構成を示す機能ブロック図である。図8aに示すように、この符号化装置200は、入力部201、出力部202、レジスタ205a,205b、記憶部206、コード変換部250を有する。   FIG. 8A is a functional block diagram illustrating the configuration of the encoding device according to the second embodiment. As shown in FIG. 8a, the encoding device 200 includes an input unit 201, an output unit 202, registers 205a and 205b, a storage unit 206, and a code conversion unit 250.

入力部201は、コード変換を行うテキストデータを受け付ける処理部である。入力部201は、受け付けたテキストデータを、レジスタ205aに格納する。   The input unit 201 is a processing unit that receives text data for code conversion. The input unit 201 stores the received text data in the register 205a.

出力部202は、レジスタ205bに格納されるコード変換後のテキストデータを出力する処理部である。   The output unit 202 is a processing unit that outputs the text data after code conversion stored in the register 205b.

レジスタ205aは、コード変換を行う前のテキストデータを格納するものである。レジスタ205bは、コード変換後のテキストデータを格納するものである。   The register 205a stores text data before code conversion. The register 205b stores text data after code conversion.

記憶部206は、コード割当表210と、2バイトコード割当表215aと、3バイトコード割当表215bとを有する。記憶部206は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 206 includes a code allocation table 210, a 2-byte code allocation table 215a, and a 3-byte code allocation table 215b. The storage unit 206 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

図9は、本実施例2に係るコード割当表の一例を示す図である。コード割当表210は、単語等と、所定のコードとを対応付けたテーブルであり、図7aで説明したコード割当表210に対応する。図9に示すように、このコード割当表210は、単語1バイト領域210Aと、英数字1バイト領域210Bと、2バイト領域210Cと、3バイト領域210Dとを有する。   FIG. 9 is a diagram illustrating an example of a code assignment table according to the second embodiment. The code assignment table 210 is a table in which words and the like are associated with predetermined codes, and corresponds to the code assignment table 210 described with reference to FIG. As shown in FIG. 9, the code allocation table 210 has a word 1-byte area 210A, an alphanumeric 1-byte area 210B, a 2-byte area 210C, and a 3-byte area 210D.

単語1バイト領域210Aは、コード割当表210の00h〜1Fhの領域である。この単語1バイト領域210Aには、青空文庫、オックスフォード英語辞典、その他の一般的な書籍を基にして、出現頻度の高い上位32個の単語が設定される。   The word 1-byte area 210A is an area from 00h to 1Fh in the code assignment table 210. In the word 1-byte area 210A, the top 32 words having the highest appearance frequency are set based on the blue sky library, the Oxford English dictionary, and other general books.

単語1バイト領域210Aに設定された単語は、単語1バイト領域210Aの設定位置に応じた1バイトのコードが割り当てられる。例えば、単語「the△」は、1バイトのコード「00h」が割り当てられる。単語1バイト領域210Aに設定された残りの単語も同様に、1バイトのコードが割り当てられる。   A 1-byte code corresponding to the set position of the word 1-byte area 210A is assigned to the word set in the word 1-byte area 210A. For example, the word “theΔ” is assigned a 1-byte code “00h”. Similarly, a 1-byte code is assigned to the remaining words set in the word 1-byte area 210A.

英数字1バイト領域210Bは、コード割当表210の20h〜7Fhの領域である。この英数字1バイト領域210Bには、コード割当表50の20h〜7Fhに設定される英数字と同様の英数字が設定される。   The alphanumeric 1-byte area 210B is an area of 20h to 7Fh in the code assignment table 210. In this alphanumeric 1-byte area 210B, alphanumeric characters similar to the alphanumeric characters set in 20h to 7Fh of the code assignment table 50 are set.

英数字1バイト領域210Bに設定された英数字は、英数字1バイト領域210Bの設定位置に応じた1バイトのコードが割り当てられる。例えば、数値「0」は、1バイトのコード「30h」が割り当てられる。英数字1バイト領域210Bに設定された残りの英数字も同様に、1バイトのコードが割り当てられる。   An alphanumeric character set in the alphanumeric 1-byte area 210B is assigned a 1-byte code corresponding to the set position of the alphanumeric 1-byte area 210B. For example, the numerical value “0” is assigned a 1-byte code “30h”. Similarly, a 1-byte code is assigned to the remaining alphanumeric characters set in the alphanumeric 1-byte area 210B.

2バイト領域210Cは、コード割当表210の80h〜9Fhの領域である。この2バイト領域210Cには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値以上となる単語が設定される。以下の説明では、適宜、出現頻度が所定値以上となる単語を高頻度単語と表記する。また、2バイト領域210Cには、制御記号等が含まれていても良い。   The 2-byte area 210C is an area from 80h to 9Fh in the code assignment table 210. In this 2-byte area 210C, words whose appearance frequency is equal to or higher than a predetermined value are set based on a blue sky library, an Oxford English dictionary, and other general books. In the following description, words whose appearance frequency is equal to or higher than a predetermined value will be referred to as high-frequency words as appropriate. The 2-byte area 210C may include a control symbol or the like.

ここで、2バイト領域210Cには、係る2バイト領域210Cに設定された高頻度単語等に割り当てる2バイトのコードのうち、前半の1バイトのコードのみが定義されている。2バイト領域210Cに設定された単語等に割り当てる2バイトのコードは、後述する2バイトコード割当表215aに定義されている。   Here, in the 2-byte area 210C, only the 1-byte code of the first half is defined among 2-byte codes assigned to the high-frequency word or the like set in the 2-byte area 210C. A 2-byte code assigned to a word or the like set in the 2-byte area 210C is defined in a 2-byte code assignment table 215a described later.

例えば、2バイト領域210Cの高頻度単語に割り当てる2バイトのコードのうち、前半の1バイトのコードは「80h〜9Fh」となる。そして、前半の1バイトのコードと、残りの1バイトのコードは、2バイトコード割当表215aに定義されている。   For example, among the 2-byte codes assigned to the high-frequency words in the 2-byte area 210C, the 1-byte code in the first half is “80h-9Fh”. The 1-byte code in the first half and the remaining 1-byte code are defined in the 2-byte code allocation table 215a.

3バイト領域210Dは、コード割当表210のA0h〜FFhの領域である。この3バイト領域210Dには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値未満となる低頻度の単語が設定される。例えば、3バイト領域210Dには、CJK文字、英単語、日本単語、数値、タグ、動的コード等が含まれる。動的コードは、例えば、人物名や住所、連結単語等に対応するものである。   The 3-byte area 210D is an area from A0h to FFh in the code assignment table 210. In this 3-byte area 210D, a low-frequency word whose appearance frequency is less than a predetermined value is set based on a blue sky library, an Oxford English dictionary, and other general books. For example, the 3-byte area 210D includes CJK characters, English words, Japanese words, numerical values, tags, dynamic codes, and the like. The dynamic code corresponds to, for example, a person name, an address, a connected word, or the like.

ここで、3バイト領域210Dには、係る3バイト領域210Dに設定された単語等に割り当てる3バイトのコードのうち、前半の1バイトのコードのみが定義されている。3バイト領域210Dに設定された単語等に割り当てる3バイトのコードは、後述する3バイトコード割当表215bに定義されている。   Here, in the 3-byte area 210D, only the 1-byte code of the first half is defined among 3-byte codes assigned to the word set in the 3-byte area 210D. A 3-byte code assigned to a word or the like set in the 3-byte area 210D is defined in a 3-byte code assignment table 215b described later.

図10は、本実施例2に係る2バイトコード割当表の一例を示す図である。図10に示すように、2バイトコード割当表215aは、高頻度単語と、2バイトのコードとを対応付ける。   FIG. 10 is a diagram illustrating an example of a 2-byte code allocation table according to the second embodiment. As shown in FIG. 10, the 2-byte code assignment table 215a associates high-frequency words with 2-byte codes.

例えば、2バイトコード割当表215aにおいて、「8000h〜9FFFh」には、高頻度単語が設定され、設定位置に応じた2バイトのコードが割り当てられる。例えば、設定位置「8000h」に設定された高頻度単語には、2バイトのコード「8000h」が割り当てられる。   For example, in the 2-byte code assignment table 215a, a high-frequency word is set in “8000h to 9FFFh”, and a 2-byte code corresponding to the set position is assigned. For example, the 2-byte code “8000h” is assigned to the high-frequency word set at the setting position “8000h”.

図11は、本実施例2に係る3バイトコード割当表の一例を示す図である。図11に示すように、3バイトコード割当表215bは、CJK文字、英単語、日本単語、数値、タグ、動的コードと、3バイトのコードとを対応付ける。   FIG. 11 is a diagram illustrating an example of a 3-byte code allocation table according to the second embodiment. As shown in FIG. 11, the 3-byte code assignment table 215b associates CJK characters, English words, Japanese words, numerical values, tags, dynamic codes, and 3-byte codes.

図8aの説明に戻る。コード変換部250は、コード割当表210、2バイトコード割当表215a、3バイトコード割当表215bを基にして、レジスタ205aに格納されたテキストデータをコード化する処理部である。コード変換部250は、コード化したテキストデータを、レジスタ205bに格納する。   Returning to the description of FIG. The code conversion unit 250 is a processing unit that encodes the text data stored in the register 205a based on the code allocation table 210, the 2-byte code allocation table 215a, and the 3-byte code allocation table 215b. The code conversion unit 250 stores the encoded text data in the register 205b.

以下において、コード変換部250の処理の一例について説明する。コード変換部250は、テキストデータから、スペース「△」で区切られる単語を取得する。コード変換部250は、取得した単語が、単語1バイト領域210Aに設定された単語か、英数字1バイト領域210Bに設定された英数字に対応するものか、2バイト領域210Cに設定された単語か、3バイト領域210Dに設定された単語かを判定する。   Hereinafter, an example of processing of the code conversion unit 250 will be described. The code conversion unit 250 acquires words delimited by the space “Δ” from the text data. The code conversion unit 250 determines whether the acquired word is a word set in the word 1-byte area 210A or an alphanumeric word set in the alphanumeric 1-byte area 210B, or a word set in the 2-byte area 210C Or a word set in the 3-byte area 210D.

コード変換部250の取得した単語が単語1バイト領域210Aに設定された単語である場合について説明する。コード変換部250は、取得した単語と、単語1バイト領域210Aの各単語とを比較して、該当する設定位置の1バイトのコードを特定し、コード化する。例えば、コード変換部250は、取得した単語が「the△」である場合には、かかる単語「the△」を「00h」にコード化する。   A case where the word acquired by the code conversion unit 250 is a word set in the word 1-byte area 210A will be described. The code conversion unit 250 compares the acquired word with each word in the word 1-byte area 210A to identify and code a 1-byte code at the corresponding setting position. For example, if the acquired word is “theΔ”, the code conversion unit 250 encodes the word “theΔ” into “00h”.

コード変換部250の取得した情報が英数字1バイト領域210Bに設定された英数字である場合について説明する。コード変換部250は、取得した英数字と、英数字1バイト領域210Bの各英数字とを比較して、該当する設置位置の1バイトのコードを特定し、コード化する。例えば、コード変換部250は、取得した英数字が「A」である場合には、係る英数字「A」を「41h」にコード化する。   A case where the information acquired by the code conversion unit 250 is an alphanumeric character set in the alphanumeric one-byte area 210B will be described. The code conversion unit 250 compares the acquired alphanumeric character with each alphanumeric character in the alphanumeric one-byte area 210B, and specifies and encodes the one-byte code at the corresponding installation position. For example, if the acquired alphanumeric character is “A”, the code converting unit 250 encodes the alphanumeric character “A” into “41h”.

コード変換部250の取得した単語が2バイト領域210Cに設定された単語である場合について説明する。コード変換部250は、取得した単語と、2バイトコード割当表215aとを比較して、該当する設定位置の2バイトのコードを特定し、コード化する。例えば、コード変換部250は、取得した単語が、2バイトコード割当表215aの「8000h」に設定されたある高頻度単語である場合には、かかる高頻度単語を2バイトのコード「8000h」にコード化する。   A case where the word acquired by the code conversion unit 250 is a word set in the 2-byte area 210C will be described. The code conversion unit 250 compares the acquired word with the 2-byte code assignment table 215a, identifies the 2-byte code at the corresponding setting position, and encodes it. For example, if the acquired word is a certain high-frequency word set to “8000h” in the 2-byte code assignment table 215a, the code conversion unit 250 converts the high-frequency word into a 2-byte code “8000h”. Code it.

コード変換部250の取得した単語が3バイト領域210Dに設定された単語である場合について説明する。コード変換部250は、取得した単語と、3バイトコード割当表215bとを比較して、該当する設定位置の3バイトのコードを特定し、コード化する。例えば、コード変換部250は、取得した単語が、3バイトコード割当表215bの「B00000h」に設定されたある英単語である場合には、かかる英単語を3バイトのコード「B00000h」にコード化する。   A case where the word acquired by the code conversion unit 250 is a word set in the 3-byte area 210D will be described. The code conversion unit 250 compares the acquired word with the 3-byte code assignment table 215b to identify and code a 3-byte code at the corresponding setting position. For example, if the acquired word is a certain English word set to “B00000h” in the 3-byte code allocation table 215b, the code conversion unit 250 encodes the English word into a 3-byte code “B00000h”. To do.

なお、コード変換部250は、取得した情報が、3バイト領域210Dに設定された日本単語、CJK文字、数値、タグ、動的コードである場合も、3バイトコード割当表215bと比較して、コード化する。   The code conversion unit 250 also compares the acquired information with Japanese words, CJK characters, numerical values, tags, and dynamic codes set in the 3-byte area 210D in comparison with the 3-byte code allocation table 215b. Code it.

図8bは、本実施例2に係る復号化装置の構成を示す機能ブロック図である。図8bに示すように、この復号化装置600は、入力部601、出力部602、レジスタ605a,605b、記憶部606、コード変換部650を有する。   FIG. 8B is a functional block diagram illustrating the configuration of the decoding apparatus according to the second embodiment. As illustrated in FIG. 8b, the decoding device 600 includes an input unit 601, an output unit 602, registers 605a and 605b, a storage unit 606, and a code conversion unit 650.

入力部601は、コード変換されたテキストデータを受け付ける処理部である。入力部601は、受け付けたテキストデータを、レジスタ605aに格納する。   The input unit 601 is a processing unit that receives code-converted text data. The input unit 601 stores the received text data in the register 605a.

出力部602は、レジスタ605bに格納されたテキストデータを出力する処理部である。   The output unit 602 is a processing unit that outputs text data stored in the register 605b.

レジスタ605aは、コード変換されたテキストデータを格納するものである。レジスタ605bは、文字コード変換後のテキストデータを格納するものである。   The register 605a stores code-converted text data. The register 605b stores text data after character code conversion.

記憶部606は、コード割当表210と、2バイトコード割当表215aと、3バイトコード割当表215bとを有する。記憶部606は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 606 includes a code allocation table 210, a 2-byte code allocation table 215a, and a 3-byte code allocation table 215b. The storage unit 606 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

コード割当表210に関する説明は、図9で説明したコード割当表210に関する説明と同様である。2バイトコード割当表215aに関する説明は、図10で説明した2バイトコード割当表215aに関する説明と同様である。3バイトコード割当表215bに関する説明は、図11で説明した3バイトコード割当表215bに関する説明と同様である。   The description regarding the code allocation table 210 is the same as the description regarding the code allocation table 210 described with reference to FIG. 9. The description regarding the 2-byte code allocation table 215a is the same as the description regarding the 2-byte code allocation table 215a described with reference to FIG. The description regarding the 3-byte code allocation table 215b is the same as the description regarding the 3-byte code allocation table 215b described with reference to FIG.

以下において、コード変換部650の処理の一例について説明する。例えば、コード変換部650は、テキストデータからコードを取得し、取得したコードが単語1バイト領域210Aに設定された単語に対応するものか、英数字1バイト領域210Bに設定された英数字に対応するものかを判定する。また、コード変換部650は、取得したコードが、2バイト領域210Cに設定された単語に対応するものか、3バイト領域210Dに設定された単語に対応するものかを判定する。   Hereinafter, an example of processing of the code conversion unit 650 will be described. For example, the code conversion unit 650 acquires a code from text data, and the acquired code corresponds to the word set in the word 1-byte area 210A or the alphanumeric set in the alphanumeric 1-byte area 210B Determine what to do. In addition, the code conversion unit 650 determines whether the acquired code corresponds to a word set in the 2-byte area 210C or a word set in the 3-byte area 210D.

コード変換部650の取得したコードが単語1バイト領域210Aに設定された単語に対応するコードである場合について説明する。単語1バイト領域210Aに設定された単語に対応するコードの1バイト目は「00h〜1Fh」に含まれる。コード変換部650は、コードに対応する単語を、単語1バイト領域210Aに設定された単語から選択し、選択した単語によって文字コード化する。例えば、コード変換部650は、取得したコードが「00h」である場合には、「00h」を「the△」に文字コード化する。   A case where the code acquired by the code conversion unit 650 is a code corresponding to the word set in the word 1-byte area 210A will be described. The first byte of the code corresponding to the word set in the word 1-byte area 210A is included in “00h to 1Fh”. The code conversion unit 650 selects a word corresponding to the code from words set in the word 1-byte area 210A, and converts the word into a character code using the selected word. For example, when the acquired code is “00h”, the code conversion unit 650 converts “00h” into “theΔ” as a character code.

コード変換部650が取得したコードが英数字1バイト領域210Bに設定された英数字に対応するコードである場合について説明する。英数字1バイト領域210Bに設定された英数字に対応するコードの1バイト目は「20h〜7Fh」に含まれる。コード変換部650は、コードに対応する英数字を、英数字1バイト領域210bに設定された英数字から選択し、選択した英数字によって文字コード化する。例えば、コード変換部650は、取得したコードが「41h」である場合には、「41h」を「A」に文字コード化する。   A case where the code acquired by the code conversion unit 650 is a code corresponding to an alphanumeric character set in the alphanumeric one-byte area 210B will be described. The first byte of the code corresponding to the alphanumeric character set in the alphanumeric one-byte area 210B is included in “20h-7Fh”. The code conversion unit 650 selects an alphanumeric character corresponding to the code from the alphanumeric characters set in the alphanumeric one-byte area 210b, and converts the character code into the selected alphanumeric character. For example, when the acquired code is “41h”, the code conversion unit 650 converts “41h” into “A” as a character code.

コード変換部650の取得したコードが2バイト領域210Cに設定された単語に対応するコードである場合について説明する。2バイト領域210Cに設定された単語に対応するコードの1バイト目は「80h〜9Fh」に含まれる。コード変換部650は、取得したコードと、2バイトコード割当表215aとを比較して、コードに対応する単語を特定し、文字コード化する。コード変換部650は、取得したコードが「8000h」である場合には、2バイトコード割当表215aの「8000h」に対応する高頻度単語に文字コード化する。   A case where the code acquired by the code conversion unit 650 is a code corresponding to the word set in the 2-byte area 210C will be described. The first byte of the code corresponding to the word set in the 2-byte area 210C is included in “80h-9Fh”. The code conversion unit 650 compares the acquired code with the 2-byte code assignment table 215a, identifies a word corresponding to the code, and converts it into a character code. When the acquired code is “8000h”, the code converting unit 650 converts the character code into a high-frequency word corresponding to “8000h” in the 2-byte code assignment table 215a.

コード変換部650の取得したコードが3バイト領域210Dに設定された単語に対応するコードである場合について説明する。3バイト領域210Dに設定された単語に対応するコードの1バイト目は「A0h〜FFh」に含まれる。コード変換部650は、取得したコードと、3バイトコード割当表215bとを比較して、コードに対応する単語を特定し、文字コード化する。コード変換部650は、取得したコードが「B00000h」である場合には、3バイトコード割当表215bの「B00000h」に対応する英単語に文字コード化する。   A case where the code acquired by the code conversion unit 650 is a code corresponding to the word set in the 3-byte area 210D will be described. The first byte of the code corresponding to the word set in the 3-byte area 210D is included in “A0h to FFh”. The code conversion unit 650 compares the acquired code with the 3-byte code assignment table 215b, identifies a word corresponding to the code, and converts it into a character code. When the acquired code is “B00000h”, the code conversion unit 650 converts the character code into an English word corresponding to “B00000h” in the 3-byte code assignment table 215b.

図12aは、本実施例2に係る符号化装置の処理手順を示すフローチャートである。図12aに示すように、符号化装置200の入力部201は、テキストデータをレジスタ205aに格納する(ステップS201)。符号化装置200のコード変換部250は、レジスタ205aに格納されたテキストデータから単語を取得する(ステップS202)。ステップS202では、説明の便宜上、単語と表記するが、コード変換部250が取得するものは、単語の他に、英数字、CJK文字、日本単語、英単語、数値、タグ、動的コードの場合もある。   FIG. 12A is a flowchart illustrating the processing procedure of the encoding apparatus according to the second embodiment. As shown in FIG. 12a, the input unit 201 of the encoding device 200 stores the text data in the register 205a (step S201). The code conversion unit 250 of the encoding device 200 acquires a word from the text data stored in the register 205a (step S202). In step S202, for convenience of explanation, it is written as a word, but what is acquired by the code conversion unit 250 is, in addition to the word, an alphanumeric character, CJK character, Japanese word, English word, numeric value, tag, or dynamic code. There is also.

コード変換部250は、単語とコード割当表210とを比較する(ステップS203)。コード変換部250は、単語(情報)がコード割当表210の単語1バイト領域210Aの単語または英数字1バイト領域210Bの英数字に対応する単語である場合には(ステップS204,Yes)、ステップS205に移行する。コード変換部250は、コード割当表210に基づいて、単語または英数字を1バイトのコードに変換し(ステップS205)、ステップS209に移行する。   The code conversion unit 250 compares the word with the code assignment table 210 (step S203). If the word (information) is a word corresponding to the word in the word 1-byte area 210A of the code assignment table 210 or the alphanumeric character in the alphanumeric 1-byte area 210B (Yes in step S204), the code conversion unit 250 The process proceeds to S205. Based on the code assignment table 210, the code conversion unit 250 converts a word or an alphanumeric character into a 1-byte code (step S205), and proceeds to step S209.

一方、コード変換部250は、単語(情報)がコード割当表210の単語1バイト領域210Aの単語あるいは英数字1バイト領域210Bの英数字に対応する単語でない場合には(ステップS204,No)、ステップS206に移行する。コード変換部250は、単語がコード割当表210の2バイト領域210Cの単語に対応する単語である場合には(ステップS206,Yes)、ステップS207に移行する。コード変換部250は、2バイトコード割当表215aに基づいて、単語を2バイトのコードに変換し(ステップS207)、ステップS209に移行する。   On the other hand, if the word (information) is not a word corresponding to the word in the word 1-byte area 210A of the code assignment table 210 or the alphanumeric character in the alphanumeric 1-byte area 210B (No in step S204), The process proceeds to step S206. If the word is a word corresponding to the word in the 2-byte area 210C of the code assignment table 210 (Yes at Step S206), the code conversion unit 250 proceeds to Step S207. The code conversion unit 250 converts the word into a 2-byte code based on the 2-byte code assignment table 215a (step S207), and proceeds to step S209.

一方、コード変換部250は、単語がコード割当表210の2バイト領域210Cの単語に対応する単語でない場合には(ステップS206,No)、ステップS208に移行する。コード変換部250は、3バイトコード割当表215bに基づいて、単語を3バイトのコードに変換し(ステップS208)、ステップS209に移行する。   On the other hand, if the word is not a word corresponding to the word in the 2-byte area 210C of the code assignment table 210 (No at Step S206), the code conversion unit 250 proceeds to Step S208. The code conversion unit 250 converts the word into a 3-byte code based on the 3-byte code assignment table 215b (step S208), and proceeds to step S209.

コード変換部250は、テキストデータのコード化が終了したか否かを判定する(ステップS209)。コード変換部250は、テキストデータのコード化が終了していない場合には(ステップS209,No)、ステップS202に移行する。   The code conversion unit 250 determines whether or not the text data has been encoded (step S209). If the encoding of the text data has not been completed (No at Step S209), the code conversion unit 250 proceeds to Step S202.

一方、コード変換部250は、テキストデータのコード化が終了した場合には(ステップS209,Yes)、コード化したテキストデータを、レジスタ205bに格納する(ステップS210)。   On the other hand, when the encoding of the text data is completed (Yes at Step S209), the code conversion unit 250 stores the encoded text data in the register 205b (Step S210).

図12bは、本実施例2に係る復号化装置の処理手順を示すフローチャートである。図12bに示すように、復号化装置600の入力部601は、テキストデータをレジスタ605aに格納する(ステップS601)。復号化装置600のコード変換部650は、レジスタ605aに格納されたテキストデータからコードを取得する(ステップS602)。   FIG. 12B is a flowchart illustrating the processing procedure of the decoding apparatus according to the second embodiment. As shown in FIG. 12b, the input unit 601 of the decryption apparatus 600 stores the text data in the register 605a (step S601). The code conversion unit 650 of the decryption apparatus 600 acquires a code from the text data stored in the register 605a (step S602).

コード変換部650は、コードとコード割当表210とを比較する(ステップS603)。コード変換部650は、コードがコード割当表210の単語1バイト領域210Aの単語または英数字1バイト領域210Bの英数字に対応する対応するコードである場合には(ステップS604,Yes)、ステップS605に移行する。コード変換部650は、コード割当表210に基づいて、1バイトのコードを単語または英数字に変換し(ステップS605)、ステップS609に移行する。   The code conversion unit 650 compares the code with the code assignment table 210 (step S603). When the code is a corresponding code corresponding to a word in the word 1-byte area 210A of the code assignment table 210 or an alphanumeric character in the alphanumeric 1-byte area 210B (step S604, Yes), the code conversion unit 650 performs step S605. Migrate to Based on the code assignment table 210, the code conversion unit 650 converts the 1-byte code into a word or an alphanumeric character (step S605), and proceeds to step S609.

一方、コード変換部650は、コードがコード割当表210の単語1バイト領域210Aの単語あるいは英数字1バイト領域210Bの英数字に対応するコードでない場合には(ステップS604,No)、ステップS606に移行する。コード変換部650は、コードがコード割当表210の2バイト領域210Cの単語に対応するコードである場合には(ステップS606,Yes)、ステップS607に移行する。コード変換部650は、2バイトコード割当表215aに基づいて、2バイトのコードを単語に変換し(ステップS607)、ステップS609に移行する。   On the other hand, if the code is not a code corresponding to the word in the word 1-byte area 210A of the code assignment table 210 or the alphanumeric character in the alphanumeric 1-byte area 210B (step S604, No), the code conversion unit 650 proceeds to step S606. Transition. If the code is a code corresponding to a word in the 2-byte area 210C of the code assignment table 210 (step S606, Yes), the code conversion unit 650 proceeds to step S607. Based on the 2-byte code allocation table 215a, the code conversion unit 650 converts the 2-byte code into a word (step S607), and proceeds to step S609.

一方、コード変換部650は、コードがコード割当表210の2バイト領域210Cの単語に対応するコードでない場合には(ステップS606,No)、ステップS608に移行する。コード変換部650は、3バイトコード割当表215bに基づいて、3バイトのコードを単語に変換し(ステップS608)、ステップS609に移行する。   On the other hand, if the code is not a code corresponding to the word in the 2-byte area 210C of the code assignment table 210 (No at Step S606), the code conversion unit 650 proceeds to Step S608. Based on the 3-byte code assignment table 215b, the code conversion unit 650 converts the 3-byte code into a word (step S608), and proceeds to step S609.

コード変換部650は、テキストデータの復号化が終了したか否かを判定する(ステップS609)。コード変換部250は、テキストデータの復号化が終了していない場合には(ステップS609,No)、ステップS602に移行する。   The code conversion unit 650 determines whether or not the text data has been decrypted (step S609). If the decoding of the text data has not been completed (No at Step S609), the code conversion unit 250 proceeds to Step S602.

一方、コード変換部250は、テキストデータの復号化が終了した場合には(ステップS609,Yes)、復号化したテキストデータを、レジスタ605bに格納する(ステップS610)。   On the other hand, when the decoding of the text data is completed (Yes in step S609), the code conversion unit 250 stores the decoded text data in the register 605b (step S610).

次に、本実施例2に係る符号化装置200の効果について説明する。符号化装置200は、コード割当表210の単語1バイト領域において、厳選した単語を割り当てた割当表を用いたコード変換を行う。なお、英数字1バイト領域には、従来のコード割当表50の20h〜7Fhに設定される英数字と同様の英数字を設定する。係る処理を実行することで、英数字に関しては、従来と同様に1バイトのコードに変換することを可能にしつつ、出現頻度が高い文字や単語に対しては、短いバイトコードを割り当てることができる。   Next, effects of the encoding device 200 according to the second embodiment will be described. The encoding apparatus 200 performs code conversion using an assignment table in which carefully selected words are assigned in the word 1-byte area of the code assignment table 210. In the alphanumeric 1-byte area, the same alphanumeric characters as those set for 20h to 7Fh in the conventional code assignment table 50 are set. By executing such processing, alphanumeric characters can be converted into 1-byte codes as in the past, and short byte codes can be assigned to characters and words that appear frequently. .

また、復号化装置600は、上記のコード割当表210を用いて、コード化されたテキストデータを復号化するため、出現頻度が高い単語や一般記号に対して、短いバイトコードを割り当てた場合でも、係るバイトコードを単語や一般記号に変換することができる。   In addition, since the decoding apparatus 600 uses the code allocation table 210 described above to decode the encoded text data, even when a short byte code is allocated to a word or general symbol having a high appearance frequency. , Such byte codes can be converted into words and general symbols.

図13aは、本実施例3に係る符号化装置の処理の一例を示す図である。本実施例3に係る符号化装置は、従来のコード割当表50と、本実施例3特有のコード割当表310とを切り替えて利用する。例えば、符号化装置は、テキストデータから、制御記号「SI(Shift In)」を検出した場合には、制御記号「SI」以降のテキストデータを、コード割当表310を用いて、コード変換する。一方、符号化装置は、テキストデータから、制御記号「SO(Shift Out)」を検出した場合には、コード割当表50を用いて、コード変換する。従来技術のコード割当表50に関する説明は、実施例1で説明したものと同様である。   FIG. 13A is a diagram illustrating an example of a process performed by the encoding apparatus according to the third embodiment. The encoding apparatus according to the third embodiment switches between the conventional code allocation table 50 and the code allocation table 310 unique to the third embodiment. For example, when detecting the control symbol “SI (Shift In)” from the text data, the encoding device performs code conversion on the text data after the control symbol “SI” using the code assignment table 310. On the other hand, when the control apparatus detects the control symbol “SO (Shift Out)” from the text data, the encoding apparatus performs code conversion using the code assignment table 50. The description regarding the code allocation table 50 of the prior art is the same as that described in the first embodiment.

コード割当表310について説明する。コード割当表310の00h〜1Fhには、制御記号が設定され、1バイトのコードが割り当てられる。コード変換表310の00h〜1Fhに設定される制御記号は、コード割当表50の00h〜1Fhに設定される制御記号と同様である。   The code assignment table 310 will be described. Control symbols are set in 00h to 1Fh in the code assignment table 310, and 1-byte codes are assigned. The control symbols set to 00h to 1Fh in the code conversion table 310 are the same as the control symbols set to 00h to 1Fh in the code assignment table 50.

コード割当表310の20h〜3Fhには、後述する所定の英単語が設定され、1バイトのコードが割り当てられる。コード割当表310の40h〜5Fhには、高頻度の英単語が設定され、2バイトのコードが割り当てられる。   Predetermined English words, which will be described later, are set in 20h to 3Fh of the code assignment table 310, and a 1-byte code is assigned. Frequent English words are set in 40h to 5Fh in the code assignment table 310, and a 2-byte code is assigned.

コード割当表310の60h〜7Fhには、後述する所定の日本単語が設定され、1バイトのコードが割り当てられる。コード割当表310の80h〜9Fhには、高頻度の日本単語が設定される。   A predetermined Japanese word to be described later is set in 60h to 7Fh of the code assignment table 310, and a 1-byte code is assigned. Frequent Japanese words are set in 80h to 9Fh of the code assignment table 310.

コード割当表310のA0h〜FFhには、低頻度の単語が設定され、2バイトまたは3バイトのコードが割り当てられる。   Infrequent words are set in A0h to FFh of the code assignment table 310, and 2-byte or 3-byte codes are assigned.

本実施例3について、以下の説明では、適宜、コード割当表310の00h〜1Fhの領域を「制御記号1バイト領域」と表記する。コード割当表310の20h〜3Fhの領域を「英単語1バイト領域」と表記する。コード割当表310の40h〜5Fhの領域を「英単語2バイト領域」と表記する。コード割当表310の60h〜7Fhの領域を「日本単語1バイト領域」と表記する。コード割当表310の80h〜9Fhの領域を「日本単語2バイト領域」と表記する。コード割当表310のA0h〜FFhの領域を「2・3バイト領域」と表記する。   Regarding the third embodiment, in the following description, the area from 00h to 1Fh in the code assignment table 310 will be referred to as “control symbol 1-byte area” as appropriate. The area from 20h to 3Fh in the code assignment table 310 is expressed as “English word 1-byte area”. The area from 40h to 5Fh in the code assignment table 310 is denoted as “English word 2-byte area”. The area from 60h to 7Fh in the code assignment table 310 is expressed as “Japanese word 1-byte area”. The area from 80h to 9Fh in the code assignment table 310 is expressed as “Japanese word 2-byte area”. The area from A0h to FFh in the code assignment table 310 is denoted as “2.3 byte area”.

コード変換部350は、制御記号「SI」あるいは「SO」の検出により、コード割当表50,310を切り替え、切り替えたコード割当表に基づいて、テキストデータ30aを、テキストデータ30bに変換する。ここでは、テキストデータ30aを「・・・Is△he△in△the△house?」とする。   The code conversion unit 350 switches the code assignment tables 50 and 310 by detecting the control symbol “SI” or “SO”, and converts the text data 30a to the text data 30b based on the switched code assignment table. Here, the text data 30a is assumed to be “... IsΔheΔinΔtheΔhouse?”.

以下の説明では、前提として、コード変換部350は、制御記号「SI」を検出しており、コード割当表310を基にして、テキストデータ30aをコード変換する場合について説明する。なお、コード変換部350が、コード割当表50を基にして、テキストデータ30aをコード変換する処理は、従来技術と同じであるため、説明を省略する。   In the following description, it is assumed that the code conversion unit 350 detects the control symbol “SI” and performs code conversion on the text data 30 a based on the code assignment table 310. Since the code conversion unit 350 performs code conversion on the text data 30a based on the code assignment table 50, the description thereof is omitted.

コード変換部350は、スペース「△」で区切られる単語と、コード割当表310とを比較して、単語をコードに変換する。テキストデータ30aに含まれる単語「Is△」は、コード割当表310の英単語1バイト領域に設定された単語であり、コード変換部350は、単語「Is△」を1バイトのコード「25h」と、「2Fh」とに変換する。ここで、1バイトのコード「25h」は、単語の先頭が大文字であることを示す1バイトのコードである。「2Fh」は、「is△」に対応する1バイトのコードである。   The code conversion unit 350 compares the word delimited by the space “Δ” with the code assignment table 310 and converts the word into a code. The word “IsΔ” included in the text data 30a is a word set in the 1-byte English word area of the code assignment table 310, and the code conversion unit 350 converts the word “IsΔ” into a 1-byte code “25h”. And “2Fh”. Here, the 1-byte code “25h” is a 1-byte code indicating that the beginning of the word is capitalized. “2Fh” is a 1-byte code corresponding to “isΔ”.

テキストデータ30aに含まれる「he△」は、コード割当表310の英単語1バイト領域に設定された単語であり、コード変換部350は、単語「he△」を1バイトのコード「39h」に変換する。   “HeΔ” included in the text data 30a is a word set in the 1-byte English word area of the code assignment table 310, and the code conversion unit 350 converts the word “heΔ” into a 1-byte code “39h”. Convert.

テキストデータ30aに含まれる「in△」は、コード割当表310の英単語1バイト領域に設定された単語であり、コード変換部350は、単語「in△」を1バイトのコード「2Eh」に変換する。   “InΔ” included in the text data 30a is a word set in the 1-byte English word area of the code assignment table 310, and the code conversion unit 350 converts the word “inΔ” into a 1-byte code “2Eh”. Convert.

テキストデータ30aに含まれる「the△」は、コード割当表310の英単語1バイト領域に設定された単語であり、コード変換部350は、単語「the△」を1バイトのコード「27h」に変換する。   “TheΔ” included in the text data 30a is a word set in the 1-byte English word area of the code assignment table 310, and the code conversion unit 350 converts the word “theΔ” into a 1-byte code “27h”. Convert.

テキストデータ30aに含まれる単語「house」は、「house△」と「−△」に分割される。「house△」は、コード割当表310の2バイト領域に設定された単語であり、コード変換部350は、例えば、単語「house△」を2バイトのコード「4341h」に、単語「−△」を1バイトのコード「21h」に変換する。   The word “house” included in the text data 30a is divided into “houseΔ” and “−Δ”. “HouseΔ” is a word set in the 2-byte area of the code allocation table 310. For example, the code conversion unit 350 converts the word “houseΔ” into a 2-byte code “4341h” and the word “−Δ”. Is converted to a 1-byte code “21h”.

テキストデータ30aに含まれる単語「?」は、コード割当表310の英単語2バイト領域に設定された記号であり、コード変換部350は、例えば、単語「?」を2バイトのコード「403Fh」に変換する。   The word “?” Included in the text data 30a is a symbol set in the 2-byte English word area of the code assignment table 310. For example, the code conversion unit 350 converts the word “?” Into a 2-byte code “403Fh”. Convert to

コード変換部350は、テキストデータ30aに含まれる各単語に対して、上記処理を実行することで、テキストデータ30aをテキストデータ30bにコード化する。   The code conversion unit 350 encodes the text data 30a into the text data 30b by performing the above processing on each word included in the text data 30a.

図13bは、本実施例3に係る復号化装置の処理の一例を示す図である。本実施例3に係る復号化装置は、従来のコード割当表50と、本実施例3特有のコード割当表310とを切り替えて利用する。例えば、復号化装置は、テキストデータから、制御記号「SI」のコードを検出した場合には、制御記号「SI」以降のテキストデータを、コード割当表310を用いて、文字コード変換する。一方、復号化装置は、テキストデータから、制御記号「SO」のコードを検出した場合には、コード割当表50を用いて、文字コード変換する。従来技術のコード割当表50に関する説明は、実施例1で説明したものと同様である。また、コード割当表310に関する説明は、上記の説明と同様である。   FIG. 13B is a diagram illustrating an example of a process performed by the decoding apparatus according to the third embodiment. The decoding apparatus according to the third embodiment switches between the conventional code allocation table 50 and the code allocation table 310 unique to the third embodiment. For example, when the code of the control symbol “SI” is detected from the text data, the decoding apparatus converts the text data after the control symbol “SI” into a character code using the code assignment table 310. On the other hand, when the code of the control symbol “SO” is detected from the text data, the decoding apparatus converts the character code using the code assignment table 50. The description regarding the code allocation table 50 of the prior art is the same as that described in the first embodiment. The description regarding the code assignment table 310 is the same as the above description.

コード変換部750は、制御記号「SI」のコードあるいは「SO」のコードの検出により、コード割当表50,310を切り替え、切り替えたコード割当表に基づいて、テキストデータ30bを、テキストデータ30aに変換する。ここでは、テキストデータ30bを「・・・25h 2Fh 39h 2Eh 27h 4341h 21h 403Fh・・・」とする。   The code conversion unit 750 switches the code allocation tables 50 and 310 by detecting the code of the control symbol “SI” or the code of “SO”, and converts the text data 30b to the text data 30a based on the switched code allocation table. Convert. Here, the text data 30b is assumed to be “... 25h 2Fh 39h 2Eh 27h 4341h 21h 403Fh.

以下の説明では、前提として、コード変換部750は、制御記号「SI」のコードを検出しており、コード割当表310を基にして、テキストデータ30bを文字コード変換する場合について説明する。なお、コード変換部750が、コード割当表50を基にして、テキストデータ30bを文字コード変換する処理は、従来技術と同じであるため、説明を省略する。   In the following description, it is assumed that the code conversion unit 750 detects the code of the control symbol “SI” and converts the text data 30b to a character code based on the code assignment table 310. The process in which the code conversion unit 750 converts the text data 30b into the character code based on the code assignment table 50 is the same as that in the prior art, and thus the description thereof is omitted.

コード変換部750は、コードと、コード割当表310とを比較して、コードを単語に変換する。例えば、コード変換部750は、1バイトのコード「25h」と、「2Fh」を、単語「Is△」に変換する。コード変換部750は、1バイトのコード「39h」を、単語「he△」に変換する。コード変換部750は、1バイトのコード「2Eh」を、単語「in△」に変換する。コード変換部750は、1バイトのコード「27h」を、単語「the△」に変換する。コード変換部750は、2バイトのコード「4341h」と1バイトのコード「21h」とを、単語「house」に変換する。コード変換部750は、2バイトのコード「403Fh」を、記号「?」に変換する。   The code conversion unit 750 compares the code with the code assignment table 310 and converts the code into a word. For example, the code conversion unit 750 converts the 1-byte code “25h” and “2Fh” into the word “IsΔ”. The code conversion unit 750 converts the 1-byte code “39h” into the word “heΔ”. The code conversion unit 750 converts the 1-byte code “2Eh” into the word “inΔ”. The code conversion unit 750 converts the 1-byte code “27h” into the word “theΔ”. The code conversion unit 750 converts the 2-byte code “4341h” and the 1-byte code “21h” into the word “house”. The code conversion unit 750 converts the 2-byte code “403Fh” into the symbol “?”.

コード変換部750は、テキストデータ30bに含まれる各コードに対して、上記処理を実行することで、テキストデータ30bをテキストデータ30aに文字コード化する。   The code conversion unit 750 performs the above processing on each code included in the text data 30b, thereby converting the text data 30b into text data 30a.

図14aは、本実施例3に係る符号化装置の構成を示す機能ブロック図である。図14aに示すように、この符号化装置300は、入力部301、出力部302、レジスタ305a,305b、記憶部306、コード変換部350を有する。   FIG. 14A is a functional block diagram illustrating the configuration of the encoding device according to the third embodiment. As illustrated in FIG. 14A, the encoding apparatus 300 includes an input unit 301, an output unit 302, registers 305a and 305b, a storage unit 306, and a code conversion unit 350.

入力部301は、コード変換を行うテキストデータを受け付ける処理部である。入力部301は、受け付けたテキストデータを、レジスタ305aに格納する。   The input unit 301 is a processing unit that accepts text data for code conversion. The input unit 301 stores the received text data in the register 305a.

出力部302は、レジスタ305bに格納されるコード変換後のテキストデータを出力する処理部である。   The output unit 302 is a processing unit that outputs the text data after code conversion stored in the register 305b.

レジスタ305aは、コード変換を行う前のテキストデータを格納するものである。レジスタ305bは、コード変換後のテキストデータを格納するものである。   The register 305a stores text data before code conversion. The register 305b stores text data after code conversion.

記憶部306は、コード割当表50と、コード割当表310と、英単語2バイトコード割当表315aと、日本単語2バイトコード割当表315bと、2・3バイトコード割当表316とを有する。記憶部306は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 306 includes a code allocation table 50, a code allocation table 310, an English word 2-byte code allocation table 315a, a Japanese word 2-byte code allocation table 315b, and a 2.3 byte code allocation table 316. The storage unit 306 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

コード割当表50は、従来のコード割当表である。例えば、コード割当表50の説明は、実施例1で説明したものと同様である。   The code allocation table 50 is a conventional code allocation table. For example, the description of the code assignment table 50 is the same as that described in the first embodiment.

図15は、本実施例3に係るコード割当表の一例を示す図である。コード割当表310は、単語等と、所定のコードとを対応付けたテーブルであり、図13aで説明したコード割当表310に対応する。図15に示すように、このコード割当表310は、制御記号1バイト領域310Aと、英単語1バイト領域310Bと、英単語2バイト領域310Cと、日本単語1バイト領域310Dと、日本単語2バイト領域310Eと、2・3バイト領域310Fとを有する。   FIG. 15 is a diagram illustrating an example of a code assignment table according to the third embodiment. The code assignment table 310 is a table in which words and the like are associated with predetermined codes, and corresponds to the code assignment table 310 described with reference to FIG. As shown in FIG. 15, the code allocation table 310 includes a control symbol 1 byte area 310A, an English word 1 byte area 310B, an English word 2 byte area 310C, a Japanese word 1 byte area 310D, and a Japanese word 2 bytes. It has an area 310E and a 2.3 byte area 310F.

制御記号1バイト領域310Aは、コード割当表310の00h〜1Fhの領域である。制御記号1バイト領域310Aに設定される制御記号は、コード割当表50の00h〜1Fhに設定される制御記号と同様である。なお、制御記号には、「SO」と「SI」が含まれる。制御記号「SO」は、コード変換部350に、コード割当表50を用いてコード変換を行うことを指示する制御記号である。制御記号「SI」は、コード変換部350に、コード割当表310を用いて、コード変換することを指示する制御記号である。   The control symbol 1-byte area 310A is an area from 00h to 1Fh in the code assignment table 310. The control symbols set in the control symbol 1-byte area 310A are the same as the control symbols set in 00h to 1Fh in the code assignment table 50. The control symbols include “SO” and “SI”. The control symbol “SO” is a control symbol that instructs the code conversion unit 350 to perform code conversion using the code assignment table 50. The control symbol “SI” is a control symbol that instructs the code conversion unit 350 to perform code conversion using the code assignment table 310.

英単語1バイト領域310Bは、コード割当表310の20h〜3Fhの領域である。英単語1バイト領域310Bに設定された英単語には1バイトのコードが割り当てられる。この英単語1バイト領域310Bには、オックスフォード英語辞典、その他の一般的な書籍を基にして、出現頻度の高い上位25個の英単語が設定される。例えば、単語「the」には、1バイトのコード「27h」が割り当てられる。   The English word 1-byte area 310B is an area of 20h to 3Fh in the code assignment table 310. A 1-byte code is assigned to the English word set in the English word 1-byte area 310B. In the English word 1-byte area 310B, the top 25 English words having the highest appearance frequency are set based on the Oxford English dictionary and other general books. For example, the 1-byte code “27h” is assigned to the word “the”.

また、英単語1バイト領域310Bには、スペース「△」、バックスペース「−△」、コンマ「,」、アポストロフィ「’」、単語の先頭が大文字であることを示すコード、単語の全部が大文字であることを示すコードが設定される。例えば、スペース「△」には、1バイトのコード「20h」が割り当てられる。   In the English word 1-byte area 310B, a space “Δ”, a back space “−Δ”, a comma “,”, an apostrophe “′”, a code indicating that the beginning of the word is capitalized, and all the words are capitalized. A code indicating that is set. For example, a 1-byte code “20h” is assigned to the space “Δ”.

英単語2バイト領域310Cは、コード割当表310の40h〜5Fhの領域である。この英単語2バイト領域310Cには、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値以上となる英単語が設定される。以下の説明では、適宜、出現頻度が所定値以上となる単語を高頻度英単語と表記する。   The English word 2-byte area 310C is an area of 40h to 5Fh in the code assignment table 310. In this English word 2-byte area 310C, English words whose appearance frequency is equal to or higher than a predetermined value are set based on the Oxford English dictionary and other general books. In the following description, a word whose appearance frequency is equal to or higher than a predetermined value is described as a high-frequency English word as appropriate.

ここで、英単語2バイト領域310Cには、係る英単語2バイト領域310Cに設定された高頻度英単語に割り当てる2バイトのコードのうち、前半の1バイトのコードのみが定義されている。英単語2バイト領域310Cに設定された英単語に割り当てる2バイトのコードは、後述する英単語2バイトコード割当表315aに定義されている。   Here, in the English 2-byte area 310C, only the first half-byte code is defined among 2-byte codes assigned to the high-frequency English words set in the English 2-byte area 310C. The 2-byte code assigned to the English word set in the English word 2-byte area 310C is defined in an English word 2-byte code assignment table 315a described later.

日本単語1バイト領域310Dは、コード割当表310の60h〜7Fhの領域である。この日本単語1バイト領域310Dは、青空文庫、その他の一般的な書籍を基にして、出現頻度の高い上位の日本語が設定される。例えば、日本単語「の」には、1バイトのコード「65h」が割り当てられる。   The Japanese word 1-byte area 310D is an area of 60h to 7Fh in the code assignment table 310. In this Japanese word 1-byte area 310D, higher-order Japanese having a high appearance frequency is set based on Aozora Bunko and other general books. For example, a 1-byte code “65h” is assigned to the Japanese word “NO”.

また、日本単語1バイト領域310Dは、読点「、」、句点「。」、カギ括弧が設定される。例えば、読点「、」には、1バイトのコード「61h」が割り当てられる。   The Japanese word 1-byte area 310D is set with a reading mark “,”, a punctuation mark “.”, And brackets. For example, a one-byte code “61h” is assigned to the reading point “,”.

日本単語2バイト領域310Eは、コード割当表310の80h〜9Fhの領域である。この日本単語2バイト領域310Eは、青空文庫、その他の一般的な書籍を基にして、出現頻度の高い上位の日本語が設定される。以下の説明では、適宜、出現頻度が所定値以上となる単語を高頻度日本単語と表記する。   The Japanese word 2-byte area 310E is an area from 80h to 9Fh in the code assignment table 310. In the Japanese word 2-byte area 310E, upper Japanese having a high appearance frequency is set based on the Aozora Bunko and other general books. In the following description, words whose appearance frequency is equal to or higher than a predetermined value will be described as high-frequency Japanese words as appropriate.

ここで、日本単語2バイト領域310Eには、係る日本単語2バイト領域310Eに設定された高頻度日本単語に割り当てる2バイトのコードのうち、前半の1バイトのコードのみが設定されている。日本単語2バイト領域310Eに設定された日本語に割り当てる2バイトのコードは、後述する日本単語2バイトコード割当表315bに定義されている。   Here, in the Japanese word 2-byte area 310E, only the 1-byte code in the first half of the 2-byte codes assigned to the high-frequency Japanese words set in the Japanese word 2-byte area 310E is set. The 2-byte code assigned to Japanese set in the Japanese word 2-byte area 310E is defined in a Japanese word 2-byte code assignment table 315b described later.

2・3バイト領域310Fは、コード割当表310のA0h〜FFhの領域である。この2・3バイト領域310Fには、青空文庫、オックスフォード英語辞書、その他の一般的な書籍を基にして、出現頻度が所定値未満となる低頻度の単語が設定される。以下の説明では、適宜、低頻度の単語を、低頻度単語と表記する。2・3バイト領域310Fに設定された低頻度単語には、2バイトまたは3バイトのコードが割り当てられる。   The 2.3 byte area 310F is an area from A0h to FFh in the code allocation table 310. In this 2.3 byte area 310F, low-frequency words whose appearance frequency is less than a predetermined value are set based on Aozora Bunko, Oxford English Dictionary, and other general books. In the following description, a low-frequency word is appropriately described as a low-frequency word. A 2-byte or 3-byte code is assigned to the low-frequency word set in the 2.3 byte area 310F.

なお、2・3バイト領域310Fには、係る2・3バイト領域310Fに設定された単語に割り当てるバイトコードのうち、前半の1バイトのコードのみが設定されている。2・3バイト領域310Fに設定された単語に割り当てる2バイトまたは3バイトのコードは、後述する2・3バイト割当表316に定義されている。   In the 2.3 byte area 310F, only the 1-byte code in the first half of the byte codes assigned to the words set in the 2.3 byte area 310F is set. A 2-byte or 3-byte code assigned to a word set in the 2 · 3 byte area 310F is defined in a 2 · 3 byte assignment table 316 described later.

図16は、本実施例3に係る英単語2バイトコード割当表の一例を示す図である。図16に示すように、英単語2バイトコード割当表315aは、高頻度英単語と、2バイトのコードとを対応付ける。   FIG. 16 is a diagram illustrating an example of an English word 2-byte code assignment table according to the third embodiment. As shown in FIG. 16, the English word 2-byte code assignment table 315a associates high-frequency English words with 2-byte codes.

英単語2バイトコード割当表315aにおいて、「4000h〜5FFFh」には、高頻度英単語が設定され、設置位置に応じた2バイトのコードが割り当てられる。例えば、設定位置「4000h」に設定された高頻度英単語には、2バイトのコード「4000h」が割り当てられる。   In the English word 2-byte code assignment table 315a, a high-frequency English word is set in “4000h to 5FFFh”, and a 2-byte code corresponding to the installation position is assigned. For example, the 2-byte code “4000h” is assigned to the high-frequency English word set at the setting position “4000h”.

図17は、本実施例3に係る日本単語2バイト割当表の一例を示す図である。図17に示すように、この日本単語2バイトコード割当表315bは、高頻度日本単語と、2バイトのコードとを対応付ける。   FIG. 17 is a diagram illustrating an example of a Japanese word 2-byte allocation table according to the third embodiment. As shown in FIG. 17, this Japanese word 2-byte code assignment table 315b associates high-frequency Japanese words with 2-byte codes.

日本単語2バイト割当表315bにおいて、「8000h〜9FFFh」には、高頻度日本単語が設定され、設置位置に応じた2バイトのコードが割り当てられる。例えば、設定位置「8000h」に設定された高頻度日本単語には、2バイトのコード「8000h」が割り当てられる。   In the Japanese word 2-byte allocation table 315b, a high-frequency Japanese word is set in “8000h to 9FFFh”, and a 2-byte code corresponding to the installation position is allocated. For example, a 2-byte code “8000h” is assigned to the high-frequency Japanese word set at the setting position “8000h”.

図18は、本実施例3に係る2・3バイト割当表の一例を示す図である。図18に示すように、この2・3バイト割当表316は、低頻度単語と、2バイトのコードまたは3バイトのコードを割り当てる。例えば、A000h〜E7FFh、F000h〜F7FFhに設定される低頻度単語には、2バイトのコードが割り当てられる。E90000h〜EFFFFFh、F90000h〜FFFFFFhに設定される低頻度単語には、3バイトのコードが割り当てられる。   FIG. 18 is a diagram illustrating an example of the 2.3 byte allocation table according to the third embodiment. As shown in FIG. 18, this 2/3 byte allocation table 316 allocates low frequency words and 2-byte codes or 3-byte codes. For example, a 2-byte code is assigned to low-frequency words set in A000h to E7FFh and F000h to F7FFh. A 3-byte code is assigned to the low-frequency words set in E90000h to EFFFFFh and F90000h to FFFFFFh.

図14aの説明に戻る。コード変換部350は、制御記号に基づいてコード割当表を切り替え、切り替えたコード割当表に基づいて、テキストデータをコード化する処理部である。コード変換部350は、制御記号「SI」以降のテキストデータを、コード割当表310を用いて、コード変換する。一方、符号化装置300は、テキストデータから、制御記号「SO」を検出した場合には、コード割当表50を用いて、コード変換する。従来技術のコード割当表50に関する説明は、実施例1で説明したものと同様である。コード変換部350は、コード化したテキストデータを、レジスタ305bに格納する。   Returning to the description of FIG. The code conversion unit 350 is a processing unit that switches a code allocation table based on a control symbol and encodes text data based on the switched code allocation table. The code conversion unit 350 converts the text data after the control symbol “SI” using the code assignment table 310. On the other hand, when detecting the control symbol “SO” from the text data, the encoding apparatus 300 performs code conversion using the code assignment table 50. The description regarding the code allocation table 50 of the prior art is the same as that described in the first embodiment. The code conversion unit 350 stores the encoded text data in the register 305b.

以下において、コード変換部350がコード割当表310を用いてコード化する処理の一例について説明する。コード変換部350は、テキストデータから情報(英単語、日本単語、制御記号等)を取得する。コード変換部350は、テキストデータから取得した情報が、各領域310A〜310Fの何れの領域の情報に対応するか特定し、特定した領域に応じたコード化を行う。   Hereinafter, an example of processing in which the code conversion unit 350 performs encoding using the code assignment table 310 will be described. The code conversion unit 350 acquires information (English words, Japanese words, control symbols, etc.) from the text data. The code conversion unit 350 identifies which area of the areas 310A to 310F the information acquired from the text data corresponds to, and performs coding according to the identified area.

コード変換部350の取得した情報が制御記号1バイト領域310Aに設定された制御記号である場合について説明する。コード変換部350は、取得した制御記号と、制御記号1バイト領域310Aに設定された各制御記号とを比較して、該当する設定位置の1バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した制御記号が「NUL」である場合には、かかる制御記号「NUL」を「00h」にコード化する。   A case where the information acquired by the code conversion unit 350 is a control symbol set in the control symbol 1-byte area 310A will be described. The code conversion unit 350 compares the acquired control symbol with each control symbol set in the control symbol 1-byte area 310A to identify and code a 1-byte code at the corresponding set position. For example, when the acquired control symbol is “NUL”, the code conversion unit 350 encodes the control symbol “NUL” to “00h”.

なお、コード変換部350は、取得した制御記号が「SO」である場合には、かかる制御記号「SO」を「0Eh」にコード化すると共に、利用するコード割当表を、コード割当表50に切り替える。   When the acquired control symbol is “SO”, the code conversion unit 350 encodes the control symbol “SO” into “0Eh”, and converts the code allocation table to be used into the code allocation table 50. Switch.

コード変換部350は、取得した制御記号が「SI」である場合には、かかる制御記号「SI」を「0Fh」にコード化すると共に、利用するコード割当表を、コード割当表310に切り替える。   When the acquired control symbol is “SI”, the code conversion unit 350 encodes the control symbol “SI” to “0Fh” and switches the code allocation table to be used to the code allocation table 310.

コード変換部350の取得した情報が英単語1バイト領域310Bに設定された英単語である場合について説明する。コード変換部350は、取得した英単語と、英単語1バイト領域310Bに設定された各英単語とを比較して、該当する設定位置の1バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した英単語が「the」である場合には、係る英単語「the」を「27h」にコード化する。   A case where the information acquired by the code conversion unit 350 is an English word set in the English word 1-byte area 310B will be described. The code conversion unit 350 compares the acquired English word with each English word set in the English word 1-byte area 310B, identifies the 1-byte code at the corresponding set position, and encodes it. For example, when the acquired English word is “the”, the code conversion unit 350 encodes the English word “the” into “27h”.

コード変換部350が取得した情報が英単語2バイト領域310Cに設定された英単語である場合について説明する。コード変換部350は、取得した英単語と、英単語2バイトコード割当表315aとを比較して、該当する設置位置の2バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した単語が、英単語2バイトコード割当表315aの「4000h」に設定されたある高頻度英単語である場合には、かかる高頻度英単語を2バイトのコード「4000h」にコード化する。   The case where the information acquired by the code conversion unit 350 is an English word set in the English word 2-byte area 310C will be described. The code conversion unit 350 compares the acquired English word with the English word 2-byte code assignment table 315a, identifies the 2-byte code at the corresponding installation position, and encodes it. For example, if the acquired word is a certain high-frequency English word set to “4000h” in the English word 2-byte code assignment table 315a, the code conversion unit 350 converts the high-frequency English word into a 2-byte code. Code to “4000h”.

コード変換部350の取得した情報が日本単語1バイト領域310Dに設定された日本単語である場合について説明する。コード変換部350は、取得した日本単語と、日本単語1バイト領域310Dに設定された各日本単語とを比較して、該当する設定位置の1バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した日本単語が「の」である場合には、係る日本単語「の」を「65h」にコード化する。   A case where the information acquired by the code conversion unit 350 is a Japanese word set in the Japanese word 1-byte area 310D will be described. The code conversion unit 350 compares the acquired Japanese word with each Japanese word set in the Japanese word 1-byte area 310D to identify and code a 1-byte code at the corresponding set position. For example, if the acquired Japanese word is “NO”, the code conversion unit 350 encodes the Japanese word “NO” into “65h”.

コード変換部350の取得した情報が日本単語2バイト領域310Eに設定された日本単語である場合について説明する。コード変換部350は、取得した日本単語と、日本単語2バイトコード割当表315bとを比較して、該当する設置位置の2バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した単語が、日本単語2バイトコード割当表315bの「8000h」に設定されたある高頻度日本単語である場合には、かかる高頻度日本単語を2バイトのコード「8000h」にコード化する。   A case where the information acquired by the code conversion unit 350 is a Japanese word set in the Japanese word 2-byte area 310E will be described. The code conversion unit 350 compares the acquired Japanese word with the Japanese word 2-byte code assignment table 315b, identifies the 2-byte code at the corresponding installation position, and encodes it. For example, when the acquired word is a certain high-frequency Japanese word set to “8000h” in the Japanese word 2-byte code assignment table 315b, the code conversion unit 350 converts the high-frequency Japanese word into a 2-byte code. Code to “8000h”.

コード変換部350の取得した情報が2・3バイト領域310Fに設定された低頻度単語である場合について説明する。コード変換部350は、取得した単語と、2・3バイトコード割当表316とを比較して、該当する設定位置の2バイトまたは3バイトのコードを特定し、コード化する。例えば、コード変換部350は、取得した単語が、2・3バイトコード割当表316の「A000h」に設定された低頻度単語である場合には、係る低頻度単語を2バイトのコード「A000h」にコード化する。例えば、コード変換部350は、取得した単語が、2・3バイトコード割当表316の「E90000h」に設定された低頻度単語である場合には、係る低頻度単語を3バイトのコード「E90000h」にコード化する。   A case where the information acquired by the code conversion unit 350 is a low-frequency word set in the 2.3 byte area 310F will be described. The code conversion unit 350 compares the acquired word with the 2 / 3-byte code assignment table 316, identifies the 2-byte or 3-byte code at the corresponding setting position, and encodes it. For example, if the acquired word is a low-frequency word set to “A000h” in the 2.3 byte code allocation table 316, the code conversion unit 350 converts the low-frequency word into a 2-byte code “A000h”. Code to For example, if the acquired word is a low-frequency word set to “E90000h” in the 2.3 byte code assignment table 316, the code conversion unit 350 converts the low-frequency word into a 3-byte code “E90000h”. Code to

図14bは、本実施例3に係る復号化装置の構成を示す機能ブロック図である。図14bに示すように、この復号化装置700は、入力部701、出力部702、レジスタ705a,705b、記憶部706、コード変換部750を有する。   FIG. 14B is a functional block diagram illustrating the configuration of the decoding apparatus according to the third embodiment. As illustrated in FIG. 14B, the decoding device 700 includes an input unit 701, an output unit 702, registers 705a and 705b, a storage unit 706, and a code conversion unit 750.

入力部701は、コード変換を行うテキストデータを受け付ける処理部である。入力部701は、受け付けたテキストデータを、レジスタ705aに格納する。   The input unit 701 is a processing unit that accepts text data for code conversion. The input unit 701 stores the received text data in the register 705a.

出力部702は、レジスタ705bに格納される文字コード変換後のテキストデータを出力する処理部である。   The output unit 702 is a processing unit that outputs text data after character code conversion stored in the register 705b.

レジスタ705aは、コード変換されたテキストデータを格納するものである。レジスタ705bは、文字コード変換後のテキストデータを格納するものである。   The register 705a stores code-converted text data. The register 705b stores text data after character code conversion.

記憶部706は、コード割当表50と、コード割当表310と、英単語2バイトコード割当表315aと、日本単語2バイトコード割当表315bと、2・3バイトコード割当表316とを有する。記憶部706は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 706 includes a code allocation table 50, a code allocation table 310, an English word 2-byte code allocation table 315a, a Japanese word 2-byte code allocation table 315b, and a 2.3 byte code allocation table 316. The storage unit 706 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

コード割当表50の説明は、実施例1で説明したものと同様である。コード割当表310に関する説明は、図15で説明したコード割当表310に関する説明と同様である。英単語2バイトコード割当表315aに関する説明は、図16で説明した英単語2バイトコード割当表315aに関する説明と同様である。日本単語2バイトコード割当表315bに関する説明は、図17で説明した日本単語2バイト割当表315bに関する説明と同様である。2・3バイトコード割当表316に関する説明は、図18で説明した2・3バイトコード割当表316に関する説明と同様である。   The description of the code assignment table 50 is the same as that described in the first embodiment. The description regarding the code allocation table 310 is the same as the description regarding the code allocation table 310 described with reference to FIG. The description regarding the English word 2-byte code allocation table 315a is the same as the description regarding the English word 2-byte code allocation table 315a described with reference to FIG. The description regarding the Japanese word 2-byte code allocation table 315b is the same as the description regarding the Japanese word 2-byte allocation table 315b described with reference to FIG. The description regarding the 2 · 3 byte code allocation table 316 is the same as the description regarding the 2 · 3 byte code allocation table 316 described with reference to FIG.

コード変換部750は、制御記号のコードに基づいてコード割当表を切り替え、切り替えたコード割当表に基づいて、テキストデータを文字コード化する処理部である。コード変換部750は、制御記号「SI」のコード以降のテキストデータを、コード割当表310を用いて、文字コード変換する。一方、復号化装置700は、テキストデータから、制御記号「SO」のコードを検出した場合には、コード割当表50を用いて、文字コード変換する。コード変換部750は、コード化したテキストデータを、レジスタ705bに格納する。   The code conversion unit 750 is a processing unit that switches the code assignment table based on the code of the control symbol and converts the text data into a character code based on the switched code assignment table. The code conversion unit 750 converts the text data after the code of the control symbol “SI” into a character code using the code assignment table 310. On the other hand, when the code of the control symbol “SO” is detected from the text data, the decoding apparatus 700 converts the character code using the code assignment table 50. The code conversion unit 750 stores the encoded text data in the register 705b.

以下において、コード変換部750がコード割当表310を用いて文字コード化する処理の一例について説明する。コード変換部750は、テキストデータからコードを取得する。コード変換部750は、テキストデータから取得したコードが、各領域310A〜310Fの何れの領域の情報に対応するコードであるかを特定し、特定した領域に応じた文字コード化を行う。   In the following, an example of a process in which the code conversion unit 750 performs character encoding using the code assignment table 310 will be described. The code conversion unit 750 acquires a code from the text data. The code conversion unit 750 specifies whether the code acquired from the text data is a code corresponding to information in any of the areas 310A to 310F, and performs character encoding according to the specified area.

コード変換部750の取得したコードが制御記号1バイト領域310Aに設定された制御記号のコードである場合について説明する。制御記号1バイト領域310Aに設定された制御記号に対応するコードの1バイト目は「00h〜1Fh」に含まれる。コード変換部750は、コードに対応する制御記号を、制御記号1バイト領域310Aに設定された制御記号から選択し、選択した制御記号によって文字コード化する。例えば、コード変換部750は、取得したコードが「00h」である場合には、「00h」を「NUL」に文字コード化する。   A case where the code acquired by the code conversion unit 750 is the code of the control symbol set in the control symbol 1-byte area 310A will be described. The first byte of the code corresponding to the control symbol set in the control symbol 1-byte area 310A is included in “00h to 1Fh”. The code conversion unit 750 selects a control symbol corresponding to the code from the control symbols set in the control symbol 1-byte area 310A, and character-codes the selected control symbol. For example, when the acquired code is “00h”, the code conversion unit 750 converts “00h” into “NUL” as a character code.

なお、コード変換部750は、取得したコードが「0Eh」である場合には、かかるコード「0Eh」を「SO」に文字コード化すると共に、利用するコード割当表を、コード割当表50に切り替える。   When the acquired code is “0Eh”, the code conversion unit 750 converts the code “0Eh” into a character code “SO” and switches the code allocation table to be used to the code allocation table 50. .

コード変換部750は、取得したコードが「0Fh」である場合には、かかるコード「0Fh」を「SI」に文字コード化すると共に、利用するコード割当表を、コード割当表310に切り替える。   When the acquired code is “0Fh”, the code conversion unit 750 converts the code “0Fh” into a character code “SI” and switches the code allocation table to be used to the code allocation table 310.

コード変換部750の取得したコードが英単語1バイト領域310Bに設定された英単語に対応するコードである場合について説明する。英単語1バイト領域310Bに設定された英単語に対応するコードの1バイト目は「20h〜3Fh」に含まれる。コード変換部750は、取得したコードと、英単語1バイト領域310Bに設定された各英単語のコードとを比較して、該当する設定位置の英単語を特定し、文字コード化する。例えば、コード変換部750は、取得したコードが「27h」である場合には、係るコード「27h」を「the」に文字コード化する。   A case where the code acquired by the code conversion unit 750 is a code corresponding to the English word set in the English word 1-byte area 310B will be described. The first byte of the code corresponding to the English word set in the English word 1-byte area 310B is included in “20h-3Fh”. The code conversion unit 750 compares the acquired code with the code of each English word set in the English word 1-byte area 310B, specifies the English word at the corresponding set position, and converts it into a character code. For example, when the acquired code is “27h”, the code conversion unit 750 converts the code “27h” into a character code “the”.

コード変換部750が取得したコードが英単語2バイト領域310Cに設定された英単語に対応するコードである場合について説明する。英単語2バイト領域310Cに設定された英単語に対応するコードの1バイト目は「40h〜5Fh」に含まれる。コード変換部750は、取得したコードと、英単語2バイトコード割当表315aとを比較して、該当する設置位置の英単語を特定し、文字コード化する。例えば、コード変換部750は、取得したコードが「4000h」である場合には、英単語2バイトコード割当表315aの「4000h」に対応する高頻度英単語に文字コード化する。   A case where the code acquired by the code conversion unit 750 is a code corresponding to the English word set in the English word 2-byte area 310C will be described. The first byte of the code corresponding to the English word set in the English word 2-byte area 310C is included in “40h to 5Fh”. The code conversion unit 750 compares the acquired code with the English word 2-byte code assignment table 315a, identifies the English word at the corresponding installation position, and converts it into a character code. For example, when the acquired code is “4000h”, the code conversion unit 750 converts the character code into a high-frequency English word corresponding to “4000h” in the English word 2-byte code assignment table 315a.

コード変換部750の取得したコードが2・3バイト領域310Fに設定された低頻度単語である場合について説明する。2・3バイト領域310Fに設定された低頻度単語に対応するコードの1バイト目は「A0h〜FFh」に含まれる。コード変換部750は、取得したコードと、2・3バイトコード割当表316とを比較して、対応する設定位置の低頻度単語を特定し、文字コード化する。例えば、コード変換部750は、取得したコードが「A000h」である場合には、2・3バイトコード割当表316の「A000h」に対応する低頻度単語に文字コード化する。   A case where the code acquired by the code conversion unit 750 is a low-frequency word set in the 2.3 byte area 310F will be described. The first byte of the code corresponding to the low frequency word set in the 2.3 byte area 310F is included in “A0h to FFh”. The code conversion unit 750 compares the acquired code with the 2 / 3-byte code assignment table 316, identifies the low-frequency word at the corresponding set position, and converts it into a character code. For example, when the acquired code is “A000h”, the code conversion unit 750 converts the character code into a low-frequency word corresponding to “A000h” in the 2.3 byte code allocation table 316.

図19aは、本実施例3に係る符号化装置の処理手順を示すフローチャートである。図19aに示すように、符号化装置300の入力部301は、テキストデータをレジスタ305aに格納する(ステップS301)。符号化装置300のコード変換部350は、テキストデータから情報を取得する(ステップS302)。ステップS302では、説明の便宜上、情報と表記するが、コード変換部350が取得する情報には、英単語、日本単語、制御記号等の情報が含まれる。   FIG. 19A is a flowchart illustrating the processing procedure of the encoding apparatus according to the third embodiment. As illustrated in FIG. 19a, the input unit 301 of the encoding device 300 stores text data in the register 305a (step S301). The code conversion unit 350 of the encoding device 300 acquires information from the text data (step S302). In step S302, for convenience of explanation, it is described as information, but the information acquired by the code conversion unit 350 includes information such as English words, Japanese words, control symbols, and the like.

コード変換部350は、取得した情報が制御記号の「SO」または「SI」であるか否かを判定する(ステップS303)。コード変換部350は、情報が制御記号の「SO」または「SI」である場合には(ステップS303,Yes)、ステップS304に移行する。   The code conversion unit 350 determines whether the acquired information is the control symbol “SO” or “SI” (step S303). If the information is the control symbol “SO” or “SI” (step S303, Yes), the code conversion unit 350 proceeds to step S304.

コード変換部350は、制御記号が「SO」の場合には、コード割当表50を選択し、制御記号が「SI」の場合には、コード割当表310を選択し(ステップS304)、ステップS302に移行する。   The code conversion unit 350 selects the code assignment table 50 when the control symbol is “SO”, and selects the code assignment table 310 when the control symbol is “SI” (step S304), and step S302. Migrate to

一方、コード変換部350は、取得した情報が制御記号の「SO」でもなく、かつ、「SI」でもない場合には(ステップS303,No)、第1コード変換処理を実行する(ステップS305)。コード変換部350は、テキストデータのコード化が終了したか否かを判定する(ステップS306)。   On the other hand, when the acquired information is neither “SO” nor “SI” of the control symbol (No in step S303), the code conversion unit 350 executes the first code conversion process (step S305). . The code conversion unit 350 determines whether or not the text data has been encoded (step S306).

コード変換部350は、テキストデータのコード化が終了していない場合には(ステップS306,No)、ステップS302に移行する。一方、コード変換部350は、テキストデータのコード化が終了した場合には(ステップS306,Yes)、コード化したテキストデータを、レジスタ305bに格納する(ステップS307)。   If the encoding of the text data has not been completed (No at Step S306), the code converting unit 350 proceeds to Step S302. On the other hand, when the encoding of the text data is completed (Yes in step S306), the code conversion unit 350 stores the encoded text data in the register 305b (step S307).

図20aは、第1コード変換処理の処理手順を示すフローチャートである。このコード変換処理は、図19aのステップS305に示した処理に対応するものである。図20aに示すように、符号化装置300のコード変換部350は、コード割当表50を選択中であるか否かを判定する(ステップS401)。   FIG. 20A is a flowchart showing the processing procedure of the first code conversion processing. This code conversion process corresponds to the process shown in step S305 of FIG. 19a. As illustrated in FIG. 20A, the code conversion unit 350 of the encoding device 300 determines whether or not the code assignment table 50 is being selected (step S401).

コード変換部350は、コード割当表50を選択中である場合には(ステップS401,Yes)、コード割当表50を参照し(ステップS402)、コード割当表50に基づいて、情報をバイトコードに変換する(ステップS403)。   When the code allocation table 50 is being selected (step S401, Yes), the code conversion unit 350 refers to the code allocation table 50 (step S402), and converts the information into a byte code based on the code allocation table 50. Conversion is performed (step S403).

一方、コード変換部350は、コード割当表50を選択中ではなく、コード割当表310を選択中である場合には(ステップS401,No)、ステップS404に移行する。コード変換部350は、コード割当表310を参照し(ステップS404)、コード割当表310に基づいて、情報をバイトコードに変換する(ステップS405)。   On the other hand, if the code conversion table 350 is not selecting the code assignment table 50 but is selecting the code assignment table 310 (No in step S401), the code conversion unit 350 proceeds to step S404. The code conversion unit 350 refers to the code assignment table 310 (step S404), and converts information into a byte code based on the code assignment table 310 (step S405).

図19bは、本実施例3に係る復号化装置の処理手順を示すフローチャートである。図19bに示すように、復号化装置700の入力部701は、テキストデータをレジスタ705aに格納する(ステップS701)。復号化装置700のコード変換部750は、テキストデータからコードを取得する(ステップS702)。   FIG. 19B is a flowchart illustrating the processing procedure of the decoding apparatus according to the third embodiment. As shown in FIG. 19b, the input unit 701 of the decryption apparatus 700 stores the text data in the register 705a (step S701). The code conversion unit 750 of the decryption device 700 acquires a code from the text data (step S702).

コード変換部750は、取得したコードが制御記号の「SO」または「SI」に対応するコードであるか否かを判定する(ステップS703)。コード変換部750は、コードが制御記号の「SO」または「SI」に対応するコードである場合には(ステップS703,Yes)、ステップS704に移行する。   The code conversion unit 750 determines whether or not the acquired code is a code corresponding to the control symbol “SO” or “SI” (step S703). When the code is a code corresponding to the control symbol “SO” or “SI” (Yes in step S703), the code converting unit 750 proceeds to step S704.

コード変換部750は、コードが「SO」に対応するコードの場合には、コード割当表50を選択し、コードが「SI」に対応するコードの場合には、コード割当表310を選択し(ステップS704)、ステップS702に移行する。   The code conversion unit 750 selects the code allocation table 50 when the code corresponds to “SO”, and selects the code allocation table 310 when the code corresponds to “SI” ( Step S704) and the process proceeds to Step S702.

一方、コード変換部750は、取得したコードが「SO」に対応するコードでもなく、かつ、「SI」に対応するコードでもない場合には(ステップS703,No)、第2コード変換処理を実行する(ステップS705)。コード変換部750は、テキストデータの復号化が終了したか否かを判定する(ステップS706)。   On the other hand, if the acquired code is neither a code corresponding to “SO” nor a code corresponding to “SI” (step S703, No), the code conversion unit 750 executes the second code conversion process. (Step S705). The code conversion unit 750 determines whether or not the text data has been decrypted (step S706).

コード変換部750は、テキストデータの復号化が終了していない場合には(ステップS706,No)、ステップS702に移行する。一方、コード変換部750は、テキストデータの復号化が終了した場合には(ステップS706,Yes)、復号化したテキストデータを、レジスタ705bに格納する(ステップS707)。   If the decoding of the text data has not been completed (step S706, No), the code conversion unit 750 proceeds to step S702. On the other hand, when the decoding of the text data is completed (Yes in step S706), the code conversion unit 750 stores the decoded text data in the register 705b (step S707).

図20bは、第2コード変換処理の処理手順を示すフローチャートである。このコード変換処理は、図19bのステップS705に示した処理に対応するものである。図20bに示すように、復号化装置700のコード変換部750は、コード割当表50を選択中であるか否かを判定する(ステップS801)。   FIG. 20B is a flowchart illustrating the processing procedure of the second code conversion processing. This code conversion process corresponds to the process shown in step S705 of FIG. 19b. As illustrated in FIG. 20b, the code conversion unit 750 of the decoding device 700 determines whether or not the code allocation table 50 is being selected (step S801).

コード変換部750は、コード割当表50を選択中である場合には(ステップS801,Yes)、コード割当表50を参照し(ステップS802)、コード割当表50に基づいて、バイトコードを文字コードに変換する(ステップS803)。   If the code allocation table 50 is being selected (step S801, Yes), the code conversion unit 750 refers to the code allocation table 50 (step S802), and converts the byte code into a character code based on the code allocation table 50. (Step S803).

一方、コード変換部750は、コード割当表50を選択中ではなく、コード割当表310を選択中である場合には(ステップS801,No)、ステップS804に移行する。コード変換部750は、コード割当表310を参照し(ステップS804)、コード割当表310に基づいて、バイトコードを文字コードに変換する(ステップS805)。   On the other hand, when the code allocation table 50 is not selected but the code allocation table 310 is selected (No at Step S801), the code conversion unit 750 proceeds to Step S804. The code conversion unit 750 refers to the code assignment table 310 (step S804), and converts the byte code into a character code based on the code assignment table 310 (step S805).

次に、本実施例3に係る符号化装置300の効果について説明する。符号化装置300は、従来のコード割当表50と、本実施例3特有のコード割当表310とを切り替えて利用する。例えば、符号化装置300は、テキストデータから、制御記号「SI」を検出した場合には、制御記号「SI」以降のテキストデータを、コード割当表310を用いて、コード変換する。一方、符号化装置300は、テキストデータから、制御記号「SO」を検出した場合には、コード割当表50を用いて、コード変換する。このため、従来のコード割当表50を用いたコード変換に対応しつつ、出現頻度が高い文字や単語に対しては、短いバイトコードを割り当てることができる。   Next, effects of the encoding device 300 according to the third embodiment will be described. The encoding apparatus 300 switches between the conventional code assignment table 50 and the code assignment table 310 unique to the third embodiment. For example, when detecting the control symbol “SI” from the text data, the encoding apparatus 300 converts the text data after the control symbol “SI” using the code assignment table 310. On the other hand, when detecting the control symbol “SO” from the text data, the encoding apparatus 300 performs code conversion using the code assignment table 50. Therefore, it is possible to assign a short byte code to a character or word having a high appearance frequency while corresponding to code conversion using the conventional code assignment table 50.

また、復号化装置700は、上記のコード割当表50、310を切り替えて使用し、コード化されたテキストデータを復号化するため、従来のコード割当表50を用いた文字コード変換に対応しつつ、出現頻度が高い単語や一般記号に対して、短いバイトコードを割り当てた場合でも、係るバイトコードを単語や一般記号に変換することができる。   In addition, the decoding device 700 uses the above code allocation tables 50 and 310 by switching and decodes the encoded text data, so that it supports character code conversion using the conventional code allocation table 50. Even when a short byte code is assigned to a word or general symbol having a high appearance frequency, the byte code can be converted into a word or general symbol.

図21は、本実施例4に係る復号化装置の処理の一例を示す図である。本実施例4に係る復号化装置は、第1オートマトン806a、第2オートマトン806b、第3オートマトン806cを用いて、コード変換されたテキストデータ10bを、文字コード変換することで、テキストデータ10aを生成する。テキストデータ10bは、例えば、実施例1で説明した符号化装置100によりコード変換されたものである。   FIG. 21 is a diagram illustrating an example of processing of the decoding apparatus according to the fourth embodiment. The decoding apparatus according to the fourth embodiment generates text data 10a by performing character code conversion on the text data 10b that has been subjected to code conversion using the first automaton 806a, the second automaton 806b, and the third automaton 806c. To do. The text data 10b is, for example, code-converted by the encoding device 100 described in the first embodiment.

第1オートマトン806aは、1バイトのコードと、1バイトのコードに対応する文字とが対応付けられる。図22は、第1オートマトンの一例を示す図である。図22に示すように、第1オートマトン806aは、「00h〜2Fh」と各単語とが対応付けられる。例えば、「00h〜2Fh」に対応付けられた各単語は、図3で説明した1バイト領域110Aの各単語に対応する。   In the first automaton 806a, a 1-byte code is associated with a character corresponding to the 1-byte code. FIG. 22 is a diagram illustrating an example of the first automaton. As shown in FIG. 22, in the first automaton 806a, “00h to 2Fh” is associated with each word. For example, each word associated with “00h to 2Fh” corresponds to each word in the 1-byte area 110A described with reference to FIG.

第2オートマトン806bは、2バイトのコードと、所定の文字列、スペース、記号、高頻度単語等とを対応付ける。図23は、第2オートマトンの一例を示す図である。図23に示すように、第2オートマトン806bは、「3000h〜5FFFh」と文字列、スペース、記号、高頻度単語等とが対応付けられる。ここでは図示を省略するが、第2オートマトン806bでは、2バイトのコードと、英数字、記号、かな、カナ、漢字、数値、時刻、タグ、構文とを対応付けてもよい。例えば、「3000h〜5FFFh」に対応付けられる情報は、図4で説明した2バイトコード割当表115aにおいて、「3000h〜5FFFh」と対応付けられる情報に対応する。   The second automaton 806b associates a 2-byte code with a predetermined character string, space, symbol, high-frequency word, and the like. FIG. 23 is a diagram illustrating an example of the second automaton. As shown in FIG. 23, in the second automaton 806b, “3000h to 5FFFh” is associated with a character string, a space, a symbol, a high-frequency word, and the like. Although not shown here, in the second automaton 806b, a 2-byte code may be associated with alphanumeric characters, symbols, kana, kana, kanji, numerical values, time, tags, and syntax. For example, information associated with “3000h to 5FFFh” corresponds to information associated with “3000h to 5FFFh” in the 2-byte code assignment table 115a described with reference to FIG.

第3オートマトン806cは、3バイトのコードと、所定のCJK文字、英単語、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果とを対応付ける。図24は、第3オートマトンの一例を示す図である。図24に示すように、第3オートマトン806cは、「600000h〜FFFFFFh」と、所定のCJK文字、英単語、日本単語、第3国の単語、数値、時刻、タグ、構文意味解析の結果とが対応付けられる。なお、「E00000h〜FFFFFFh」は、予備の領域となる。例えば、「600000h〜FFFFFFh」に対応付けられる情報は、図5で説明した3バイトコード割当表115bにおいて、「600000h〜FFFFFFh」に対応付けられる情報に対応する。   The third automaton 806c associates a 3-byte code with a predetermined CJK character, English word, Japanese word, third country word, numerical value, time, tag, and result of syntax semantic analysis. FIG. 24 is a diagram illustrating an example of the third automaton. As shown in FIG. 24, the third automaton 806c includes “600000h to FFFFFFh” and predetermined CJK characters, English words, Japanese words, third country words, numerical values, times, tags, and syntax semantic analysis results. It is associated. Note that “E00000h to FFFFFFh” is a spare area. For example, information associated with “600000h to FFFFFFh” corresponds to information associated with “600000h to FFFFFFh” in the 3-byte code assignment table 115b described with reference to FIG.

図21の説明に戻る。コード変換部850は、コード変換されたテキストデータ10bからコードを読み出し、コードの先頭4ビットの値に基づいて、第1オートマトン806a、第2オートマトン806b、第3オートマトン806cのいずれかのオートマトンを選択する。そして、コード変換部850は、選択したオートマトンを基にして、コードを変換する。   Returning to the description of FIG. The code conversion unit 850 reads a code from the code-converted text data 10b, and selects one of the first automaton 806a, the second automaton 806b, and the third automaton 806c based on the value of the first 4 bits of the code To do. Then, the code conversion unit 850 converts the code based on the selected automaton.

例えば、コード変換部850は、コードの先頭4ビットが「00h〜2Fh」に含まれる場合には、第1オートマトン806aを選択し、第1オートマトン806aに基づいて、コードを変換する。   For example, when the first 4 bits of the code are included in “00h to 2Fh”, the code conversion unit 850 selects the first automaton 806a and converts the code based on the first automaton 806a.

コード変換部850は、コードの先頭4ビットが「30h〜5Fh」に含まれる場合には、第2オートマトン806bを選択し、第2オートマトン806bに基づいて、コードを変換する。   When the first 4 bits of the code are included in “30h to 5Fh”, the code conversion unit 850 selects the second automaton 806b and converts the code based on the second automaton 806b.

コード変換部850は、コードの先頭4ビットが「60h〜FFh」に含まれる場合には、第3オートマトン806cを選択し、第3オートマトン806cに基づいて、コードを変換する。   When the first 4 bits of the code are included in “60h to FFh”, the code conversion unit 850 selects the third automaton 806c and converts the code based on the third automaton 806c.

図21のテキストデータ10bに含まれる各コード「12h、08h、07h、00h」の先頭4ビットは、「00h〜2Fh」に含まれるため、コード変換部850は、第1オートマトン806aを選択し、コードを変換する。例えば、コード変換部850は、「12h、08h、07h、00h」を第1オートマトン806aに基づき「he△、is△、in△、the△」にそれぞれ変換する。   Since the first 4 bits of each code “12h, 08h, 07h, 00h” included in the text data 10b of FIG. 21 are included in “00h-2Fh”, the code conversion unit 850 selects the first automaton 806a, Convert the code. For example, the code conversion unit 850 converts “12h, 08h, 07h, 00h” into “heΔ, isΔ, inΔ, theΔ” based on the first automaton 806a.

図21のテキストデータ10bに含まれるコード「4341h」の先頭4ビットは、「30h〜5Fh」に含まれるため、コード変換部850は、第2オートマトン806bを選択し、コードを変換する。例えば、コード変換部850は、「4341h」を第2オートマトン806bに基づき「house△」に変換する。コード変換部850が上記処理を実行することで、テキストデータ10bは、テキストデータ10aに変換される。   Since the first 4 bits of the code “4341h” included in the text data 10b of FIG. 21 are included in “30h to 5Fh”, the code conversion unit 850 selects the second automaton 806b and converts the code. For example, the code conversion unit 850 converts “4341h” into “houseΔ” based on the second automaton 806b. When the code conversion unit 850 executes the above processing, the text data 10b is converted into the text data 10a.

図25は、本実施例4に係る復号化装置の構成を示す機能ブロック図である。図25に示すように、この復号化装置800は、入力部801、出力部802、レジスタ805a,805b、記憶部806、コード変換部850を有する。   FIG. 25 is a functional block diagram of the configuration of the decoding apparatus according to the fourth embodiment. As illustrated in FIG. 25, the decoding device 800 includes an input unit 801, an output unit 802, registers 805a and 805b, a storage unit 806, and a code conversion unit 850.

入力部801は、コード変換されたテキストデータを受け付ける処理部である。入力部801は、受け付けたテキストデータを、レジスタ805aに格納する。   The input unit 801 is a processing unit that receives code-converted text data. The input unit 801 stores the received text data in the register 805a.

出力部802は、レジスタ805bに格納されたテキストデータを出力する処理部である。   The output unit 802 is a processing unit that outputs the text data stored in the register 805b.

記憶部806は、第1オートマトン806aと、第2オートマトン806bと、第3オートマトン806cとを有する。記憶部806は、例えば、RAM、ROM、フラッシュメモリなどの半導体メモリ素子などの記憶装置に対応する。   The storage unit 806 includes a first automaton 806a, a second automaton 806b, and a third automaton 806c. The storage unit 806 corresponds to a storage device such as a semiconductor memory element such as a RAM, a ROM, or a flash memory.

第1オートマトン806a、第2オートマトン806b、第3オートマトン806cに関する説明は、図21で説明した第1オートマトン806a、第2オートマトン806b、第3オートマトン806cに関する説明と同様である。   The description regarding the first automaton 806a, the second automaton 806b, and the third automaton 806c is the same as the description regarding the first automaton 806a, the second automaton 806b, and the third automaton 806c described with reference to FIG.

コード変換部850は、コード変換されたテキストデータ10bからコードを読み出し、コードの先頭4ビットの値に基づいて、第1オートマトン806a、第2オートマトン806b、第3オートマトン806cのいずれかのオートマトンを選択する。そして、コード変換部850は、選択したオートマトンを基にして、コードを変換する。コード変換部850の具体的な処理は、図21で説明したコード変換部850の処理と同様である。   The code conversion unit 850 reads a code from the code-converted text data 10b, and selects one of the first automaton 806a, the second automaton 806b, and the third automaton 806c based on the value of the first 4 bits of the code To do. Then, the code conversion unit 850 converts the code based on the selected automaton. Specific processing of the code conversion unit 850 is the same as the processing of the code conversion unit 850 described with reference to FIG.

図26は、本実施例4に係る復号化装置の処理手順を示すフローチャートである。図26に示すように、復号化装置800の入力部801は、テキストデータをレジスタ805aに格納する(ステップS901)。復号化装置800のコード変換部850は、レジスタ805aに格納されたテキストデータからコードを取得する(ステップS902)。   FIG. 26 is a flowchart of the process procedure of the decoding apparatus according to the fourth embodiment. As shown in FIG. 26, the input unit 801 of the decryption apparatus 800 stores the text data in the register 805a (step S901). The code conversion unit 850 of the decryption apparatus 800 acquires a code from the text data stored in the register 805a (step S902).

コード変換部850は、コードの先頭の4ビットの値と各オートマトンとを比較する(ステップS903)。コード変換部850は、コードの先頭の4ビットの値が第1オートマトン806aにヒットしたか否かを判定する(ステップS904)。コード変換部850は、コードの先頭の4ビットの値が第1オートマトン806aにヒットした場合には(ステップS904,Yes)、第1オートマトン806aを選択する(ステップS905)。コード変換部850は、第1オートマトン806aに基づいてコードを単語に変換し(ステップS906)、ステップS912に移行する。   The code conversion unit 850 compares the value of the first 4 bits of the code with each automaton (step S903). The code conversion unit 850 determines whether the value of the first 4 bits of the code hits the first automaton 806a (step S904). If the value of the first 4 bits of the code hits the first automaton 806a (step S904, Yes), the code conversion unit 850 selects the first automaton 806a (step S905). The code conversion unit 850 converts the code into a word based on the first automaton 806a (step S906), and proceeds to step S912.

一方、コード変換部850は、コードの先頭の4ビットの値が第1オートマトン806aにヒットしていない場合には(ステップS904,No)、コードの先頭の4ビットの値が第2オートマトン806bにヒットしたか否かを判定する(ステップS907)。コード変換部850は、コードの先頭の4ビットの値が第2オートマトン806bにヒットした場合には(ステップS907,Yes)、第2オートマトン806bを選択する(ステップS908)。コード変換部850は、第2オートマトン806bに基づいてコードを単語に変換し(ステップS909)、ステップS912に移行する。   On the other hand, if the value of the first 4 bits of the code does not hit the first automaton 806a (step S904, No), the code conversion unit 850 sets the value of the first 4 bits of the code to the second automaton 806b. It is determined whether or not there is a hit (step S907). If the value of the first 4 bits of the code hits the second automaton 806b (Yes in step S907), the code conversion unit 850 selects the second automaton 806b (step S908). The code conversion unit 850 converts the code into a word based on the second automaton 806b (step S909), and proceeds to step S912.

一方、コード変換部850は、コードの先頭の4ビットの値が第2オートマトン806bにヒットしない場合には(ステップS907,No)、第3オートマトン806cを選択する(ステップS910)。コード変換部850は、第3オートマトン806cに基づいてコードを単語に変換する(ステップS911)。   On the other hand, when the value of the first 4 bits of the code does not hit the second automaton 806b (No in step S907), the code conversion unit 850 selects the third automaton 806c (step S910). The code conversion unit 850 converts the code into a word based on the third automaton 806c (step S911).

コード変換部850は、テキストデータの復号化が終了したか否かを判定する(ステップS912)。コード変換部850は、テキストデータの復号化が終了していない場合には(ステップS912,No)、ステップS902に移行する。   The code conversion unit 850 determines whether or not the decoding of the text data has been completed (step S912). If the decoding of the text data has not been completed (No at Step S912), the code conversion unit 850 proceeds to Step S902.

一方、コード変換部850は、テキストデータの復号化が終了した場合には(ステップS912,Yes)、復号化したテキストデータを、レジスタ805bに格納する(ステップS913)。   On the other hand, when the decoding of the text data is finished (step S912, Yes), the code conversion unit 850 stores the decoded text data in the register 805b (step S913).

次に、復号化装置800の効果について説明する。復号化装置800は、コード変換されたテキストデータ10bからコードを読み出し、コードの先頭4ビットの値に基づいて、第1オートマトン806a、第2オートマトン806b、第3オートマトン906cのいずれかのオートマトンを選択する。そして、復号化装置800は、選択したオートマトンを基にして、コードを変換する。これにより、符号化装置100等により、短いコードに割り当てるべき、出現頻度が高い文字や単語に対応付けられたコード等の2バイト以上のコードを1バイトコードに割り当てた場合でも、復号化装置800を用いて、適切に復号化できる。すなわち、復号化装置800により、短いコードに割り当てるべき、出現頻度が高い文字や単語に対応付けられたコード等の2バイト以上のコードを1バイトコードに割り当てることができる。   Next, the effect of the decoding apparatus 800 will be described. Decoding apparatus 800 reads a code from transcoded text data 10b, and selects one of first automaton 806a, second automaton 806b, and third automaton 906c based on the value of the first 4 bits of the code. To do. Then, decoding apparatus 800 converts the code based on the selected automaton. Thereby, even when the encoding device 100 or the like assigns a code of 2 bytes or more, such as a code associated with a character or word having a high appearance frequency, which should be assigned to a short code, to the 1-byte code, the decoding device 800. Can be properly decoded. That is, the decoding apparatus 800 can assign a code of 2 bytes or more, such as a code associated with a character or word having a high appearance frequency, to be assigned to a short code, to a 1-byte code.

下記に、本実施形態に用いられるハードウェア及びソフトウェアについて説明する。図27は、コンピュータ1のハードウェア構成例を示す。コンピュータ1は、例えば、プロセッサ401、RAM(Random Access Memory)402、ROM(Read Only Memory)403、ドライブ装置404、記憶媒体405、入力インターフェース(I/F)406、入力デバイス407、出力インターフェース(I/F)408、出力デバイス409、通信インターフェース(I/F)410、SAN(Storage Area Network)インターフェース(I/F)411およびバス412などを含む。それぞれのハードウェアはバス412を介して接続されている。   The hardware and software used in this embodiment will be described below. FIG. 27 shows a hardware configuration example of the computer 1. The computer 1 includes, for example, a processor 401, a RAM (Random Access Memory) 402, a ROM (Read Only Memory) 403, a drive device 404, a storage medium 405, an input interface (I / F) 406, an input device 407, an output interface (I / F) 408, an output device 409, a communication interface (I / F) 410, a SAN (Storage Area Network) interface (I / F) 411, a bus 412, and the like. Each piece of hardware is connected via a bus 412.

RAM402は読み書き可能なメモリ装置であって、例えば、SRAM(Static RAM)やDRAM(Dynamic RAM)などの半導体メモリ、またはRAMでなくてもフラッシュメモリなどが用いられる。ROM403は、PROM(Programmable ROM)なども含む。ドライブ装置404は、記憶媒体405に記録された情報の読み出しか書き込みかの少なくともいずれか一方を行なう装置である。記憶媒体405は、ドライブ装置404によって書き込まれた情報を記憶する。記憶媒体405は、例えば、ハードディスク、SSD(Solid State Drive)などのフラッシュメモリ、CD(Compact Disc)、DVD(Digital Versatile Disc)、ブルーレイディスクなどの記憶媒体である。また、例えば、コンピュータ1は、複数種類の記憶媒体それぞれについて、ドライブ装置404及び記憶媒体405を設ける。   The RAM 402 is a readable / writable memory device. For example, a semiconductor memory such as an SRAM (Static RAM) or a DRAM (Dynamic RAM), or a flash memory is used even if it is not a RAM. The ROM 403 includes a PROM (Programmable ROM). The drive device 404 is a device that performs at least one of reading and writing of information recorded on the storage medium 405. The storage medium 405 stores information written by the drive device 404. The storage medium 405 is a storage medium such as a hard disk, a flash memory such as an SSD (Solid State Drive), a CD (Compact Disc), a DVD (Digital Versatile Disc), or a Blu-ray disc. For example, the computer 1 includes a drive device 404 and a storage medium 405 for each of a plurality of types of storage media.

入力インターフェース406は、入力デバイス407と接続されており、入力デバイス407から受信した入力信号をプロセッサ401に伝達する回路である。出力インターフェース408は、出力デバイス409と接続されており、出力デバイス409に、プロセッサ401の指示に応じた出力を実行させる回路である。通信インターフェース410はネットワーク3を介した通信の制御を行なう回路である。通信インターフェース410は、例えばネットワークインターフェースカード(NIC)などである。SANインターフェース411は、ストレージエリアネットワークによりコンピュータ1と接続された記憶装置との通信の制御を行なう回路である。SANインターフェース411は、例えばホストバスアダプタ(HBA)などである。   The input interface 406 is connected to the input device 407 and is a circuit that transmits an input signal received from the input device 407 to the processor 401. The output interface 408 is connected to the output device 409 and is a circuit that causes the output device 409 to execute an output in accordance with an instruction from the processor 401. The communication interface 410 is a circuit that controls communication via the network 3. The communication interface 410 is, for example, a network interface card (NIC). The SAN interface 411 is a circuit that controls communication with a storage device connected to the computer 1 via a storage area network. The SAN interface 411 is a host bus adapter (HBA), for example.

入力デバイス407は、操作に応じて入力信号を送信する装置である。入力信号は、例えば、キーボードやコンピュータ1の本体に取り付けられたボタンなどのキー装置や、マウスやタッチパネルなどのポインティングデバイスである。出力デバイス409は、コンピュータ1の制御に応じて情報を出力する装置である。出力デバイス409は、例えば、ディスプレイなどの画像出力装置(表示デバイス)や、スピーカーなどの音声出力装置などである。また、例えば、タッチスクリーンなどの入出力装置が、入力デバイス407及び出力デバイス409として用いられる。また、入力デバイス407及び出力デバイス409は、コンピュータ1と一体になっていてもよいし、コンピュータ1に含まれず、例えば、コンピュータ1に外部から接続する装置であってもよい。   The input device 407 is a device that transmits an input signal according to an operation. The input signal is, for example, a key device such as a keyboard or a button attached to the main body of the computer 1, or a pointing device such as a mouse or a touch panel. The output device 409 is an apparatus that outputs information according to the control of the computer 1. The output device 409 is, for example, an image output device (display device) such as a display, or an audio output device such as a speaker. For example, an input / output device such as a touch screen is used as the input device 407 and the output device 409. The input device 407 and the output device 409 may be integrated with the computer 1 or may be an apparatus that is not included in the computer 1 and is connected to the computer 1 from the outside, for example.

例えば、プロセッサ401は、ROM403や記憶媒体405に記憶されたプログラムをRAM402に読み出し、読み出されたプログラムの手順に従って、入力部101,201,301、コード変換部150,250,350、出力部102,202,302の処理を行なう。その際にRAM402はプロセッサ401のワークエリアとして用いられる。記憶部の機能は、ROM403および記憶媒体405がプログラムファイル(後述のアプリケーションプログラム24、ミドルウェア23およびOS22など)やデータファイル(テキストデータ、照合対象となる文字列)を記憶し、RAM402がプロセッサ401のワークエリアとして用いられることによって実現される。プロセッサ401が読み出すプログラムについては、図28を用いて説明する。   For example, the processor 401 reads a program stored in the ROM 403 or the storage medium 405 to the RAM 402, and according to the procedure of the read program, the input units 101, 201, 301, the code conversion units 150, 250, 350, and the output unit 102. , 202, 302 are performed. At that time, the RAM 402 is used as a work area of the processor 401. As for the function of the storage unit, the ROM 403 and the storage medium 405 store program files (such as an application program 24, middleware 23, and OS 22 described later) and data files (text data, character strings to be collated), and the RAM 402 stores the processor 401. It is realized by being used as a work area. The program read by the processor 401 will be described with reference to FIG.

図28は、コンピュータで動作するプログラムの構成例を示す。コンピュータ1において、図28に示すハードウェア群21(401〜412)の制御を行なうOS(オペレーティング・システム)22が動作する。OS22に従った手順でプロセッサ401が動作して、ハードウェア群21の制御・管理が行なわれることにより、アプリケーションプログラム24やミドルウェア23に従った処理がハードウェア群21で実行される。さらに、コンピュータ1において、ミドルウェア23またはアプリケーションプログラム24が、RAM402に読み出されてプロセッサ401により実行される。   FIG. 28 shows a configuration example of a program that runs on a computer. In the computer 1, an OS (Operating System) 22 for controlling the hardware group 21 (401 to 412) shown in FIG. The processor 401 operates in accordance with the procedure in accordance with the OS 22 to control and manage the hardware group 21, whereby processing according to the application program 24 and the middleware 23 is executed in the hardware group 21. Further, in the computer 1, the middleware 23 or the application program 24 is read into the RAM 402 and executed by the processor 401.

プロセッサ401が、照合機能が呼び出された場合に、ミドルウェア23またはアプリケーションプログラム24の少なくとも一部に基づく処理を行なうことにより、(それらの処理をOS22に基づいてハードウェア群21を制御して)コード変換部150,250,350の機能が実現される。照合機能は、それぞれアプリケーションプログラム24自体に含まれてもよいし、アプリケーションプログラム24に従って呼び出されることで実行されるミドルウェア23の一部であってもよい。   When the processor 401 calls the collation function, the processor 401 performs processing based on at least a part of the middleware 23 or the application program 24 (by controlling the hardware group 21 based on the OS 22). The functions of the conversion units 150, 250, and 350 are realized. The collation function may be included in the application program 24 itself, or may be a part of the middleware 23 that is executed by being called according to the application program 24.

図29は、実施形態のシステムにおける装置の構成例を示す。図29のシステムは、コンピュータ1a、コンピュータ1b、基地局2およびネットワーク3を含む。コンピュータ1aは、無線または有線の少なくとも一方により、コンピュータ1bと接続されたネットワーク3に接続している。図2a、図8a、図14aに示す符号化装置100,200,300の機能は、図29に示すコンピュータ1aとコンピュータ1bとのいずれに含まれてもよい。また、図2b、図8b、図14b、図25に示す復号化装置500,600,700、800の機能は、図29に示すコンピュータ1aとコンピュータ1bとのいずれに含まれてもよい。   FIG. 29 shows a configuration example of an apparatus in the system of the embodiment. The system in FIG. 29 includes a computer 1 a, a computer 1 b, a base station 2 and a network 3. The computer 1a is connected to the network 3 connected to the computer 1b by at least one of wireless and wired. The functions of the encoding devices 100, 200, and 300 shown in FIGS. 2a, 8a, and 14a may be included in either the computer 1a or the computer 1b shown in FIG. Further, the functions of the decoding apparatuses 500, 600, 700, and 800 shown in FIGS. 2b, 8b, 14b, and 25 may be included in either the computer 1a or the computer 1b shown in FIG.

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

(付記1)コンピュータに、
記憶装置に格納された、第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を参照し、
前記第2コード割当表を基にして生成された複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化する
処理を実行させることを特徴とする復号化プログラム。
(Supplementary note 1)
A part of the character assigned to the 1-byte area of the first code assignment table stored in the storage device is assigned to the 2-byte area, and at least a part of the character assigned to the 2-byte area A conversion rule for encoding input character data by assigning a code of 2 bytes or more, and the value of the first 4 bits of the encoded code data depends on the code length of the code data Refer to the second code assignment table that defines different conversion rules,
A plurality of automata generated based on the second code allocation table are used, and the encoded data is characterized by the automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decryption program for executing a process of decrypting data.

(付記2)コンピュータが実行する復号化方法であって、
記憶装置に格納された、第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を参照し、
前記第2コード割当表を基にして生成された複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化する
処理を実行することを特徴とする復号化方法。
(Appendix 2) A decryption method executed by a computer,
A part of the character assigned to the 1-byte area of the first code assignment table stored in the storage device is assigned to the 2-byte area, and at least a part of the character assigned to the 2-byte area A conversion rule for encoding input character data by assigning a code of 2 bytes or more, and the value of the first 4 bits of the encoded code data depends on the code length of the code data Refer to the second code assignment table that defines different conversion rules,
A plurality of automata generated based on the second code allocation table are used, and the encoded data is characterized by the automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decoding method characterized by executing a process of decoding data.

(付記3)第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を基に生成された複数のオートマトンを記憶する記憶部と、
前記複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化するコード変換部と
を有することを特徴とする復号化装置。
(Supplementary Note 3) A part of the character assigned to the 1-byte area of the first code assignment table is assigned to the 2-byte area, and at least a part of the character assigned to the 2-byte area is 2 A conversion rule for encoding input character data by assigning a code of bytes or more, wherein the value of the first 4 bits of the encoded code data differs according to the code length of the code data A storage unit that stores a plurality of automata generated based on the second code allocation table that defines
A code conversion unit that uses the plurality of automata and decodes the encoded data into character data by an automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decoding device characterized by the above.

100,200,300 符号化装置
150,250,350 コード変換部
100, 200, 300 Encoding device 150, 250, 350 Code conversion unit

Claims (3)

コンピュータに、
記憶装置に格納された、第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を参照し、
前記第2コード割当表を基にして生成された複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化する
処理を実行させることを特徴とする復号化プログラム。
On the computer,
A part of the character assigned to the 1-byte area of the first code assignment table stored in the storage device is assigned to the 2-byte area, and at least a part of the character assigned to the 2-byte area A conversion rule for encoding input character data by assigning a code of 2 bytes or more, and the value of the first 4 bits of the encoded code data depends on the code length of the code data Refer to the second code assignment table that defines different conversion rules,
A plurality of automata generated based on the second code allocation table are used, and the encoded data is characterized by the automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decryption program for executing a process of decrypting data.
コンピュータが実行する復号化方法であって、
記憶装置に格納された、第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を参照し、
前記第2コード割当表を基にして生成された複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化する
処理を実行することを特徴とする復号化方法。
A decryption method executed by a computer,
A part of the character assigned to the 1-byte area of the first code assignment table stored in the storage device is assigned to the 2-byte area, and at least a part of the character assigned to the 2-byte area A conversion rule for encoding input character data by assigning a code of 2 bytes or more, and the value of the first 4 bits of the encoded code data depends on the code length of the code data Refer to the second code assignment table that defines different conversion rules,
A plurality of automata generated based on the second code allocation table are used, and the encoded data is characterized by the automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decoding method characterized by executing a process of decoding data.
第1コード割当表の1バイト領域に割り当てられた文字の一部を、2バイト領域に割り当て、かつ、前記2バイト領域に割り当てられた前記文字の少なくとも一部に対して、2バイト以上のコードを割り当てることで、入力された文字データをコード化する変換規則であって、前記コード化された符号データの先頭4ビットの値は当該符号データのコード長に応じて異なる変換規則を定義した第2コード割当表を基に生成された複数のオートマトンを記憶する記憶部と、
前記複数のオートマトンを利用し、コード化されたデータを前記複数のオートマトンのうち、当該データの先頭4ビットの値に応じて選択されるオートマトンにより文字データに復号化するコード変換部と
を有することを特徴とする復号化装置。
A part of a character assigned to the 1-byte area of the first code assignment table is assigned to a 2-byte area, and a code of 2 bytes or more is assigned to at least a part of the character assigned to the 2-byte area. Is a conversion rule for encoding the input character data, and the value of the first 4 bits of the encoded code data defines a conversion rule that is different depending on the code length of the code data. A storage unit for storing a plurality of automata generated based on the two-code allocation table;
A code conversion unit that uses the plurality of automata and decodes the encoded data into character data by an automaton selected according to the value of the first 4 bits of the data among the plurality of automata. A decoding device characterized by the above.
JP2016098753A 2015-07-13 2016-05-17 Decoding program, decoding method, and decoding device Active JP6665679B2 (en)

Priority Applications (5)

Application Number Priority Date Filing Date Title
JP2016098753A JP6665679B2 (en) 2016-05-17 2016-05-17 Decoding program, decoding method, and decoding device
US15/207,876 US9779071B2 (en) 2015-07-13 2016-07-12 Non-transitory computer-readable recording medium, encoding method, encoding apparatus, decoding method, and decoding apparatus
EP16179064.7A EP3119003A3 (en) 2015-07-13 2016-07-12 Encoding computer program, encoding method, encoding apparatus, decoding computer program, decoding method, and decoding apparatus
CN201610545992.5A CN106354699B (en) 2015-07-13 2016-07-12 Encoding method, encoding device, decoding method, and decoding device
US15/722,203 US20180052810A1 (en) 2015-07-13 2017-10-02 Non-transitory computer-readable recording medium, encoding method, encoding apparatus, decoding method, and decoding apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2016098753A JP6665679B2 (en) 2016-05-17 2016-05-17 Decoding program, decoding method, and decoding device

Publications (2)

Publication Number Publication Date
JP2017208644A true JP2017208644A (en) 2017-11-24
JP6665679B2 JP6665679B2 (en) 2020-03-13

Family

ID=60417172

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2016098753A Active JP6665679B2 (en) 2015-07-13 2016-05-17 Decoding program, decoding method, and decoding device

Country Status (1)

Country Link
JP (1) JP6665679B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020061641A (en) * 2018-10-09 2020-04-16 富士通株式会社 Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device
EP4053730A1 (en) * 2017-12-28 2022-09-07 Fujitsu Limited Decoding program creating dynamic dictionary associating codes to words for extraction

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4475174A (en) * 1981-09-08 1984-10-02 Nippon Telegraph & Telephone Public Corporation Decoding apparatus for codes represented by code tree
JPH09298470A (en) * 1996-05-08 1997-11-18 Sony Corp Coding and decoding device
JP2005135086A (en) * 2003-10-29 2005-05-26 Casio Comput Co Ltd Dictionary data compression apparatus, electronic dictionary device, compressed dictionary data production method and program
JP2016046602A (en) * 2014-08-20 2016-04-04 富士通株式会社 Compression program, compression apparatus, compression method, decompression program, decompression apparatus, and decompression method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4475174A (en) * 1981-09-08 1984-10-02 Nippon Telegraph & Telephone Public Corporation Decoding apparatus for codes represented by code tree
JPH09298470A (en) * 1996-05-08 1997-11-18 Sony Corp Coding and decoding device
JP2005135086A (en) * 2003-10-29 2005-05-26 Casio Comput Co Ltd Dictionary data compression apparatus, electronic dictionary device, compressed dictionary data production method and program
JP2016046602A (en) * 2014-08-20 2016-04-04 富士通株式会社 Compression program, compression apparatus, compression method, decompression program, decompression apparatus, and decompression method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
SUNOS リファレンスマニュアル1:ユーザーコマンド YACC(1), JPN6020000831, 2010, ISSN: 0004193280 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4053730A1 (en) * 2017-12-28 2022-09-07 Fujitsu Limited Decoding program creating dynamic dictionary associating codes to words for extraction
JP2020061641A (en) * 2018-10-09 2020-04-16 富士通株式会社 Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device

Also Published As

Publication number Publication date
JP6665679B2 (en) 2020-03-13

Similar Documents

Publication Publication Date Title
US10360183B2 (en) Encoding device, encoding method, decoding device, decoding method, and computer-readable recording medium
JP5831298B2 (en) Program, information processing apparatus, and index generation method
CN106354699B (en) Encoding method, encoding device, decoding method, and decoding device
JP6648620B2 (en) Encoding program, encoding device, and encoding method
JP6641857B2 (en) Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device
JP6686639B2 (en) Encoding program, encoding device, encoding method, decoding program, decoding device, and decoding method
JP6540308B2 (en) Encoding program, encoding method, encoding apparatus, decoding program, decoding method and decoding apparatus
JP6665679B2 (en) Decoding program, decoding method, and decoding device
CN106354746B (en) Search method and search device
US11055328B2 (en) Non-transitory computer readable medium, encode device, and encode method
JP6834327B2 (en) Coding program, coding device and coding method
JP6540306B2 (en) Encoding program, encoding method, encoding apparatus, decoding program, decoding method and decoding apparatus
JP6805720B2 (en) Data search program, data search device and data search method
JP7210130B2 (en) Encoding program, encoding method and encoding device
JP7159557B2 (en) DYNAMIC DICTIONARY GENERATOR, DYNAMIC DICTIONARY GENERATION METHOD AND DECODER
WO2014030189A1 (en) Compression program, compression method, compression device, expansion program, expansion method, expansion device, and data transfer system
JP6135788B2 (en) Compression program, compression method, compression device, decompression program, decompression method, decompression device, and data transfer system
WO2014030180A1 (en) Storage program, storage method, storage device, decompression program, decompression method, and decompression device
CN106471743B (en) Encoding of plain ASCII data streams
JP2020061641A (en) Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device
JP2017195628A (en) Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device
JP2007004503A (en) Program conversion system, program conversion method and code conversion program
JP2016171589A (en) Encoding program, encoding method, encoding device, decoding program, decoding method, and decoding device
JP2005275880A (en) Device, method and program for converting word and phrase into data

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20190212

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20191218

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20200121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20200203

R150 Certificate of patent or registration of utility model

Ref document number: 6665679

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150