JP3115459B2 - Method of constructing and retrieving character recognition dictionary - Google Patents

Method of constructing and retrieving character recognition dictionary

Info

Publication number
JP3115459B2
JP3115459B2 JP05286113A JP28611393A JP3115459B2 JP 3115459 B2 JP3115459 B2 JP 3115459B2 JP 05286113 A JP05286113 A JP 05286113A JP 28611393 A JP28611393 A JP 28611393A JP 3115459 B2 JP3115459 B2 JP 3115459B2
Authority
JP
Japan
Prior art keywords
search key
character
word
words
search
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP05286113A
Other languages
Japanese (ja)
Other versions
JPH07121665A (en
Inventor
佳孝 濱口
節正 広垣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Electric Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oki Electric Industry Co Ltd filed Critical Oki Electric Industry Co Ltd
Priority to JP05286113A priority Critical patent/JP3115459B2/en
Publication of JPH07121665A publication Critical patent/JPH07121665A/en
Application granted granted Critical
Publication of JP3115459B2 publication Critical patent/JP3115459B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、文字認識における認識
結果を自動的に修正する後処理を行なうための文字認識
辞書の構成方法及び検索方法に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for constructing and retrieving a character recognition dictionary for performing post-processing for automatically correcting the result of character recognition.

【0002】[0002]

【従来の技術】従来、手書き文字等を光学的な手法等に
より認識する文字認識においては、認識の誤りを自動的
に修正するために、文字認識結果を単語辞書と照合する
後処理が行なわれている。このような後処理を迅速に行
なうためには、単語辞書の検索を迅速に行なわなければ
ならない。このため、単純に第1文字目を検索キーとし
て単語辞書を検索したのでは、例えば英語の辞書の場合
に「a」で始まる単語は多く、「x」で始まる単語は少
ないように、検索キーによって単語数がまちまちとな
り、効率的な検索が行なえない。そこで、単語中の特定
の位置の文字、例えば第2文字目の文字を検索キーとし
た検索が可能な辞書を構成して文字検索を行なう方法が
ある(特公平4−38026号)。
2. Description of the Related Art Conventionally, in character recognition for recognizing handwritten characters or the like by an optical method or the like, post-processing for collating a character recognition result with a word dictionary is performed in order to automatically correct a recognition error. ing. In order to perform such post-processing quickly, it is necessary to quickly search the word dictionary. For this reason, simply searching the word dictionary using the first character as a search key, for example, in the case of an English dictionary, there are many words starting with “a” and few words starting with “x”. As a result, the number of words varies, and an efficient search cannot be performed. Therefore, there is a method of performing a character search by constructing a dictionary capable of searching using a character at a specific position in a word, for example, the character of the second character as a search key (Japanese Patent Publication No. 4-38026).

【0003】一方、ハッシュ法を用いて単語辞書を分割
し、各分割単語群にハッシュ値を割り当て、文字認識結
果により得られたハッシュ値と等しい分割単語群につい
て検索を行なう方法もある。
On the other hand, there is a method in which a word dictionary is divided using a hash method, a hash value is assigned to each divided word group, and a search is performed for a divided word group equal to a hash value obtained as a result of character recognition.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上述し
た従来の技術には、次のような問題があった。即ち、単
語の特定の位置の文字を検索キーとする場合でも、なお
各検索キーに登録される単語の数にばらつきがある。従
って、各検索キーについて登録されている単語をハッシ
ュ法により各検索キーについて同一の分割数で分割した
場合、各検索キーの各ハッシュ値に対して登録されてい
る単語の数に大きな差が生じる場合もある。
However, the above-mentioned prior art has the following problems. That is, even when a character at a specific position of a word is used as a search key, the number of words registered in each search key still varies. Therefore, when words registered for each search key are divided by the same division number for each search key by the hash method, a large difference occurs in the number of words registered for each hash value of each search key. In some cases.

【0005】この結果、不必要に辞書が細分化された場
合には、各分割単語群に付与されるハッシュ値等のデー
タ部分が不必要に多くなり、メモリの使用効率が悪くな
る。一方、辞書の分割が大きすぎる場合には、ハッシュ
法を使った検索によっても高速な検索が行なえないとい
う問題があった。
[0005] As a result, when the dictionary is unnecessarily subdivided, the data portion such as the hash value assigned to each divided word group becomes unnecessarily large, and the use efficiency of the memory deteriorates. On the other hand, if the division of the dictionary is too large, there is a problem that a high-speed search cannot be performed even by a search using the hash method.

【0006】例えば、図4に示した例であれば、各単語
の2文字目を検索キーとした場合、検索キー「a」に登
録される単語の数は2469語であり、検索キー「f」
に登録される単語の数は62語である。このような辞書
を、検索キー「a」に登録される単語の検索をハッシュ
値で十分高速に行なうためにハッシュ値で64分割しよ
うとすると、検索キー「f」に登録される単語も64分
割しなければならないことになる。ところが、検索キー
「f」については62語しか登録されておらず、64分
割することは無意味である。以上の理由により、特公平
4−38026号の手法とハッシュ法を単純に組み合わ
せただけでは、単語辞書を高速に検索することができな
かった。
For example, in the example shown in FIG. 4, when the second character of each word is used as a search key, the number of words registered in the search key "a" is 2,469 words, and the search key "f""
Are 62 words. If it is attempted to divide such a dictionary into 64 words by hash value in order to search for the words registered in the search key "a" sufficiently fast by using the hash value, the words registered in the search key "f" are also divided into 64 words. You have to do it. However, only 62 words are registered for the search key "f", and it is meaningless to divide it into 64 words. For the above reasons, a simple combination of the technique of Japanese Patent Publication No. 4-38026 and the hash method could not search the word dictionary at high speed.

【0007】本発明は、以上の点に着目してなされたも
ので、各単語に検索キーのコードとハッシュ値を付加し
て登録することで、メモリを有効利用しながら高速に単
語を検索できるようにした文字認識辞書の構成方法及び
検索方法を提供することを目的とするものである。
The present invention has been made in view of the above points . A code of a search key and a hash value are added to each word.
Registering at high speed while efficiently using memory.
It is an object of the present invention to provide a method of constructing a character recognition dictionary capable of searching words and a method of searching for the words .

【0008】[0008]

【課題を解決するための手段】本発明の文字認識辞書の
構成方法は、各単語中の予め定められた共通の特定位置
の各文字をそれぞれ検索キーとし、各単語の特定位置の
文字が各検索キーと一致する全ての単語を該各検索キー
に属する単語とし、該各検索キーに属する単語の単語数
を計数して該単語数を該検索キー毎に登録し、各検索キ
ー毎に登録された単語数が多い検索キーほどビット長の
短いコードになるように該各検索キーに対応するコード
を割当て、各検索キー毎に登録された単語数が多いほど
長いビット長になるように各検索キーに属する各単語の
ハッシュ値を算出し、各単語に、該各単語に対応する検
索キーのコードとハッシュ値を付加して登録することを
特徴とするものである。
According to the method of constructing a character recognition dictionary of the present invention , each character at a predetermined common specific position in each word is used as a search key, and the specific position of each word is determined.
Search for all words whose characters match each search key
And the number of words belonging to each search key
And the number of words is registered for each search key.
-The search key with the larger number of words registered for each
Code corresponding to each search key so that it becomes a short code
And the more words registered for each search key
Of each word belonging to each search key so as to have a long bit length
A hash value is calculated, and a check is performed for each word.
It is characterized in that a search key code and a hash value are added and registered.

【0009】本発明の文字認識辞書の検索方法は、文字
認識の対象となる文字パターンを文字認識した結果得ら
れる候補文字のうち、予め定められた特定位置の文字を
検索キーとし、該検索キーのコードと一致する全ての単
語を文字認識辞書から検索し、文字認識の対象となる文
字パターンを文字認識した結果得られる候補文字により
該候補文字のハッシュ値を算出し、検索キーのコードに
基づいて検索した全ての単語のうち、該検索した全ての
単語が有するハッシュ値と候補文字のハッシュ値が等し
い全ての単語について該候補文字と一致する単語が存在
するか否かを検索し、候補文字と一致する単語が存在す
る場合は、該候補文字を認識結果とすることを特徴とす
るものである。
[0009] The method of the search character recognition dictionary of the present invention, character
The result of character recognition of the character pattern to be recognized
Of the candidate characters to be
As a search key, all units that match the code of the search key
A sentence to be searched for a word from the character recognition dictionary and subjected to character recognition
By the candidate character obtained as a result of character recognition of the character pattern
Calculate the hash value of the candidate character and use it as the search key code
Of all words searched based on
The hash value of the word and the hash value of the candidate character are equal
For all words, there is a word that matches the candidate character
Whether or not there is a word that matches the candidate character
The candidate character as a recognition result.
Things.

【0010】[0010]

【作用】本発明の文字認識辞書の構成方法においては、
例えば、英語の単語辞書については検索するための単語
の数がなるべく均一になるよう、各単語の第2文字目の
文字を検索キーとすると共に、各検索キー毎に属する単
語の単語数を計数する。そして、単語数の多い検索キー
にはビット長が短く、単語数の少ない検索キーにはビッ
ト長が長くなるコードを各検索キーに割当てる。また、
ハッシュ値のビット長は、登録される単語の数が多い検
索キーについては長くし、登録される単語の数が少ない
検索キーについては短くする。これにより、各単語に付
されるコードとハッシュ値のビット長が一定となる。
In the method for constructing a character recognition dictionary according to the present invention,
For example, as the number of words to search becomes as uniform as possible for the English word dictionary, as well as the search key and the second character of the character of each word, a single belonging to each search key
Count the number of words in a word. And a search key with many words
Has a short bit length and a search key with a small number of words has a small bit length.
Is assigned to each search key. Also,
The bit length of the hash value is increased for search keys having a large number of registered words, and is shortened for search keys having a small number of registered words. This allows each word to be
The bit lengths of the code and the hash value are constant.

【0011】本発明の文字認識辞書の検索方法において
は、光学式文字読取装置等により認識した文字パターン
について上述のように構成した単語辞書を用いて認識結
果を修正する際、以下のように単語辞書を検索する。第
2文字目の文字パターンの候補文字を検索キーとして単
語辞書を検索し、各文字パターンの候補文字のASCI
Iコード値の合計値により上記と同様にハッシュ値を求
め、文字認識結果の修正に適切な単語が含まれる単語群
を検索する。もし、その単語群から適切な単語が検索さ
れなかったときは、同じ検索キーに属する他の単語群を
検索する。
In the character recognition dictionary search method of the present invention, when a character pattern recognized by an optical character reader or the like is used to correct the recognition result using the word dictionary configured as described above, the following is performed. Search the dictionary. The word dictionary is searched using the candidate character of the second character pattern as a search key, and the ASCI of the candidate character of each character pattern is searched.
A hash value is obtained from the total value of the I code values in the same manner as described above, and a word group including a word suitable for correcting the character recognition result is searched. If an appropriate word is not searched from the word group, another word group belonging to the same search key is searched.

【0012】[0012]

【実施例】以下、本発明の実施例を図面を参照して詳細
に説明する。図1は、本発明の文字認識辞書の構成方法
を適用した装置の一実施例のブロック図である。図示の
装置は、検索キー抽出部120、単語数計数部500、
分割数決定部600、ハッシュ値算出部320、辞書作
成部700等から成る。検索キー抽出部120は、単語
辞書420に登録すべき各単語について、特定文字位置
の文字を検索キーとして抽出する。この特定文字位置
は、例えば、英語等の場合、第2文字目である。後述す
る図2の装置では、この位置の文字パターンを認識し、
その候補文字を検索キーとして単語辞書420を検索す
る。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a block diagram of an embodiment of an apparatus to which a method for configuring a character recognition dictionary according to the present invention is applied. The illustrated device includes a search key extracting unit 120, a word counting unit 500,
It comprises a division number determination unit 600, a hash value calculation unit 320, a dictionary creation unit 700, and the like. The search key extraction unit 120 extracts a character at a specific character position as a search key for each word to be registered in the word dictionary 420. This specific character position is, for example, the second character in English or the like. The device of FIG. 2 described later recognizes the character pattern at this position,
The word dictionary 420 is searched using the candidate character as a search key.

【0013】単語数計数部500は、検索キー抽出部1
20で各単語について抽出された検索キーを用い、各検
索キーにいくつの単語が登録されるかを計数する。一般
には文字の出現率に偏りがあるため、検索キーによって
登録される単語数はかなり異なる。従って、これらの単
語を均一な単語数の単語群に分割するため、単語数計数
部500によりすべての検索キーについて登録されるす
べての単語を計数する。
The word number counting section 500 includes a search key extracting section 1
At 20, the number of words registered in each search key is counted using the search keys extracted for each word. In general, since the appearance rate of characters is biased, the number of words registered by a search key differs considerably. Therefore, in order to divide these words into a word group having a uniform number of words, the word number counting unit 500 counts all words registered for all search keys.

【0014】分割数決定部600は、単語数計数部50
0で得られる各検索キーに登録される単語数に応じて、
各検索キーの各ハッシュ値に登録される単語数がほぼ均
一になるように、各検索キーに登録される単語の分割数
を決定する。これにより、各検索キーに登録される単語
数がたとえ大きく異なったとしても、そのような検索キ
ーによる検索に対してハッシュ値による検索を有効に組
み合わせることができる。この分割数決定部600で決
定された各検索キーに対する分割数は図2の装置での単
語辞書の検索時に使用するために分割数テーブル220
に格納される。ハッシュ値算出部320は、単語辞書4
20に登録する各単語について、検索キー抽出部120
で抽出された検索キーに対応する分割数に応じたハッシ
ュ値の算出法を用いて当該単語のハッシュ値を決定す
る。この算出法の具体例については後述する。
The number-of-division determining unit 600 includes a word number counting unit 50.
According to the number of words registered in each search key obtained by 0,
The number of words to be registered in each search key is determined so that the number of words registered in each hash value of each search key is substantially uniform. Thereby, even if the number of words registered in each search key is significantly different, it is possible to effectively combine a search using a hash value with a search using such a search key. The number of divisions for each search key determined by the number-of-divisions determination unit 600 is used in the division number table 220 for use in searching the word dictionary in the apparatus of FIG.
Is stored in The hash value calculation unit 320 determines whether the word dictionary 4
For each word to be registered in the search key extraction unit 120,
The hash value of the word is determined using a hash value calculation method corresponding to the number of divisions corresponding to the search key extracted in step (1). A specific example of this calculation method will be described later.

【0015】辞書作成部700は、単語辞書420に登
録する各単語を、検索キー抽出部120で得られた検索
キーとハッシュ値算出部320で得られたハッシュ値を
検索用のコードとして単語辞書420に格納する。図1
の装置で構成された単語辞書は、図2の装置で検索され
る。
The dictionary creation unit 700 uses the search key obtained by the search key extraction unit 120 and the hash value obtained by the hash value calculation unit 320 as a search code to convert each word registered in the word dictionary 420 into a word dictionary. 420. FIG.
The word dictionary configured by the apparatus of FIG. 2 is searched by the apparatus of FIG.

【0016】図2は、本発明の文字認識辞書の検索方法
を適用した装置の一実施例のブロック図である。図示の
装置は、検索キー抽出部110、分割数検索部210、
ハッシュ値算出部310、辞書検索部410等から成
る。検索キー抽出部110は、光学式文字読取装置等の
文字認識結果から単語中の特定の位置の文字認識結果で
ある文字コード(第1候補文字)を検索キーとして抽出
する。尚、文字認識結果として複数の文字が候補文字と
して挙がる場合は、まず、第1候補文字を検索キーと
し、順次第2候補以降の文字を検索キーとするようにし
てもよい。
FIG. 2 is a block diagram of an embodiment of an apparatus to which the character recognition dictionary search method according to the present invention is applied. The illustrated device includes a search key extraction unit 110, a division number search unit 210,
It comprises a hash value calculation unit 310, a dictionary search unit 410 and the like. The search key extraction unit 110 extracts, as a search key, a character code (first candidate character) that is a result of character recognition at a specific position in a word from a character recognition result of an optical character reader or the like. When a plurality of characters are listed as candidate characters as a result of character recognition, the first candidate character may be used as a search key first, and the characters subsequent to the second candidate may be used sequentially as search keys.

【0017】分割数検索部210は、単語辞書420に
検索キー抽出部110で抽出された検索キー文字に登録
されている単語がハッシュ値で何分割されているかを分
割数テーブル220から検索する。分割数テーブル22
0には、単語辞書420に登録されている単語につい
て、各検索キーごとに、その検索キーに登録されている
単語がハッシュ値でいくつに分割されているかを示す分
割数が格納されている。ハッシュ値算出部310は、分
割数検索部210で検索された分割数により、その分割
数を実現するように予め定められたハッシュ値算出法を
用いて文字認識結果等からハッシュ値の算出を行なう。
例えば、分割数が“8”であれば、単語の各文字の認識
結果の第1候補文字の文字コード(ASCIIコード
等)を足し合せたものを“8”で割った余りをハッシュ
値とする。このようなハッシュ値の算出法は、これ以外
のどのような方法でもよい。
The number-of-divisions search unit 210 searches the number-of-divisions table 220 for how many words registered in the word dictionary 420 by the search key characters extracted by the search key extraction unit 110 are divided by hash values. Division number table 22
For each word registered in the word dictionary 420, 0 stores the number of divisions indicating how many words registered in the search key are divided by the hash value. The hash value calculation unit 310 calculates a hash value from a character recognition result or the like using a hash value calculation method predetermined so as to realize the number of divisions, based on the number of divisions searched by the number of divisions search unit 210. .
For example, if the division number is “8”, the remainder obtained by adding the character codes (such as ASCII codes) of the first candidate characters of the recognition result of each character of the word and dividing the sum by “8” is used as the hash value. . Such a hash value calculation method may be any other method.

【0018】辞書検索部410は、単語辞書420から
検索キー抽出部110で得られた検索キーに登録された
単語をハッシュ値算出部310で得られたハッシュ値の
ものから順に検索する。これにより、文字認識結果が正
しい場合は、検索キー及びハッシュ値がともに正しいた
め、その単語は速やかに単語辞書420により検索され
る。このため、文字認識結果が正しい場合は、後処理が
高速に行なわれる。
The dictionary search unit 410 searches words registered in the search key obtained by the search key extraction unit 110 from the word dictionary 420 in order from the hash value obtained by the hash value calculation unit 310. As a result, if the character recognition result is correct, the search key and the hash value are both correct, and the word is quickly searched by the word dictionary 420. Therefore, when the character recognition result is correct, the post-processing is performed at high speed.

【0019】次に、分割数決定部600の具体的な処理
構成例を図3を用いて詳細に説明する。図3に示すよう
に、ハフマン符号割付処理610では、各検索キーにつ
いて登録される単語数を用いてハフマン法によりコード
を割り付ける。ハフマン法は、出現率の高いデータに短
いコードを割り付け、出現率の低いデータには長いコー
ドを割り付けることによって、データ圧縮を行なう方法
である。このようなハフマン法により、登録される単語
数が多い検索キーにはビット長が短いコードが割り付け
られ、登録される単語数が少ない検索キーにはビット長
が長いコードが割り付けられる。例えば、図4に示すよ
うに、登録単語数が最も多い検索キー「a」には「00」
が割り付けられる。また、登録単語数が2番目に多い検
索キー「e」には「110 」が割り付けられる。そして、
登録単語数が少ない検索キー「d」、「f」には、「10
111101」、「01111100」がそれぞれ割り付けられる。
Next, a specific processing configuration example of the division number determination unit 600 will be described in detail with reference to FIG. As shown in FIG. 3, in the Huffman code assignment processing 610, codes are assigned by the Huffman method using the number of words registered for each search key. The Huffman method is a method of performing data compression by allocating a short code to data having a high appearance rate and allocating a long code to data having a low appearance rate. According to the Huffman method, a code having a short bit length is assigned to a search key having a large number of registered words, and a code having a long bit length is assigned to a search key having a small number of registered words. For example, as shown in FIG. 4, "00" is assigned to the search key "a" having the largest number of registered words.
Is assigned. Also, “110” is assigned to the search key “e” having the second largest number of registered words. And
The search keys “d” and “f” with a small number of registered words include “10”
“111101” and “01111100” are assigned.

【0020】また、図4の例では、「001 」等の「00」
で始まるコードは、「a」以外には割り付けられない。
従って、「00」を検出すれば、それに続くビットを検出
しなくても、「a」を検出することができる。即ち、
「a」のコード「00」の後に任意のビットをつなげても
コード部分だけを抜き出すことができる。尚、図4にお
いては、検索キーの一部のみを示しているが、アルファ
ベットの26文字及びピリオドやコンマ等についても同
様にそれぞれ図示しないコードが割り付けられる。ハッ
シュ値ビット長決定処理620は、予め定められたビッ
ト長からハフマン符号割付処理610で検索キーのコー
ドに割り当てられたビット長を引いたものをハッシュ値
のビット長とする。従って、ハッシュ値のビット長は、
登録される単語が多い検索キーでは長くなり、少ない検
索キーでは短くなる。即ち、検索キーに登録される単語
が多いほど、ハッシュ値による分割数が多くなる。
In the example of FIG. 4, “00” such as “001” is used.
Are not assigned to any code other than "a".
Therefore, if "00" is detected, "a" can be detected without detecting the subsequent bit. That is,
Even if an arbitrary bit is connected after the code “00” of “a”, only the code portion can be extracted. Although only a part of the search key is shown in FIG. 4, codes (not shown) are similarly assigned to 26 letters of the alphabet, periods, commas, and the like. In the hash value bit length determination processing 620, a value obtained by subtracting the bit length allocated to the code of the search key in the Huffman code allocation processing 610 from the predetermined bit length is set as the bit length of the hash value. Therefore, the bit length of the hash value is
A search key with many registered words becomes longer, and a search key with less words becomes shorter. That is, as the number of words registered in the search key increases, the number of divisions by the hash value increases.

【0021】以上のような処理により、検索キーのコー
ド及びハッシュ値での分割数が定められた場合、検索キ
ーのコード長とハッシュ値のビット長の和が一定とな
る。このため、検索キーに登録される単語数にかかわら
ず、単語辞書中で検索キーのコードとハッシュ値の占め
るフィールドの合計のビット長を一定とすることができ
る。
When the code of the search key and the number of divisions by the hash value are determined by the above processing, the sum of the code length of the search key and the bit length of the hash value becomes constant. Therefore, regardless of the number of words registered in the search key, the total bit length of the field occupied by the code of the search key and the hash value in the word dictionary can be made constant.

【0022】次に、辞書を構成する手順及び構成した辞
書を検索する手順の具体例を説明する。この例では、検
索キーに単語の2文字目を用いることとする。ハッシュ
値の計算には、単語の各文字のASCIIコードの和を
分割数で割った余りを用いるものとする。図4に、各検
索キーに登録される単語を分割する分割数の決定処理の
例を示す。
Next, a specific example of a procedure for configuring a dictionary and a procedure for searching the configured dictionary will be described. In this example, the second character of the word is used as the search key. In calculating the hash value, the remainder obtained by dividing the sum of the ASCII codes of the characters of the word by the number of divisions is used. FIG. 4 shows an example of a process of determining the number of divisions into which words registered in each search key are divided.

【0023】まず、図1の検索キー抽出部120で、登
録される全単語について、2文字目の文字が検索キーと
して抽出される。そして、次の単語数計数部500で、
各検索キーごとにその検索キー文字が抽出された単語の
数を計数する。図4に示すように、例えば、検索キーが
「a」となる単語は、2469語である。また、検索キ
ーが「c」、「d」の単語は、288語、99語であ
り、その他の単語については図示の通りである。図示の
例でわかるように、検索キーにより登録される単語数は
それぞれ異なり、その差はかなり大きい。
First, in the search key extracting unit 120 of FIG. 1, the second character is extracted as a search key for all registered words. Then, in the next word counting unit 500,
For each search key, the number of words from which the search key character is extracted is counted. As shown in FIG. 4, for example, the word whose search key is “a” is 2469 words. The words with the search keys "c" and "d" are 288 words and 99 words, and the other words are as shown in the figure. As can be seen from the illustrated example, the number of words registered by the search key differs, and the difference is quite large.

【0024】次に、図3の処理610で、各検索キーの
文字に対し、上述した単語数を用いてハフマン法でコー
ドを割り付ける。即ち、単語数の多い文字には短いコー
ドを割り付け、単語数の少ない文字には長いコードを割
り付ける。このようにして決められたコードは例えば検
索キー「a」のように2469語という他の検索キーよ
り多くの単語が登録される場合は「00」のようにビット
長が短くなる。また、検索キー「f」のように62語と
いう他の検索キーより少ない単語が登録される場合は
「01111100」のようにビット長が長くなる。そして、処
理620で予め定められたビット長から処理610で検
索キーに割り当てられたコードのビット長を引き、ハッ
シュ値のビット長とする。例えば、予め定められたビッ
ト長を“8”とすると、検索キー「a」の場合は検索キ
ーに割り当てられたコード「00」のビット長“2”を
“8”から引き、ハッシュ値のビット長は6ビットとな
り、分割数は“2”の6乗で“64”となる。
Next, in a process 610 of FIG. 3, a code is assigned to the character of each search key by the Huffman method using the number of words described above. That is, a short code is assigned to a character having a large number of words, and a long code is assigned to a character having a small number of words. The code determined in this manner has a shorter bit length such as "00" when more words are registered than the other search key of 2469 words such as the search key "a". Also, when a word such as the search key “f” is registered, which is 62 words less than the other search keys, the bit length becomes longer like “01111100”. Then, the bit length of the code assigned to the search key in the process 610 is subtracted from the bit length predetermined in the process 620 to obtain the bit length of the hash value. For example, if the predetermined bit length is “8”, in the case of the search key “a”, the bit length “2” of the code “00” assigned to the search key is subtracted from “8”, and the bit of the hash value is The length is 6 bits, and the number of divisions is “64” as the sixth power of “2”.

【0025】次に、各検索キーについて処理620にお
いて、上述のようにして求めた分割数により各検索キー
に登録される単語を分割する。すると、図4の最下欄に
示すように、各検索キーの各ハッシュ値に登録される単
語数の差は小さくなる。例えば、検索キー「a」と
「f」では、登録単語数は、“2469”と“62”で
約40倍の差があるが、ハッシュ値で分割すると、“3
9”と“62”で、1.6倍程度まで差が小さくなって
いる。これにより、ハッシュ法による検索を有効に行な
うことができ、安定した検索性能を実現できる。
Next, in the processing 620 for each search key, divides the words registered in each of the search key by split number determined as described above. Then, as shown in the lowermost column of FIG. 4, the difference in the number of words registered in each hash value of each search key becomes small. For example, for the search keys “a” and “f”, the number of registered words is about 40 times different between “2469” and “62”.
The difference between "9" and "62" is reduced to about 1.6 times, whereby the search by the hash method can be performed effectively, and stable search performance can be realized.

【0026】図5に、単語「read」を例に挙げ、単
語辞書を構成する手順を具体的に示す。まず、検索キー
抽出部120で「read」の2文字目の「e」が検索
キーとして抽出される。図4により検索キーが「e」の
場合は検索キーコードが「110」でハッシュ法での分割
数は「32」である。次に、ハッシュ値算出部320
で、「r」、「e」、「a」、「d」の各文字のASC
IIコードの和を取った「412」を分割数の「32」
で割った余りの「28」、即ち2進数で「11100 」がハ
ッシュ値として算出される。こうして、単語「rea
d」は、検索キーコード「110 」、ハッシュ値「11100
」で単語辞書420に登録される。
FIG. 5 shows a specific procedure for constructing a word dictionary, taking the word "read" as an example. First, the search key extraction unit 120 extracts “e” as the second character of “read” as a search key. According to FIG. 4, when the search key is "e", the search key code is "110" and the number of divisions by the hash method is "32". Next, the hash value calculation unit 320
ASC of each character of "r", "e", "a", "d"
"412", which is the sum of II codes, is divided by "32"
The remainder “28”, ie, “11100” in binary, is calculated as the hash value. Thus, the word "rea
d ”is a search key code“ 110 ”and a hash value“ 11100
"In the word dictionary 420.

【0027】この例では、検索する単語が32分割にな
っており、ハッシュ値が5ビットで表わされる。そし
て、検索キーコードが「110 」の3ビットであり、ハッ
シュ値と合せて8ビットとなる。このように、検索キー
コードとハッシュ値のビット長の合計は、必ず8ビット
となる。従って、検索キーコードとハッシュ値を合成し
て全体として1つのキーとして使用することにより、検
索キーコード用のメモリ領域とハッシュ値用のメモリ領
域とをビット長の違いを考慮してそれぞれ確保する必要
はなくなる。このため、メモリ効率が非常によくなる。
In this example, the word to be searched is divided into 32, and the hash value is represented by 5 bits. The search key code is 3 bits of "110", which is 8 bits in total with the hash value. Thus, the total of the bit lengths of the search key code and the hash value is always 8 bits. Therefore, by synthesizing the search key code and the hash value and using them as one key as a whole, a memory area for the search key code and a memory area for the hash value are secured in consideration of the bit length difference. There is no need. Therefore, the memory efficiency becomes very good.

【0028】図6に、辞書検索処理の例を示す。辞書検
索においては、ハッシュ値の算出は、検索キー抽出とハ
ッシュ値算出が登録単語ではなく、光学式文字読取装置
等の文字認識結果に対して行なわれる。この点以外は、
辞書構成処理と同様である。従って、辞書検索の手順
は、図5に示す手順と同様のものとなる。以下、この手
順を説明する。まず、検索キー抽出部110で単語の2
文字目の認識結果の第1候補文字「e」を検索キーとし
て抽出する。次に、分割数検索部210で分割数テーブ
ル220から検索キー「e」に対応する検索キーコード
及び分割数を検索し、それぞれ検索キーコード「110 」
と分割数「32」を得る。
FIG. 6 shows an example of the dictionary search process. In the dictionary search, the hash value is calculated by performing search key extraction and hash value calculation on character recognition results of an optical character reader or the like, not on registered words. Other than this,
This is the same as the dictionary construction process. Therefore, the dictionary search procedure is the same as the procedure shown in FIG. Hereinafter, this procedure will be described. First, the search key extraction unit 110 searches for the word 2
The first candidate character “e” of the recognition result of the character is extracted as a search key. Next, the division number search unit 210 searches the division number table 220 for a search key code and a division number corresponding to the search key “e”, and respectively retrieves the search key code “110”.
And the division number “32”.

【0029】そして、ハッシュ値算出部310で、各文
字の第1候補文字「r」、「e」、「a」、「d」のA
SCIIコードの和の「412」を分割数「32」で割
った余り「28」の2進数「11100 」をハッシュ値とし
て算出する。こうして得られた検索キーコード「110 」
についてのハッシュ値「11100 」の部分から最初に単語
の検索を始める。この場合、認識結果として得られた第
1候補文字が正しい限り、最初に検索を始めたハッシュ
値の部分に目的の単語の「read」が格納されてい
る。これにより、高速に検索を行なうことができる。一
方、認識結果として得られた第1候補文字が正しくない
ときは、それらの第1候補文字から算出されたハッシュ
値の部分には検索したい単語が格納されていないのが普
通である。このように検索したい単語がない場合は、従
来の手法と同様に、その検索キーコードのそのハッシュ
値以外の単語を認識結果の第1候補文字と比較してい
く。
Then, the hash value calculation unit 310 calculates the A of the first candidate characters "r", "e", "a", and "d" of each character.
The binary number “11100” of the remainder “28” obtained by dividing “412” of the sum of the SCII codes by the division number “32” is calculated as a hash value. The search key code "110" thus obtained
First, a search for a word is started from the part of the hash value "11100" of. In this case, as long as the first candidate character obtained as a result of the recognition is correct, “read” of the target word is stored in the portion of the hash value at which the search is first started. As a result, a high-speed search can be performed. On the other hand, when the first candidate characters obtained as the recognition result are incorrect, the word to be searched is not usually stored in the portion of the hash value calculated from the first candidate characters. When there is no word to be searched, words other than the hash value of the search key code are compared with the first candidate character of the recognition result, as in the conventional method.

【0030】このようにして、文字認識結果が正しい場
合は、単語辞書420の検索キー抽出部110で得られ
た検索キーの単語のうち、ハッシュ値算出部310で得
られたハッシュ値の単語の中に検索すべき単語が見つか
るため、検索キーコードに登録されている単語数の多少
にかかわらず、均一かつ高速に単語が検索される。尚、
上述した実施例においては、英語の辞書を構成し、検索
する場合について説明したが、本発明はこれに限定され
ることなく、日本語、フランス語その他、あらゆる言語
に適用できることはもちろんである。
As described above, when the character recognition result is correct, of the words of the search key obtained by the search key extraction unit 110 of the word dictionary 420, the words of the hash value obtained by the hash value calculation unit 310 Since a word to be searched is found in the word, the word is searched uniformly and at high speed regardless of the number of words registered in the search key code. still,
In the above-described embodiment, the case where the English dictionary is constructed and searched has been described. However, the present invention is not limited to this, and it is needless to say that the present invention can be applied to Japanese, French and other languages.

【0031】[0031]

【発明の効果】以上説明したように、本発明の文字認識
辞書の構成方法及び検索方法によれば、単語中の特定位
置の文字を検索キーとして単語の検索を行なう手法と、
ハッシュ法とを組み合わせて辞書を構成し、検索するよ
うにしたので、各検索キーに登録される単語が各ハッシ
ュ値に対しほぼ均一に分割され、分割数が多すぎて検索
用のコードデータ量が増してメモリの使用効率が悪化す
ることを防止でき、また、分割数が少なすぎて効率的な
検索ができなくなることを防止することができる。従っ
て、文字認識結果が正しい場合の辞書の検索時間を短縮
することができる。また、検索キーコードにハフマンコ
ード等を用いることにより、検索キーコードにハッシュ
値をつなげて1つの領域に格納することが可能となり、
メモリの使用効率を更に向上させることができる。
As described above, according to the method of constructing and retrieving a character recognition dictionary of the present invention, a method of performing a word search using a character at a specific position in a word as a search key,
Since the dictionary is configured and searched by combining with the hash method, the words registered in each search key are divided almost uniformly for each hash value, and the number of divisions is too large, and the amount of code data for search is large. Can be prevented from increasing and the use efficiency of the memory can be prevented from deteriorating. Further, it can be prevented that the number of divisions is too small to perform efficient search. Therefore, it is possible to shorten the dictionary search time when the character recognition result is correct. Further, by using a Huffman code or the like as a search key code, it becomes possible to connect a hash value to the search key code and store it in one area,
The use efficiency of the memory can be further improved.

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

【図1】本発明の文字認識辞書の構成方法を適用した装
置の一実施例のブロック図である。
FIG. 1 is a block diagram of an embodiment of an apparatus to which a method for configuring a character recognition dictionary according to the present invention is applied.

【図2】本発明の文字認識辞書の検索方法を適用した装
置の一実施例のブロック図である。
FIG. 2 is a block diagram of an embodiment of an apparatus to which the character recognition dictionary search method of the present invention is applied.

【図3】分割数決定処理手順の説明図である。FIG. 3 is an explanatory diagram of a division number determination processing procedure.

【図4】分割数決定処理例の説明図である。FIG. 4 is an explanatory diagram of an example of a division number determination process.

【図5】辞書構成処理例の説明図である。FIG. 5 is an explanatory diagram of a dictionary configuration processing example.

【図6】辞書検索処理例の説明図である。FIG. 6 is an explanatory diagram of a dictionary search processing example.

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

110、120 検索キー抽出部 210 分割数検索部 220 分割数テーブル 310、320 ハッシュ値算出部 410 辞書検索部 420 単語辞書 600 分割数決定部 700 辞書作成部 110, 120 search key extraction unit 210 division number search unit 220 division number table 310, 320 hash value calculation unit 410 dictionary search unit 420 word dictionary 600 division number determination unit 700 dictionary creation unit

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭62−278689(JP,A) A.V.エイホ 外2名,“情報処理 シリーズ11データ構造とアルゴリズム" 初版,株式会社培風館,1987年3月10 日,p106−p112及びp331−336 (58)調査した分野(Int.Cl.7,DB名) G06K 9/72 G06F 17/30 412 JICSTファイル(JOIS)──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-62-278689 (JP, A) V. Eiho and two others, "Data Processing Series 11 Data Structure and Algorithm" First Edition, Baifukan Co., Ltd., March 10, 1987, p106-p112 and p331-336 (58) Fields surveyed (Int. Cl. 7 , DB name ) G06K 9/72 G06F 17/30 412 JICST file (JOIS)

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 各単語中の予め定められた共通の特定位
置の各文字をそれぞれ検索キーとし、 前記各単語の特定位置の文字が前記各検索キーと一致す
る全ての単語を該各検索キーに属する単語とし、該各検
索キーに属する単語の単語数を計数して該単語数を該検
索キー毎に登録し、 前記各検索キー毎に登録された前記単語数が多い検索キ
ーほどビット長の短いコードになるように該各検索キー
に対応するコードを割当て、 前記各検索キー毎に登録された前記単語数が多いほど長
いビット長になるように前記各検索キーに属する各単語
のハッシュ値を算出し、 前記各単語に、該各単語に対応する前記検索キーのコー
ドと前記ハッシュ値を付加して登録することを特徴とす
る文字認識辞書の構成方法。
1. A method according to claim 1 , wherein each character at a predetermined specific position in each word is used as a search key, and all words whose characters at the specific position of each word match the search key are used as search keys. , The number of words belonging to each search key is counted, and the number of words is registered for each search key. The search key having a larger number of words registered for each search key has a bit length A code corresponding to each of the search keys is assigned so as to have a shorter code length. A hash of each word belonging to each of the search keys is set such that the longer the number of words registered for each of the search keys is, the longer the bit length becomes. A method for constructing a character recognition dictionary, comprising: calculating a value; adding a code of the search key corresponding to each word and the hash value to each word;
【請求項2】 請求項1に記載の文字認識辞書の構成方
法に基づいて構成された該文字認識辞書の検索方法にお
いて、 文字認識の対象となる文字パターンを文字認識した結果
得られる候補文字のうち、予め定められた前記特定位置
の文字を検索キーとし、該検索キーのコードと一致する
全ての単語を前記文字認識辞書から検索し、 文字認識の対象となる文字パターンを文字認識した結果
得られる候補文字により該候補文字のハッシュ値を算出
し、 前記検索キーのコードに基づいて検索した全ての単語の
うち、該検索した全ての単語が有するハッシュ値と前記
候補文字のハッシュ値が等しい全ての単語について該候
補文字と一致する単語が存在するか否かを検索し、 前記候補文字と一致する単語が存在する場合は、該候補
文字を認識結果とすることを特徴とする文字認識辞書の
検索方法。
2. A method for retrieving a character recognition dictionary according to claim 1, wherein the character pattern is a character pattern to be recognized. Of these, the predetermined character at the specific position is used as a search key, all words that match the code of the search key are searched from the character recognition dictionary, and the result of character recognition of a character pattern to be subjected to character recognition is obtained. The hash value of the candidate character is calculated based on the candidate character to be obtained, and among all the words searched based on the code of the search key, the hash value of all the searched words is equal to the hash value of the candidate character. Is searched for a word that matches the candidate character, and if there is a word that matches the candidate character, the candidate character is used as the recognition result. A method for searching a character recognition dictionary.
JP05286113A 1993-10-20 1993-10-20 Method of constructing and retrieving character recognition dictionary Expired - Fee Related JP3115459B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP05286113A JP3115459B2 (en) 1993-10-20 1993-10-20 Method of constructing and retrieving character recognition dictionary

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP05286113A JP3115459B2 (en) 1993-10-20 1993-10-20 Method of constructing and retrieving character recognition dictionary

Publications (2)

Publication Number Publication Date
JPH07121665A JPH07121665A (en) 1995-05-12
JP3115459B2 true JP3115459B2 (en) 2000-12-04

Family

ID=17700106

Family Applications (1)

Application Number Title Priority Date Filing Date
JP05286113A Expired - Fee Related JP3115459B2 (en) 1993-10-20 1993-10-20 Method of constructing and retrieving character recognition dictionary

Country Status (1)

Country Link
JP (1) JP3115459B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH077559A (en) * 1993-06-14 1995-01-10 Chuo Denshi Kk One-action dial notifying device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006172135A (en) * 2004-12-15 2006-06-29 Canon Inc Information processor, information processing method, program and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
A.V.エイホ 外2名,"情報処理シリーズ11データ構造とアルゴリズム"初版,株式会社培風館,1987年3月10日,p106−p112及びp331−336

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH077559A (en) * 1993-06-14 1995-01-10 Chuo Denshi Kk One-action dial notifying device

Also Published As

Publication number Publication date
JPH07121665A (en) 1995-05-12

Similar Documents

Publication Publication Date Title
EP0510634B1 (en) Data base retrieval system
US7016896B2 (en) Pattern search method, pattern search apparatus and computer program therefor, and storage medium thereof
JP2607818B2 (en) Method and apparatus for determining whether a record is stored in a computer system
JP3077765B2 (en) System and method for reducing search range of lexical dictionary
US5542090A (en) Text retrieval method and system using signature of nearby words
US5982929A (en) Pattern recognition method and system
US6173252B1 (en) Apparatus and methods for Chinese error check by means of dynamic programming and weighted classes
US8095526B2 (en) Efficient retrieval of variable-length character string data
US6978044B2 (en) Pattern string matching apparatus and pattern string matching method
JP3258063B2 (en) Database search system and method
CN111782892B (en) Similar character recognition method, device, apparatus and storage medium based on prefix tree
US20030126138A1 (en) Computer-implemented column mapping system and method
JP3115459B2 (en) Method of constructing and retrieving character recognition dictionary
JP2681663B2 (en) Japanese sentence correction candidate character extraction method
JPH06325091A (en) Similarity evaluation type data base retrieval device
JP3259781B2 (en) Database search system and database search method
JP3288063B2 (en) Variable length data storage and reference system
JP2827066B2 (en) Post-processing method for character recognition of documents with mixed digit strings
JP3241854B2 (en) Automatic word spelling correction device
JPH05181913A (en) Compression and decoding system for ascending-order integer string data
JPH05346974A (en) Character recognizing device
JP3100786B2 (en) Character recognition post-processing method
JPH0795337B2 (en) Word recognition method
JPH06274701A (en) Word collating device
JPH0757059A (en) Character recognition device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees