JPS63238680A - Matching method and dictionary retrieving method for symbol string - Google Patents

Matching method and dictionary retrieving method for symbol string

Info

Publication number
JPS63238680A
JPS63238680A JP25665487A JP25665487A JPS63238680A JP S63238680 A JPS63238680 A JP S63238680A JP 25665487 A JP25665487 A JP 25665487A JP 25665487 A JP25665487 A JP 25665487A JP S63238680 A JPS63238680 A JP S63238680A
Authority
JP
Japan
Prior art keywords
dictionary
code
matching
symbol
string
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
Application number
JP25665487A
Other languages
Japanese (ja)
Inventor
Hajime Sato
元 佐藤
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.)
Ricoh Co Ltd
Original Assignee
Ricoh 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to US07/118,528 priority Critical patent/US4905295A/en
Publication of JPS63238680A publication Critical patent/JPS63238680A/en
Priority to US07/398,649 priority patent/US4979226A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To simplify matching and flow control of dictionary retrieval by not only inserting a special symbol but also adding control information to and on symbol strings registered in a register and a dictionary. CONSTITUTION:When it is checked whether a first symbol string A in a register 11 coincides with a preliminarily registered second symbol string B or not, the special symbol is inserted to a second symbol string B and procedures of a correspondence relations between symbols to be compared are changed in accordance with this symbol. Not only the special symbol is inserted but also control information is added to and on each dictionary symbol string registered in the dictionary, and matching between dictionary symbol strings and an unknown symbol string is controlled in accordance with this control information and procedures of correspondence relations between symbols to be compared are controlled by the special symbol, and the flow of dictionary retrieval after matching between dictionary symbol strings and the unknown symbol string in the case of coincidence between them is controlled in accordance with control information added to the dictionary symbol string. Thus, matching and control flow of dictionary retrieval are simplified.

Description

【発明の詳細な説明】 〔技術分野〕 本発明は、記号列のマツチング方法および記号列を登録
した辞書から未知記号列と一致して記号列を探索するた
めの辞書検索方法に関する。さらに詳細には、本発明は
パターン認識装置において、入カバターンの特徴ベクト
ルと認識辞書の特徴ベクトルとのマツチング処理および
認識辞書の検索処理に好適な記号列のマツチング方法お
よび辞書検索方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field] The present invention relates to a symbol string matching method and a dictionary search method for searching for a symbol string that matches an unknown symbol string from a dictionary in which symbol strings are registered. More specifically, the present invention relates to a symbol string matching method and dictionary search method suitable for matching a feature vector of an input pattern with a feature vector of a recognition dictionary and searching a recognition dictionary in a pattern recognition device.

〔従来技術〕[Prior art]

文字などのパターンを認識する装置においては、各種パ
ターンの特徴ベクトル(特徴列)を登録した辞書を備え
ており、入カバターンから抽出した特徴ベクトル(未知
特徴列)と一致する特徴ベクトルを辞書から検索するこ
とにより入カバターンの候補パターンを決定する。
Devices that recognize patterns such as characters are equipped with a dictionary in which feature vectors (feature sequences) of various patterns are registered, and the dictionary is searched for a feature vector that matches the feature vector (unknown feature sequence) extracted from the input pattern. By doing so, a candidate pattern for the input pattern is determined.

ところで、このような辞書検索における特徴ベクトル相
互のマツチングにおいては、ノイズやパターン変形など
による影響のため、特徴ベクトルの全要素の対応関係を
一義的に決定して要素相互を比較してマツチングの一致
、不一致(成立、不成立)を判定すると、認識率が低下
する。この対策として、辞書の特徴ベクトルとのマツチ
ングにおいて、入カバターンの特徴ベクトルの一部の要
素を無視して一致、不一致の判定をしたり、あるいは比
較する要素の対応関係の手順を変化させたりすると有効
である。
By the way, when matching feature vectors together in such a dictionary search, due to the effects of noise, pattern deformation, etc., it is necessary to uniquely determine the correspondence of all elements of the feature vectors and compare the elements to achieve matching. , the recognition rate decreases when a mismatch (establishment, failure) is determined. As a countermeasure to this problem, when matching with the feature vector of the dictionary, some elements of the feature vector of the input pattern may be ignored to determine whether they match or do not match, or the procedure for determining the correspondence of the elements to be compared may be changed. It is valid.

しかし、このようなマツチング方法の制御を行っても、
一種類のパターンに対して一つの特徴ベクトルだけを辞
書に登録した場合、パターンの変形に対応しきれないた
め、パターン変形に十分対応可能とするには、一種類の
パターンに対して複数の特徴ベクトルを辞書に登録する
必要がある。
However, even if this matching method is controlled,
If only one feature vector is registered in the dictionary for one type of pattern, it cannot cope with the deformation of the pattern, so in order to be able to sufficiently deal with pattern deformation, it is necessary to register multiple features for one type of pattern. It is necessary to register the vector in the dictionary.

さらに、複数の候補より一つを選択する場合(例えば入
カバターンがαまたはβであるか、あるいは、どちらで
もないかを判定する場合)、複数の候補のそれぞれの特
徴ベクトルを辞書に登録する必要がある。この場合、マ
ツチング方法の制御の他に、ある辞書の特徴ベクトルで
一致がとれた後の辞書検索の流れを適切に制御するため
の工夫が必要である。
Furthermore, when selecting one from multiple candidates (for example, when determining whether the input pattern is α, β, or neither), it is necessary to register the feature vectors of each of the multiple candidates in the dictionary. There is. In this case, in addition to controlling the matching method, it is necessary to devise ways to appropriately control the flow of dictionary search after a match is made using the feature vector of a certain dictionary.

しかし従来、上記のマツチング方法や比較対応関係、辞
書検索の流れの制御を状態遷移図を用いて行っており(
例えば電子通信学会技術研究報告PRL85−35、加
藤rストローク構造解析法における辞書の自動作成法J
)、その制御のための記述が著しく複雑であり、また制
御処理が繁雑になるという問題があった。
However, conventionally, the above-mentioned matching method, comparison correspondence relationship, and dictionary search flow have been controlled using state transition diagrams (
For example, IEICE technical research report PRL85-35, automatic dictionary creation method in Kato r stroke structure analysis method J
), the description for the control is extremely complicated, and the control process becomes complicated.

〔目 的〕〔the purpose〕

本発明の目的は、パターンの特徴ベクトルなどの記号列
と予め登録された同様の記号列とのマツチングにおいて
、比較する要素の対応関係の変更記述を簡略化し、制御
を簡単化した記号列のマツチング方法を提供することに
ある0本発明の他の目的は、パターン認識装置書のよう
な記号列の辞書の検索において、マツチング、比較対応
関係、および辞書検索の流れを簡単な記述により多様か
つ適切に制褐可能な辞書検索方法を提供することにある
An object of the present invention is to simplify the description of changing the correspondence between elements to be compared in matching symbol strings such as pattern feature vectors with similar symbol strings registered in advance, and to simplify symbol string matching with simplified control. Another object of the present invention is to provide a method for searching a dictionary of symbol strings, such as a pattern recognition device, by easily describing the flow of matching, comparison correspondence, and dictionary search in a variety of ways and appropriately. The purpose of the present invention is to provide a dictionary search method that can be used in a variety of ways.

〔構 成〕〔composition〕

本発明の記号列のマツチング方法は、第1の記号列があ
らかじめg、録されている第2の記号列と一致している
かどうか調べる際、第2の記号列中に特殊な記号を挿入
しておき、この記号に従って比較する対応関係の手順を
変更するものである。
In the symbol string matching method of the present invention, when checking whether a first symbol string matches a second symbol string recorded in advance, a special symbol is inserted into the second symbol string. The procedure for comparing correspondence relationships is changed according to this symbol.

また本発明の辞書検索方法は、辞書に賛録された各辞書
記号列に特殊記号を挿入するとNもに制御情報を付加し
ておき、辞書記号列と未知記号列とのマツチングの方法
を当該辞書記号列に付加された制御情報に従って制御す
るとへもに、比較する記号の対応関係の手順を、当該辞
書記号列に挿入された特殊コードにより制御し、当該辞
書記号列と当該未知記号列とのマツチングの結果が一致
となった場合におけるその後の辞書検索の流れを当該辞
書記号列に付加された制御情報に従って制御するもので
ある。
Furthermore, in the dictionary search method of the present invention, when a special symbol is inserted into each dictionary symbol string recorded in the dictionary, control information is added to each dictionary symbol string, and the matching method between the dictionary symbol string and the unknown symbol string is changed. In addition to controlling according to the control information added to the dictionary symbol string, the procedure for the correspondence of the symbols to be compared is controlled by a special code inserted in the dictionary symbol string, and the dictionary symbol string and the unknown symbol string are When the matching results in a match, the flow of the subsequent dictionary search is controlled in accordance with the control information added to the dictionary symbol string.

〔実施例〕〔Example〕

以下1本発明の実施例について図面により説明する。 An embodiment of the present invention will be described below with reference to the drawings.

第1図は本発明の一実施例の記号列マツチング処理装置
の機能ブロック図を示す、第1図において、Aレジスタ
11には、第1の記号列としての認識対象パターンの特
徴ベクトル(以下、コード列Aという)がアドレス0か
ら格納されている。
FIG. 1 shows a functional block diagram of a symbol string matching processing device according to an embodiment of the present invention. In FIG. 1, the A register 11 contains a feature vector (hereinafter referred to as Code string A) is stored starting from address 0.

Bレジスタ12には、あらかじめf録されている第2の
記号列としての特徴ベクトル(以下、コード列Bという
)がアドレス1以降に格納されている。このコード列B
の中に、一つあるいはそれ以上の特殊コードを挿入して
おき、後述するように、コード列A中のコードの比較す
る順番を変えるのに使用する1本実施例では、この特殊
コードを0とする。また、Bレジスタ12のアドレス0
には、比較が部分対応か全体対応かを示すコードが格納
される。本実施例では1部分対応の場合、アドレス0の
コードはO1全体対応の場合、アドレス0のコードは1
とする。
In the B register 12, a feature vector (hereinafter referred to as code string B) as a second symbol string, which has been recorded in advance, is stored at address 1 and thereafter. This code string B
In this embodiment, one or more special codes are inserted into 0 and used to change the order in which the codes in code string A are compared, as will be described later. shall be. Also, address 0 of B register 12
stores a code indicating whether the comparison is partial correspondence or total correspondence. In this embodiment, in the case of one part correspondence, the code of address 0 is 1, and in the case of whole O1 correspondence, the code of address 0 is 1.
shall be.

レジスタ11の読出しアドレスはAアドレスカウンタ1
4で指示され、Bレジスタ12の読出しアドレスはBア
ドレスカウンタ15で指示される。
The read address of register 11 is A address counter 1
4, and the read address of the B register 12 is indicated by the B address counter 15.

両レジスタ11.12から読み出されたコードの一致、
不一致は比較回路16で比較され、その比較結果は制御
回路17に入力される。制御回路17には、Bレジスタ
12のアドレスOのコード(0あるいは1)、及びBレ
ジスタ12から読み出される特殊コード(すなわち0)
も入力される。
Matching of codes read from both registers 11.12,
A comparison circuit 16 compares the discrepancies, and the comparison result is input to the control circuit 17. The control circuit 17 contains the code of address O of the B register 12 (0 or 1) and the special code read from the B register 12 (i.e. 0).
is also input.

制御回路17では、Bレジスタ12から読み出される特
殊コード、及び、比較回路16の比較結果によりフラグ
13を“1″あるいは“0″とし、該フラグ13の状態
を参照してアドレスカウンタ14.15の更新動作を制
御する。
In the control circuit 17, the flag 13 is set to "1" or "0" according to the special code read from the B register 12 and the comparison result of the comparison circuit 16, and the address counter 14.15 is set by referring to the state of the flag 13. Control update behavior.

本実施例の動作概要は次の通りである。初期状態として
、Aアドレスカウンタ14をO,Bアドレスカウンタ1
5を1として、Aレジスタ11のコード列Aはアドレス
0から、Bレジスタ12のコード列Bはアドレス1から
それぞれ読み出し、対応するコードを比較回路16で比
較する。なお。
An outline of the operation of this embodiment is as follows. As an initial state, the A address counter 14 is set to O, and the B address counter 1 is set to
5 as 1, the code string A of the A register 11 is read from address 0, and the code string B of the B register 12 is read from address 1, and the corresponding codes are compared by the comparison circuit 16. In addition.

不一致が検出された際に、コード列Bの最初のアドレス
1に特殊コードすなわちOが挿入されている場合は、A
アドレスカウンタ14を+1とし。
If a special code, that is, O, is inserted at the first address 1 of code string B when a mismatch is detected, A
Set the address counter 14 to +1.

コード列Aはアドレス1のコードから比較対象とする。Code string A is compared starting with the code at address 1.

Bレジスタ12より特殊コードすなわち0が読み出され
ない間、比較回路16で一致が検出される都度、アドレ
スカウンタ14.15をそれぞれ+1してレジスタ11
.12よりコードを順次読み出し、比較回路16で比較
する。比較回路16で不一致が検出されると、コード列
Bのアドレス1のコードを調べる。該コードがOでない
場合は、コード列Aとコード列Bはマツチングがとれな
かったとして処理を終了するが、該コードがOの場合は
、Aアドレスカウンタ14を1、Bアドレスカウンタ1
5を1とし、コード列Aのアドレス1以降のコードを比
較対象として初めからやりなおす、そして、再び不一致
が検出されると、Aアドレスカウンタ14を2としくB
アドレスカウンタ15は1)、コード列Aのアドレス2
以降のコードを比較対象とする。これを不一致が検出さ
れる都度繰り返す、即ち、これは位置ずれパターンや変
形パターンに対処するためである。
While the special code, that is, 0, is not read from the B register 12, each time a match is detected in the comparison circuit 16, the address counters 14 and 15 are each incremented by 1 and the register 11 is read out.
.. The codes are sequentially read out from 12 and compared by a comparison circuit 16. When the comparison circuit 16 detects a mismatch, the code at address 1 of code string B is checked. If the code is not O, it is assumed that code string A and code string B are not matched and the process ends; however, if the code is O, the A address counter 14 is set to 1 and the B address counter 14 is set to 1.
5 is set to 1, and the code starting from address 1 of code string A is compared and restarted from the beginning. When a mismatch is detected again, the A address counter 14 is set to 2 and B is set to 1.
Address counter 15 is 1), address 2 of code string A
The following code will be compared. This is repeated every time a mismatch is detected, that is, this is to deal with misalignment patterns and deformed patterns.

コード列Aとコード列Bの一致が進み、Bアドレスカウ
ンタ15がi(i>1)になり、Bレジスタ12より0
が読み出されたとする。即ち、コード列Bのアドレスi
に特殊コードが挿入されている。この時、Bアドレスカ
ウンタ15を+1し、コード列Bのアドレス(i+1)
のコードをBしジスタ12より読み出す。そして、この
コード列Bのアドレス(i+1)のコードと同一コード
が読み出されるまで、Aアドレスカウンタ14を順次+
1して、Aレジスタ11よりコードを次々に読み出す、
この間、Bアドレスカウンタ15の更新はストップして
おく0両者のコードが一致したら、再びアドレスカウン
タ14.15をそれぞれ+1し、レジスタ11.12よ
り次のコードを読み出す。これにより、コード列A中の
不要なコードをコード列Bとの比較対象から除外するこ
とができる。
The match between code string A and code string B progresses, the B address counter 15 becomes i (i>1), and the B register 12 becomes 0.
Suppose that is read out. That is, address i of code string B
A special code has been inserted. At this time, the B address counter 15 is incremented by 1, and the address of code string B (i+1) is
The code is read out from register 12. Then, the A address counter 14 is sequentially ++ until the same code as the code at address (i+1) of code string B is read out.
1, and read the codes one after another from the A register 11.
During this time, updating of the B address counter 15 is stopped. When the two codes match, the address counters 14 and 15 are each incremented by 1 again, and the next code is read from the registers 11 and 12. Thereby, unnecessary codes in code string A can be excluded from comparison with code string B.

コード列Bの最終コードに到達したなら、Bレジスタ1
2のアドレスOを調べる。そして、該アドレス0のコー
ドが0(部分対応)の場合は、コード列Aのコードが最
後まで来ていなくとも、コード列Aとコード列Bはマツ
チングがとれたとする。Bレジスタ12のアドレスOが
1(全体対応)の場合は、コード列Aも最終コードまで
来ているときのみマツチングがとれたとし、それ以外は
マツチングがとれなかったとする。
When the final code of code string B is reached, B register 1
Check address O of 2. If the code at address 0 is 0 (partial correspondence), it is assumed that code string A and code string B are matched even if the code of code string A has not reached the end. When the address O of the B register 12 is 1 (general correspondence), it is assumed that matching is achieved only when the code string A also reaches the final code, and matching is not achieved otherwise.

次に、マツチング方法を具体例について説明する。Next, a specific example of the matching method will be explained.

第2図にコード列Aの一例を示し、第3図にコード列B
の一例を示す、第3図のコード列Bはいずれも部分対応
(アドレス0=0)の例を示したものである。
Fig. 2 shows an example of code string A, and Fig. 3 shows an example of code string B.
Code string B in FIG. 3, which shows an example, shows an example of partial correspondence (address 0=0).

初め、第2図のコード列Aと第3図(イ)のコード列B
とのマツチング処理について説明する。
First, code string A in Figure 2 and code string B in Figure 3 (A)
The matching process with .

この場合のアドレス、コード、フラグの遷移を第4図に
示す。まず、フラグを1にして(初期条件)、コード列
AのアドレスOのコード4とコード列Bのアドレス1の
コード4を読み出して比較する(ステップ1)1両者の
コードが一致すると、コード列Bのアドレス2のコード
を読み出す(ステップ2)、コード列Bのアドレス2は
コード=0であるので、次のアドレス3のコード2を読
み出し、フラグをOにする(ステップ3)。そして、コ
ード列Aのアドレス1のコード1を読み出すが(ステッ
プ4)、該コードはコード2と一致しないため無視し、
次のアドレス2のコード2を読み出し、コード列Bのア
ドレス3のコード2と比較する(ステップ5)0両者の
コードが一致したので、コード列Bのアドレス4のコー
ドを読み出し、フラグを1に戻す(ステップ6)。コー
ド列Bのアドレス4のコードはOのため1次のアドレス
5のコード4を読み出し、フラグを再び0にする(ステ
ップ7)。そして、コード列Aのアドレス3のコード1
を読み出すが(ステップ8)、該コードはコード4と一
致しないため無視し1次のアドレス4のコード4を読み
出し、コード列Bのアドレス5のコード4と比較し、一
致を得る(ステップ9)、コード列Bはアドレス5で終
りのため。
FIG. 4 shows the transition of addresses, codes, and flags in this case. First, set the flag to 1 (initial condition), read and compare code 4 at address O of code string A and code 4 at address 1 of code string B (step 1) 1 If the two codes match, the code string The code at address 2 of code string B is read out (step 2). Since the code at address 2 in code string B is 0, code 2 at the next address 3 is read out and the flag is set to O (step 3). Then, code 1 at address 1 of code string A is read out (step 4), but this code does not match code 2, so it is ignored.
Next, read code 2 at address 2 and compare it with code 2 at address 3 in code string B (step 5).0 Since both codes match, read the code at address 4 in code string B and set the flag to 1. Return (Step 6). Since the code at address 4 of code string B is O, code 4 at the primary address 5 is read and the flag is set to 0 again (step 7). Then, code 1 at address 3 of code string A
(Step 8), but since this code does not match Code 4, it is ignored, and Code 4 of the primary address 4 is read and compared with Code 4 of Address 5 of code string B to find a match (Step 9). , because code string B ends at address 5.

アドレス0のコードを調べる0本例では、アドレスOの
コードは0で部分対応を示しているため、コード列Aが
最終のアドレス7まで達していなくとも、コード列Aは
コード列Bに一致しているとする。
Checking the code at address 0 In this example, the code at address O is 0, indicating a partial correspondence, so even if code string A does not reach the final address 7, code string A matches code string B. Suppose that

次に、第2図のコード列Aと第3図(ロ)のコード列B
とのマツチング処理について説明する。
Next, code string A in Fig. 2 and code string B in Fig. 3 (b)
The matching process with .

この場合のアドレス、コード、フラグの遷移を第5図に
示す、第5図において、ステップ5までは第4図と同様
である。ステップ6でコード列Bのアドレス4のコード
3を読み出し、フラグを1にする(ステップ5で一致が
とれているため)。次のステップ7でコード列Aのアド
レス3のコード1を読み出し、コード列Bのアドレス4
のコード3と比較する。両者は一致しないため、こ\で
マツチング処理は打ち切られ、コード列Aはコード列B
と対応しないと判定される。
The transition of addresses, codes, and flags in this case is shown in FIG. 5. In FIG. 5, steps up to step 5 are the same as in FIG. 4. In step 6, code 3 at address 4 of code string B is read and the flag is set to 1 (because a match was found in step 5). In the next step 7, code 1 at address 3 of code string A is read out, and code 1 at address 4 of code string B is read out.
Compare with code 3. Since the two do not match, the matching process is terminated at this point, and code string A becomes code string B.
It is determined that it does not correspond to

次に、第2図のコード列Aと第3図(ハ)のコード列B
とのマツチング処理について説明する。
Next, code string A in Fig. 2 and code string B in Fig. 3 (c)
The matching process with .

これはコード列Bの先頭(アドレス1)にも特殊コード
すなわちOが挿入されている例で、この例の場合、アド
レス2以降のコード列がコード列Aに存在するかどうか
、比較する順序を変えて繰り返しサーチされる。この場
合のアドレス、コード。
This is an example in which a special code, ie O, is also inserted at the beginning of code string B (address 1). It is searched repeatedly with different changes. Address, code in this case.

フラグの遷移を第6図に示す。FIG. 6 shows the transition of the flags.

第6図において、ステップ1でフラグを1に初期設定し
て、コード列Aのアドレス0とコード列Bのアドレス1
のコードを読み出すが、コード列Bのアドレス1のコー
ドが0のため、次のステップ2でコード列Bのアドレス
2のコード4を読み出し、これから比較を開始する。マ
ツチング処理が進み、ステップ9でコード列Bの最終ア
ドレス5のコード1を読み出し1次のステップ10でコ
ード列Aのアドレス5のコード3を読み出す。コードI
JIFコード3のため、本来ならコード列Aとコード列
Bは対応がとれないと判定されることになるが、コード
列Bのアドレス1がコード=0のため、ステップ12で
コード列Bのアドレス2のコード4を再び読み出し、次
のステップ13でコード列Aのアドレス1のコード1を
読み出してマツチング処理を繰り返す。このようにして
、コード列Bの(4,4,1)がコード列Aのアドレス
4 (=4) 、アドレス6 (=4) 、アドレス7
(=1)に存在することが見つかり、結果としてコード
列Aとコード列Bの対応が成立すると判定される。
In FIG. 6, the flag is initialized to 1 in step 1, and address 0 of code string A and address 1 of code string B are set to 1.
However, since the code at address 1 of code string B is 0, in the next step 2, code 4 at address 2 of code string B is read out, and the comparison starts from there. The matching process progresses, and in step 9 code 1 at the final address 5 of code string B is read out, and in the next step 10 code 3 at address 5 of code string A is read out. Code I
Because the JIF code is 3, it would normally be determined that code string A and code string B do not correspond, but since address 1 of code string B is code = 0, the address of code string B is determined in step 12. Code 4 of address 1 of code string A is read out again in step 13, and the matching process is repeated. In this way, (4, 4, 1) of code string B becomes address 4 (=4), address 6 (=4), and address 7 of code string A.
(=1), and as a result, it is determined that the correspondence between code string A and code string B is established.

第7図は全体対応(アドレス0=1)の場合のコード列
Bの一例を示したものである。これとの比較対象のコー
ド列Aは第2図のものを使用する。
FIG. 7 shows an example of code string B in the case of global correspondence (address 0=1). As the code string A to be compared with this, the one shown in FIG. 2 is used.

全体対応の場合、コード列Bのアドレス1あるいは2以
降のコード列が全てコード列Aに存在する時、コード列
Aのアドレスが最後までいったかどうか判定し、最後ま
でいっていれば対応関係が成立したとし、最後までいっ
ていなければ成立しないとする。コード列B中の特殊コ
ード0の役目は部分対応の場合と同様である。
In the case of global correspondence, when all code strings after address 1 or 2 of code string B exist in code string A, it is determined whether the address of code string A has reached the end, and if it has reached the end, the correspondence is established. Suppose we do this, and it will not be established unless it reaches the end. The role of special code 0 in code string B is the same as in the case of partial correspondence.

第2図と第7図(イ)のマツチングの場合、コード列B
のコード(4,1)が全てコード列Aに存在する時、コ
ード列Aのアドレスは1となり、最後までいっていない
。したがって、第2図のコード列Aと第7図(イ)のコ
ード列Bの対応関係は成立しない。
In the case of matching Figure 2 and Figure 7 (A), code string B
When all the codes (4, 1) exist in code string A, the address of code string A is 1 and has not reached the end. Therefore, the correspondence between code string A in FIG. 2 and code string B in FIG. 7(a) does not hold.

第2図と第7図(ロ)とのマツチングの場合も、コード
列Bのコード(4,2,4)が全てコード列Aに存在す
るが、このときのコード列Aのアドレスは4であるため
、対応関係は成立しないとする。
In the case of matching between Figure 2 and Figure 7 (b), all codes (4, 2, 4) of code string B exist in code string A, but the address of code string A at this time is 4. Therefore, it is assumed that the correspondence relationship does not hold.

第2図と第7図(ハ)とのマツチングの場合は、コード
列Bのコード(3,4,1)が全てコード列Aに存在す
る時、コード列Aのアドレスは最終アドレスの7となり
、対応関係が成立する。
In the case of matching between Figure 2 and Figure 7 (c), when the codes (3, 4, 1) of code string B are all present in code string A, the address of code string A becomes the final address 7. , a correspondence relationship is established.

次に、本実施例のパターンマツチングへのJt一体的応
用例について考えてみる。コード1〜4を、第8図(イ
)のようにストローク特徴抽出におけるパターン輪郭部
の追跡点の移動方向とし1例えば第8図(ロ)の数字「
3」を同図(ホ)のようにコード列Bとしてあらかじめ
記述しておく。この場合、第8図(ハ)に示す変形され
た数字「3」のコード列Aは同図(ニ)のように抽出さ
れるが、これを上述の方法により同図(ホ)のコード列
Bとマツチング処理することにより、対応関係をとるこ
とができる。
Next, let us consider an example of the integrated application of Jt to pattern matching of this embodiment. Let codes 1 to 4 be the movement direction of the tracking point of the pattern contour in stroke feature extraction as shown in Figure 8 (a).
3" is previously written as code string B as shown in FIG. In this case, the transformed code string A of the number "3" shown in FIG. 8(C) is extracted as shown in FIG. By performing matching processing with B, a correspondence relationship can be established.

第1図の制御回路17の処理フローをまとめて示すと第
9図及び第10図のようになる。なお、第10図は第9
図における判定ステップ116の詳細を示したものであ
る。
The processing flow of the control circuit 17 in FIG. 1 is summarized as shown in FIGS. 9 and 10. Note that Figure 10 is
The details of the determination step 116 in the figure are shown.

第9図において、101,102は初期設定ステップで
ある。103〜105はコード列Bのアドレス1がコー
ドOの場合、アドレス2のコードを読み出すステップで
ある。コード列Bの中のコードOが現われない場合、1
06→107→108→109→110→106のステ
ップをループしてコード列Aとコード列Bの対応するコ
ードのマツチングがとられる。111はコード列Bの中
に挿入したコードOが現われた場合、コード列Bのアド
レスを+1するステップである。ステップ112〜11
4は、ステップ107で不一致が検出された時、コード
列Bのアドレス1がコード0の場合、コード列Aの初期
設定をやり直して再度マツチング処理を繰り返すための
ステップである。
In FIG. 9, 101 and 102 are initial setting steps. Steps 103 to 105 read the code at address 2 when address 1 of code string B is code O. If code O in code string B does not appear, 1
The steps 06→107→108→109→110→106 are looped to match the corresponding codes of code string A and code string B. Step 111 is a step in which when the code O inserted in the code string B appears, the address of the code string B is incremented by one. Steps 112-11
4 is a step for re-initializing code string A and repeating the matching process again if address 1 of code string B is code 0 when a mismatch is detected in step 107.

第10図の201は部分対応か全体対応かを判定するス
テップ、202はコード列Aが最終アドレスまできたか
どうか判定するステップである。
201 in FIG. 10 is a step for determining whether it is a partial correspondence or a whole correspondence, and 202 is a step for determining whether the code string A has reached the final address.

なお、第1図は単なる機能ブロック図を示したにすぎず
、実際には例えばパソコン等を使用し、第9図、第10
図の処理はソフトウェア的に処理されるものである。
Note that Figure 1 merely shows a functional block diagram, and in reality, for example, a personal computer or the like is used to
The processing shown in the figure is performed by software.

第11図は本発明の他の実施例の辞書検索装置の機能ブ
ロック図を示す。第11図において、辞書メモリ110
0には例えばパターンの特徴ベクトルなどの記号列が辞
書記号列(以下、辞書コード列)として予め格納されて
いる。入カバターンの特徴ベクトルなどの未知記号列(
以下、未知コード列)は入力レジスタ1102に入力し
、辞書検索の結果は出力レジスタ1104に出力する。
FIG. 11 shows a functional block diagram of a dictionary search device according to another embodiment of the present invention. In FIG. 11, dictionary memory 110
For example, a symbol string such as a feature vector of a pattern is stored in advance as a dictionary symbol string (hereinafter referred to as a dictionary code string) in 0. Unknown symbol strings such as feature vectors of input patterns (
An unknown code string (hereinafter referred to as an unknown code string) is input to an input register 1102, and a dictionary search result is output to an output register 1104.

検索制御部1106は辞書メモリ100のアクセスや辞
書検索処理全体の制御などを行うものであり、その制御
などに関連してレジスタ群1108を備えている。この
レジスタ群1108は、C0DE、AN、BN、JAD
R,CN、MODE。
The search control unit 1106 accesses the dictionary memory 100 and controls the entire dictionary search process, and includes a register group 1108 in connection with such control. This register group 1108 includes C0DE, AN, BN, JAD
R, CN, MODE.

FLG、RLTの各レジスタからなっている。It consists of FLG and RLT registers.

1110は辞書コード列と未知コード列とのマツチング
処理を実行するマツチング処理部である。
Reference numeral 1110 is a matching processing unit that performs matching processing between a dictionary code string and an unknown code string.

未知コード列および辞書コード列は検索制御部1106
によってAレジスタ1112およびBレジスタ1114
にそれぞれ設定される。ADR1カウンタ1116はA
レジスタ1112の読出しアドレスを指定するアドレス
カウンタであり、ADR2カウンタ1118はBレジス
タ1114の読出しアドレスを指定するアドレスカウン
タである。
The unknown code string and dictionary code string are stored in the search control unit 1106.
A register 1112 and B register 1114 by
are set respectively. ADR1 counter 1116 is A
The ADR2 counter 1118 is an address counter that specifies the read address of the register 1112, and the ADR2 counter 1118 is an address counter that specifies the read address of the B register 1114.

比較回路1120はA、Bレジスタから出力されるコー
ドの一致、不一致を比較し、比較結果をマツチング制御
部1122に入力する。このマツチング制御部1122
はマツチング処理部1110の動作を制御するものであ
り、マツチング手順の制御に関連したCNTカウンタ1
124を備えており、またレジスタ群1108中の特定
のレジスタ(フラグ)をアクセス可能である。Bレジス
タ1114の出力コードはマツチング制御部1122に
も入力する。ADRIカウンタ1116およびADR2
カウンタ1118は、マツチング制御部1122により
制御される。
The comparison circuit 1120 compares the codes output from the A and B registers to see if they match or do not match, and inputs the comparison result to the matching control unit 1122. This matching control section 1122
is for controlling the operation of the matching processing section 1110, and is for controlling the CNT counter 1 related to the control of the matching procedure.
124, and a specific register (flag) in the register group 1108 can be accessed. The output code of the B register 1114 is also input to the matching control section 1122. ADRI counter 1116 and ADR2
Counter 1118 is controlled by matching control section 1122.

第12図は辞書検索処理の全体的な流れを示す。FIG. 12 shows the overall flow of dictionary search processing.

ステップ1203はマツチング処理部1110による処
理ステップであり、残りの各ステップは検索制御部11
06のステップである。辞書検索処理動作の詳細につい
ては後述する。
Step 1203 is a processing step by the matching processing unit 1110, and the remaining steps are performed by the search control unit 11.
This is step 06. Details of the dictionary search processing operation will be described later.

第13図に辞書の構造を例示する6図示のように辞書の
構成単位は、可変長の辞書コード列に文字コード(1バ
イト)、モード識別子(1バイト)および飛び先番地(
1バイト)、さらにコード列数(1バイト)からなる。
Figure 13 illustrates the structure of a dictionary. As shown in Figure 6, the constituent units of a dictionary are a variable-length dictionary code string, a character code (1 byte), a mode identifier (1 byte), and a jump address (
(1 byte) and the number of code strings (1 byte).

コード列数は辞書コード列のバイト数を示す。The number of code strings indicates the number of bytes of the dictionary code string.

モード識別子は、マツチング方法(部分対応、全体対応
)およびマツチングで一致した場合のその後の辞書検索
の流れの制御方法を指定するための情報である。飛び先
番地は、モード識別子によってジャンプが指定された辞
書コード列のマツチングが一致(成立)した場合に1次
にマツチングの対象となる進むべき辞書構成単位の先頭
番地を指定する。また、辞書コード列中には、マツチン
グにおいて比較する記号の対応関係の手順を制御するた
めの特殊コードが必要に応じて挿入される。
The mode identifier is information for specifying a matching method (partial correspondence, whole correspondence) and a method for controlling the subsequent flow of dictionary search when a match is found. The jump address specifies the starting address of the dictionary constituent unit to which the dictionary code strings to which the jump is specified by the mode identifier are to be proceeded to when matching (established) occurs. Further, a special code for controlling the procedure of the correspondence of symbols to be compared in matching is inserted into the dictionary code string as necessary.

このようなモード識別子、飛び先番地および特殊コード
が制御情報として各辞書コード列に付加されているわけ
である。
Such a mode identifier, jump address, and special code are added to each dictionary code string as control information.

なお、辞書の最後にはターミネータとしてコードrFF
Jが置かれる。
In addition, at the end of the dictionary, the code rFF is used as a terminator.
J is placed.

このような構造の辞書の具体例を第14図に示す、■か
ら■はそれぞれ辞書構成単位である。文字コードのOは
リジェクトコードである。各辞書コード列中のコード0
は制御情報の一部としての特殊コードであり、これは前
記第1実施例における特殊コードと同一目的のために挿
入されている。
A specific example of a dictionary with such a structure is shown in FIG. 14, where ■ to ■ are dictionary constituent units, respectively. The character code O is a reject code. Code 0 in each dictionary code string
is a special code as part of the control information, which is inserted for the same purpose as the special code in the first embodiment.

なお、辞書コード列中の特殊コード以外のコードは、具
体的には第8図に関連して説明したような文字パターン
のストロークの方向コードなどである。
Note that the codes other than the special code in the dictionary code string are specifically the stroke direction code of the character pattern as described in connection with FIG.

こ\で識別子(一般表現はrbl、b2J)とモードの
関係を説明する。
Here, the relationship between identifiers (generally expressed as rbl, b2J) and modes will be explained.

■の辞書構成単位のように識別子が「00」に設定され
た辞書コード列については、「部分対応」のマツチング
が行われ、その結果が一致の場合に検索を終了しく辞書
から抜ける)、不一致の場合に直後に位置した辞書構成
単位(■)の辞書コード列とのマツチング処理に進む。
For dictionary code strings whose identifier is set to "00", such as the dictionary constituent unit in (■), "partial correspondence" matching is performed, and if the result is a match, the search is terminated and the dictionary is exited), or a mismatch. In this case, the process proceeds to matching processing with the dictionary code string of the dictionary constituent unit (■) located immediately after.

