JP2011154495A - Character code conversion device, character code conversion method and character code conversion program - Google Patents
Character code conversion device, character code conversion method and character code conversion program Download PDFInfo
- Publication number
- JP2011154495A JP2011154495A JP2010014909A JP2010014909A JP2011154495A JP 2011154495 A JP2011154495 A JP 2011154495A JP 2010014909 A JP2010014909 A JP 2010014909A JP 2010014909 A JP2010014909 A JP 2010014909A JP 2011154495 A JP2011154495 A JP 2011154495A
- Authority
- JP
- Japan
- Prior art keywords
- code conversion
- conversion
- character
- code
- conversion 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.)
- Pending
Links
Images
Landscapes
- Document Processing Apparatus (AREA)
Abstract
Description
本発明は文字コード変換装置、文字コード変換方法、および文字コード変換プログラムに関し、特に特殊文字や外字を含む文字列を迅速に変換することを可能とする文字コード変換装置、文字コード変換方法、および文字コード変換プログラムに関する。 The present invention relates to a character code conversion device, a character code conversion method, and a character code conversion program, and in particular, a character code conversion device, a character code conversion method, and a character code conversion method that can quickly convert a character string including special characters and external characters. It relates to a character code conversion program.
コンピュータ上で文字を利用するための文字コードには数多くの体系がある。特に日本語ではEUC(EUC_JP)、JIS(7ビット)、シフトJIS(SHIFT_JIS)、ユニコード(UTF-8)などが多く使用されている。文字コードについては多くの規格が並立しているのに加えて、たとえば日本電気(株)のJIPS(JIPS(J)、JIPS(E))などのように、特定のベンダに固有の文字コードもある。 There are many systems for character codes for using characters on a computer. Particularly in Japanese, EUC (EUC_JP), JIS (7 bits), Shift JIS (SHIFT_JIS), Unicode (UTF-8), etc. are often used. In addition to many standards for character codes, there are also character codes specific to specific vendors, such as NEC Corporation's JIPS (JIPS (J), JIPS (E)). is there.
図9は、コンピュータネットワークで文字コードの変換が利用される場面の一例を示す説明図である。一般的なコンピュータネットワーク501は、端末装置であるクライアントコンピュータ510と、アプリケーションサーバ520とがインターネット530を介して接続され、アプリケーションサーバ520はさらにメインフレームによるホスト540と接続されている。アプリケーションサーバ520内部で、ウェブアプリケーション521、EJB(Enterprise JavaBeans)522、文字コード変換部523が動作している。
FIG. 9 is an explanatory diagram illustrating an example of a situation in which character code conversion is used in a computer network. In a general computer network 501, a client computer 510 as a terminal device and an
クライアントコンピュータ510は、シフトJISやユニコードなどのような文字コードで記述された文字列を、ウェブアプリケーション521に送信する。文字コード変換部523は、ウェブアプリケーション521からEJB522を介して受けたこの文字列をJIPSに変換して、ホスト540で動作している既存のオンライン業務システムに送信して処理させる。ホスト540から返信されたJIPSで記述された処理結果は、文字コード変換部523でシフトJISやユニコードに変換されて、EJB522およびウェブアプリケーション521を通じてクライアントコンピュータ510に戻される。既存のオンライン業務システムを変更しなくてもよいように、このような文字コードの変換が必要となるのである。
The client computer 510 transmits a character string described in a character code such as Shift JIS or Unicode to the
この例に限らず、コンピュータを利用する上で文字コードの変換が必要となる場面は多くある。たとえば、日本語の電子メールではJIS(7ビット)が事実上の標準の文字コードとされており、多くのコンピュータではシフトJISやユニコードなどの文字コードで作成された電子メールをJIS(7ビット)に変換してから送信している。 In addition to this example, there are many scenes in which character code conversion is required when using a computer. For example, JIS (7-bit) is the de facto standard character code for Japanese e-mail, and many computers use JIS (7-bit) for e-mail created with character codes such as Shift JIS and Unicode. It is sent after being converted to.
ある文字コードで定義されている文字が、別の文字コードでは定義されていない(または複数種類の文字に分けられている)などのような場合もある。たとえば特殊文字(ベンダー定義文字)や外字(ユーザ定義文字)などがこれに該当する。人名や地名などにそれらの特殊文字や外字などが含まれていることも多い。ある文字コードで記述された文字列を別の文字コードに変換する際、その文字列にそれらの特殊文字や外字などが含まれていると、正常な文字列に変換されないという問題が生じる。 In some cases, a character defined in one character code is not defined in another character code (or divided into a plurality of types of characters). For example, special characters (vendor-defined characters) and external characters (user-defined characters) correspond to this. Such special characters and external characters are often included in names of people and places. When a character string described in a certain character code is converted into another character code, if the character string includes those special characters or external characters, there is a problem that the character string is not converted into a normal character string.
特殊文字や外字を含む文字列の文字コード変換に関連する技術文献として、たとえば次に示す各特許文献がある。その中でも特許文献1には、特殊文字や外字のコード変換を、通常の文字コードに対するコード変換装置とは別装置で行ない、その後、通常の文字コードに対するコード変換装置に渡すという文字コードの変換手法が記載されている。 As technical documents related to character code conversion of character strings including special characters and external characters, for example, there are the following patent documents. Among them, Patent Document 1 discloses a character code conversion method in which code conversion of special characters and external characters is performed by a device different from a code conversion device for normal character codes, and then passed to a code conversion device for normal character codes. Is described.
また特許文献2には、片方向のみの変換テーブルを持つことで高速な変換とメモリ容量の削減を可能とするという文字コードの変換手法が記載されている。特許文献3には、事前に変換テーブルに対応付けられていない文字コードが発生した際に、新規文字フォント作成や変換テーブルの追加作業を行うという文字コードの変換手法が記載されている。 Patent Document 2 describes a character code conversion method that enables high-speed conversion and memory capacity reduction by having a conversion table only in one direction. Patent Document 3 describes a character code conversion method in which a new character font is created or a conversion table is added when a character code not previously associated with a conversion table is generated.
前述の各特許文献に記載された技術では、特殊文字や外字を含む文字列を正常に変換することは可能ではあるが、その変換処理に多くの手間および時間がかかるという問題がある。 Although the techniques described in each of the above-mentioned patent documents can normally convert a character string including special characters and external characters, there is a problem that the conversion process takes a lot of time and effort.
たとえば特許文献1に記載の技術では、先に特殊文字や外字のみをコード変換した後、通常の文字コードに対するコード変換を行なうという2段階の処理が必要である。また、特許文献1に記載の手法では、特殊文字や外字のコード変換規則のみを変更したい場合にも、通常の文字コードの変換に使用される変換テーブル自体を修正する必要があるという問題がある。 For example, the technique described in Patent Document 1 requires a two-stage process in which only special characters and external characters are first subjected to code conversion and then code conversion is performed on a normal character code. Further, the technique described in Patent Document 1 has a problem that it is necessary to modify the conversion table itself used for conversion of normal character codes even when only the special character or external character code conversion rules are to be changed. .
特許文献2に記載の技術では、片方向のみの変換テーブルしか持たないので、その逆方向の変換は不可能であるか、もしくは処理が著しく遅くなる。特許文献3に記載の技術では、変換処理の時点で新規文字フォント作成や変換テーブルの追加作業を行うので、処理に時間がかかることになる。 Since the technique described in Patent Document 2 has only a conversion table in one direction, conversion in the opposite direction is impossible, or the processing is significantly slowed down. In the technique described in Patent Document 3, since new character font creation and conversion table addition work are performed at the time of conversion processing, it takes time for the processing.
さらに、各文字コードに関する規格はたびたび改正され、その改正によって、人名や地名などで利用される文字の追加、字体の変更や入れ替えが行われることがある(実際、西暦1997年にはJIS規格(JIS X 0208)の改正により、外字の利用が原則的に禁止されたこともある)。そのような場合に、これらの手法では、変換テーブル全体の修正が必要となるという問題もある。特許文献1〜3に記載の技術では、この問題に対応することはできない。 Furthermore, the standards related to each character code are frequently revised, and the revision may add characters used in personal names, place names, etc., and change or replace the fonts (in fact, the JIS standards ( (In some cases, the use of external characters was prohibited in principle due to the revision of JIS X 0208). In such a case, these methods also have a problem that the entire conversion table needs to be corrected. The techniques described in Patent Documents 1 to 3 cannot cope with this problem.
本発明の目的は、特殊文字や外字を含む文字列を迅速かつ正常に変換することを可能とし、かつ字体の変更や入れ替えに容易に対応することを可能とする文字コード変換装置、文字コード変換方法、および文字コード変換プログラムを提供することにある。 An object of the present invention is to provide a character code conversion device and a character code conversion which can quickly and normally convert a character string including special characters and external characters and can easily cope with a change or replacement of a character font. A method and a character code conversion program are provided.
上記目的を達成するため、本発明に係る文字コード変換装置は、入力された変換前文字列情報を文字コードの異なる変換後文字列に変換して出力する文字コード変換装置であって、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群および変換前後の文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを記憶する外部記憶手段と、起動される時に第1のコード変換テーブル群の中から1つ以上の必要なコード変換テーブルを予め備えられた主記憶手段に第2のコード変換テーブル群として記憶するコード変換処理部と、起動される時に辞書ファイルを読み込み、この辞書ファイル内に定義された変換規則に基づいて第2のコード変換テーブル群の中で変換規則に該当するコード変換テーブルを更新する辞書変換処理部とを有することを特徴とする。 In order to achieve the above object, a character code conversion apparatus according to the present invention is a character code conversion apparatus that converts input character string information before conversion into a converted character string having a different character code, and outputs the converted character string information. A first code conversion table group including a plurality of code conversion tables that define a correspondence relationship between only character codes, and a dictionary file that defines conversion rules that correspond to arbitrary character strings between character codes before and after conversion External storage means for storing, and code stored as a second code conversion table group in main storage means provided in advance with one or more necessary code conversion tables from the first code conversion table group when activated Reads the dictionary file when activated with the conversion processing unit, and converts it in the second code conversion table group based on the conversion rules defined in this dictionary file It characterized by having a dictionary conversion processing unit for updating the code conversion table corresponding to the law.
上記目的を達成するため、本発明に係る文字コード変換方法は、入力された変換前文字列情報を文字コードの異なる変換後文字列に変換して出力する文字コード変換装置にあって、文字コード変換装置が起動される時に、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群をコード変換処理部が予め備えられた外部記憶手段から読み込み、読み込まれた第1のコード変換テーブル群の中から1つ以上の必要なコード変換テーブルをコード変換処理部が予め備えられた主記憶手段に第2のコード変換テーブル群として記憶し、第1のコード変換テーブル群に続いて変換前後の文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを外部記憶手段から辞書変換処理部が読み込み、この辞書ファイル内に定義された変換規則に基づいて第2のコード変換テーブル群の中で変換規則に該当するコード変換テーブルを辞書変換処理部が更新することを特徴とする。 In order to achieve the above object, a character code conversion method according to the present invention is a character code conversion device that converts input character string information before conversion into a converted character string having a different character code and outputs the character code. When the conversion device is activated, a first code conversion table group including a plurality of code conversion tables defining a correspondence relationship between character codes in only one direction is read from an external storage means provided in advance with a code conversion processing unit. One or more necessary code conversion tables from the read first code conversion table group are stored as a second code conversion table group in the main storage means provided in advance in the code conversion processing unit, Following the code conversion table group, a dictionary file defining a conversion rule corresponding to an arbitrary character string between character codes before and after conversion is converted from the external storage means to the dictionary conversion process. Department reads the code conversion table corresponding to the conversion rule in the second code conversion table group based on the defined conversion rule into the dictionary file dictionary conversion processing unit and updates.
上記目的を達成するため、本発明に係る文字コード変換プログラムは、入力された変換前文字列情報を文字コードの異なる変換後文字列に変換して出力する文字コード変換装置にあって、文字コード変換装置が備えているコンピュータに、文字コード変換装置が起動される時に、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群を予め備えられた外部記憶手段から読み込む手順、読み込まれた第1のコード変換テーブル群の中から1つ以上の必要なコード変換テーブルを予め備えられた主記憶手段に第2のコード変換テーブル群として記憶する手順、第1のコード変換テーブル群に続いて変換前後の文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを外部記憶手段から読み込む手順、およびこの辞書ファイル内に定義された変換規則に基づいて第2のコード変換テーブル群の中で変換規則に該当するコード変換テーブルを更新する手順を実行させることを特徴とする。 In order to achieve the above object, a character code conversion program according to the present invention is a character code conversion apparatus that converts input character string information before conversion into a converted character string having a different character code and outputs the character code. When the character code conversion device is activated, the computer provided in the conversion device is preliminarily provided with a first code conversion table group including a plurality of code conversion tables that define correspondences between character codes in only one direction. A procedure for reading from the external storage means, and a procedure for storing one or more necessary code conversion tables from the read first code conversion table group as a second code conversion table group in a main storage means provided in advance. A dictionary file that defines a conversion rule that corresponds to an arbitrary character string between character codes before and after conversion following the first code conversion table group A procedure for reading from the partial storage means, and a procedure for updating the code conversion table corresponding to the conversion rule in the second code conversion table group based on the conversion rule defined in the dictionary file. To do.
上述したように本発明は、文字コード変換装置の起動時に、辞書ファイルに定義されている変換規則によってコード変換テーブルを更新するように構成したので、この装置が動作している間は通常の片方向のみの文字コード変換と同じ手間で変換処理が可能となる。これによって、特殊文字や外字を含む文字列を迅速かつ正常に変換することが可能であり、かつ字体の変更や入れ替えに容易に対応することも可能であるという優れた特徴を持つ文字コード変換装置、文字コード変換方法、および文字コード変換プログラムを提供することができる。 As described above, the present invention is configured to update the code conversion table according to the conversion rules defined in the dictionary file when the character code conversion apparatus is started up. Conversion processing can be performed with the same effort as character code conversion in only the direction. This makes it possible to quickly and normally convert character strings including special characters and external characters, and to easily change and replace fonts. A character code conversion method and a character code conversion program can be provided.
(第1の実施形態)
以下、本発明の第1の実施形態の構成について添付図1に基づいて説明する。
最初に、本実施形態の基本的な内容について説明し、その後でより具体的な内容について説明する。
本実施形態に係る文字コード変換装置10は、入力された変換前文字列情報31を文字コードの異なる変換後文字列32に変換して出力する文字コード変換装置である。この文字コード変換装置10は、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群41および変換前後の文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイル42を記憶する外部記憶手段14と、起動される時に第1のコード変換テーブル群の中から1つ以上の必要なコード変換テーブルを予め備えられた主記憶手段12に第2のコード変換テーブル群41Bとして記憶するコード変換処理部51と、起動される時に辞書ファイル42を読み込み、この辞書ファイル内に定義された変換規則に基づいて第2のコード変換テーブル群41Bの中で変換規則に該当するコード変換テーブルを更新する辞書変換処理部52とを有する。
(First embodiment)
Hereinafter, the structure of the 1st Embodiment of this invention is demonstrated based on attached FIG.
First, the basic content of the present embodiment will be described, and then more specific content will be described.
The character
ここで、変換前文字列情報31が、変換前文字列31Aと、変換前後の文字コード種類を定義する変換方向情報31Bとを含み、コード変換処理部51が、変換前文字列情報31が入力された際に変換方向情報31Bに対応するコード変換テーブルを第2のコード変換テーブル群41Bから検索して変換前文字列に対応する変換後文字列を出力する。
Here, the pre-conversion
そして第2のコード変換テーブル群41Bが、第1のコード変換テーブルおよび第1のコード変換テーブルと逆方向の文字コード間の対応関係を定義した第2のコード変換テーブルとを含む。
The second code
この構成を備えることにより、文字コード変換装置10は、特殊文字や外字を含む文字列を迅速かつ正常に変換することが可能となる。
以下、これをより詳細に説明する。
With this configuration, the character
Hereinafter, this will be described in more detail.
図1は、本発明の第1の実施形態に係る文字コード変換装置10のハードウェアとしての構成を示す説明図である。文字コード変換装置10は、一般的なコンピュータ装置であり、コンピュータプログラムを実行する主体となる主演算制御手段(CPU: Central Processing Unit)11と、データを記憶する主記憶手段(RAM)12と、動作中のアプリケーションソフトの動作状態を記憶するアプリ状態記憶手段13と、ハードディスクなどのような外部記憶手段14、15と、ユーザからの入力操作を受け付けるキーボードなどの入力手段16と、ユーザに処理結果を表示するディスプレイなどの出力手段17とを備える。主記憶手段12とアプリ状態記憶手段13は物理的には同一の記憶手段でよいし、同様に外部記憶手段14および15は物理的には同一の記憶手段でよい。
FIG. 1 is an explanatory diagram showing a hardware configuration of the character
主演算制御手段11は、ワードプロセッサ、表計算、ウェブブラウザなどのような一般的なアプリケーションソフト21を動作させて、その動作状態をアプリ状態記憶手段13に記憶している。アプリケーションソフト21は入力手段16を介してユーザに操作され、その処理結果を出力手段17に表示するが、その処理の過程で必要に応じてコード変換手段22を利用する。アプリケーションソフト21からの呼び出しに応じて、主演算制御手段11上でコード変換手段22が動作し、これにアプリケーションソフト21が変換前文字列情報31を入力する。コード変換手段22は、変換前文字列情報31を文字コードの異なる変換後文字列32に変換して、これをアプリケーションソフト21に返すソフトウェアである。変換後文字列32を受けたアプリケーションソフト21は、アプリ状態記憶手段13から主演算制御手段11上に戻って動作を継続する。
The main
そして外部記憶手段14には、コード変換手段22が後述の処理を行う際に参照するデータであるコード変換テーブル群41が記憶されている。同様に外部記憶手段15には、コード変換手段22が後述の処理を行う際に参照するデータである辞書ファイル42が記憶されている。コード変換テーブル群41および辞書ファイル42の内容については後述する。
The
コード変換手段22は、コード変換処理部51と、辞書変換処理部52という各機能部からなる。コード変換処理部51は、コード変換テーブル群41を外部記憶手段14から読み出して、主記憶手段12にコード変換テーブル群41Bとして記憶する。そしてアプリケーションソフト21から変換前文字列情報31が入力されると、コード変換処理部51はコード変換テーブル群41のデータを参照して変換後の文字コードを取得して、それによって変換後文字列32に変換する処理を行う。
The code conversion means 22 is composed of functional units, a code
辞書変換処理部52は、外部記憶手段15から辞書ファイル42のデータを読み出してこれを参照して、そこに定義されている情報に基づいて主記憶手段12上のコード変換テーブル群41Bを更新する。この処理の詳細についても後述する。
The dictionary
図2は、図1で示した変換前文字列情報31のより詳しいデータ構成を示す説明図である。変換前文字列情報31は、変換前文字列31Aと、変換前後の文字コード種類をたとえば「ユニコード→シフトJIS」のように定義する変換方向情報31Bとを含む。変換後文字列32は、変換前文字列31Aを変換方向情報31Bに従って変換した後の文字列である。
FIG. 2 is an explanatory diagram showing a more detailed data structure of the pre-conversion
図3は、図1で示したコード変換テーブル群41および41Bの持つ各々のコード変換テーブルで可能な変換方向の例について示す表である。一つのコード変換テーブルは、たとえば「ユニコード→シフトJIS」のように片方向の変換のみが可能となっている。このため、コード変換テーブル群41は、「ユニコード→シフトJIS」「シフトJIS→ユニコード」「ユニコード→EUC」「EUC→ユニコード」などのような片方向のみの変換を行なう複数のコード変換テーブルを含む。図3では、変換前後の文字コード種類が同一であっても、JIS年度種別が異なれば字形などが異なる場合があるため、変換前後の文字コード種類とJIS年度種別とを合わせて示している。
FIG. 3 is a table showing examples of possible conversion directions in the respective code conversion tables of the code
コード変換テーブル群41Bは、コード変換テーブル群41の中で、あらかじめ定義された必要なコード変換テーブルのみを抽出したものである。ここでは「ユニコード→シフトJIS」「シフトJIS→ユニコード」のみを抽出している。
The code
図4は、図1で示した辞書ファイル42による変換規則の定義と、この定義のコード変換テーブル群41Bへの反映の一例を示す説明図である。辞書ファイル42では、任意の変換規則を定義することができ、かつ複数のコード変換テーブルに関する変換規則を定義できる。なお、ここでいう辞書ファイル42は、たとえばマイクロソフト社製のMS−IMEや、ジャストシステム(株)製のATOK(登録商標)などの日本語入力メソッドで、入力されたかな文字列を漢字仮名交じり文字列に変換する際に利用される辞書ファイルとは特に関係はない。
FIG. 4 is an explanatory diagram showing an example of the conversion rule definition by the
例えば、図4に示した例では、ユニコードの3042「あ」をシフトJISの82A9「か」に対応付ける定義、あるいはユニコードの3055「さ」をシフトJISの82BD「た」に対応付ける定義が記載されている。この「あ」→「か」、「さ」→「た」の対応付けは一例として記載したに過ぎず、実際にはユニコード側とシフトJIS側で共に特殊文字や外字などを含む任意の文字間の対応を変換規則として定義することができる。辞書変換処理部52は、この辞書ファイル42で定義された変換規則を、コード変換テーブル群41Bの中でこの変換方向(ここでは「ユニコード→シフトJIS」)に該当するコード変換テーブルに反映する。
For example, in the example shown in FIG. 4, a definition that associates
図5は、図1で示したコード変換手段22が起動される際の処理について示すフローチャートである。その起動の際、コード変換処理部51は、コード変換テーブル群41を外部記憶手段14から読み出して、コード変換テーブル群41Bとして主記憶手段12に記憶する(ステップS101)。
FIG. 5 is a flowchart showing processing when the
その際、コード変換処理部51は、コード変換テーブル群41の全てのデータを読み出してコード変換テーブル群41Bとして記憶するのではなく、必要なもののみをあらかじめ定義しておいて読み込むようにすることができる。本実施形態では、ある変換方向とその逆方向に対応するコード変換テーブルをコード変換テーブル群41から抽出し、コード変換テーブル群41Bとして記憶する。これによって、特定の文字コード間について、相互間での文字コードの変換処理を可能としている。
At that time, the code
コード変換処理部51がコード変換テーブル群41Bを主記憶手段12に記憶した後、辞書変換処理部52は辞書ファイル42が外部記憶手段15上に存在するか否かを確認する。(ステップS102)。辞書ファイル42が存在する場合は、辞書変換処理部52が辞書ファイル42に定義されている図4に示した変換規則の定義を読み込み(ステップS103)、ステップS104以降の処理を継続する。ステップS102で辞書ファイル42が存在しない場合は、そこで処理を終了する。
After the code
その後、辞書変換処理部52は、コード変換テーブル群41Bで読み込む複数のコード変換テーブルのうち、どのコード変換テーブルの定義内容を更新するのかを判断する(ステップS104)。
Thereafter, the dictionary
ここで、定義内容を更新するコード変換テーブルの判断は、辞書ファイル42に定義している変換方向と一致するコード変換テーブルをコード変換テーブル群41Bから検索することで行なう。例えば、辞書ファイル42に「ユニコード→シフトJIS」と定義されている場合、この「ユニコード→シフトJIS」の変換方向のコード変換テーブルをコード変換テーブル群41Bから検索する。
Here, the code conversion table for updating the definition content is determined by searching the code
更新するコード変換テーブルを検出した後、辞書変換処理部52は、辞書ファイル42に定義されている内容でコード変換テーブル群41Bを更新する。(ステップS105)以上で、コード変換手段22の起動の処理が完了する。
After detecting the code conversion table to be updated, the dictionary
ステップS105で行なっているコード変換テーブル群41Bの更新では、辞書変換処理部52が辞書ファイル42に定義されている複数の定義を読み込み、その内容でコード変換テーブル群41Bで持っているコード変換テーブルの内容を更新する。
In the update of the code
この際、コード変換テーブル群41Bは、図3に示したように「ユニコード→シフトJIS」などのような片方向の変換のみを保持したコード変換テーブルを複数持っているため、辞書変換処理部52は、辞書ファイル42に定義されている変換方向と一致するコード変換テーブルをコード変換テーブル群41Bから検索する。
At this time, the code
例えば、辞書ファイル42に「ユニコード→シフトJIS」の文字の対応関係が定義されている場合、この「ユニコード→シフトJIS」の変換方向のコード変換テーブルをコード変換テーブル群41Bから検索して取得し、このコード変換テーブルを取得した後、辞書ファイル42で定義されている内容でこのコード変換テーブルの内容を更新する。
For example, when the correspondence relationship of the characters “Unicode → Shift JIS” is defined in the
図6は、図1で示したコード変換手段22が文字コードの変換を行う際の処理について示すフローチャートである。アプリケーションソフト21からコード変換手段22に対して変換前文字列情報31(変換前文字列31Aおよび変換方向情報31B)が入力される(ステップS201)と、コード変換処理部51が入力された変換前文字列31Aを変換方向情報31Bに従って変換する処理を開始する。
FIG. 6 is a flowchart showing processing when the code conversion means 22 shown in FIG. 1 converts character codes. When pre-conversion character string information 31 (pre-conversion character string 31A and conversion direction information 31B) is input from the
その際、コード変換処理部51がコード変換テーブル群41B内で保持しているコード変換テーブルについて、アプリケーションから入力された変換方向情報31B、たとえば「ユニコード→シフトJIS」などの変換方向に対応するコード変換テーブルをコード変換テーブル群41Bから検索する(ステップS202)。
At this time, with respect to the code conversion table held in the code
その後、コード変換処理部51が取得したコード変換テーブルを参照し、変換前の文字コードに対応する文字コードをコード変換テーブルから取得して(ステップS203)、その取得後、取得した文字コードに対応する変換後文字列32をアプリケーションソフト21に出力する(ステップS204)。以上、図6で説明した処理は、特殊文字や外字などを含まない通常の文字列に対する文字コードの変換処理と同一である。
Thereafter, the code
(より具体的な動作例)
次に、本実施形態をより具体的な動作例によって説明する。図5に示したコード変換手段22が起動される際の処理で、辞書ファイル42が外部記憶手段14上に存在し、かつその辞書ファイル42には「ユニコード→シフトJIS」という変換方向が定義されているものとする。コード変換手段22は、コード変換テーブル群41を外部記憶手段14から読み出して、コード変換テーブル群41Bとして主記憶手段12に記憶する(ステップS101)。
(More specific operation example)
Next, the present embodiment will be described with a more specific operation example. In the process when the code conversion means 22 shown in FIG. 5 is activated, the
一つのコード変換テーブルは、たとえば「ユニコード→シフトJIS」のように片方向の変換のみが可能となっている。このため、コード変換テーブル群41は、図3に示したように「ユニコード→シフトJIS」「シフトJIS→ユニコード」「ユニコード→EUC」「EUC→ユニコード」などのような片方向のみの変換を行なうコード変換テーブルを複数保持している。
One code conversion table can be converted only in one direction, for example, “Unicode → Shift JIS”. Therefore, the code
コード変換処理部51は、コード変換テーブル群41の全てのデータを読み出してコード変換テーブル群41Bとして記憶するのではなく、必要なもののみをあらかじめ定義しておいて読み込むようにすることができるので、ここでは「ユニコード→シフトJIS」と「シフトJIS→ユニコード」のみをコード変換テーブル群41Bとして主記憶手段12に記憶する。
Since the code
このように定義すれば、ユニコードとシフトJISとの相互間で文字コードの変換処理が可能である。図9で説明したように、ある文字列を別の文字コードに変換して別の装置に渡して処理させると、多くの場合、返って来た処理結果の文字列を逆方向で変換することが必要となるので、特定の文字コード間で相互に変換処理を可能とすることが望ましい。 If defined in this way, a character code conversion process can be performed between Unicode and Shift JIS. As described in FIG. 9, when a character string is converted into another character code and passed to another device for processing, in many cases, the returned character string of the processing result is converted in the reverse direction. Therefore, it is desirable to enable conversion processing between specific character codes.
コード変換処理部51がコード変換テーブル群41Bを主記憶手段12に記憶した後、辞書変換処理部52は辞書ファイル42が外部記憶手段14上に存在するか否かを確認する。(ステップS102)。ここでは、辞書ファイル42が存在しているので、辞書変換処理部52が辞書ファイル42に定義されている定義内容を読み込んで(ステップS103)、ステップS104以降の処理を継続する。
After the code
その後、辞書変換処理部52は、コード変換テーブル群41Bで読み込んだ複数のコード変換テーブルのうち、どのコード変換テーブルの定義内容を更新するのかを判断する(ステップS104)。ここでは、辞書ファイル42に定義されている通り、「ユニコード→シフトJIS」の変換方向のコード変換テーブルをコード変換テーブル群41Bから検索する。
Thereafter, the dictionary
そして辞書変換処理部52は、コード変換テーブル群41Bから「ユニコード→シフトJIS」のコード変換テーブルを検出した後、ここに定義されている内容で主記憶手段12上のコード変換テーブル群41Bを更新する(ステップS105)。
The dictionary
図6に示したコード変換手段22が文字コードの変換を行う際の処理で、やはりこれと同じように、アプリケーションソフト21からコード変換手段22に対して「ユニコード→シフトJIS」という変換方向情報31Bを含む変換前文字列情報31が入力された(ステップS201)ものとする。
In the process when the code conversion means 22 shown in FIG. 6 converts the character code, the conversion direction information 31B “Unicode → Shift JIS” is sent from the
アプリケーションソフト21から変換前文字列情報31が入力されると、コード変換処理部51が入力された変換前文字列31Aを変換方向情報31B=「ユニコード→シフトJIS」に従って変換する。その際、コード変換処理部51がコード変換テーブル群41B内で保持しているコード変換テーブルについて、アプリケーションから入力された変換方向情報31B=「ユニコード→シフトJIS」に対応するコード変換テーブルをコード変換テーブル群41Bから検索する(ステップS202)。
When the pre-conversion
その後、コード変換処理部51が取得した「ユニコード→シフトJIS」のコード変換テーブルを参照し、変換前の文字コードに対応する文字コードをコード変換テーブルから取得して(ステップS203)、その取得後、取得した文字コードに対応する変換後文字列32をアプリケーションソフト21に出力する(ステップS204)。
After that, referring to the “Unicode → Shift JIS” code conversion table acquired by the code
(第1の実施形態の全体的な動作)
次に、上記の実施形態の全体的な動作について説明する。本実施形態に係る文字コード変換方法は、入力された変換前文字列情報を文字コードの異なる変換後文字列に変換して出力する文字コード変換装置10にあって、文字コード変換装置が起動される時に、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群をコード変換処理部が予め備えられた外部記憶手段から読み込み、読み込まれた第1のコード変換テーブル群の中から1つ以上の必要なコード変換テーブルをコード変換処理部が予め備えられた主記憶手段に第2のコード変換テーブル群として記憶し(図5・ステップS101)、第1のコード変換テーブル群に続いて変換前後の文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを外部記憶手段から辞書変換処理部が読み込み(図5・ステップS103)、この辞書ファイル内に定義された変換規則に基づいて第2のコード変換テーブル群の中で変換規則に該当するコード変換テーブルを辞書変換処理部が更新する(図5・ステップS105)。
(Overall operation of the first embodiment)
Next, the overall operation of the above embodiment will be described. The character code conversion method according to the present embodiment is a character
ここで、上記各動作ステップについては、これをコンピュータで実行可能にプログラム化し、これらを前記各ステップを直接実行するコンピュータである文字コード変換装置10に実行させるようにしてもよい。
この構成および動作により、本実施形態は以下のような効果を奏する。
Here, each of the above-described operation steps may be programmed to be executable by a computer, and may be executed by the character
With this configuration and operation, the present embodiment has the following effects.
本実施形態では、特許文献1に記載された技術のように2段階の処理でコード変換を行なうのではなく、コード変換手段22が起動される際に辞書ファイル42に定義された内容に基づいてコード変換テーブル群41Bを更新するので、コード変換手段22が動作している間は特殊文字や外字などを含まない通常の文字列に対するコード変換処理と同じ1段階の処理でコード変換を行なうことが可能となり、これによってコード変換の処理を高速に行なうことが可能となる。また、コード変換テーブル群41に対する変更を行うのではなく、辞書ファイル42に定義さえしておけばどのような変換規則も定義できるので、規格の変更による字体の変更や入れ替えにも容易に対応することが可能となる。
In this embodiment, code conversion is not performed in a two-stage process as in the technique described in Patent Document 1, but based on the contents defined in the
(第2の実施形態)
第2の実施形態に係る文字コード変換装置310は、第1の実施形態に係る文字コード変換装置10の構成に、辞書ファイルが更新されているか否かを定期的に確認し、更新されていれば第2のコード変換テーブル群の中で変換規則に該当するコード変換テーブルを更新する辞書更新処理部353を追加している。
(Second Embodiment)
The character
これによって、文字コード変換装置310を再起動することなく、変換規則の変更が可能となる。
以下、これをより詳細に説明する。
As a result, conversion rules can be changed without restarting the character
Hereinafter, this will be described in more detail.
図7は、本発明の第2の実施形態に係る文字コード変換装置310の構成を示す説明図である。文字コード変換装置310は、図1に示した第1の実施形態に係る文字コード変換装置10のコード変換手段22を、コード変換処理部51および辞書変換処理部52に加えて辞書更新処理部353を有するコード変換手段322に変更した構成としている。これ以外の構成は、第1の実施形態に係る文字コード変換装置310と同一である。
FIG. 7 is an explanatory diagram showing the configuration of the character
図8は、図7で示した辞書更新処理部353の動作を示すフローチャートである。辞書更新処理部353は、辞書ファイル42の更新日付が変化しているかを一定間隔で確認し(ステップS401)、更新日付が変化している場合には外部記憶手段14から辞書ファイル42を読み込み(ステップS402)、読み込んだ内容でコード変換手段22が主記憶手段12上に記憶したコード変換テーブル群41Bを更新する(ステップS403)。
FIG. 8 is a flowchart showing the operation of the dictionary
辞書更新処理部353によるコード変換テーブル群41Bの更新にかかる処理は、第1の実施形態で説明した辞書変換処理部52による処理と同一である。ただし、この処理は、図5〜7に示したコード変換処理部51および辞書変換処理部52による処理とは独立して行われる。
The processing for updating the code
この点以外は、コード変換手段322の動作は、第1の実施形態として説明したコード変換手段22と同一である。これにより、文字コード変換装置310は、第1の実施形態で説明した効果に加えて、文字コード変換装置310を再起動せずに変換規則の変更が可能となるという効果が生じる。
Except for this point, the operation of the
これまで本発明について図面に示した特定の実施形態をもって説明してきたが、本発明は図面に示した実施形態に限定されるものではなく、本発明の効果を奏する限り、これまで知られたいかなる構成であっても採用することができる。 The present invention has been described with reference to the specific embodiments shown in the drawings. However, the present invention is not limited to the embodiments shown in the drawings, and any known hitherto provided that the effects of the present invention are achieved. Even if it is a structure, it is employable.
コンピュータ装置もしくはコンピュータネットワークで、文字コードの変換を行うものについて幅広く適用することができる。 The present invention can be widely applied to computer devices or computer networks that perform character code conversion.
10、310 文字コード変換装置
11 主演算制御手段
12 主記憶手段
13 アプリ状態記憶手段
14、15 外部記憶手段
16 入力手段
17 出力手段
21 アプリケーションソフト
22、322 コード変換手段
31 変換前文字列情報
31A 変換前文字列
31B 変換方向情報
32 変換後文字列
41、41B コード変換テーブル群
42 辞書ファイル
51 コード変換処理部
52 辞書変換処理部
353 辞書更新処理部
DESCRIPTION OF SYMBOLS 10,310
Claims (6)
片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群および変換前後の前記文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを記憶する外部記憶手段と、
起動される時に前記第1のコード変換テーブル群の中から1つ以上の必要な前記コード変換テーブルを予め備えられた主記憶手段に第2のコード変換テーブル群として記憶するコード変換処理部と、
起動される時に前記辞書ファイルを読み込み、この辞書ファイル内に定義された前記変換規則に基づいて前記第2のコード変換テーブル群の中で前記変換規則に該当するコード変換テーブルを更新する辞書変換処理部と
を有することを特徴とする文字コード変換装置。 A character code conversion device that converts input character string information before conversion into a converted character string having a different character code and outputs the converted character string information,
A first code conversion table group including a plurality of code conversion tables that define a correspondence relationship between character codes in only one direction and a conversion rule that is a correspondence of an arbitrary character string between the character codes before and after the conversion are defined. An external storage means for storing dictionary files;
A code conversion processing unit for storing one or more necessary code conversion tables from the first code conversion table group as a second code conversion table group in a main storage unit provided in advance when activated;
Dictionary conversion processing that reads the dictionary file when activated and updates a code conversion table corresponding to the conversion rule in the second code conversion table group based on the conversion rule defined in the dictionary file And a character code conversion device.
前記コード変換処理部が、前記変換前文字列情報が入力された際に前記変換方向情報に対応する前記コード変換テーブルを前記第2のコード変換テーブル群から検索して前記変換前文字列に対応する変換後文字列を出力することを特徴とする、請求項1に記載の文字コード変換装置。 The pre-conversion character string information includes a pre-conversion character string and conversion direction information defining character code types before and after conversion,
When the pre-conversion character string information is input, the code conversion processing unit searches the code conversion table corresponding to the conversion direction information from the second code conversion table group and corresponds to the pre-conversion character string. The character code conversion device according to claim 1, wherein the converted character string is output.
前記文字コード変換装置が起動される時に、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群をコード変換処理部が予め備えられた外部記憶手段から読み込み、
読み込まれた前記第1のコード変換テーブル群の中から1つ以上の必要な前記コード変換テーブルを前記コード変換処理部が予め備えられた主記憶手段に第2のコード変換テーブル群として記憶し、
前記第1のコード変換テーブル群に続いて変換前後の前記文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを前記外部記憶手段から辞書変換処理部が読み込み、
この辞書ファイル内に定義された前記変換規則に基づいて前記第2のコード変換テーブル群の中で前記変換規則に該当するコード変換テーブルを辞書変換処理部が更新する
ことを特徴とする文字コード変換方法。 In the character code conversion device for converting the input pre-conversion character string information into a post-conversion character string with a different character code and outputting the converted character string information,
When the character code conversion device is activated, an external storage in which a code conversion processing unit is preliminarily provided with a first code conversion table group including a plurality of code conversion tables that define a correspondence relationship between character codes in only one direction. Read from means,
One or more necessary code conversion tables from the read first code conversion table group are stored as a second code conversion table group in the main storage means provided in advance in the code conversion processing unit,
Following the first code conversion table group, the dictionary conversion processing unit reads a dictionary file defining a conversion rule that is a correspondence of an arbitrary character string between the character codes before and after conversion from the external storage unit,
Character code conversion characterized in that a dictionary conversion processing unit updates a code conversion table corresponding to the conversion rule in the second code conversion table group based on the conversion rule defined in the dictionary file. Method.
前記文字コード変換装置が備えているコンピュータに、
前記文字コード変換装置が起動される時に、片方向のみの文字コード間の対応関係を定義した複数のコード変換テーブルを含む第1のコード変換テーブル群を予め備えられた外部記憶手段から読み込む手順、
読み込まれた前記第1のコード変換テーブル群の中から1つ以上の必要な前記コード変換テーブルを予め備えられた主記憶手段に第2のコード変換テーブル群として記憶する手順、
前記第1のコード変換テーブル群に続いて変換前後の前記文字コード間での任意の文字列の対応である変換規則を定義する辞書ファイルを前記外部記憶手段から読み込む手順、
およびこの辞書ファイル内に定義された前記変換規則に基づいて前記第2のコード変換テーブル群の中で前記変換規則に該当するコード変換テーブルを更新する手順
を実行させることを特徴とする文字コード変換プログラム。 In the character code conversion device for converting the input pre-conversion character string information into a post-conversion character string with a different character code and outputting the converted character string information,
In the computer provided with the character code converter,
A procedure of reading a first code conversion table group including a plurality of code conversion tables defining a correspondence relationship between character codes in only one direction when the character code conversion device is activated from an external storage means provided in advance;
A procedure for storing one or more necessary code conversion tables from the read first code conversion table group as a second code conversion table group in a main storage means provided in advance;
A procedure for reading from the external storage means a dictionary file that defines a conversion rule corresponding to an arbitrary character string between the character codes before and after conversion following the first code conversion table group;
And a procedure for updating a code conversion table corresponding to the conversion rule in the second code conversion table group based on the conversion rule defined in the dictionary file. program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010014909A JP2011154495A (en) | 2010-01-27 | 2010-01-27 | Character code conversion device, character code conversion method and character code conversion program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010014909A JP2011154495A (en) | 2010-01-27 | 2010-01-27 | Character code conversion device, character code conversion method and character code conversion program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011154495A true JP2011154495A (en) | 2011-08-11 |
Family
ID=44540414
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010014909A Pending JP2011154495A (en) | 2010-01-27 | 2010-01-27 | Character code conversion device, character code conversion method and character code conversion program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011154495A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013073560A (en) * | 2011-09-29 | 2013-04-22 | Dainippon Printing Co Ltd | Character code conversion method and system |
WO2014010442A1 (en) | 2012-07-13 | 2014-01-16 | 日東電工株式会社 | On-demand multiple power source management system, on-demand multiple power source management system program and computer-readable recording medium on which said program is recorded |
KR20200001826A (en) * | 2018-06-28 | 2020-01-07 | 주식회사 윤디자인그룹 | Method, user terminal and program for providing character candidate corresponding to input character |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07271777A (en) * | 1994-03-31 | 1995-10-20 | Fujitsu Ltd | Character code management system of decentralized information processing system |
JPH09152859A (en) * | 1995-11-29 | 1997-06-10 | Seiko Epson Corp | Printer |
JPH1055358A (en) * | 1996-05-16 | 1998-02-24 | Fujitsu Ltd | Device and method for external character management, and computer readable medium stored with computer program performing external character management |
JPH117442A (en) * | 1997-06-16 | 1999-01-12 | Nec Software Ltd | Automatic external character conversion system in client server system |
-
2010
- 2010-01-27 JP JP2010014909A patent/JP2011154495A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH07271777A (en) * | 1994-03-31 | 1995-10-20 | Fujitsu Ltd | Character code management system of decentralized information processing system |
JPH09152859A (en) * | 1995-11-29 | 1997-06-10 | Seiko Epson Corp | Printer |
JPH1055358A (en) * | 1996-05-16 | 1998-02-24 | Fujitsu Ltd | Device and method for external character management, and computer readable medium stored with computer program performing external character management |
JPH117442A (en) * | 1997-06-16 | 1999-01-12 | Nec Software Ltd | Automatic external character conversion system in client server system |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013073560A (en) * | 2011-09-29 | 2013-04-22 | Dainippon Printing Co Ltd | Character code conversion method and system |
WO2014010442A1 (en) | 2012-07-13 | 2014-01-16 | 日東電工株式会社 | On-demand multiple power source management system, on-demand multiple power source management system program and computer-readable recording medium on which said program is recorded |
KR20200001826A (en) * | 2018-06-28 | 2020-01-07 | 주식회사 윤디자인그룹 | Method, user terminal and program for providing character candidate corresponding to input character |
KR102145264B1 (en) * | 2018-06-28 | 2020-08-18 | 주식회사 윤디자인그룹 | Method, user terminal and program for providing character candidate corresponding to input character |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6922538B2 (en) | API learning | |
KR20060047421A (en) | Language localization using tables | |
JP2016218698A (en) | Document conversion program and document conversion method | |
KR102531507B1 (en) | Method, device, equipment and storage medium for outputting information | |
US9208134B2 (en) | Methods and systems for tokenizing multilingual textual documents | |
US9002772B2 (en) | Scalable rule-based processing system with trigger rules and rule evaluator | |
JP2011154495A (en) | Character code conversion device, character code conversion method and character code conversion program | |
JP2009015395A (en) | Dictionary construction support device and dictionary construction support program | |
JP5979650B2 (en) | Method for dividing terms with appropriate granularity, computer for dividing terms with appropriate granularity, and computer program thereof | |
JP2008226010A (en) | Compile method and compile device | |
JP6723726B2 (en) | Input support device | |
WO2007088902A1 (en) | Character processing device, method and program, and recording medium | |
WO2016031959A1 (en) | Migration support device | |
JP5238560B2 (en) | Translation apparatus, method, and program | |
JP7083473B2 (en) | Input support device | |
JP2010204910A (en) | System, method, and program for displaying reciprocal link | |
US9792197B2 (en) | Apparatus and program | |
CN111279350B (en) | System and method for providing globalization features in service management application interfaces | |
JP5975272B2 (en) | List display device, list display method, and program for list display | |
WO2023171790A1 (en) | Text creation assistance device and text creation assistance program | |
JP2013020539A (en) | Multilingual display method and multilingual display program | |
JP4847210B2 (en) | Input conversion learning program, input conversion learning method, and input conversion learning device | |
JP5483166B2 (en) | Document search apparatus, document search method, and program | |
JP2009230705A (en) | Template preparation device, device and method for preparing document data, and program | |
JP4061283B2 (en) | Apparatus, method and program for converting lexical data to data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20121112 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20131003 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20131008 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20140225 |