JP2654022B2 - Dictionary search method - Google Patents
Dictionary search methodInfo
- Publication number
- JP2654022B2 JP2654022B2 JP62170510A JP17051087A JP2654022B2 JP 2654022 B2 JP2654022 B2 JP 2654022B2 JP 62170510 A JP62170510 A JP 62170510A JP 17051087 A JP17051087 A JP 17051087A JP 2654022 B2 JP2654022 B2 JP 2654022B2
- Authority
- JP
- Japan
- Prior art keywords
- dictionary
- code
- matching
- register
- address
- 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
Links
Landscapes
- Character Discrimination (AREA)
Description
【発明の詳細な説明】 〔技術分野〕 本発明は、記号列を登録した辞書から未知記号列と一
致した記号列を探索する目的に適用される辞書検索方法
に関し、特にパターン認識装置における認識辞書の検索
などに好適な辞書検索方法に関する。Description: TECHNICAL FIELD The present invention relates to a dictionary search method applied for the purpose of searching for a symbol string that matches an unknown symbol string from a dictionary in which symbol strings are registered, and more particularly, to a recognition dictionary in a pattern recognition device. The present invention relates to a dictionary search method suitable for searching for a dictionary.
文字などのパターンを認識する装置においては、各種
パターンの特徴ベクトル(特徴列)を登録した辞書を備
えており、入力パターンから抽出した特徴ベクトル(未
知特徴列)と一致する特徴ベクトルを辞書から検索する
ことにより入力パターンの候補パターンを決定する。An apparatus for recognizing patterns such as characters is provided with a dictionary in which feature vectors (feature strings) of various patterns are registered, and a dictionary is searched for a feature vector that matches a feature vector (unknown feature string) extracted from an input pattern. Thus, a candidate pattern of the input pattern is determined.
ところで、このような辞書検索における特徴ベクトル
相互のマッチングにおいては、ノイズやパターン変形な
どによる影響のため、特徴ベクトルの全要素の対応関係
を一義的に決定して要素相互を比較してマッチングの一
致、不一致(成立、不成立)を判定すると、認識率が低
下する。この対策として、辞書の特徴ベクトルとのマッ
チングにおいて、入力パターンの特徴ベクトルの一部の
要素を無視して一致、不一致の判定をしたり、あるいは
比較する要素の対応関係の手順を変化させたりすると有
効である。By the way, in the matching of feature vectors in such a dictionary search, due to the influence of noise, pattern deformation, etc., the correspondence of all the elements of the feature vector is uniquely determined, and the elements are compared with each other. When it is determined that they do not match (established or unestablished), the recognition rate decreases. As a countermeasure, when matching with the dictionary feature vector, if some elements of the feature vector of the input pattern are ignored, matching or non-matching is determined, or the procedure of the correspondence relationship of the compared elements is changed. It is valid.
しかし、このようなマッチング方法の制御を行って
も、一種類のパターンに対して一つの特徴ベクトルだけ
を辞書に登録した場合、パターンの変形に対応しきれな
いため、パターン変形に十分対応可能とするには、一種
類のパターンに対して複数の特徴ベクトルを辞書に登録
する必要がある。さらに、複数の候補より一つを選択す
る場合(例えば入力パターンがαまたはβであるか、あ
るいは、どちらでもないかを判定する場合)、複数の候
補のそれぞれの特徴ベクトルを辞書に登録する必要があ
る。この場合、マッチング方法の制御の他に、ある辞書
の特徴ベクトルで一致がとれた後の辞書検索の流れを適
切に制御するための工夫が必要ある。However, even if such a control of the matching method is performed, if only one feature vector is registered in the dictionary for one type of pattern, the pattern cannot be fully deformed. To do so, it is necessary to register a plurality of feature vectors for a single pattern in a dictionary. Furthermore, when selecting one from a plurality of candidates (for example, determining whether the input pattern is α or β or neither), it is necessary to register each feature vector of the plurality of candidates in the dictionary. There is. In this case, in addition to the control of the matching method, it is necessary to devise a method for appropriately controlling the flow of the dictionary search after a match is obtained with the feature vector of a certain dictionary.
しかし、従来、上記のマッチング方法や辞書検索の流
れの制御を状態遷移図を用いて行っており(例えば電子
通信学会技術研究報告PRL85−35、加藤「ストローク構
造解析法における辞書の自動作成法」)、その制御のた
めの記述が著しく複雑であり、また制御処理が繁雑にな
るという問題があった。However, conventionally, the above matching method and control of the dictionary search flow are performed using a state transition diagram (for example, IEICE Technical Report PRL85-35, Kato "Automatic dictionary creation method in stroke structure analysis method"). ), There is a problem that the description for the control is extremely complicated and the control processing becomes complicated.
本発明の目的は、パターン認識用辞書のような記号列
の辞書の検索において、マッチング方法および辞書検索
の流れを簡単に制御するようにした辞書検索方法を提供
することにある。SUMMARY OF THE INVENTION It is an object of the present invention to provide a dictionary search method that easily controls a matching method and a dictionary search flow in a search for a symbol string dictionary such as a pattern recognition dictionary.
本発明は、辞書に登録された各辞書記号列に制御情報
を付加しておき、辞書記号列と未知記号列とのマッチン
グの方法を当該辞書記号列に付加された制御情報に従っ
て制御するとゝもに、当該辞書記号列と当該未知記号列
とのマッチングの結果が一致となった場合におけるその
後の辞書検索の流れを当該辞書記号列に付加された制御
情報に従って制御するものである。According to the present invention, control information is added to each dictionary symbol string registered in the dictionary, and a matching method between the dictionary symbol string and the unknown symbol string is controlled according to the control information added to the dictionary symbol string. Then, when the result of matching between the dictionary symbol string and the unknown symbol string matches, the flow of the subsequent dictionary search is controlled according to the control information added to the dictionary symbol string.
以下、本発明の一実施例について図面により説明す
る。Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
第1図は本発明の一実施例の機能ブロック図を示す。
第1図において、辞書メモリ100には例えばパターンの
特徴ベクトルなどの記号列が辞書記号列(以下、辞書コ
ード列)として予め格納されている。入力パターンの特
徴ベクトルなどの未知記号列(以下、未知コード列)は
入力レジスタ102に入力し、辞書検索の結果は出力レジ
スタ104に出力する。検索制御部106は辞書メモリ100の
アクセスや辞書検索処理全体の制御などを行うものであ
り、その制御などに関連してレジスタ群108を備えてい
る。このレジスタ群108は、CODE,AN,BN,JADR,CN,MODE,F
LG,RLTの各レジスタからなっている。FIG. 1 shows a functional block diagram of one embodiment of the present invention.
In FIG. 1, a symbol string such as a pattern feature vector is stored in the dictionary memory 100 in advance as a dictionary symbol string (hereinafter, a dictionary code string). An unknown symbol string (hereinafter, unknown code string) such as a feature vector of an input pattern is input to an input register 102, and a dictionary search result is output to an output register 104. The search control unit 106 performs access to the dictionary memory 100 and controls the entire dictionary search process, and includes a register group 108 in association with the control and the like. This register group 108 includes CODE, AN, BN, JADR, CN, MODE, F
It consists of LG and RLT registers.
110は辞書コード列と未知コード列とのマッチング処
理を実行するマッチング処理部である。未知コード列お
よび辞書コード列は検索制御部106によってAレジスタ1
12およびBレジスタ114にそれぞれ設定される。ADR1カ
ウンタ116はAレジスタ112の読出しアドレスを指定する
アドレスカウンタであり、ADR2カウンタ118はBレジス
タ114の読出しアドレスを指定するアドレスカウンタで
ある。比較回路120はA,Bレジスタから出力されるコード
の一致、不一致を比較し、比較結果をマッチング制御部
122に入力する。このマッチング制御部122はマッチング
処理部110の動作を制御するものであり、マッチング手
順の制御に関連したCNTカウンタ124を備えており、また
レジスタ群108中の特定のレジスタ(フラグ)をアクセ
ス可能である。Bレジスタ114の出力コードはマッチン
グ制御部122にも入力する。ADR1カウンタ116およびADR2
カウンタ118は、マッチング制御部122により制御され
る。110 is a matching processing unit that executes a matching process between the dictionary code sequence and the unknown code sequence. The unknown code string and the dictionary code string are stored in the A register 1 by the search control unit 106.
12 and B register 114, respectively. The ADR1 counter 116 is an address counter that specifies the read address of the A register 112, and the ADR2 counter 118 is the address counter that specifies the read address of the B register 114. The comparison circuit 120 compares the codes output from the A and B registers for coincidence and non-coincidence, and compares the comparison result with the matching control unit.
Enter 122. The matching control unit 122 controls the operation of the matching processing unit 110, includes a CNT counter 124 related to control of the matching procedure, and can access a specific register (flag) in the register group 108. is there. The output code of the B register 114 is also input to the matching control unit 122. ADR1 counter 116 and ADR2
The counter 118 is controlled by the matching control unit 122.
第2図は辞書検索処理の全体的な流れを示す。ステッ
プ203はマッチング処理部110による処理ステップであ
り、残りの各ステップは検索制御部106のステップであ
る。辞書検索処理動作の詳細については後述する。FIG. 2 shows the overall flow of the dictionary search process. Step 203 is a processing step performed by the matching processing unit 110, and the remaining steps are steps of the search control unit 106. Details of the dictionary search processing operation will be described later.
第3図に辞書の構造を例示する。図示のように辞書の
構成単位は、可変長の辞書コード列に文字コード(1バ
イト)、モード識別子(1バイト)および飛び先番地
(1バイト)、さらにコード数(1バイト)からなる。
コード数は辞書コード列のバイト数を示す。FIG. 3 illustrates the structure of the dictionary. As shown, the constituent units of the dictionary include a variable-length dictionary code string, a character code (1 byte), a mode identifier (1 byte), a jump address (1 byte), and the number of codes (1 byte).
The number of codes indicates the number of bytes of the dictionary code string.
モード識別子は、マッチング方法(部分対応、全体対
応)およびマッチングで一致した場合のその後の辞書検
索の流れの制御方法を指定するための情報である。飛び
先番地は、モード識別子によってジャンプが指定された
辞書コード列のマッチングが一致(成立)した場合に、
次にマッチングの対象となる進むべき辞書構成単位の先
頭番地を指定する。また、辞書コード列中には、マッチ
ングにおいて比較する記号の対応関係の手順を制御する
ための特殊コードが必要に応じて挿入される。このよう
なモード識別子、飛び先番地および特殊コードが制御情
報として各辞書コード列に付加されているわけである。The mode identifier is information for designating a matching method (partial correspondence, whole correspondence) and a method of controlling a flow of a subsequent dictionary search when matching is performed. The jump address is determined when the matching of the dictionary code string to which the jump is specified by the mode identifier matches (establishes).
Next, the start address of a dictionary constituent unit to be advanced to be matched is specified. Also, a special code for controlling the procedure of the correspondence relation of the symbols to be compared in the matching is inserted as needed in the dictionary code string. Such a mode identifier, a jump address and a special code are added to each dictionary code string as control information.
なお、辞書の最後にはターミネータとしてコード「F
F」が置かれる。At the end of the dictionary, the code "F
F "is placed.
このような構造の辞書の具体例を第4図に示す。か
らはそれぞれ辞書構成単位である。文字コードの0は
リジェクトコードである。各辞書コード列中のコード0
は制御情報の一部としての特殊コードである。なお、辞
書コード列中の特殊コード以外のコードは、具体的には
文字パターンのストロークの方向コードなどである。FIG. 4 shows a specific example of a dictionary having such a structure. To are dictionary constituent units. The character code 0 is a reject code. Code 0 in each dictionary code string
Is a special code as a part of the control information. The codes other than the special codes in the dictionary code string are, for example, stroke direction codes of a character pattern.
こゝで識別子(一般表面は「b1,b2」)とモードの関
係を説明する。Here, the relationship between identifiers (general surfaces are “b1, b2”) and modes will be described.
の辞書構成単位のように識別子が「00」に設定され
た辞書コード列については、「部分対応」のマッチング
が行われ、その結果が一致の場合に検索を終了し(辞書
から抜ける)、不一致の場合に直後に位置した辞書構成
単位()の辞書コード列とのマッチング処理に進む。For dictionary code strings whose identifiers are set to "00", such as the dictionary constituent units of ".", Matching is performed for "partial correspondence", and if the result is a match, the search ends (exits from the dictionary), and In the case of, the process proceeds to the matching process with the dictionary code string of the dictionary constituent unit () located immediately after.
の辞書構成単位のように識別子が「01」に設定され
た辞書コード列については、「部分対応」のマッチング
がなされる。そして、マッチングの結果が一致の場合に
は飛び先番地により指定された辞書構成単位()の辞
書コード列のマッチング処理に進む(ジャンプする)
が、結果が不一致の場合に直後の辞書構成単位()の
辞書コード列のマッチング処理に進む。For a dictionary code string whose identifier is set to “01” as in the dictionary constituent unit of “1”, “partial correspondence” is matched. If the result of the matching is a match, the process proceeds to the matching process of the dictionary code string of the dictionary constituent unit () specified by the jump address (jump).
However, if the result does not match, the process proceeds to the dictionary code string matching process of the dictionary constituent unit () immediately after.
の辞書構成単位のように識別子が「10」に設定され
た辞書コード列については、マッチングは「全体対応」
でなされ、その結果が一致の場合に辞書から抜ける。マ
ッチングの結果が不一致の場合に直後の辞書構成単位
()の辞書コード列とのマッチング処理に進む。For dictionary code strings whose identifiers are set to "10", such as the dictionary constituent unit of
And exit from the dictionary if the result is a match. When the result of the matching does not match, the process proceeds to the matching process with the dictionary code string of the immediately following dictionary constituent unit ().
の辞書構成単位のように識別子が「11」に設定され
た辞書コード列については、「全体対応」のマッチング
が行われ、その結果が一致の場合に飛び先番地で指定さ
れた辞書構成単位()の辞書コード列とのマッチング
処理に進み(ジャンプし)、不一致の場合には直後の辞
書構成単位()の辞書コード列のマッチング処理に進
む。For the dictionary code string whose identifier is set to “11” as in the dictionary constituent unit of “1”, matching of “overall correspondence” is performed, and if the result is a match, the dictionary constituent unit specified by the jump destination address ( )) (Jumping) to the matching process with the dictionary code string, and in the case of a non-match, the processing proceeds to the matching processing of the dictionary code string of the immediately following dictionary constituent unit ().
第6図はマッチング処理部110の動作のフローチャー
トであり、第7図は第6図中のステップ316の詳細フロ
ーチャートである。これらのフローチャートを参照して
マッチング処理動作を説明する。FIG. 6 is a flowchart of the operation of the matching processing unit 110, and FIG. 7 is a detailed flowchart of step 316 in FIG. The matching processing operation will be described with reference to these flowcharts.
マッチング制御部122は検索制御部106により起動され
ると、初期設定としてCNTカウンタ124に−1を設定する
(ステップ301)。When activated by the search control unit 106, the matching control unit 122 sets -1 to the CNT counter 124 as an initial setting (step 301).
ステップ302はステップ303以降の実際のマッチング処
理のための初期設定ステップであるが、このステップで
ADR1カウンタ116にCNTカウンタ124の値を設定し、ADR2
カウンタ118に0を設定し、またFLGレジスタ(フラグ)
を1にセットする。Step 302 is an initial setting step for the actual matching process after step 303.
Set the value of CNT counter 124 to ADR1 counter 116, and
Set 0 to counter 118, and FLG register (flag)
Is set to 1.
次にマッチング制御部122はFLGレジスタがリセット状
態(設定値が0)であるか調べ(ステップ303)、リセ
ット状態であればステップ306にジャンプする。FLGレジ
スタがセット状態ならば、Bレジスタ114の出力コード
(ADR2カウンタ188により指定されたアドレスから読出
された辞書コード列のコード)が0すなわち特殊コード
であるかを調べ(ステップ304)、特殊コードでなけれ
ばステップ306にジャンプする。特殊コードであると、F
LGレジスタを0にリセットするとゝもにADR2カウンタ11
8を+1し(ステップ305)、ステップ303に戻る。Next, the matching control unit 122 checks whether the FLG register is in a reset state (set value is 0) (step 303). If the FLG register is in a reset state, the process jumps to step 306. If the FLG register is set, it is checked whether the output code of the B register 114 (code of the dictionary code string read from the address specified by the ADR2 counter 188) is 0, that is, a special code (step 304). Otherwise, jump to step 306. If it is a special code, F
When the LG register is reset to 0, the ADR2 counter 11
8 is incremented by 1 (step 305), and the process returns to step 303.
ステップ306において、ADR1カウンタ116を+1してA
レジスタ112の次のアドレスからコードを読出し、比較
回路120で比較が一致したか調べる(ステップ307)。In step 306, ADR1 counter 116 is incremented by 1 to
The code is read from the next address of the register 112, and the comparison circuit 120 checks whether the comparisons match (step 307).
一致がとれた場合、ADR2カウンタ118を+1してBレ
ジスタ114の次のアドレスからコードを読出し、またFLG
レジスタをセットする(ステップ308)。そして、ADR2
カウンタ118の値がBNレジスタの値以下であるか調べる
(ステップ309)。なお、BNレジスタには、検索制御部1
06により辞書コード列のコード数が予め設定されてい
る。If a match is found, the code is read from the next address of the B register 114 by incrementing the ADR2 counter 118 by one, and the FLG
A register is set (step 308). And ADR2
It is checked whether the value of the counter 118 is equal to or less than the value of the BN register (step 309). The search control unit 1 is stored in the BN register.
06 sets the number of codes in the dictionary code string in advance.
ADR2カウンタ値≦BNレジスタ値であれば、Bレジスタ
114の出力コードが特殊コードすなわち0であるかを調
べ(ステップ310)、特殊コードでなければステップ306
に戻りADR1カウンタ116を+1してAレジスタ112の次の
アドレスのコードを読出す。ステップ310においてBレ
ジスタ114の出力コードを0と判定した場合、ADR2カウ
ンタ118を+1してBレジスタ144の次のアドレスのコー
ドを読出し、またFLGレジスタをリセット(ステップ31
1)、ステップ306に戻る。B register if ADR2 counter value ≤ BN register value
It is checked whether the output code of 114 is a special code, that is, 0 (step 310).
The ADR1 counter 116 is incremented by 1 to read the code at the next address of the A register 112. If it is determined in step 310 that the output code of the B register 114 is 0, the ADR2 counter 118 is incremented by 1 to read the code at the next address of the B register 144, and the FLG register is reset (step 31).
1) Return to step 306.
ステップ309の判定条件が不成立の場合、ステップ316
に進む。このステップ316の詳細を第7図に示す。ま
ず、MODEレジスタのb1部分の値が0であるかを調べる
(ステップ401)。なお、MODEレジスタには検索制御部1
06に識別子の情報が予め設定されている。b1=0であれ
ば、すなわち当該辞書コード列が「部分対応」のマッチ
ングを指定されていれば、マッチング制御部122はマッ
チング結果を一致と判定し、結果のフラグとしてのRLT
レジスタを1にセットする(ステップ405)。If the judgment condition of step 309 is not satisfied, step 316
Proceed to. The details of this step 316 are shown in FIG. First, it is checked whether the value of the b1 part of the MODE register is 0 (step 401). The MODE register has a search control unit 1
The identifier information is set in 06 in advance. If b1 = 0, that is, if the dictionary code string is specified as “partial correspondence” matching, the matching control unit 122 determines that the matching result is a match, and RLT as a result flag
The register is set to 1 (step 405).
b1≠0の場合(当該辞書コード列が「全体対応」のマ
ッチングを指定されている)、さらにADR1カウンタ116
の値がANレジスタの値と一致するか調べる(ステップ40
2)。なお、ANレジスタには、検索制御部106により未知
コード列のコード数が予め設定されている。If b1 ≠ 0 (the dictionary code string is specified to match “all”), the ADR1 counter 116
Is checked to see if it matches the value of the AN register (step 40
2). In the AN register, the number of codes in the unknown code string is set in advance by the search control unit 106.
ステップ402の比較が一致した場合、すなわち未知コ
ード列の最後のコードまでマッチングが進んだ場合は、
マッチングの結果を不一致と判定してRLTレジスタに1
を設定する(ステップ404)。そうでない場合、マッチ
ングの結果を不一致と判定してRLTレジスタに0を設定
する(ステップ403)。If the comparison in step 402 matches, that is, if the matching has progressed to the last code in the unknown code sequence,
The result of the matching is determined to be unmatched, and 1 is stored in the RLT register.
Is set (step 404). Otherwise, the result of the matching is determined to be non-matching and 0 is set in the RLT register (step 403).
第6図は戻って説明する。ステップ307によってコー
ドが不一致と判定した場合、FLGレジスタがセット状態
であるかを調べる(ステップ312)。リセット状態であ
ればステップ306に戻り、Aレジスタ112の次のアドレス
のコードを読出すが、セット状態の場合はMODEレジスタ
のb1部分の値が0であるか調べる(ステップ313)。b1
≠0の場合、すなわち当該辞書コード列が「全体対応」
のマッチングを指定されている場合、マッチングは不一
致と判定し、RLTレジスタに0を設定する(ステップ31
5)。b1=0の場合は、CNTカウンタ124を+1し(ステ
ップ314)、ステップ302に戻りマッチングをし直す。こ
の場合、前回のマッチングにおけるAレジスタ112の最
初のアドレスの次のアドレスのコードからマッチング処
理が行われることになる。FIG. 6 will be described again. If it is determined in step 307 that the codes do not match, it is checked whether the FLG register is set (step 312). If it is in the reset state, the process returns to step 306 to read the code at the next address of the A register 112. If it is in the set state, it is checked whether the value of the b1 portion of the MODE register is 0 (step 313). b1
In the case of $ 0, that is, the dictionary code string is "whole correspondence"
If the matching is specified, it is determined that the matching does not match, and 0 is set in the RLT register (step 31).
Five). If b1 = 0, the CNT counter 124 is incremented by 1 (step 314), and the process returns to step 302 to perform matching again. In this case, the matching process is performed from the code of the address next to the first address of the A register 112 in the previous matching.
なお、ステップ315,403,404,405に進んだ場合、マッ
チング制御部122はマッチング処理の終了を検索制御部1
06に通知する。If the process has proceeded to steps 315, 403, 404, and 405, the matching control unit 122 notifies the search control unit 1 of the end of the matching process.
Notify 06.
以上説明したマッチング処理について、具体的なコー
ド列を用いて説明する。The matching process described above will be described using a specific code string.
まず「部分対応」のマッチング動作について説明す
る。First, the “partial correspondence” matching operation will be described.
検索制御部106の制御により、第8図に示すコード列
が未知コード列として、図示のようなアドレス関係にて
Aレジスタ112に設定され、また、第9図(イ)に示す
コード列が辞書コード列として図示のアドレス関係にて
Bレジスタ114に設定されたとする。この場合のマッチ
ング処理におけるアドレス、コード、フラグの遷移を第
10図に示す。Under the control of the search control unit 106, the code sequence shown in FIG. 8 is set as an unknown code sequence in the A register 112 with the address relationship as shown, and the code sequence shown in FIG. It is assumed that a code string is set in the B register 114 based on the illustrated address relationship. The transition of the address, code, and flag in the matching process in this case is
Figure 10 shows.
検索制御部106によってレジスタ群108中のMODEレジス
タはb1=0に設定される。The search control unit 106 sets the MODE register in the register group 108 to b1 = 0.
マッチング制御部122は起動をかけられると、FLGレジ
スタを1にセットし、Bレジスタ114のアドレス0のコ
ードを読出すが、このコードは特殊コード0でないた
め、Aレジスタ112のアドレス0のコードを読出す(第1
0図のステップ1)。A,Bレジスタ112,114から読出され
たコードは両方とも4であり、一致するため、ADR2カウ
ンタ118を+1してBアドレス114のアドレス1のコード
を読出す(ステップ2)。When activated, the matching control unit 122 sets the FLG register to 1 and reads the code at address 0 of the B register 114. However, since this code is not a special code 0, the code at address 0 of the A register 112 is read. Read (1st
Step 1 in FIG. Since the codes read from the A and B registers 112 and 114 are both 4 and coincide, the ADR2 counter 118 is incremented by 1 to read the code of the address 1 of the B address 114 (step 2).
このコードは特殊コード0であるから、マッチング制
御部122はFLGレジスタを0にリセットするとゝもに、AD
R2カウンタ118を+1してBレジスタ114のアドレス3の
コードを読出す(ステップ3)。Since this code is a special code 0, the matching control unit 122 resets the FLG register to 0, and
The code of the address 3 of the B register 114 is read out by incrementing the R2 counter 118 by 1 (step 3).
このコードは2で一致せず、FLGレジスタもリセット
状態であるから、ADR1カウンタ116を+1しAレジスタ1
12のアドレス1のコードを読出す(ステップ4)。これ
も不一致であり、FDG=0であるので、ADR1カウンタ116
を+1してアドレス2のコードを読出す(ステップ
5)。Since this code does not match at 2 and the FLG register is also in the reset state, the ADR1 counter 116 is incremented by 1 and the A register 1
The code of address 12 is read (step 4). This is also a mismatch, and since FDG = 0, the ADR1 counter 116
Is incremented by 1, and the code at address 2 is read (step 5).
このコードは2で、辞書のコード列のコードと一致す
るので、FLGレジスタをセットするとゝもに、ADR2カウ
ンタ118を+1しBレジスタ114から次のコードを読出す
(ステップ6)。このコードは0であるので、FLGレジ
スタをリセットし、またADR2カウンタ118を+1して次
のコードを読出す(ステップ7)。Since this code is 2, which matches the code in the code string in the dictionary, the ADR2 counter 118 is incremented by 1 when the FLG register is set, and the next code is read from the B register 114 (step 6). Since this code is 0, the FLG register is reset, and the ADR2 counter 118 is incremented by 1 to read the next code (step 7).
このコードは0でないので、ADR1カウンタ116を+1
してAレジスタ112のアドレス3のコードを読出す(ス
テップ8)。このコードは1で、Bレジスタ114の出力
コード4とは一致せず、またFLG=0であるので、ADR1
カウンタ116を+1しAレジスタ112のアドレス4のコー
ドを読出す(ステップ9)。このコードは4で一致がと
れるので、FLGレジスタをセットする。こゝで、この時
のADR2カウンタ118は辞書コード列の最終コードに対応
したアドレスまで増加しているので、マッチング制御部
124は一致がとれたと判定し、マッチング結果の判定結
果のフラグとしてのRLTレジスタに1を設定する。Since this code is not 0, the ADR1 counter 116 is incremented by 1
Then, the code at the address 3 of the A register 112 is read (step 8). Since this code is 1 and does not match the output code 4 of the B register 114 and FLG = 0, ADR1
The counter 116 is incremented by one, and the code at address 4 of the A register 112 is read (step 9). This code matches at 4, so the FLG register is set. At this time, since the ADR2 counter 118 at this time has increased to the address corresponding to the last code of the dictionary code string, the matching control unit
Reference numeral 124 determines that a match has been obtained, and sets 1 to the RLT register as a flag of the determination result of the matching result.
このように制御コード0によって比較するコードの対
応関係の手順が制御されながらマッチングが実行される
が、こゝではマッチング方法は「部分対応」であるた
め、未知コード列のアドレス1,3のコードが無視され、
アドレス0,2,4のコードが辞書コード列のアドレス0,2,4
のコードと順次一致することにより、マッチングは一致
ないし成立した(対応関係がとれた)と判定される。As described above, the matching is performed while the procedure of the correspondence relation of the codes to be compared is controlled by the control code 0. In this case, since the matching method is “partial correspondence”, the codes of the addresses 1 and 3 of the unknown code string are used. Is ignored,
The code of address 0,2,4 is the address 0,2,4 of the dictionary code string
Are determined to be matched or established (correspondence is established).
第8図の未知コード列と第9図(ロ)の辞書コード列
とのマッチング(「部分対応」)の場合、前記の例と同
様の動作によりアドレス、コード、フラグの遷移は第11
図に示すようになるが、ステップ7でコードの対応関係
がとれなくなり、第6図のステップ315に進んで結果は
不一致となる。In the case of matching (“partial correspondence”) between the unknown code string in FIG. 8 and the dictionary code string in FIG. 9 (b), the transition of the address, code, and flag is performed by the same operation as in the above example.
As shown in the figure, the correspondence between the codes cannot be established in step 7, and the process proceeds to step 315 in FIG. 6, and the result does not match.
次に、第8図の未知コード列と第9図(ハ)の辞書コ
ード列とマッチング(「部分対応」)を説明する。この
場合、アドレス、コード、フラグの遷移は第12図に示す
ようになる。Next, the matching (“partial correspondence”) with the unknown code string in FIG. 8 and the dictionary code string in FIG. 9C will be described. In this case, the transition of the address, code, and flag is as shown in FIG.
最初に辞書コード列のアドレス0のコードが読出され
る(ステップ1)が、このコードは0すなわち特殊コー
ドであるから、第6図のステップ305の処理に進むた
め、FLGレジスタがリセットされるとゝもにADR2カウン
タ118が+1されて辞書コード列のアドレス1のコード
が読出され、こゝから未知コード列との比較が始まる
(ステップ2)。First, the code at address 0 in the dictionary code string is read (step 1). Since this code is 0, that is, a special code, the process proceeds to step 305 in FIG. {Circle around (1)}, the ADR2 counter 118 is incremented by 1 to read the code at the address 1 of the dictionary code string, and the comparison with the unknown code string starts from this (step 2).
マッチング処理が進み、ステップ10でコードの比較が
不一致となり、その時にFLGレジスタがセット状態であ
るため、第6図のステップ313に進む。こゝではb1=0
(「部分対応」)であるから、ステップ314を経由して
ステップ302に処理が戻る。したがって、第12図のステ
ップ11により2回目のマッチングが開始する。たゞし、
未知コード列のアドレス0のコードはマッチングから除
外され、アドレス1のコード以降を対象としてマッチン
グが行われる。The matching process proceeds, and the code comparison becomes inconsistent in step 10, and the FLG register is set at that time. Therefore, the process proceeds to step 313 in FIG. Here b1 = 0
(“Partial correspondence”), the process returns to step 302 via step 314. Therefore, the second matching starts in step 11 of FIG. A lot
The code at the address 0 of the unknown code string is excluded from the matching, and the matching is performed for the code after the address 1.
マッチング処理が進み、ステップ7で未知コード列の
最終コードまで一致がとれると、第6図のステップ308
を経てステップ309に進み、こゝからステップ316に入
り、最終的に一致と判定される。The matching process proceeds, and if a match is obtained up to the last code of the unknown code string in step 7, step 308 in FIG.
Then, the process proceeds to step 309, from which the process proceeds to step 316, where it is finally determined that they match.
なお、3回目のマッチングを行う場合、未知コード列
のアドレス0,1のコードは無視され、アドレス2以降の
コードが対象となる。When the third matching is performed, the codes at addresses 0 and 1 in the unknown code string are ignored, and the codes after address 2 are targeted.
次に「全体対応」のマッチング処理について説明す
る。「全体対応」のマッチングでは、辞書コード列がす
べて未知コード列に存在するとき、未知コード列の最終
コードまでマッチングが進んだかどうかを判定し(第7
図のステップ402)、最後まで進んだならばマッチング
が一致したと判定するが、最後まで進んでいなければ不
一致と判定する。辞書コード列中の特殊コード0の役目
は「部分対応」の場合と同様である。Next, the matching process of “overall correspondence” will be described. In the matching of “whole correspondence”, when all dictionary code strings are present in the unknown code string, it is determined whether the matching has progressed to the last code of the unknown code string (No. 7).
In step 402 in the figure, if the process has reached the end, it is determined that matching has been matched, but if not, the process determines that there is no match. The role of the special code 0 in the dictionary code sequence is the same as in the case of “partial correspondence”.
例えば第8図に示した未知コード列と第13図(イ)の
辞書コード列とのマッチングの場合、未知コード列のア
ドレス1のコードで辞書コード列のすべてと一致がと
れ、未知コード列の最終コードまでマッチングが進まな
いため、第7図のステップ402からステップ404に進み、
最終的に不一致と判定される。For example, in the case of matching between the unknown code string shown in FIG. 8 and the dictionary code string shown in FIG. 13A, the code at address 1 of the unknown code string matches all the dictionary code strings, and the unknown code string Since the matching does not proceed to the final code, the process proceeds from step 402 to step 404 in FIG.
Finally, it is determined that they do not match.
第8図の未知コード列と第13図(ロ)の辞書コード列
のマッチングの場合と同様であり、不一致と判定され
る。This is the same as the matching between the unknown code string in FIG. 8 and the dictionary code string in FIG. 13 (b), and it is determined that they do not match.
第8図の未知コード列と第13図(ニ)の辞書コード列
とのマッチングの場合、未知コード列の最終アドレス7
で辞書コード列のコード(3,4,1)のすべてについて一
致がとれるため、マッチングは一致と判定される。In the case of matching between the unknown code string in FIG. 8 and the dictionary code string in FIG.
Can be matched for all of the codes (3, 4, 1) in the dictionary code string, so that the matching is determined to be a match.
こゝで、コード列の具体例とマッチングについて説明
する。ストローク特徴抽出におけるパターン輪郭部の追
跡点の移動方向に対応して、第14図(イ)に示すような
方向コード1〜4を定義する。そして、例えば第14図
(ロ)の数字「3」のパターンを同図(ホ)のような辞
書コード列(「全体対応」)として予め記述しておく。
この場合、第14図(ハ)に示す変形した数字「3」のパ
ターンから同図(ハ)のような未知コード列が抽出され
るが、これを前述の方法により同図(ニ)の辞書コード
列とマッチングすることにより、対応関係をとることが
できる。Here, a specific example of the code string and matching will be described. Direction codes 1 to 4 as shown in FIG. 14A are defined corresponding to the moving directions of the tracking points of the pattern contour portion in the stroke feature extraction. Then, for example, the pattern of the numeral “3” in FIG. 14 (b) is described in advance as a dictionary code string (“all correspondence”) as in FIG. 14 (e).
In this case, an unknown code string as shown in FIG. 14 (c) is extracted from the deformed pattern of the numeral “3” shown in FIG. 14 (c). By matching with the code string, a correspondence can be obtained.
次に、辞書の内容を第4図に示す通りとし、入力レジ
スタ102を介して第5図に示すような未知コード列が入
力された場合の辞書検索動作について、第2図を参照し
て説明する。Next, the dictionary search operation when the contents of the dictionary are as shown in FIG. 4 and an unknown code string as shown in FIG. 5 is input via the input register 102 will be described with reference to FIG. I do.
検索制御部106に入力された未知コード列をAレジス
タ112に設定するとゝもに、そのコード数をレジスタ群1
08中のANレジスタに設定する(ステップ200)。なお、
検索制御部106は辞書アクセス用のポインタを持ってお
り、この時点ではアドレス0に設定される。When the unknown code string input to the search control unit 106 is set in the A register 112, the number of codes is set to the register group 1
Set to the AN register in 08 (step 200). In addition,
The search control unit 106 has a dictionary access pointer, and is set to address 0 at this time.
次に検索制御部106はポインタが指定するアドレスの
1バイトがターミネータ「FF」であるか調べる。最初は
アドレス0の1バイト、すなわち辞書構成単位の文字
コードのバイトが調べられることになり、ターミネータ
ではないから、ステップ202に進む。Next, the search control unit 106 checks whether one byte of the address specified by the pointer is the terminator “FF”. At first, one byte of the address 0, that is, the byte of the character code of the dictionary constituent unit is checked. Since the byte is not a terminator, the process proceeds to step 202.
初めてこのステップ202に進んだ場合、検索制御部106
は辞書構成単位を読出し、その文字コード(α)をCO
DEレジスタに、識別子をMODEレジスタに、飛び先番地を
JADRレジスタに、コード数をBNレジスタに、また辞書コ
ード列をBレジスタ114に設定する。そして、ポインタ
を次の辞書構成単位の先頭アドレス(8)に更新する。
なお、辞書コード列は可変長であるため、その長さをコ
ード数によって認識し、またポインタを更新する。この
ような制御の後、検索制御部106はマッチング制御部122
を起動する。When the process proceeds to step 202 for the first time, the search control unit 106
Reads out the dictionary constituent units and converts the character code (α) to CO
The DE register, the identifier in the MODE register, and the destination address
The number of codes is set in the JADR register, the BN register is set, and the dictionary code string is set in the B register 114. Then, the pointer is updated to the start address (8) of the next dictionary constituent unit.
Since the dictionary code string has a variable length, the length is recognized based on the number of codes, and the pointer is updated. After such control, the search control unit 106 sets the matching control unit 122
Start
マッチング制御部122の制御により、A,B,レジスタ11
2,114内のコード列について前述のようなマッチング処
理が実行される(ステップ203)。最終的なマッチング
結果の判定結果が得られると、終了通知が検索制御部10
6に送出される。A, B, and register 11 are controlled by the matching control unit 122.
The matching process as described above is performed on the code strings in 2,114 (step 203). When a final matching result is obtained, an end notification is sent to the search control unit 10.
Sent to 6.
検査制御部106は終了通知を受けると、マッチング結
果のフラグであるRLTレジスタの値を調べる(ステップ2
04)。最初はの辞書コード列とのマッチングであり、
不一致となるためRLT=0である。したがって、検索制
御部106はステップ206に進み、ポインタが示すアドレス
の1バイト(辞書構成単位の先頭バイト)を参照し、
ステップ201の判定を行う。Upon receiving the end notification, the inspection control unit 106 checks the value of the RLT register, which is a flag of the matching result (step 2).
04). The first is the matching with the dictionary code string,
RLT = 0 because there is no match. Therefore, the search control unit 106 proceeds to step 206 and refers to one byte (the first byte of the dictionary constituent unit) of the address indicated by the pointer,
The determination in step 201 is performed.
この場合、ターミネータでないから、辞書構成単位
を読出して辞書コード列をBレジスタ114に設定し、そ
の他のバイトをレジスタ群108の対応したレジスタにそ
れぞれ設定し、マッチング制御部122を起動する(ステ
ップ202)。In this case, since it is not a terminator, the dictionary constituent unit is read, the dictionary code string is set in the B register 114, the other bytes are set in the corresponding registers of the register group 108, and the matching control unit 122 is started (step 202). ).
辞書構成単位のマッチングでは一致がとれるため、
検索制御部106はMODEレジスタの値をチェックする(ス
テップ208)。こゝではMODEレジスタの値(識別子)は0
1であるから、辞書構成単位の飛び先番地をポインタ
に設定し、アドレス24の1バイトすなわち構成単位の
先頭バイトを参照し(ステップ210)、ステップ201の判
定を行う。Because matching can be obtained by matching dictionary constituent units,
The search control unit 106 checks the value of the MODE register (Step 208). Here, the value (identifier) of the MODE register is 0
Since it is 1, the jump address of the dictionary constituent unit is set as the pointer, and one byte of the address 24, that is, the first byte of the constituent unit is referred to (step 210), and the judgment of step 201 is performed.
このバイトはターミネータではないから、ステップ20
2に進み、辞書構成単位の辞書コード列をBレジスタ1
14に設定し、その他のバイトをレジスタ群108に設定し
たのちマッチング制御部122を起動する。This byte is not a terminator, so step 20
Proceed to 2 to store the dictionary code string in the dictionary
After setting to 14 and other bytes to the register group 108, the matching control unit 122 is started.
この辞書コード列のマッチングは不一致になるため、
処理はステップ204,ステップ206,ステップ202と進み、
辞書構成単位の辞書コード列の未知コード列のマッチ
ングが実行される。このマッチングでは一致がとれ、RL
Tレジスタは1に設定されるため、ステップ208に進む。
こゝではMODEレジスタの値は00であるから、ステップ21
2に進む。このステップにおいて、検索制御部106はCODE
レジスタに設定されている文字コード(α)を出力レジ
スタ104に設定し辞書から抜ける(ステップ212)。すな
わち、当該辞書の検索は終了である。Since the matching of this dictionary code string does not match,
The processing proceeds to step 204, step 206, step 202,
The matching of the unknown code string of the dictionary code string of the dictionary constituent unit is executed. This match is a match and RL
Since the T register is set to 1, the process proceeds to step 208.
In this case, since the value of the MODE register is 00, step 21
Proceed to 2. In this step, the search control unit 106
The character code (α) set in the register is set in the output register 104 and exits from the dictionary (step 212). That is, the search of the dictionary is completed.
なお、もしの辞書コード列とのマッチングが不一致
の場合、ターミネータが参照される結果、ステップ214
に進み、リジェクトコードが出力レジスタ104に設定さ
れて辞書検索を終了する。If the matching with the dictionary code string does not match, as a result of referring to the terminator, step 214 is executed.
The reject code is set in the output register 104, and the dictionary search ends.
このように、辞書コード列に付加した制御情報に従っ
て辞書検索の流れを柔軟に制御することができ、その制
御は簡単であるとゝもに、制御のための記述も容易であ
る。As described above, the flow of the dictionary search can be flexibly controlled according to the control information added to the dictionary code string, and the control is simple and the description for the control is also easy.
なお、第1図のマッチング制御部、検査制御部などは
ハードウェアによって実現してもよいし、ソフトウェア
によって実現してもよい。In addition, the matching control unit, the inspection control unit, and the like in FIG. 1 may be realized by hardware or may be realized by software.
以上の説明から明らかなように、本発明によれば、辞
書に登録された各辞書記号列に制御情報を付加すること
により、辞書検索におけるマッチング方法および辞書検
索の流れを簡単に制御することができるため、パターン
変形に強いパターン認識などを実現する上で大きな効果
がある。As is apparent from the above description, according to the present invention, by adding control information to each dictionary symbol string registered in the dictionary, it is possible to easily control the matching method in the dictionary search and the flow of the dictionary search. Therefore, there is a great effect in realizing pattern recognition that is resistant to pattern deformation.
【図面の簡単な説明】 第1図は本発明の一実施例の機能ブロック図、第2図は
辞書検索動作のフローチャート、第3図は辞書構成の一
例を示す図、第4図は辞書の具体例を示す図、第5図は
未知コード列の一例を示す図、第6図はマッチング処理
のフローチャート、第7図は第6図中のステップ316の
詳細フローチャート、第8図はマッチング処理の説明の
ための未知コード列を示す図、第9図は「部分対応」の
マッチング処理の説明のための辞書コード列を示す図、
第10図ないし第12図はそれぞれ第8図の未知コード列と
第9図の各辞書コード列とのマッチング処理におけるア
ドレス、コード、フラグの遷移を示す図、第13図は「全
体対応」のマッチング処理の説明のための辞書コード列
を示す図、第14図は数字のパターンと辞書コード列およ
び未知コード列を対応付けて説明する図である。 100……辞書メモリ、102……入力レジスタ、 104……出力レジスタ、106……検索制御部、 108……レジスタ群、110……マッチング処理部、112…
…Aレジスタ、 114……Bレジスタ、116……ADR1カウンタ、118……ADR
2カウンタ、 120……比較回路、122……マッチング制御部。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a functional block diagram of one embodiment of the present invention, FIG. 2 is a flowchart of a dictionary search operation, FIG. 3 is a diagram showing an example of a dictionary configuration, and FIG. FIG. 5 shows a specific example, FIG. 5 shows an example of an unknown code string, FIG. 6 is a flowchart of a matching process, FIG. 7 is a detailed flowchart of step 316 in FIG. 6, and FIG. FIG. 9 is a diagram showing an unknown code sequence for explanation, FIG. 9 is a diagram showing a dictionary code sequence for explaining a “partial correspondence” matching process,
10 to 12 are diagrams showing transitions of addresses, codes and flags in the matching process between the unknown code sequence in FIG. 8 and each dictionary code sequence in FIG. 9, and FIG. FIG. 14 is a diagram showing a dictionary code sequence for explaining the matching process, and FIG. 14 is a diagram for explaining a pattern of numbers in association with a dictionary code sequence and an unknown code sequence. 100 dictionary memory, 102 input register, 104 output register, 106 search control unit, 108 register group, 110 matching processing unit, 112
... A register, 114 ... B register, 116 ... ADR1 counter, 118 ... ADR
2 counter, 120... Comparison circuit, 122... Matching control unit.
Claims (2)
を付加しておき、辞書記号列と未知記号列とのマッチン
グの方法を当該辞書記号列に付加された制御情報に従っ
て制御するとゝもに、当該辞書記号列と当該未知記号列
とのマッチングの結果が一致となった場合におけるその
後の辞書検索の流れを当該辞書記号列に付加された制御
情報に従って制御することを特徴とする辞書検索方法。1. A method in which control information is added to each dictionary symbol string registered in a dictionary and a matching method between the dictionary symbol string and the unknown symbol string is controlled according to the control information added to the dictionary symbol string. A dictionary for controlling a flow of a subsequent dictionary search in a case where a result of matching between the dictionary symbol string and the unknown symbol string matches, according to control information added to the dictionary symbol string. retrieval method.
おいて比較する記号の対応関係の手順を、制御情報の一
部として当該辞書記号列に挿入された特殊コードにより
制御することを特徴とする特許請求の範囲第1項記載の
辞書検索方法。2. The method according to claim 1, wherein a procedure of a correspondence relation of symbols to be compared in matching between the dictionary symbol string and the unknown symbol string is controlled by a special code inserted into the dictionary symbol string as a part of control information. The dictionary search method according to claim 1.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62170510A JP2654022B2 (en) | 1987-07-08 | 1987-07-08 | Dictionary search method |
| US07/118,528 US4905295A (en) | 1986-11-13 | 1987-11-09 | Code sequence matching method and apparatus |
| US07/398,649 US4979226A (en) | 1986-11-13 | 1989-08-25 | Code sequence matching method and apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP62170510A JP2654022B2 (en) | 1987-07-08 | 1987-07-08 | Dictionary search method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPS6414685A JPS6414685A (en) | 1989-01-18 |
| JP2654022B2 true JP2654022B2 (en) | 1997-09-17 |
Family
ID=15906284
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP62170510A Expired - Fee Related JP2654022B2 (en) | 1986-11-13 | 1987-07-08 | Dictionary search method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2654022B2 (en) |
-
1987
- 1987-07-08 JP JP62170510A patent/JP2654022B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPS6414685A (en) | 1989-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US4979226A (en) | Code sequence matching method and apparatus | |
| US5794048A (en) | Method for classification of year-related data fields in a program | |
| WO1985000681A1 (en) | Parallel text matching methods and apparatus | |
| JPH08255176A (en) | Method and system for comparison of table of database | |
| US6978044B2 (en) | Pattern string matching apparatus and pattern string matching method | |
| JP2654022B2 (en) | Dictionary search method | |
| KR930000593B1 (en) | Information retrieval system using approximate match between input string and keyword and matching method | |
| JP2906583B2 (en) | Pattern identification device | |
| JP3071745B2 (en) | Post-processing method of character recognition result | |
| JP2773657B2 (en) | String search device | |
| KR19990015114A (en) | Character Recognizer Using Character Connection Information | |
| JPH06274701A (en) | Word collating device | |
| JP2918380B2 (en) | Post-processing method of character recognition result | |
| KR940003634B1 (en) | Character type automatic choosing method of character recognition systm | |
| JPH10269311A (en) | Slip processing unit designating method | |
| JP2839515B2 (en) | Character reading system | |
| JPH05174062A (en) | String search processor | |
| JPH0423167A (en) | Command retrieving system | |
| JPS59117673A (en) | Postprocessing system of character recognizing device | |
| JP2923295B2 (en) | Pattern identification processing method | |
| JP2639314B2 (en) | Character recognition method | |
| JPH07121665A (en) | Compiling method and retrieving method for character recognition dictionary | |
| JPH07192013A (en) | Document data processing unit | |
| JPH02244292A (en) | English word search device | |
| JPS5820075B2 (en) | pattern recognition device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| LAPS | Cancellation because of no payment of annual fees |