■の辞書構成単位のように識別子が「01」に設定され
た辞書コード列については、「部分対応」のマツチング
がなされる。そして、マツチングの結果が一致の場合に
は飛び先番地により指定された辞書構成単位(■)の辞
書コード列のマツチング処理に進む(ジャンプする)が
、結果が不一致の場合に直後の辞書構成単位(■)の辞
書コード列のマツチング処理に進む。
For dictionary code strings whose identifiers are set to "01", such as the dictionary constituent unit (2), "partial correspondence" matching is performed. If the matching result is a match, the process proceeds (jumps) to the matching process of the dictionary code string of the dictionary constituent unit (■) specified by the jump destination address, but if the result is a mismatch, the immediately following dictionary constituent unit Proceed to the matching process of the dictionary code string (■).

■の辞書構成単位のように識別子が「10」に設定され
た辞書コード列については、マツチングは「全体対応」
でなされ、その結果が一致の場合に辞書から抜ける。マ
ツチングの結果が不一致の場合に直後の辞書構成単位(
■)の辞書コード列とのマツチング処理に進む。
For dictionary code strings whose identifier is set to "10", such as the dictionary constituent unit in ■, matching is "generally compatible".
and exits the dictionary if the result is a match. If the matching results do not match, the following dictionary constituent unit (
Proceed to the matching process with the dictionary code string in (2).

■の辞書構成単位のように識別子が「11」に設定され
た辞書コード列については、[全体対応」のマツチング
が行われ、その結果が一致の場合に飛び先番地で指定さ
れた辞書構成単位(■)の辞書コード列とのマツチング
処理に進み(ジャンプし)、不一致の場合には直後の辞
書構成単位(■)の辞書コード列のマツチング処理に進
む。
For dictionary code strings whose identifiers are set to "11", such as the dictionary constituent unit in ■, matching is performed using the [whole correspondence], and if the result is a match, the dictionary constituent unit specified by the jump address is The process proceeds (jumps) to the matching process with the dictionary code string of (■), and if there is a mismatch, the process proceeds to the matching process of the dictionary code string of the immediately following dictionary constituent unit (■).

第16図はマツチング処理部1110の動作のフローチ
ャートであり、第17図は第16図中のステップ131
6の詳細フローチャートである。
FIG. 16 is a flowchart of the operation of the matching processing section 1110, and FIG. 17 is a flowchart of the operation of the matching processing section 1110, and FIG.
6 is a detailed flowchart.

これらのフローチャートを参照してマツチング処理動作
を説明する。
The matching processing operation will be explained with reference to these flowcharts.

マツチング制御部1122は検索制御部1106により
起動されると、初期設定としてCNTカウンタ1124
に−1を設定する(ステップ1301)。
When the matching control unit 1122 is activated by the search control unit 1106, the matching control unit 1122 sets the CNT counter 1124 as an initial setting.
is set to -1 (step 1301).

ステップ1302はステップ1303以降の実際のマツ
チング処理のための初期設定ステップであるが、このス
テップでADR1カウンタ1116にCNTカウンタ1
124の値を設定し、ADR2カウンタ1118にOを
設定し、またFLGレジスタ(フラグ)を1にセットす
る。
Step 1302 is an initial setting step for the actual matching process after step 1303.
The value of 124 is set, the ADR2 counter 1118 is set to O, and the FLG register (flag) is set to 1.

次にマツチング制御部1122はFLGレジスタがリセ
ット状態(設定値がO)であるか調べ(ステップ130
3)、リセット状態であればステップ1306にジャン
プする。FLGレジスタがセット状態ならば、Bレジス
タ1114の出力コード(ADR2カウンタ1118に
より指定さたアドレスから読出された辞書コード列のコ
ード)がOすなわち特殊コードであるかを調べ(ステッ
プ1304)、特殊コードでなければステップ1306
にジャンプする。特殊コードであると、FLGレジスタ
を0にリセットすると\もにA D R2カウンタ11
18を+1しくステップ1305)、ステップ1303
に戻る。
Next, the matching control unit 1122 checks whether the FLG register is in the reset state (set value is O) (step 130).
3) If it is in the reset state, jump to step 1306. If the FLG register is in the set state, it is checked whether the output code of the B register 1114 (the code of the dictionary code string read from the address specified by the ADR2 counter 1118) is O, that is, a special code (step 1304), and the special code is If not, step 1306
Jump to. If it is a special code, if you reset the FLG register to 0, the ADR2 counter 11 will also be reset.
18 +1 step 1305), step 1303
Return to

ステップ1306において、ADRIカウンタ1116
を+1してAレジスタ1112の次のアドレスからコー
ドを読出し、比較回路1120で比較が一致したか調べ
る(ステップ1307)。
In step 1306, ADRI counter 1116
is incremented by 1, the code is read from the next address of the A register 1112, and the comparison circuit 1120 checks whether there is a match (step 1307).

一致がとれた場合、ADH2カウンタ1118を+1し
てBレジスタ1114の次のアドレスからコードを読出
し、またFLGレジスタをセットする(ステップ130
8)、そして、ADR2カウンタ1118の値がBNレ
ジスタの値以下であるか調べる(ステップ1309)。
If a match is found, the ADH2 counter 1118 is incremented by 1, the code is read from the next address of the B register 1114, and the FLG register is set (step 130).
8), and checks whether the value of the ADR2 counter 1118 is less than or equal to the value of the BN register (step 1309).

なお、BNレジスタには、検索制御部1106により辞
書コード列のコード列数が予め設定されている。
Note that the number of code strings in the dictionary code string is preset in the BN register by the search control unit 1106.

ADR2カウンタ値≦BNレジスタ値であれば。If ADR2 counter value≦BN register value.

Bレジスタ1114の出力コードが特殊コードすなわち
Oであるかを調べ(ステップ1310)、特殊コードで
なければステップ1306に戻りADRIカウンタ11
16を+1してAレジスタ1112の次のアドレスのコ
ードを読出す。ステップ1310においてBレジスタ1
114の出力コードを0と判定した場合、ADR2カウ
ンタ1118を+1してBレジスタ1144の次のアド
レスのコードを読出し、またFLGレジスタをリセット
しくステップ1311)、ステップ1306に戻る。
It is checked whether the output code of the B register 1114 is a special code, that is, O (step 1310), and if it is not a special code, the process returns to step 1306 and the ADRI counter 11
16 is +1 and the code of the next address in the A register 1112 is read. In step 1310, B register 1
If the output code of 114 is determined to be 0, the ADR2 counter 1118 is incremented by 1, the code of the next address of the B register 1144 is read out, and the FLG register is reset (step 1311), and the process returns to step 1306.

ステップ1309の判定条件が不成立の場合、ステップ
1316に進む。このステップ1316の詳細を第17
図により説明する。まず、MODEレジスタのb1部分
の値が0であるか調べる(ステップ1401)、なお、
MODEレジスタには検索制御部1106により識別子
の情報が予め設定されている。b1=0であれば、すな
わち当該辞書コード列が「部分対応」のマツチングを指
定されていれば、マツチング制御部1122はマツチン
グ結果を一致と判定し、結果のフラグとしてのRLTレ
ジスタを1にセットする(ステップ1405)。
If the determination condition in step 1309 is not met, the process advances to step 1316. The details of this step 1316 are explained in the 17th section.
This will be explained using figures. First, check whether the value of the b1 part of the MODE register is 0 (step 1401).
Identifier information is preset in the MODE register by the search control unit 1106. If b1 = 0, that is, if the dictionary code string specifies "partial correspondence" matching, the matching control unit 1122 determines the matching result as a match, and sets the RLT register as a flag of the result to 1. (step 1405).

b1〜0の場合(当該辞書コード列が「全体対応」のマ
ツチングを指定されている)、さらにADRIカウンタ
1116の値がANレジスタの値と一致するか調べる(
ステップl 402)。なお。
In the case of b1 to 0 (the corresponding dictionary code string is specified for "general matching" matching), further check whether the value of the ADRI counter 1116 matches the value of the AN register (
Step l 402). In addition.

ANレジスタには、検索制御部1106により未知コー
ド列のコード数が予め設定されている。
The number of codes of the unknown code string is preset in the AN register by the search control unit 1106.

ステップ1402の比較が一致した場合、すなわち未知
コード列の最後のコードまでマツチングが進んだ場合は
、マツチングの結果を不一致と判定してRLTレジスタ
に1を設定する(ステップ1404)。そうでない場合
、マツチングの結果を不一致と判定してRLTレジスタ
に0を設定する(ステップ1403)。
If the comparison in step 1402 results in a match, that is, if the matching has progressed to the last code of the unknown code string, the matching result is determined to be a mismatch, and 1 is set in the RLT register (step 1404). If not, the matching result is determined to be a mismatch, and 0 is set in the RLT register (step 1403).

第16図に戻って説明する。ステップ1307によって
コードが不一致と判定した場合、FLGレジスタがセッ
ト状態であるかを調べる(ステップ1312)。リセッ
ト状態であればステップ1306に戻り、Aレジスタ1
112の次のアドレスのコードを読出すが、セット状態
の場合はMODEレジスタのb1部分の値がOであるか
調べる(ステップ1313)、bl〜0の場合、すなわ
ち当該辞書コード列が[全体対応」のマツチングを指定
されている場合、マツチングは不一致と判定し、RLT
レジスタに0を設定する(ステップ1315)、bl=
oの場合は、CENTカウンタ1124を+1しくステ
ップ1314)、ステップ302に戻りマツチングをし
直す。この場合、前回のマツチングにおけるAレジスタ
1112の最初のアドレスの次のアドレスのコードから
マツチング処理が行われることになる。
The explanation will be returned to FIG. 16. If it is determined in step 1307 that the codes do not match, it is checked whether the FLG register is set (step 1312). If it is in the reset state, return to step 1306 and register A register 1.
The code at the next address of 112 is read out, and if it is in the set state, it is checked whether the value of the b1 part of the MODE register is O (step 1313); if bl~0, that is, the dictionary code string is ”, the matching is determined to be a mismatch, and the RLT
Set the register to 0 (step 1315), bl=
If o, the CENT counter 1124 is incremented by 1 (step 1314), and the process returns to step 302 to perform matching again. In this case, the matching process will be performed from the code at the address next to the first address of the A register 1112 in the previous matching.

なおステップ1315,1403,1404゜1405
に進んだ場合、マツチング制御部1122はマツチング
処理の終了を検索制御部1106に通知する。
Note that steps 1315, 1403, 1404゜1405
If the process proceeds to , the matching control unit 1122 notifies the search control unit 1106 that the matching process has ended.

以上説明したマツチング処理について、具体的なコード
列を用いて説明する。
The matching process described above will be explained using a specific code string.

まず1部分対応」のマツチング動作について説明する。First, the matching operation of "one-part correspondence" will be explained.

検索制御部1106の制御により、第2図に示すコード
列が未知コード列として、図示のようなアドレス関係に
てAレジスタ1112に設定され、また、第18図(イ
)に示すコード列が辞書コード列として図示のアドレス
関係にてBレジスタ1114に設定されたとする。この
場合のマツチング処理におけるアドレス、コード、フラ
グの遷移を第19図に示す。
Under the control of the search control unit 1106, the code string shown in FIG. 2 is set as an unknown code string in the A register 1112 with the address relationship shown in the figure, and the code string shown in FIG. Assume that the code string is set in the B register 1114 according to the address relationship shown in the figure. FIG. 19 shows the transition of addresses, codes, and flags in the matching process in this case.

検索制御部1106によってレジスタ群1108中のM
ODEレジスタはbl=oに設定される。
M in the register group 1108 by the search control unit 1106
The ODE register is set to bl=o.

マツチング制御部1122は起動をかけられると、FL
Gレジスタを1にセットし、Bレジスタ1114のアド
レスOのコードを読出すが、このコードは特殊コード0
でないため、Aレジスタ1112のアドレスOのコード
を読出す(第19図のステップ1)。A、Bレジスタ1
112,1114から読出されたコードは両方とも4で
あり、一致するため、ADR2カウンタ1118を+1
してBレジスタ1114のアドレス1のコードを読出す
(ステップ2)。
When the matching control unit 1122 is activated, the FL
Set the G register to 1 and read the code at address O of the B register 1114, but this code is special code 0.
Therefore, the code at address O of the A register 1112 is read (step 1 in FIG. 19). A, B register 1
The codes read from 112 and 1114 are both 4 and match, so the ADR2 counter 1118 is increased by +1.
Then, the code at address 1 of B register 1114 is read out (step 2).

