JPH0658675B2 - Syntax checking method - Google Patents
Syntax checking methodInfo
- Publication number
- JPH0658675B2 JPH0658675B2 JP63114321A JP11432188A JPH0658675B2 JP H0658675 B2 JPH0658675 B2 JP H0658675B2 JP 63114321 A JP63114321 A JP 63114321A JP 11432188 A JP11432188 A JP 11432188A JP H0658675 B2 JPH0658675 B2 JP H0658675B2
- Authority
- JP
- Japan
- Prior art keywords
- vector
- check
- phrases
- syntax
- phrase
- 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 - Lifetime
Links
Landscapes
- Devices For Executing Special Programs (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は構文検査方式に関し、特に文の記述に矛盾がな
いかどうかを判定する構文検査方式に関する。The present invention relates to a syntax checking method, and more particularly to a syntax checking method for determining whether or not there is a contradiction in a statement description.
従来の構文検査方式は、検査対象文を構成しているそれ
ぞれの句を認識した時点で、その句と同一文で使用でき
ない句が、既に検査対象分の中で認識されているかどう
かを、その句と同一文に使用できない句のすべてについ
て調べている。In the conventional syntax checking method, at the time of recognizing each of the phrases constituting the sentence to be checked, whether or not a phrase that cannot be used in the same sentence as the phrase is already recognized in the check target is checked. I am looking into all the phrases that cannot be used in the same sentence as the phrase.
例えば、句aと句bとが同一文では使用できず、句aと
句cとも同一文には使用できないときには、句aを認識
した時点で、既に句bが認識されているかどうかを調べ
るとともに、既に句cが認識されているかどうかも調べ
ている。For example, when the phrase a and the phrase b cannot be used in the same sentence and the phrase a and the phrase c cannot be used in the same sentence, it is checked whether or not the phrase b is already recognized when the phrase a is recognized. , Also checks whether the phrase c has already been recognized.
上述した従来の構文検査方式では、例えば、句aと句b
とが同一文では使用できないときには、句aを認識した
時点で、既に句bが認識されているかどうかを調べる処
理が必要となり、逆に句bを認識した時点で、既に句a
が認識されているかどうかを調べる処理が必要となる。In the conventional syntax checking method described above, for example, phrase a and phrase b
When and cannot be used in the same sentence, it is necessary to check whether or not phrase b has already been recognized when the phrase a is recognized, and conversely, when the phrase b is recognized, the phrase a has already been recognized.
It is necessary to perform processing to check whether or not is recognized.
このように、上述した従来の構文検査方式は、検査対象
文を構成しているそれぞれの句を認識した時点で、その
句と同一文で使用できない句が、既に検査対象分の中で
認識されているかどうかを、その句と同一文で使用でき
ない句のすべてについて調べる処理が必要となるので、
冗長な処理のため構文チェックを行う処理が大きくなり
処理時間が長くなるという欠点がある。As described above, in the conventional syntax checking method described above, at the time of recognizing each of the phrases forming the check target sentence, a phrase that cannot be used in the same sentence as the phrase is already recognized in the check target. It is necessary to check all the phrases that cannot be used in the same sentence as that phrase,
There is a disadvantage that the syntax check process becomes large and the processing time becomes long because of the redundant process.
また、構文を構成する句の種類が増えると、増えた句に
対するチェックをお互いに加えなくてはならないため、
処理全体を変更しなければならないという問題点があ
る。Also, as the types of clauses that make up the syntax increase, checks for the increased clauses must be added to each other, so
There is a problem that the whole process must be changed.
本発明の目的は、同一文で使用できない句の組合わせを
検査マトリックスで示し、検査対象文を構成する句を被
検査ベクトルで示すことにより、検査対象文を構成する
句の組合わせの矛盾を容易に検出することができる構文
検査方式を提供することにある。An object of the present invention is to show a combination of phrases that cannot be used in the same sentence by a check matrix, and show a phrase that constitutes a check target sentence by a checked vector to prevent a contradiction of a combination of phrases that form a check target sentence. It is to provide a syntax check method that can be easily detected.
本発明の構文検査方式は、検査対象文を構成する句の組
合わせに矛盾がないかどうかを判定し、矛盾があれば検
出する構文検査方式において、 (A)構文に使用されるすべての句に一対一に対応する
各ビット位置を構成要素とする被検査ベクトル、 (B)構文に使用されるすべての句に一対一に対応する
それぞれの行および列を有し、同一文で使用できない句
の組合わせに対応するビット位置だけをオンの状態にし
た検査マトリックス、 (C)すべてのビット位置がオフの初期状態にある前記
被検査ベクトルに対して、前記検査対象文を構成する句
のそれぞれに対応する前記被検査ベクトルのビット位置
をそれぞれオンの状態に設定する句対応ビット設定手
段、 (D)前記句対応ビット設定手段で設定された前記被検
査ベクトルと前記検査マトリックスとをつき合わせ、前
記被検査ベクトルがオンである各ビット位置に対応する
前記検査マトリックスの各行をそれぞれ検査ベクトルと
呼ぶとき、それぞれの検査ベクトルがオンであるビット
位置と前記被検査ベクトルがオンであるビット位置とが
一致する場合が存在するかどうかをそれぞれの検査ベク
トルについて調べることにより、前記検査対象文に同一
文で使用できない句の組合わせがあるかどうかを判定す
る矛盾検出手段、 を備えて構成されている。The syntax check method of the present invention determines whether or not there is a contradiction in a combination of phrases that form a sentence to be checked, and detects a contradiction, in the syntax check method, (A) all the phrases used in the syntax A vector to be inspected having each bit position corresponding to 1 to 1 as a constituent element, and (B) a phrase having a row and a column corresponding to all the phrases used in the syntax, which cannot be used in the same sentence. A check matrix in which only the bit positions corresponding to the combinations are turned on, (C) For each of the tested vectors in the initial state where all the bit positions are turned off, Clause corresponding bit setting means for setting the bit position of the examined vector corresponding to each to ON state, and (D) the examined vector set by the clause corresponding bit setting means and the examination When each row of the check matrix corresponding to each bit position where the check vector is ON is called a check vector, a bit position where each check vector is ON and the check vector is ON Conflict detection means for determining whether there is a combination of phrases that cannot be used in the same sentence in the check target sentence by checking whether or not there is a case where the bit position matches with It is equipped with.
次に本発明の実施例について図面を参照して説明する。 Next, embodiments of the present invention will be described with reference to the drawings.
第1図は本発明の構文検査方式の一実施例を示すブロッ
ク図である。FIG. 1 is a block diagram showing an embodiment of the syntax checking system of the present invention.
第1図に示す本実施例の構文検査方式は、検査対象文S
を構成する句の組合わせに矛盾がないかどうかを判定
し、検査対象文Sに矛盾があれば検出している。The syntax check method of this embodiment shown in FIG.
It is determined whether or not there is a contradiction in the combination of phrases that form the, and if there is a contradiction in the check target sentence S, it is detected.
第2図は検査対象文Sの一例を示すコボル言語の対象文
記述図である。FIG. 2 is an object sentence description diagram of the Kobol language showing an example of the inspection object sentence S.
第2図の検査対象文Sは、PICTURE句、PCCU
RS句およびVLUE句を有している。The inspection target sentence S in FIG. 2 is a PICTURE clause, PCCU.
It has an RS clause and a VLUE clause.
また、第1図の被検査ベクトル1は、構文に使用される
すべての句に一対一に対応する各ビット位置を構成要素
とするベクトルである。Also, the vector to be inspected 1 in FIG. 1 is a vector whose constituent elements are bit positions corresponding to all the phrases used in the syntax on a one-to-one basis.
第3図は被検査ベクトル1の一例を示すベクトル構成図
である。FIG. 3 is a vector configuration diagram showing an example of the inspection vector 1.
第3図の被検査ベクトル1は、構文に使用される16個
の句に一対一に対応するビット位置を構成要素としてい
る。The vector 1 to be inspected in FIG. 3 has bit positions that correspond one-to-one to the 16 phrases used in the syntax.
さらに、検査マトリックス2は、構文に使用されるすべ
ての句に一対1に対応するそれぞれの行および列を有
し、同一文で使用できない句の組合わせに対応するビッ
ト位置だけをオンの状態にしている。Furthermore, the check matrix 2 has a row and a column corresponding to all the phrases used in the syntax one-to-one, and turns on only the bit positions corresponding to the combinations of phrases that cannot be used in the same statement. ing.
第4図は検査マトリックス2の一例を示すマトリックス
構成図である。FIG. 4 is a matrix configuration diagram showing an example of the inspection matrix 2.
第4図に示すように、検査マトリックス2は、構文に使
用される16個の句に一対一に対応するそれぞれの行お
よび列を有し、同一文で使用できない句の組合わせに対
応するビット位置だけをオンの状態にしている。As shown in FIG. 4, the check matrix 2 has respective rows and columns corresponding to the 16 phrases used in the syntax one-to-one, and bits corresponding to combinations of phrases that cannot be used in the same sentence. Only the position is turned on.
一方、最初、すべてのビット位置がオフの初期状態にあ
る被検査ベクトル1に対して、句対応ビット設定手段3
は、句認識手段Kによって、検査対象文Sの一つの句が
認識されるたびに起動され、認識された句に対応する被
検査ベクトル1のビット位置をそれぞれオンの状態に設
定している。On the other hand, first, with respect to the tested vector 1 in the initial state in which all bit positions are off, the phrase corresponding bit setting means 3
Is activated each time one phrase of the sentence S to be inspected is recognized by the phrase recognizing means K, and the bit positions of the inspected vector 1 corresponding to the recognized phrase are set to the ON state.
この場合には、第3図に示しているように、PICTU
RE句,OCCURS句およびVLUE句のそれぞれに
対応するビット位置の2,5および7がそれぞれオンの
状態に設定される。In this case, as shown in FIG.
Bit positions 2, 5 and 7 respectively corresponding to the RE clause, the OCCURS clause and the VLUE clause are set to the ON state.
次に、矛盾検出手段4は、まず、句対応ビット設定手段
3で設定された第3図の被検査ベクトル1と第4図の検
査マトリックス2とをつき合わせ、被検査ベクトル1が
オンである各ビット位置に対応する検査マトリックス2
の各行をそれぞれ検査ベクトルとして取出す。Next, the contradiction detecting means 4 first matches the inspected vector 1 of FIG. 3 set by the phrase corresponding bit setting means 3 with the inspected matrix 2 of FIG. 4, and the inspected vector 1 is ON. Check matrix 2 corresponding to each bit position
Each row of is extracted as a check vector.
この場合には、次の三つの検査ベクトルが取出される。In this case, the following three test vectors are fetched.
ビット位置の2に対応する検査ベクトル →0100000001000000 ビット位置の5に対応する検査ベクトル →0001000100001000 ビット位置の7に対応する検査ベクトル →0000010000000000 そこで、矛盾検出手段4は、検査ベクトルがオンである
ビット位置と被検査ベクトル1がオンであるビット位置
とが一致する場合が存在するかどうかをそれぞれの検査
ベクトルについて調べることにより、検査対象文Sに同
一文で使用できない句の組合わせがあるかどうかを判定
することができる。The check vector corresponding to bit position 2 → the check vector corresponding to 0100000001000000 bit position 5 → the check vector corresponding to bit position 000010100001000 bit → 7 It is determined whether or not there is a combination of phrases that cannot be used in the same sentence in the check target sentence S by checking whether or not there is a case where the bit position where the checked vector 1 is ON matches. can do.
この場合には、ビット位置の5に対応する検査ベクトル
がオンであるビット位置と被検査ベクトル1がオンであ
るビット位置とが7の列で一致し、ビット位置の7に対
応する検査ベクトルがオンであるビット位置と被検査ベ
クトル1がオンであるビット位置とが5の列で一致して
おり、検査対象文Sに同一文で使用できない句の組合わ
せがあるので、矛盾検出手段4は、メッセージ出力手段
Mにエラーメッセージを出力する。In this case, the bit position in which the check vector corresponding to bit position 5 is ON and the bit position in which the tested vector 1 is ON match in the column of 7, and the check vector corresponding to bit position 7 is Since the bit position that is on and the bit position that the vector to be inspected 1 are on match in the column of 5, and there is a combination of phrases that cannot be used in the same sentence in the inspected sentence S, the conflict detection means 4 , Outputs an error message to the message output means M.
第5図は矛盾検出手段4の動作の一例を示す流れ図であ
る。FIG. 5 is a flow chart showing an example of the operation of the contradiction detection means 4.
矛盾検出手段4は、第5図に示すように、まず、ステッ
プF1で、第3図の被検査ベクトル1のビット位置を示
すiを初期値の0に設定する。As shown in FIG. 5, the contradiction detecting means 4 firstly sets i, which is the bit position of the vector 1 to be inspected in FIG. 3, to an initial value 0 in step F1.
次に、ステップF2で、被検査ベクトル1のビット位置
のiがオンかオフかを判断し、オンのときには、次のス
テップF3に移行するが、オフのときには、処理を省い
てステップF10へ飛躍する。Next, in step F2, it is determined whether the bit position i of the vector to be inspected 1 is on or off. If it is on, the process proceeds to the next step F3. If it is off, the process is skipped and the process jumps to step F10. To do.
次のステップF3では、第4図の検査マトリックス2か
ら、ビット位置のiに対応する検査ベクトルとして取出
す。In the next step F3, a check vector corresponding to the bit position i is extracted from the check matrix 2 in FIG.
次に、ステップF4で、被検査ベクトル1とその検査ベ
クトルとの対応する各構成要素の論理積を求めて、その
結果を構成要素とする検査ベクトルを作成する。Next, in step F4, the logical product of the corresponding constituent elements of the vector under test 1 and the test vector is obtained, and the test vector having the result as the constituent element is created.
次に、ステップF5で、作成した検査ベクトルのビット
位置を示すjを初期値の0に設定する。Next, in step F5, j indicating the bit position of the created check vector is set to 0, which is an initial value.
次のステップF6で、その検査ベクトルのjのビット位
置がオンかオフかを判断し、オンのときにのみ、次のス
テップF7で、メッセージ出力手段Mにエラーメッセー
ジを出力する。In the next step F6, it is determined whether the bit position of the check vector j is ON or OFF. Only when the bit position is ON, an error message is output to the message output means M in the next step F7.
次に、ステップF8で、jに1を加え、次のステップF
9で、jが16になったかどうかを判断し、jが16で
ない(NO)ときには、ステップF6に戻り、jが16
である。(YES)ときには、次のステップF10へ移
行する。Next, in step F8, 1 is added to j and the next step F
At 9, it is determined whether j has become 16, and when j is not 16 (NO), the process returns to step F6 and j is 16
Is. If (YES), the process moves to the next step F10.
次のステップF10で、iに1を加え、次のステップF
11で、iが16になったかどうかを判断し、iが16
でない(NO)ときには、ステップF2に戻り、iが1
6である(YES)ときには、終了することとなる。In the next step F10, 1 is added to i, and the next step F
In 11, it is judged whether i becomes 16, and i becomes 16
If not (NO), the process returns to step F2 and i is 1
When it is 6 (YES), the process ends.
以上述べたように、本実施例の構文検査方式は、同一文
で使用できない句の組合わせを検査マトリックスで示
し、検査対象文を構成する句を被検査ベクトルで示すこ
とにより、検査対象文を構成する句の組合わせの矛盾を
容易に検出することができる。As described above, according to the syntax check method of the present embodiment, the combination of phrases that cannot be used in the same sentence is indicated by the check matrix, and the phrases forming the check target sentence are shown by the check vector, so that the check target sentence is It is possible to easily detect a contradiction in a combination of constituent phrases.
以上説明したように、本発明の構文検査方式は、同一文
で使用できない句の組合わせを検査マトリックスで示
し、検査対象文を構成する句を被検査ベクトルで示すこ
とにより、検査対象文を構成する句の組合わせの矛盾を
容易に検出することができるという効果を有している。As described above, according to the syntax check method of the present invention, the combination of phrases that cannot be used in the same sentence is indicated by the check matrix, and the phrases forming the check target sentence are indicated by the check vector to form the check target sentence. This has the effect that it is possible to easily detect a contradiction in a combination of phrases that are set.
また、本発明の構文検査方式は、新たな句が加わった
り、これまでの句の取扱いが変更になったりした場合で
も、処理全体を変更することなく、被検査ベクトルのビ
ット数および検査マトリックスの大きさと内容とを変更
することにより容易に対応することができるという効果
がある。Further, the syntax check method of the present invention, even when a new phrase is added or the handling of the phrase so far is changed, without changing the entire processing, the number of bits of the vector to be inspected and the check matrix can be changed. There is an effect that it is possible to easily deal with it by changing the size and the content.
第1図は本発明の構文検査方式の一実施例を示すブロッ
ク図、第2図は検査対象文の一例を示すコボル言語の対
象文記述図、第3図は被検査ベクトルの一例を示すベク
トル構成図、第4図は検査マトリックスの一例を示すマ
トリックス構成図、第5図は矛盾検出手段の動作の一例
を示す流れ図である。 1……被検査ベクトル、2……検査マトリックス、3…
…句対応ビット設定手段、4……矛盾検出手段、K……
句認識手段、M……メッセージ出力手段、S……検査対
象文。FIG. 1 is a block diagram showing an embodiment of the syntax check system of the present invention, FIG. 2 is a target sentence description diagram of the Kobol language showing an example of a check target sentence, and FIG. 3 is a vector showing an example of a checked vector. Configuration diagram, FIG. 4 is a matrix configuration diagram showing an example of the inspection matrix, and FIG. 5 is a flow chart showing an example of the operation of the contradiction detection means. 1 ... Inspected vector, 2 ... Inspection matrix, 3 ...
... phrase corresponding bit setting means, 4 ... contradiction detection means, K ...
Phrase recognition means, M ... Message output means, S ... Sentence sentence.
Claims (1)
がないかどうかを判定し、矛盾があれば検出する構文検
査方式において、 (A)構文に使用されるすべての句に一対一に対応する
各ビット位置を構成要素とする被検査ベクトル、 (B)構文に使用されるすべての句に一対一に対応する
それぞれの行および列を有し、同一文で使用できない句
の組合わせに対応するビット位置だけをオンの状態にし
た検査マトリックス、 (C)すべてのビット位置がオフの初期状態にある前記
被検査ベクトルに対して、前記検査対象文を構成する句
のそれぞれに対応する前記被検査ベクトルのビット位置
をそれぞれオンの状態に設定する句対応ビット設定手
段、 (D)前記句対応ビット設定手段で設定された前記被検
査ベクトルと前記検査マトリックスとをつき合わせ、前
記被検査ベクトルがオンである各ビット位置に対応する
前記検査マトリックスの各行をそれぞれ検査ベクトルと
呼ぶとき、それぞれの検査ベクトルがオンであるビット
位置と前記被検査ベクトルがオンであるビット位置とが
一致する場合が存在するかどうかをそれぞれの検査ベク
トルについて調べることにより、前記検査対象文に同一
文で使用できない句の組合わせがあるかどうかを判定す
る矛盾検出手段、 を備えることを特徴とする構文検査方式。1. A syntax check method for determining whether or not there is a contradiction in a combination of phrases constituting a sentence to be checked, and detecting the contradiction, in a syntax checking method, (A) one-to-one for all phrases used in a syntax A vector to be inspected having each bit position corresponding to as a constituent, and (B) a combination of phrases having one-to-one correspondence to all the phrases used in the syntax and which cannot be used in the same sentence. A check matrix in which only the bit positions corresponding to are turned on, (C) Corresponding to each of the phrases constituting the check target sentence for the checked vector in the initial state where all the bit positions are turned off Phrase-corresponding bit setting means for setting each bit position of the inspected vector to an ON state, (D) the inspected vector and the inspection matrix set by the phrase-corresponding bit setting means And each row of the check matrix corresponding to each bit position for which the tested vector is on is called a check vector, the bit position for which each check vector is on and the tested vector for Conflict detection means for determining whether or not there is a combination of phrases that cannot be used in the same sentence in the check target sentence by checking whether or not there is a case in which a certain bit position matches, for each check vector, A syntax check method characterized by the following.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63114321A JPH0658675B2 (en) | 1988-05-10 | 1988-05-10 | Syntax checking method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP63114321A JPH0658675B2 (en) | 1988-05-10 | 1988-05-10 | Syntax checking method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH01283669A JPH01283669A (en) | 1989-11-15 |
| JPH0658675B2 true JPH0658675B2 (en) | 1994-08-03 |
Family
ID=14634917
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP63114321A Expired - Lifetime JPH0658675B2 (en) | 1988-05-10 | 1988-05-10 | Syntax checking method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0658675B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP7545064B2 (en) | 2022-06-24 | 2024-09-04 | ダイキン工業株式会社 | Surface treatment agent for electrode material, positive electrode active material, current collector foil, negative electrode active material, conductive assistant, electrode, method for manufacturing positive electrode active material, method for manufacturing current collector foil, method for manufacturing negative electrode active material, method for manufacturing conductive assistant, and method for manufacturing electrode |
-
1988
- 1988-05-10 JP JP63114321A patent/JPH0658675B2/en not_active Expired - Lifetime
Also Published As
| Publication number | Publication date |
|---|---|
| JPH01283669A (en) | 1989-11-15 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0415000A2 (en) | Method and apparatus for spelling error detection and correction | |
| Purdom | A sentence generator for testing parsers | |
| US5161105A (en) | Machine translation apparatus having a process function for proper nouns with acronyms | |
| JP2637344B2 (en) | Symbol recognition method and device | |
| JPH034946B2 (en) | ||
| KR100892004B1 (en) | Apparatus and Method for Providing Verb-centered Automatic Grammar Error Detection and Correction Information in English Composition Learning System | |
| JPH0658675B2 (en) | Syntax checking method | |
| GB963554A (en) | Systmes for identifying manifestations,for example, speech | |
| JPS59127139A (en) | Sentence fault detecting and correcting device | |
| JP2908460B2 (en) | Error recognition correction method and apparatus | |
| JPS62139042A (en) | Checking system for translation program | |
| JP2795332B2 (en) | Loop processing error detection device | |
| JPH0715691B2 (en) | Automatic translator | |
| JP2895137B2 (en) | Japanese sentence error automatic detection and correction device | |
| JPH0222400B2 (en) | ||
| JPH0632092B2 (en) | Word matching method | |
| JPH05204299A (en) | Teaching device for language | |
| JPH04364577A (en) | Specific data pattern detection system | |
| JPH02309448A (en) | Error detecting device | |
| JPH01306959A (en) | System for detecting error in word-separation | |
| JPH10301597A (en) | Voice recognition device | |
| JPS63213065A (en) | Analyzing system for japanese sentence | |
| JPH03156589A (en) | Method for detecting and correcting erroneously read character | |
| JPH0556032A (en) | Frame synchronization system | |
| JPH02173886A (en) | Word recognizing system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20070803 Year of fee payment: 13 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080803 Year of fee payment: 14 |
|
| EXPY | Cancellation because of completion of term | ||
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080803 Year of fee payment: 14 |