このコードは特殊コードOであるから、マツチング制御
部1122はFLGレジスタをOにリセットするとNも
に、ADR2カウンタ1118を+1してBレジスタ1
114のアドレス2のコードを読出す(ステップ3)。
This code is a special code O, so when the matching control unit 1122 resets the FLG register to O, it also adds 1 to the ADR2 counter 1118 and sets the B register 1.
The code at address 2 of 114 is read out (step 3).

このコードは2で一致せず、FLGレジスタもリセット
状態であるから、ADRIカウンタ1116を+LL、
Aレジスタ1112のアドレス1のコードを読出す(ス
テップ4)。これも不一致であり、FLG=Oであるの
で、ADR1カウンタ1116を+1してAレジスタ1
112のアドレス2のコードを読出す(ステップ5)。
This code is 2, which does not match, and the FLG register is also in the reset state, so set the ADRI counter 1116 to +LL,
The code at address 1 of A register 1112 is read (step 4). This is also a mismatch and FLG=O, so the ADR1 counter 1116 is +1 and the A register 1 is
The code at address 2 of 112 is read out (step 5).

このコードは2で、辞書コード列のコードと一致するの
で、FLGレジスタをセットすると\もに、ADH2カ
ウンタ1118を+ILBレジスタ1114から次のコ
ードを読出す(ステップ6)。
This code is 2, which matches the code in the dictionary code string, so when the FLG register is set, the next code is read from the ADH2 counter 1118 and the ILB register 1114 (step 6).

このコードはOであるので、FLGレジスタをリセット
し、またADR2カウンタ1118を+1して次のコー
ドを読出す(ステップ7)。
Since this code is O, the FLG register is reset, the ADR2 counter 1118 is increased by 1, and the next code is read (step 7).

このコードはOでないので、ADRIカウンタ1116
を+1してAレジスタ1112のアドレス3のコードを
読出す(ステップ8)。このコードは1で、Bレジスタ
1114の出力コード4とは一致せず、またFLG=O
であるので、ADR1カウンタ1116を+LL、Aレ
ジスタ1112のアドレス4のコードを読出す(ステッ
プ9)。
Since this code is not O, the ADRI counter 1116
is incremented by 1 and the code at address 3 of the A register 1112 is read out (step 8). This code is 1, which does not match the output code 4 of the B register 1114, and FLG=O
Therefore, the ADR1 counter 1116 is set to +LL and the code at address 4 of the A register 1112 is read (step 9).

このコードは4で一致がとれるので、FLGレジスタを
セットする。こぎで、この時のADR2カウンタ111
8は辞書コード列の最終コードに対応したアドレスまで
増加しているので、マツチング制御部1124は一致が
とれたと判定し、マツチング結果の判定結果のフラグと
してのRLTレジスタに1を設定する。
Since this code matches with 4, set the FLG register. At this time, ADR2 counter 111
Since 8 has increased to the address corresponding to the final code of the dictionary code string, the matching control unit 1124 determines that a match has been achieved and sets 1 in the RLT register as a flag indicating the determination result of the matching result.

このように制御コードOによって比較するコードの対応
関係の手順が制御されながらマツチングが実行されるが
、こNではマツチング方法は1部分対応」であるため、
未知コード列のアドレス1゜3のコードが無視され、ア
ドレス0,2.4のコードが辞書コード列のアドレス0
,2.4のコードと順次一致することにより、マツチン
グは一致ないし成立した(対応関係がとれた)と判定さ
れる。
In this way, matching is executed while controlling the procedure of the correspondence of the codes to be compared by the control code O, but in this N, the matching method is "one-part correspondence", so
The code at address 1.3 of the unknown code string is ignored, and the code at address 0, 2.4 is ignored at address 0 of the dictionary code string.
, 2.4, it is determined that matching has been achieved (correspondence has been established).

第2図の未知コード列と第18図(ロ)の辞書コード列
とのマツチング(1部分対応」)の場合。
In the case of matching (one-part correspondence) between the unknown code string in FIG. 2 and the dictionary code string in FIG. 18(b).

前記の例と同様の動作によりアドレス、コード、フラグ
の遷移は第20図に示すようになるが、ステップ7でコ
ードの対応関係がとれなくなり、第16図のステップ1
315に進んで結果は不一致となる。
By the same operation as in the above example, the transition of addresses, codes, and flags becomes as shown in FIG.
Proceeding to 315, the result is a mismatch.

次に、第2図の未知コード列と第18図(ハ)の辞書コ
ード列とのマツチング(「部分対応」)を説明する。こ
の場合、アドレス、コード、フラグの遷移は第21図に
示すようになる。
Next, matching ("partial correspondence") between the unknown code string in FIG. 2 and the dictionary code string in FIG. 18(c) will be explained. In this case, the transitions of addresses, codes, and flags are as shown in FIG.

最初に辞書コード列のアドレスOのコードが読出される
(ステップ1)が、このコードは0すなわち特殊コード
であるから、第16図のステップ1305の処理に進む
ため、FLGレジスタがリセットされるとシもにADR
2カウンタ1118が+1されて辞書コード列のアドレ
ス1のコードが読出され、こ〜から未知コード列との比
較が始まる(ステップ2)。
First, the code at address O in the dictionary code string is read (step 1), but since this code is 0, that is, a special code, the process proceeds to step 1305 in FIG. 16, so when the FLG register is reset. Shimoni ADR
2 counter 1118 is incremented by 1, the code at address 1 of the dictionary code string is read out, and comparison with the unknown code string starts from here (step 2).

マツチング処理が進み、ステップ10でコードの比較が
不一致となり、その時にFLGレジスタがセット状態で
あるため、第16図のステップ1313に進む。こ\で
はbl=o(1部分対応」)であるから、ステップ13
14を経由してステップ1302に処理が戻る。したが
って、第21図のステップ11より2回目のマツチング
が開始する。たゾし、未知コード列のアドレスOのコー
ドはマツチングから除外され、アドレス1のコード以降
を対象としてマツチングが行われる。
As the matching process progresses, the code comparison results in a mismatch in step 10, and since the FLG register is in the set state at that time, the process advances to step 1313 in FIG. In this case, bl=o (one-part correspondence), so step 13
The process returns to step 1302 via step 14. Therefore, the second matching starts from step 11 in FIG. Therefore, the code at address O in the unknown code string is excluded from matching, and matching is performed for the code at address 1 and onwards.

マツチング処理が進み、ステップ7で未知コード列の最
終コードまで一致がとれると、第16図のステップ13
08を経てステップ1309に進み、こNからステップ
1316に入り、最終的に一致と判定される。
When the matching process progresses and a match is achieved up to the last code of the unknown code string in step 7, step 13 in FIG.
The process proceeds to step 1309 via step 08, and from this step N, the process proceeds to step 1316, where it is finally determined that there is a match.

なお、3回目のマツチングを行う場合、未知コード列の
アドレス0,1のコードは無視され、アドレス2以降の
コードが対象となる。
Note that when matching is performed for the third time, the codes at addresses 0 and 1 of the unknown code string are ignored, and the codes from address 2 onwards are targeted.

次に「全体対応」のマツチング処理について説明する。Next, the "overall matching" matching process will be explained.

「全体対応」のマツチングでは、辞書コード列がすべて
未知コード列に存在するとき、未知コード列の最終コー
ドまでマツチングが進んだかどうかを判定しく第17図
のステップ1402)、最後まで進んだならばマツチン
グが一致したと判定するが、最後まで進んでいなければ
不一致と判定する。辞書コード列中の特殊コードOの役
目は1部分対応」の場合と同様である。
In "overall matching" matching, when all the dictionary code strings exist in the unknown code string, it is necessary to judge whether the matching has progressed to the final code of the unknown code string (step 1402 in Fig. 17), and if it has progressed to the end. It is determined that the matching matches, but if the matching has not progressed to the end, it is determined that there is a mismatch. The role of the special code O in the dictionary code string is the same as in the case of "one-part correspondence".

例えば第2図に示した未知コード列と第22図(イ)の
辞書コード列とのマツチングの場合、未知コード列のア
ドレス1のコードで辞書コード列のすべてと一致がとれ
、未知コード列の最終コードまでマツチングが進まない
ため、第17図のステップ1402からステップ140
3に進み、最終的に不一致と判定される。
For example, when matching the unknown code string shown in Figure 2 with the dictionary code string shown in Figure 22 (A), the code at address 1 of the unknown code string matches all of the dictionary code strings, and the unknown code string Since matching does not proceed to the final code, steps 1402 to 140 in FIG.
The process proceeds to step 3 and is finally determined to be a mismatch.

第2図の未知コード列と第22図(ロ)の辞書コード列
のマツチングの場合も同様であり、不一致と判定される
The same applies to the case of matching the unknown code string in FIG. 2 and the dictionary code string in FIG. 22(b), and it is determined that they do not match.

第2図の未知コード列と第22図(ニ)の辞書コード列
とのマツチングの場合、未知コード列の最終アドレス7
で辞書コード列のコード(3,4゜1)のすべてについ
て一致がとれるため、マツチングは一致と判定される。
In the case of matching the unknown code string in Fig. 2 with the dictionary code string in Fig. 22 (d), the final address 7 of the unknown code string
Since all of the codes (3, 4° 1) in the dictionary code string are matched, the matching is determined to be a match.

次に、辞書の内容を第14図に示す通りとし、入力レジ
スタ1102を介して第15図に示すような未知コード
列が入力された場合の辞書検索動作について、第12図
を参照して説明する。
Next, the dictionary search operation when the contents of the dictionary are as shown in FIG. 14 and an unknown code string as shown in FIG. 15 is input via the input register 1102 will be explained with reference to FIG. do.

検索制御部1106は、入力された未知コード列をAレ
ジスタ1112に設定すると\もに、そのコード列数を
レジスタ群1108中のANレジスタに設定する(ステ
ップ1200)。なお、検索制御部1106は辞書アク
セス用のポインタを持っており、この時点ではアドレス
0に設定される。
When the search control unit 1106 sets the input unknown code string in the A register 1112, it also sets the number of code strings in the AN register in the register group 1108 (step 1200). Note that the search control unit 1106 has a pointer for dictionary access, which is set to address 0 at this point.

次に検索制御部1106はポインタが指定するアドレス
の1バイトがターミネータrFFJであるか調べる。最
初はアドレス0の1バイト、すなわち辞書構成単位■の
文字コードのバイ1へが調べられることになり、ターミ
ネータではないから、ステップ1202に進む。
Next, the search control unit 1106 checks whether 1 byte of the address specified by the pointer is the terminator rFFJ. Initially, one byte at address 0, that is, byte 1 of the character code of the dictionary constituent unit ■, is examined, and since it is not a terminator, the process advances to step 1202.

初めてこのステップ1202に進んだ場合、検索制御部
1106は辞書構成単位のを読出し、その文字コード(
α)をC0DEレジスタに、識別子をMODEレジスタ
に、飛び先番地をJADRレジスタに、コード列数をB
Nレジスタに、また辞書コード列をBレジスタ1114
に設定する。
When proceeding to step 1202 for the first time, the search control unit 1106 reads out the dictionary constituent unit and uses its character code (
α) in the C0DE register, the identifier in the MODE register, the jump address in the JADR register, and the number of code strings in B
The dictionary code string is stored in the N register, and the dictionary code string is stored in the B register 1114.
Set to .

そして、ポインタを次の辞書構成rp1位の先頭アドレ
ス(8)に更新する。なお、辞書コード列は可変長であ
るため、その長さをコード列数によって認識し、またポ
インタを更新する。このような制御の後、検索制御部1
106はマツチング制御部1122を起動する。
Then, the pointer is updated to the first address (8) of the next dictionary configuration rp. Note that since the dictionary code string has a variable length, its length is recognized by the number of code strings, and the pointer is updated. After such control, the search control unit 1
106 activates the matching control section 1122.

マツチング制御部1122の制御により、A。A under the control of the matching control unit 1122.

B、レジスタ1112.1114内のコード列について
第16図および第17図によって説明したようなマツチ
ング処理が実行される(ステップ1203)。最終的な
マツチング結果の判定結果が得られると、終了通知が検
索制御部1106に送出される。
B. Matching processing as described with reference to FIGS. 16 and 17 is performed for the code strings in registers 1112 and 1114 (step 1203). When the final matching result determination result is obtained, a completion notification is sent to the search control unit 1106.

検索制御部1106は終了通知を受けると、マツチング
結果のフラグであるR L Tレジスタの値を調べる(
ステップ1204)。最初は■の^?、書コード列との
マツチングであり、不一致となろためRLT=Oである
。したがって、検索制御部1106はステップ1206
に進み、ポインタか示すアドレスの1バイト(辞書構成
単位(■の先頭バイト)を参照し、ステップ1201の
判定を行う。
When the search control unit 1106 receives the completion notification, it checks the value of the RLT register, which is the flag of the matching result (
Step 1204). At first, ■ ^? , and the writing code string, and since they do not match, RLT=O. Therefore, the search control unit 1106 performs step 1206.
The process proceeds to step 1201, and refers to the 1 byte (dictionary constituent unit (first byte of ■) of the address indicated by the pointer), and performs the determination in step 1201.

この場合、ターミネータでないから、辞書構成単位■を
続出して辞書コード列をBレジスタ1114に設定し、
その他のバイトをレジスタ群1108の対応したレジス
タにそれぞれ設定し、マツチング制御部1122を起動
する(ステップ1202)。
In this case, since it is not a terminator, the dictionary constituent unit ■ is output one after another and the dictionary code string is set in the B register 1114,
The other bytes are set in the corresponding registers of the register group 1108, and the matching control unit 1122 is activated (step 1202).

辞書構成単位■のマツチングでは一致がとれるため、検
索制御部1106はMODEレジスタの値をチェックす
る(ステップ1208)。こ\ではMODEレジスタの
値(:1別子)は01であるから、辞書構成単位(2)
の飛び先番地をポインタに設定し、アドレス24の1パ
イ1〜すなわち構成m位■の先頭バイトを参照しくステ
ップ1210)、ステップ1201の判定を行う。
Since a match is obtained by matching the dictionary constituent unit (2), the search control unit 1106 checks the value of the MODE register (step 1208). In this case, the value of the MODE register (:1 identifier) is 01, so the dictionary configuration unit (2)
The jump destination address is set in the pointer, and the determinations in step 1210) and step 1201 are made with reference to the first byte of 1 pie 1 to 2 of the configuration m in address 24.

このバイトはターミネータではないから、ステップ12
02に進み、辞書構成単位(4)の辞書コード列をBレ
ジスタ1114に設定し、その他のバイトをレジスタ群
1108に設定したのちマツチング制御部1122を起
動する。
This byte is not a terminator, so step 12
02, the dictionary code string of the dictionary constituent unit (4) is set in the B register 1114, the other bytes are set in the register group 1108, and then the matching control unit 1122 is activated.

この辞書コード列のマツチングは不一致になるため、処
理はステップ1204.ステップ1206、ステップ1
202と進み、辞書構成tr1位■の辞書コード列と未
知コード列のマツチングが実行される。このマツチング
では一致がとれ、RLTレジスタは1に設定されるため
、ステップ1208に進む。こ\ではMODEレジスタ
の値は00であるから、ステップ1212に進む。この
ステップにおいて、検索制御部106はC0DEレジス
タに設定されている文字コード(α)を出力レジスタ1
104に設定し辞書から抜ける(ステップ1212)。
Since this matching of dictionary code strings results in a mismatch, the process proceeds to step 1204. Step 1206, Step 1
Proceeding to step 202, matching of the dictionary code string of the first place (■) in the dictionary configuration tr and the unknown code string is executed. This matching results in a match and the RLT register is set to 1, so the process advances to step 1208. In this case, the value of the MODE register is 00, so the process advances to step 1212. In this step, the search control unit 106 outputs the character code (α) set in the C0DE register to the output register 1.
104 and exits from the dictionary (step 1212).

すなわち、当該辞書の検索は終了である。In other words, the search of the dictionary is completed.

なお、もし■の辞書コード列とのマツチングが不一致の
場合、ターミネータが参照される結果、ステップ121
4に進み、リジェクトコードが出力レジスタ1104に
設定されて辞)1F検索を終了する。
Note that if the matching with the dictionary code string of ■ does not match, the terminator is referenced and as a result step 121
4, a reject code is set in the output register 1104, and the 1F search ends.

このように、辞書コード列に付加した制御情報に従って
辞書検索の流れを柔軟に制御することができ、その制御
は簡単であると\もに、制御のための記述も容易である
In this way, 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.

なお、第11図のマツチング制御部、検索制御部などは
ハードウェアによって実現してもよいし、ラフ1−ウェ
アによって実現してもよい。
Note that the matching control section, search control section, etc. shown in FIG. 11 may be realized by hardware, or may be realized by rough hardware.

第23図は本発明の第3の実施例の辞書検索装置の機能
ブロック図を示す。この辞書検索装置の全体構成図は第
11図に示した第2実施例の辞書検索装置と同様であり
、また、辞書検索動作の全体的流れは第12図によって
示される通りであって第2実施例と全く同一である。
FIG. 23 shows a functional block diagram of a dictionary search device according to a third embodiment of the present invention. The overall configuration diagram of this dictionary search device is the same as the dictionary search device of the second embodiment shown in FIG. 11, and the overall flow of the dictionary search operation is as shown in FIG. It is exactly the same as the example.

しかし、マツチング処理部11’l Oa内のマツチン
グ制御部1122aに制御用のADROカウンタ112
5.ADRカウンタ1126、ADRBカウンタ112
7が追加され、また、Aレジスタ1112の出力コード
がマツチング制御部1122aに入力され、マツチング
処理内容も一部違いがある。また、辞書メモリ1100
に格納される辞書のデータ構造および入力レジスタ11
02に入力する未知コード列の構造に一部違いがある。
However, the ADRO counter 112 for control is not installed in the matching control unit 1122a in the matching processing unit 11'l Oa.
5. ADR counter 1126, ADRB counter 112
7 is added, and the output code of the A register 1112 is input to the matching control unit 1122a, and there are some differences in the contents of the matching process. In addition, the dictionary memory 1100
Dictionary data structure and input register 11 stored in
There are some differences in the structure of the unknown code string input to 02.

以下、第2実施例との違いを中心にして、本実施例につ
いて詳細に説明する。
Hereinafter, this embodiment will be described in detail, focusing on the differences from the second embodiment.

第24図に辞書の構造を例示する。この図と第2実施例
に関連した第13図と比較すると明らかなように1本実
施例における辞書においては、各辞書構成単位のコード
列の各コードの次アドレスに、当該コードに関連した長
さまたは量の情報が付加されている。具体的には、各コ
ードは、第8図に関連して説明したようなパターンのス
トロークの方向を示す方向コードであり、各コードには
対応のストロークの長さの情報が付加されている。
FIG. 24 illustrates the structure of the dictionary. As is clear from a comparison between this figure and FIG. 13 related to the second embodiment, in the dictionary according to the present embodiment, the next address of each code in the code string of each dictionary constituent unit has a length associated with the code. Information about the size or amount is added. Specifically, each code is a direction code indicating the direction of the stroke of the pattern as described in connection with FIG. 8, and information on the length of the corresponding stroke is added to each code.

なお、辞書のコード列には第2実施例と同様に比較対応
関係の変更のための特殊コード(0)が必要に応じて挿
入されるが、この特殊コードに対しては、0を示す情報
が付加される。これ以外の辞書構造は第2実施例の場合
と同一である。
Note that a special code (0) for changing the comparison correspondence is inserted into the code string of the dictionary as necessary, as in the second embodiment, but for this special code, information indicating 0 is inserted. is added. The dictionary structure other than this is the same as in the second embodiment.

第25図は入力レジスタ1102に入力する未知コード
列の一例である6図示のように本実施例においては、未
知コード列も辞書のコード列と同様に、コード(例えば
方向コード)にそれに関連した長さまた量(例えばスト
ロークの長さ)の情報を付加した構造である。
FIG. 25 is an example of an unknown code string input to the input register 1102. As shown in FIG. This is a structure in which information about length or quantity (for example, stroke length) is added.

本実施例においては、上述のような辞書のコード列と未
知コード列とのマツチングにおいて、各コード(例えば
方向コード)の比較を行うだけでなく、各コードに関連
して長さまたは量(例えばストローク兼)の比較も行う
。このような長さまたは量の比較をも行う関係で、マツ
チング処理部1110aのマツチング制御部1122a
は、前述のように3つのレジスタ1125,112f;
In this embodiment, in matching the dictionary code string and the unknown code string as described above, not only each code (for example, direction code) is compared, but also the length or quantity (for example, We also compare strokes (combined with strokes). In order to also compare such lengths or amounts, the matching control unit 1122a of the matching processing unit 1110a
As mentioned above, the three registers 1125, 112f;
.

1127を新たに備えている。1127 is newly equipped.

第26図はマツチング処理部1110aの動作のフロー
チャートである。なお、ステップ2112は第16図の
ステップ1316と同様の処理ステップであり、その内
容は第17図に示す通りである。
FIG. 26 is a flowchart of the operation of the matching processing section 1110a. Note that step 2112 is a processing step similar to step 1316 in FIG. 16, and its contents are as shown in FIG. 17.

本実施例のマツチング処理は、第2実施例と同様に未知
コード列と辞書コード列とのコードの比較を行い、それ
が一致するとステップ2109により、その時の比較対
象のコードに関連した長さまたは量の差の絶対値dが所
定の値TH(例えば2)以下であるか否かを調べ、差の
絶対値がTH以下であれば当該コードは一致とするが、
差の絶対値がTHを越える場合は当該コードの比較を不
一致と判定することが大きな特徴である。すなわち、コ
ード比較およびコードに関連した長さまたは量の比較に
よりマツチングを行うことが、第1実施例および第2実
施例との主たる違いである。
In the matching process of this embodiment, as in the second embodiment, the codes of the unknown code string and the dictionary code string are compared, and if they match, step 2109 is performed to match the length or length associated with the code being compared at that time. It is checked whether the absolute value d of the difference in quantity is less than or equal to a predetermined value TH (for example, 2), and if the absolute value of the difference is less than or equal to TH, the code is determined to be a match.
A major feature is that when the absolute value of the difference exceeds TH, the comparison of the codes is determined to be a mismatch. That is, the main difference between the first and second embodiments is that matching is performed by comparing codes and comparing the lengths or quantities associated with the codes.

以下、第26図に示す処理の流れ沿ってマツチング処理
動作を詳細に説明する。マツチング制御部1122aは
検査制御部1106により起動されると、初期設定とし
てCNTカウンタ1124に−1を設定し、またはAD
ROカウンタ1125に一2振設定する(ステップ21
01)。
The matching processing operation will be described in detail below along the processing flow shown in FIG. When the matching control unit 1122a is activated by the inspection control unit 1106, the matching control unit 1122a sets -1 to the CNT counter 1124 as an initial setting, or
Set 12 swings in the RO counter 1125 (step 21
01).

ステップ2102はステップ2103以降の実際のマツ
チング処理のための初期設定のステップである。このス
テップで、マツチング制御部1122aはADRAカウ
ンタ1126にADROカウンタ1125の値を設定し
、ADRBカウンタ1127に0を設定し、またFLG
レジスタ(フラグ)を1にセットする。
Step 2102 is an initial setting step for actual matching processing after step 2103. In this step, the matching control unit 1122a sets the value of the ADRO counter 1125 in the ADRA counter 1126, sets the value of the ADRB counter 1127 to 0, and
Set the register (flag) to 1.

次にマツチング制御部1122aは、FLGレジスタが
リセット状態(0)であるか調べ(ステップ2103)
、リセット状態であればステップ2106にジャンプす
る。
Next, the matching control unit 1122a checks whether the FLG register is in the reset state (0) (step 2103).
, if it is in the reset state, jump to step 2106.

FLGレジスタがセット状態(1)であれば、マツチン
グ制御部1122aはBレジスタ1114の出力コード
(アドレスOのコード)が0すなわち特殊コードである
か比較回路1120の出力により調べ(ステップ210
4)、特殊コードでなければステップ2106にジャン
プする。特殊コードであれば、FLGレジスタをリセッ
トするとへもにADRBカウンタ1127を+1しくス
テップ2105)、ステップ2103に戻る。
If the FLG register is set (1), the matching control unit 1122a checks whether the output code of the B register 1114 (code at address O) is 0, that is, a special code, based on the output of the comparison circuit 1120 (step 210).
4) If the code is not a special code, jump to step 2106. If it is a special code, the FLG register is reset, the ADRB counter 1127 is incremented by 1 (step 2105), and the process returns to step 2103.

ステップ2103または2104からステップ2106
にジャンプすると、マツチング制御部1122aはA 
D E< Aカウンタ1126を+2し、ADRAカウ
ンタ1126の値をADR1カウンタ1116に、A 
D RBカウンタ1127の値をADR2カウンタ11
18にそれぞれ設定する。
Step 2103 or 2104 to step 2106
When jumping to A, the matching control unit 1122a
D E< Add 2 to A counter 1126, set value of ADRA counter 1126 to ADR1 counter
D The value of the RB counter 1127 is transferred to the ADR2 counter 11.
18 respectively.

その結果、Aレジスタ1112よりADRIカウンタ1
116によって指定されたアドレスのコードと、Bレジ
スタ1114のADR2カウンタ1118によって指定
されたアドレスのコードとが出力され、比較回路112
0により比較される。
As a result, ADRI counter 1 is set from A register 1112.
The code of the address specified by 116 and the code of the address specified by ADR2 counter 1118 of B register 1114 are output, and the code of the address specified by ADR2 counter 1118 of B register 1114 is output.
Compare by 0.

マツチング制御部1122aは比較回路1120の出力
を調べ(ステップ2107)、比較が一致ならばステッ
プ2108に進み、不一致ならばステップ2115に進
む。
The matching control unit 1122a checks the output of the comparison circuit 1120 (step 2107), and if the comparison shows a match, the process proceeds to step 2108, and if the comparison does not match, the process proceeds to step 2115.

コードの比較が一致した場合、ステップ2108におい
て、ADRAカウンタ1126の値に1を加えた値をA
DRIカウンタ1116に設定し。
If the codes match, in step 2108, the value obtained by adding 1 to the value of the ADRA counter 1126 is set to A.
Set in DRI counter 1116.

ADRBカウンタ1127の値に1を加えた値をADR
2カウンタ1118に設定することにより、未知コード
列および辞書コード列中の比較が一致したコードの長さ
または量の情報をA、Bレジスタ1112.1114よ
り出力させ、その長さまたは量の差の絶対値dをJf算
する。そして、ステップ2109により、dがTII以
下であるか否かを調べる。dがTH以下の場合、当該コ
ードの比軟一致を有効と判断しステップ2110に進む
が、dがTHを越えた場合には当該コード比較の一致は
有効とは評価せず、ステップ2115に進む。
ADR is the value of ADRB counter 1127 plus 1.
By setting the 2 counter 1118, information on the length or amount of the matched code in the unknown code string and the dictionary code string is output from the A and B registers 1112 and 1114, and the difference in length or amount is outputted from the A and B registers 1112 and 1114. Calculate the absolute value d by Jf. Then, in step 2109, it is checked whether d is less than or equal to TII. If d is less than or equal to TH, the soft match of the code is determined to be valid and the process proceeds to step 2110; however, if d exceeds TH, the code comparison match is not evaluated to be valid and the process proceeds to step 2115. .

ステップ2110に進んだ場合、マツチング制御部11
22aはADRBレジスタ1127の値に1を加えた値
をADH2カウンタ1118に設定し、またFLGレジ
スタをセットする。次に、ADR2カウンタ1118の
イ直がBNレジスタの値以下であるか調べる(ステップ
2111)。なお、BNレジスタには、検索制御部11
06により/1?書コード列のコード列数が予め設定さ
れている。
If the process proceeds to step 2110, the matching control unit 11
22a sets a value obtained by adding 1 to the value of the ADRB register 1127 in the ADH2 counter 1118, and also sets the FLG register. Next, it is checked whether the value of the ADR2 counter 1118 is less than or equal to the value of the BN register (step 2111). Note that the BN register contains the search control unit 11.
By 06/1? The number of code strings of the writing code strings is set in advance.

ADR2カウンタ値≦BNレジスタ値の場合、マツチン
グ制御部1122aはBレジスタ1114の出力コード
(ADRZカウンタ1118によって指定されたアドレ
スのコード)がOすなわち特殊コードであるか調べる(
ステップ2113)。
If the ADR2 counter value≦BN register value, the matching control unit 1122a checks whether the output code of the B register 1114 (the code at the address specified by the ADRZ counter 1118) is O, that is, a special code (
Step 2113).

特殊コードでなければステップ2106に戻るが、特殊
コードの場合には、ステップ2114によりADRBレ
ジスタ1127の値を+2とし、かっFLGレジスタを
リセットしてからステップ2106に戻る、 ステップ2111の判定が不成立の場合、マツチング制
御部1122aはステップ2112の判定を行い、RL
Tレジスタをセラ1−またはりセラ1〜する(この判定
の内容は第17図の通り)。
If the code is not a special code, the process returns to step 2106, but if it is a special code, the value of the ADRB register 1127 is set to +2 in step 2114, the FLG register is reset, and the process returns to step 2106. If RL
The T register is set to Sera 1- or Sera 1- (the content of this determination is as shown in FIG. 17).

ステップ2107でコード比較が不一致と判定された場
合、またはステップ2109で比較一致が有効とは認め
られなかった場合、マツチング制御部L122aはFL
Gレジスタがリセット状態(0)であるか調べ(ステッ
プ2115)、リセット状態ならばステップ2106の
処理に戻る。
If it is determined in step 2107 that the code comparison does not match, or if it is determined that the comparison match is not valid in step 2109, the matching control unit L122a
It is checked whether the G register is in the reset state (0) (step 2115), and if it is in the reset state, the process returns to step 2106.

他方、FLGレジスタがリセット状態でなければ、MO
DEレジスタのb1部分の値が0であるか調べる(ステ
ップ2116)。b1〜Oの場合。
On the other hand, if the FLG register is not in the reset state, the MO
It is checked whether the value of the b1 portion of the DE register is 0 (step 2116). In the case of b1~O.

すなわち当該辞書コード列が「全体対応」のマツチング
を指定されている場合、マツチングは不一致と判定し、
RLTレジスタ(結果フラグ)にOを設定しくステップ
2118)、マツチングは終了する。b1=0の場合、
すなわち1部分対応のj場合には、CNTカウンタ11
24を+1したのち、CNTカウンタ1124の値を2
倍した値をA D RQレジスタ1125に設定しくス
テップ2117)、ステップ2102に仄すマッチング
処理を(1)開する。
In other words, if the dictionary code string in question is specified for matching of "whole correspondence", the matching is determined to be a mismatch, and
The RLT register (result flag) is set to O (step 2118), and the matching ends. If b1=0,
In other words, in the case of j corresponding to one part, the CNT counter 11
After adding 1 to 24, the value of CNT counter 1124 is increased by 2.
The multiplied value is set in the ADRQ register 1125 (step 2117), and matching processing in step 2102 is started (1).

なお、ステップ2112またはステップ2118に進ん
だ場合、マツチング制御部LL22aはマツチング処理
の終了を検索制御部L I Q 6に通知する。
Note that when the process proceeds to step 2112 or step 2118, the matching control unit LL22a notifies the search control unit LIQ6 of the end of the matching process.

例えば第27図に示す未知コード列を図示のアドレス関
係でAレジスタ1112に格納し、第28図(イ)また
は(ロ)に示すような辞書コード列を図示のアドレス関
係でBレジスタ1114に格納して、r部分対応Jのマ
ツチングを行うとする。各コード列の奇数アドレスは長
さまたは量の情報である。
For example, the unknown code string shown in FIG. 27 is stored in the A register 1112 with the address relationship shown, and the dictionary code string shown in FIG. 28 (a) or (b) is stored in the B register 1114 with the address relationship shown. Assume that matching of r part correspondence J is performed. The odd addresses of each code string are length or quantity information.

第28図(イ)の辞書コード列とのマツチングの場合、
アドレス、コード、フラグの遷移は第29図のようにな
り、マツチング結果は一致となる。
In the case of matching with the dictionary code string in Figure 28 (a),
The transition of addresses, codes, and flags is as shown in FIG. 29, and the matching result is a match.

、たゾし、ステップ2109の判定閾値THは2とする
, and the determination threshold TH in step 2109 is set to 2.

第28図(ロ)の辞書コード列は、アドレス9の長さま
たは量が(イ)の辞書コード列と違うだけであるが、こ
の違いによりマツチング結果は不一致となる。
The dictionary code string in FIG. 28(B) differs from the dictionary code string in FIG. 28(B) only in the length or amount of address 9, but this difference causes a mismatch in the matching results.

このようにコード列に長さまたは量の情報を付加し、長
さまたは量の比較をマツチングに導入することにより、
マツチング精度を向上することができる。これについて
、具体的なパターンの例で説明する。
By adding length or quantity information to the code string in this way and introducing length or quantity comparison into matching,
Matching accuracy can be improved. This will be explained using a specific pattern example.

例えば、第30図(イ)に示す手書きの数字「0」のパ
ターンと、第30図(ロ)に示す手書きの数字「6ノの
パターンに、第8図により説明したような方向コードを
付与すると1図示のよう(イ)と(ロ)には全く同一の
方向コードが同一順序で付与されることになる。したが
って、方向コードだけからなるコード列のマツチングで
は、いずれのパターンも同一の辞書コード列とのマツチ
ングが成立してしまい識別不可能である。
For example, the handwritten number "0" pattern shown in Figure 30 (a) and the handwritten number "6" pattern shown in Figure 30 (b) are given a direction code as explained in Figure 8. Then, as shown in Figure 1, exactly the same direction codes are assigned to (a) and (b) in the same order.Therefore, when matching a code string consisting only of direction codes, both patterns are assigned the same dictionary. Matching with the code string is established and identification is impossible.

しかし、各パターンは傘印の部分のストローク長の違い
が相当に大きい。したがって、方向コードにストローク
長さを付加した構造の辞書コード列および未知コード列
とし、ストローク長さの比較をも行うマツチング処理で
あれば、傘印の部分のストローク長さの違いによって(
イ)のパターンのコード列は数字「0」の辞書コード列
とのマツチングが成立するも、数字「6」の辞書コード
列とのマツチングが不成立となり、(ロ)のパターンは
その逆となる。このようにして、類似パターンの識別精
度を上げることができる。
However, the stroke lengths of the umbrella marks in each pattern differ considerably. Therefore, if the dictionary code string and unknown code string have a structure in which the stroke length is added to the direction code, and the matching process also compares the stroke lengths, the difference in the stroke length of the umbrella mark part (
The code string of the pattern (b) is matched with the dictionary code string of the number "0", but not matched with the dictionary code string of the number "6", and the opposite is true for the pattern (b). In this way, the accuracy of identifying similar patterns can be improved.

〔効 果〕〔effect〕

以上の説明から明らかなように、本発明によれば、記号
列中に特殊記号を挿入することにより比較する記号の対
応関係の変更を極めて簡単に実現することができ、また
、辞書に’?録された記号列に特殊記号を挿入するとへ
もに制御情報を付加することにより、辞書検索における
マツチング方法および辞書検索流れの制御を簡単に行う
ことができ、パターン変形に強いパターン認識などを実
現する上で大きな効果がある。さらには、辞書記号列お
よび未知記号列に、その長さ情報をも付加することによ
り、類似パターンの識別精度も向上する効果がある。
As is clear from the above description, according to the present invention, by inserting special symbols into a symbol string, it is possible to extremely easily change the correspondence between symbols to be compared, and also to add '?' to a dictionary. By adding control information to the recorded symbol string when inserting special symbols, it is possible to easily control the matching method and dictionary search flow in dictionary searches, realizing pattern recognition that is resistant to pattern deformation. It has a great effect on doing so. Furthermore, by adding length information to dictionary symbol strings and unknown symbol strings, the accuracy of identifying similar patterns can also be improved.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例のマツチング処理装置の機能
ブロック図、第2図は第1の記号列(コード列)の−例
を示す図、第3図は第2の記号列の一例を示す図、第4
図乃至第6図は第2図、第3図の例のアドレス、コード
、フラグの遷移を示す図、第7図は第2の記号列の他の
一例を示す図。 第8図は本発明の応用例を示す図、第9図及び第10図
は第1図の処理フロー例を示す図、第11図は本発明の
他の実施例の辞i1F検索装置の機能ブロック図、第1
2図は辞書検索動作のフローチャ−ト、第13図は辞書
構成の一例を示す図、第14図は辞書の具体例を示す図
、第15図は未知コード列の一例を示す図、第16図は
マツチング処理のフローチャート、第17図は第16図
中のステップ1316の詳細フローチャート、第18図
は「部分対応」のマツチング処理の説明のための辞書コ
ード列を示す図、第19図ないし第21図はそれぞれ第
2図の未知コード列と第19図の各辞書コード列とのマ
ツチング処理におけるアドレス、コード、フラグの遷移
を示す図、第22図は「全体対応」のマツチング処理の
説明のための辞書コード列を示す図、第23図は本発明
の更に別の実施例の辞書検索装置の機能ブロック図、第
24図は辞書構成の一例を示す図、第25図は未知コー
ド列の一例を示す図、第26図はマツチング処理のフロ
ーチャート、第27図はマツチング処理を説明するため
の未知コード列を示す図、第28図は1部分対応」のマ
ツチング処理を説明するための辞書コード列を示す図、
第29図は第27図の未知コーダ処と第28図(イ)の
辞書コード列との1部分対応」のマツチングにおけるア
ドレス、コード、フラグの遷移を示す図、第30図は長
さまたは量の比較をマツチン′グに導入したことによる
効果を説明するための手書きパターンを示す図である。 11・・・Aレジスタ、  12・・・Bレジスタ、1
3・・・フラグ、  14・・・Aアドレスカウンタ。 15・・・Bアドレスカウンタ、 16・・・比較回路
、17・・・制御回路、  1100・・・辞書メモリ
、1102・・・入力レジスタ、 1104・・・出力レジスタ、 1106・・・検索制御部、 1108・・・レジスタ群。 1110.1110a・・・マツチング処理部、111
2・・・Aレジスタ、 1114・・・Bレジスタ。 1116・・・ADR1カウンタ、 1118・・・ADR2カウンタ、 1120・・・比較回路、 1122.1122a・・・マツチング制御部、112
4・・・CNTカウンタ、 1125・・・ADROレジスタ、 1126・・・ADRAレジスタ、 1127・・・ADRBレジスタ。 第1図 第  3  図 第4図 第  5  図 第6図 (イ)                    0口
)(/\)クード°列 B 第11図 第15図 第  17  図 第  19  図 第20図 第23図 第24図 第25図
FIG. 1 is a functional block diagram of a matching processing device according to an embodiment of the present invention, FIG. 2 is a diagram showing an example of a first symbol string (code string), and FIG. 3 is an example of a second symbol string. Figure 4 showing
6 to 6 are diagrams showing transitions of addresses, codes, and flags in the example of FIGS. 2 and 3, and FIG. 7 is a diagram showing another example of the second symbol string. FIG. 8 is a diagram showing an application example of the present invention, FIGS. 9 and 10 are diagrams showing an example of the processing flow of FIG. 1, and FIG. 11 is a function of the i1F search device according to another embodiment of the present invention Block diagram, 1st
2 is a flowchart of dictionary search operation, FIG. 13 is a diagram showing an example of the dictionary configuration, FIG. 14 is a diagram showing a specific example of the dictionary, FIG. 15 is a diagram showing an example of an unknown code string, and FIG. 16 is a diagram showing an example of the dictionary configuration. 17 is a detailed flowchart of step 1316 in FIG. 16, FIG. 18 is a diagram showing a dictionary code string for explaining the "partial correspondence" matching process, and FIGS. 21 is a diagram showing the transition of addresses, codes, and flags in the matching process between the unknown code string in FIG. 2 and each dictionary code string in FIG. FIG. 23 is a functional block diagram of a dictionary search device according to another embodiment of the present invention, FIG. 24 is a diagram showing an example of the dictionary configuration, and FIG. 25 is a diagram showing an unknown code string. A diagram showing an example, FIG. 26 is a flowchart of the matching process, FIG. 27 is a diagram showing an unknown code string to explain the matching process, and FIG. 28 is a dictionary code to explain the matching process of "1 partial correspondence" Diagram showing columns,
FIG. 29 is a diagram showing the transition of addresses, codes, and flags in matching "partial correspondence between the unknown coder section in FIG. 27 and the dictionary code string in FIG. FIG. 2 is a diagram showing a handwritten pattern for explaining the effect of introducing comparison of . 11...A register, 12...B register, 1
3...Flag, 14...A address counter. 15... B address counter, 16... Comparison circuit, 17... Control circuit, 1100... Dictionary memory, 1102... Input register, 1104... Output register, 1106... Search control unit , 1108...Register group. 1110.1110a...Matching processing unit, 111
2...A register, 1114...B register. 1116...ADR1 counter, 1118...ADR2 counter, 1120...Comparison circuit, 1122.1122a...Matching control unit, 112
4...CNT counter, 1125...ADRO register, 1126...ADRA register, 1127...ADRB register. Fig. 1 Fig. 3 Fig. 4 Fig. 5 Fig. 6 (A) Figure 25

Claims (7)

【特許請求の範囲】[Claims] (1)第1の記号列が予め登録されている第2の記号列
とあっているかどうかを調べる際、第2の記号列の中に
特殊な記号を挿入しておき、該特殊な記号により、比較
する記号列の対応関係の順序を制御することを特徴とす
る記号列のマッチング方法。
(1) When checking whether a first symbol string matches a pre-registered second symbol string, insert a special symbol into the second symbol string, and use the special symbol to , a symbol string matching method characterized by controlling the order of correspondence of symbol strings to be compared.
(2)第2の記号列の中に部分対応か全体対応かを指定
するモードを設定しておき、第2の記号列が第1の記号
列に全て存在する時、部分対応か全体対応かをチェック
して、最終的に一致、不一致を判定することを特徴とす
る特許請求の範囲第1項記載の記号列のマッチング方法
(2) A mode is set in the second symbol string to specify whether it is partial correspondence or whole correspondence, and when all the second symbol strings are present in the first symbol string, whether it is partial correspondence or total correspondence. 2. The method for matching symbol strings according to claim 1, further comprising the step of checking the following to finally determine whether they match or not.
(3)第1および第2の記号列はそれを構成する各記号
に関連した長さまたは量の情報を含み、各記号列のマッ
チングにおいて記号およびそれに関連した長さまたは量
をそれぞれ比較することを特徴とする特許請求の範囲第
1項または第2図に記載の記号列のマッチング方法。
(3) The first and second symbol strings include length or quantity information associated with each symbol constituting the first and second symbol strings, and the symbols and their associated lengths or quantities are compared, respectively, in matching each symbol string. A method for matching symbol strings according to claim 1 or FIG. 2, characterized in that:
(4)第1および第2の記号列の各記号はパターンのス
トロークの方向を示す方向コードであり、各記号列には
その各記号列に対応するストロークの長さ情報を付加し
ておき、各記号列のマッチングにおいて記号および長さ
をそれぞれ比較することを特徴とする特許請求の範囲第
1項または第2項に記載の記号列のマッチング方法。
(4) Each symbol in the first and second symbol strings is a direction code indicating the direction of the stroke of the pattern, and each symbol string has stroke length information added thereto, 3. The method for matching symbol strings according to claim 1, wherein symbols and lengths are compared in matching each symbol string.
(5)辞書に登録された各辞書記号列に特殊記号を挿入
するとゝもに制御情報を付加しておき、辞書記号列と未
知記号列とのマッチングの方法を当該辞書記号列に付加
された制御情報に従って制御するとゝもに、比較する記
号の対応関係の手順を当該辞書記号列に挿入された特殊
コードにより制御し、当該辞書記号列と当該未知記号列
とのマッチングの結果が一致となった場合におけるその
後の辞書検索の流れを当該辞書記号列に付加された制御
情報に従って制御することを特徴とする辞書検索方法。
(5) When inserting special symbols into each dictionary symbol string registered in the dictionary, control information is also added, and the method of matching between the dictionary symbol string and the unknown symbol string is added to the dictionary symbol string. In addition to controlling according to the control information, the procedure for the correspondence of the symbols to be compared is controlled by a special code inserted into the dictionary symbol string, so that the result of matching the dictionary symbol string and the unknown symbol string is a match. A dictionary search method characterized in that the flow of subsequent dictionary searches in the case of a dictionary symbol string is controlled in accordance with control information added to the dictionary symbol string.
(6)辞書記号列および未知記号列はそれを構成する各
記号列に関連した長さまたま量の情報を含み、各記号列
のマッチングにおいて記号およびそれに関連した長さま
たは量をそれぞれ比較することを特徴とする特許請求の
範囲第5項記載の辞書検索方法。
(6) Dictionary symbol strings and unknown symbol strings contain length and quantity information related to each of the constituent symbol strings, and the symbols and their associated lengths and quantities are compared in matching each symbol string. A dictionary search method according to claim 5, characterized in that:
(7)辞書記号列および未知記号列の中の各記号はパタ
ーンのストロークの方法を示すコードであり、辞書記号
列および未知記号列にはその各記号に対応するストロー
クの長さ情報を付加しておき、辞書記号列と未知記号列
とのマッチングにおいて記号および長さをそれぞれ比較
することを特徴とする特許請求の範囲第5項記載の辞書
検索方法。
(7) Each symbol in the dictionary symbol string and unknown symbol string is a code that indicates the stroke method of the pattern, and the stroke length information corresponding to each symbol is added to the dictionary symbol string and unknown symbol string. 6. The dictionary search method according to claim 5, wherein symbols and lengths are respectively compared in matching a dictionary symbol string and an unknown symbol string.
JP25665487A 1986-11-13 1987-10-12 Matching method and dictionary retrieving method for symbol string Pending JPS63238680A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
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 (2)

Application Number Priority Date Filing Date Title
JP61-270528 1986-11-13
JP27052886 1986-11-13

Publications (1)

Publication Number Publication Date
JPS63238680A true JPS63238680A (en) 1988-10-04

Family

ID=17487473

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25665487A Pending JPS63238680A (en) 1986-11-13 1987-10-12 Matching method and dictionary retrieving method for symbol string

Country Status (1)

Country Link
JP (1) JPS63238680A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55157775A (en) * 1979-05-29 1980-12-08 Nippon Electric Co Character training machine

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS55157775A (en) * 1979-05-29 1980-12-08 Nippon Electric Co Character training machine

Similar Documents

Publication Publication Date Title
US5745745A (en) Text search method and apparatus for structured documents
US8838551B2 (en) Multi-level database compression
JP3201945B2 (en) How to compare database tables
US5794048A (en) Method for classification of year-related data fields in a program
US8190591B2 (en) Bit string searching apparatus, searching method, and program
US20060039618A1 (en) Method for reducing binary image update package sizes
WO1985000681A1 (en) Parallel text matching methods and apparatus
US9009655B2 (en) Code string search apparatus, search method, and program
CN113961768B (en) Sensitive word detection method and device, computer equipment and storage medium
US20030126138A1 (en) Computer-implemented column mapping system and method
US20040139298A1 (en) Method and apparatus for instruction compression and decompression in a cache memory
US6304878B1 (en) Method and system for improved enumeration of tries
US6681347B1 (en) Method for testing keyboard complied with language code
JPS63238680A (en) Matching method and dictionary retrieving method for symbol string
CN112925874B (en) Similar code searching method and system based on case marks
EP0622752A2 (en) Apparatus and method for a lexical post-processor for a neural network-based character processor
US8195667B2 (en) Bit string search apparatus, search method, and program
Daciuk et al. Natural Language Dictionaries Implemented as Finite Automata.
JP2998054B2 (en) Character recognition method and character recognition device
JP2654022B2 (en) Dictionary search method
CN114995880B (en) Binary code similarity comparison method based on SimHash
JPH03257693A (en) Character recognized result correcting system
US20220277731A1 (en) Word weight calculation system
JP3127869B2 (en) Similar data extraction system and method
JP3071745B2 (en) Post-processing method of character recognition result