JPH02226364A - Syntax analyzing device - Google Patents
Syntax analyzing deviceInfo
- Publication number
- JPH02226364A JPH02226364A JP1045499A JP4549989A JPH02226364A JP H02226364 A JPH02226364 A JP H02226364A JP 1045499 A JP1045499 A JP 1045499A JP 4549989 A JP4549989 A JP 4549989A JP H02226364 A JPH02226364 A JP H02226364A
- Authority
- JP
- Japan
- Prior art keywords
- information
- erroneous
- phrase structure
- rule
- input sentence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000004458 analytical method Methods 0.000 claims abstract description 69
- 238000010586 diagram Methods 0.000 description 15
- 238000000034 method Methods 0.000 description 14
- 238000001514 detection method Methods 0.000 description 7
- 101100443291 Mus musculus Dnajc27 gene Proteins 0.000 description 2
- 238000012916 structural analysis Methods 0.000 description 2
- 239000002344 surface layer Substances 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 230000001932 seasonal effect Effects 0.000 description 1
Landscapes
- Machine Translation (AREA)
Abstract
Description
【発明の詳細な説明】
[産業上の利用分野]
本発明は、構文解析装置にかかり、例えば、自然言語の
構文解析において、文法的な誤りを含んだ文を、誤りを
含まない正しい文と同様に構文解析ができるようにした
ものに関する。[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a syntactic analysis device, and for example, in parsing natural language, a sentence containing a grammatical error is converted into a correct sentence containing no errors. It also concerns something that can be parsed.
[従来の技術]
従来の構文解析の原理は、解析対象たる文の種類(例え
ば、英語、日本語等の文の種類)に応じて、句構造規則
を作成しておき、入力された文の各単語の組み合わせを
前記句構造規則に当てはめることにより、前記入力され
た文を前記句構造規則の組み合わせとして表すことによ
り、入力された文の構造を知るものであった。[Prior Art] The principle of conventional syntactic analysis is to create phrase structure rules according to the type of sentence to be analyzed (for example, English, Japanese, etc.), and then to analyze the input sentence. By applying each combination of words to the phrase structure rules, the input sentence is expressed as a combination of the phrase structure rules, and the structure of the input sentence is known.
ところで、入力された文が完全に正しい文であれば、上
述の構造解析の原理をそのまま適用することで比較的ス
ムーズに解析を行うことができる。By the way, if the input sentence is completely correct, it can be analyzed relatively smoothly by applying the above-described structural analysis principle as is.
しかしながら、入力された文に誤りがある場合には、上
記原理を単純に適用するだけでは構造解析が不可能とな
る場合が多く生ずる。それゆえ、従来から、誤りを含ん
だ文の構造解析を可能とした方法が種々提案されている
。However, if there is an error in the input sentence, it often becomes impossible to analyze the structure simply by applying the above principle. Therefore, various methods have been proposed in the past that have made it possible to analyze the structure of sentences containing errors.
これらの方法の多くは、理論的には問題はない力釈実際
に解析を実行するためのシステムを設計する際に、高度
に専門的な文法知識が必要となったり、あるいは、完成
したシステムで構造解析を行った場合、解析に著しく長
時間を要する場合が多い等という欠点を有するものであ
った。Many of these methods are good in theory, but require highly specialized grammar knowledge when designing the system to actually perform the parsing, or require highly specialized grammar knowledge in the finished system. When structural analysis is performed, it often takes a considerable amount of time, which is a drawback.
そのため、システムの設計も容易で、かつ、効率的な解
析が可能な方法として、例えば、特開昭60−3366
3号公報に記載の方法が提案されている。Therefore, as a method that allows easy system design and efficient analysis, for example, Japanese Patent Application Laid-Open No. 60-3366
A method described in Publication No. 3 is proposed.
この方法は、例えば、入力した文に冠詞が現れた場合に
は、それは名詞句の始まりであって、以下には必ず形容
詞か名詞のいずれかが来ると予想できるので、そこにカ
ット(Cut )と称する規制条件をいれておき、予想
した品詞が現れなかった場合ににはその語が誤りを含ん
でいるものと判断して、前記規制条件によりその誤りの
部分を読み飛ばして以後の解析を行うようにしたもので
ある。With this method, for example, if an article appears in the input sentence, it is the beginning of a noun phrase, and it can be predicted that either an adjective or a noun will follow, so you can cut it there. If the expected part of speech does not appear, it is determined that the word contains an error, and the erroneous part is skipped in the subsequent analysis using the above regulation condition. This is what I decided to do.
すなわち、冠詞の後に名詞や形容詞以外の品詞が来たと
きには、誤りであることが明らかであるので、もう−度
前記冠詞の前に戻ってそこから解析をやり直す(バック
トラック)等いう無駄を省いて解析の効率化を図ったも
のである。In other words, when a part of speech other than a noun or adjective comes after an article, it is obvious that it is an error, so there is no need to go back to the article and redo the analysis from there (backtracking). The aim is to improve the efficiency of analysis.
[発明が解決しようとする課題]
ところが、上述の方法によって文の誤りを発見できるの
は、カットをいれることが可能な部分についてだけて′
あり、このカッ1〜をいれることがて゛きる部分とは、
後続の品詞が決定できる特定の条件が成立する部分に限
られ、それ以外の場合には誤りを発見できないという限
界があった。[Problem to be solved by the invention] However, the above method can only detect errors in sentences where cuts can be made.
There is, and the part where you can put in this Kak1~ is,
This method was limited to parts where specific conditions were met to determine the subsequent part of speech, and there was a limitation in that errors could not be detected in other cases.
本発明は、上述の背景のもとでなされたものであり、様
々な態様の誤りを発見できるとともに、効率的な解析が
できるようにした構文解析装置を提供することを目的と
したものである。The present invention was made against the above-mentioned background, and aims to provide a syntax analysis device that can detect errors in various aspects and perform efficient analysis. .
[課題を解決するための手段]
本発明は、以下の各要素を備えた構成とすることにより
上述の課題を解決している。[Means for Solving the Problems] The present invention solves the above problems by having a configuration including the following elements.
■ 入力文を単語に分解してこの分解した単語を含む情
報を出力する語黄解析部。■ A word yellow analysis unit that decomposes the input sentence into words and outputs information including the decomposed words.
■ 入力文の種類に応じてあらかじめ作成された句構造
規則を含む情報を備えた文法規則テーブルを格納する第
1の記憶手段。■ A first storage means for storing a grammar rule table having information including phrase structure rules created in advance according to the type of input sentence.
■ 入力文の種類に応じた各単語の種類を含む情報を備
えた単語辞書を格納する第2の記憶手段。(2) A second storage means for storing a word dictionary including information including the types of each word depending on the type of input sentence.
■ 前記語彙解析部から分解された単語を含む情報を入
力し、前記第1の記憶手段及び第2の記憶手段からそれ
ぞれ句構造規則を含む情報及び単語の種類を含む情報を
読み出してこれら情報と前記語紮解析部から入力した単
語を含む情報とによって前記入力文の構文を解析する構
文解析部。(2) Input information including decomposed words from the vocabulary analysis unit, read out information including phrase structure rules and information including word types from the first storage means and second storage means, respectively, and combine these information with each other. a syntactic analysis unit that analyzes the syntax of the input sentence using information including words input from the word phrasing analysis unit;
■ 前記第1の記憶手段に格納される文法規則テーブル
に、正しい句構造規則のほかに誤りの句構造規則を含む
誤り文に関する情報を含めたこと。(2) The grammar rule table stored in the first storage means includes information regarding erroneous sentences that include incorrect phrase structure rules in addition to correct phrase structure rules.
[作用]
上述の構成によれば、入力された文は、前記語彙解析部
によって各単語に分解され、前記構文解析部によって解
析される。[Operation] According to the above configuration, the input sentence is broken down into words by the vocabulary analysis section, and analyzed by the syntax analysis section.
前記構文解析部では、前記語彙解析部から単語を含む情
報を入力し、前記第1の記憶手段及び第2の記憶手段か
らそれぞれ句構造規則を含む情報及び単語の種類を含む
情報を読み出してこれら情報と前記語彙解析部から入力
した郡語を含む情報とによって前記入力文の構文を解析
する。The syntactic analysis unit inputs information including words from the vocabulary analysis unit, reads out information including phrase structure rules and information including word types from the first storage means and second storage means, respectively, and processes them. The syntax of the input sentence is analyzed using the information and the information including the group words input from the vocabulary analysis section.
その際、前記第1の記憶手段に格納された文法規則テー
ブルに、正しい句構造規則のほかに誤り句構造規則を含
む誤り文に関する情報が含まれていることから、前記入
力文に誤りの部分がある場合においても、この入力文の
誤りの部分をこの誤り句構造規則を含む誤り文に関する
情報を用いて速やかに構文解析をすることができる。At this time, since the grammar rule table stored in the first storage means includes information regarding the erroneous sentence including the erroneous phrase structure rule in addition to the correct phrase structure rule, the erroneous part of the input sentence is Even in such a case, the erroneous part of the input sentence can be quickly parsed using information about the erroneous sentence including the erroneous phrase structure rule.
すなわち、例えば、入力文中に、本来の正しい句構造と
してはrABJという句構造であるべきものを、rAb
、というように誤った句構造として含まれていたとした
場合、前記文法規則テーブルには、正しい句構造rAB
Jは勿論のこと、誤りの句構造としてrAbJが含まれ
ているので、入力文にこの誤り句構造規則rAb、を適
用して構文解析を続行でき、しかも、この部分が誤りで
あることを明確に示すことができる。That is, for example, in an input sentence, what should be the correct phrase structure rABJ is changed to rAb
, the correct phrase structure rAB is included in the grammar rule table.
Since rAbJ is included as an erroneous phrase structure as well as J, it is possible to continue parsing by applying this erroneous phrase structure rule rAb to the input sentence, and also to clarify that this part is an error. can be shown.
[実施例]
(第1実施例)
第1図は本発明の第1実施例にかかる構文解析装置の概
略構成を示す機能ブロック図、第2図は第1図における
装置の実際の構成例を示すブロック図、第3図は第1図
における文法規則テーブルの説明図、第4図は第1図に
おける単語辞書の説明図、第5図は第1図及び第2図の
構文解析装置による構文解析時における構文解析木の説
明図である。以下、これらの図面を参照しながら本発明
の第1実施例を詳述する。[Embodiment] (First Embodiment) FIG. 1 is a functional block diagram showing a schematic configuration of a parsing device according to a first embodiment of the present invention, and FIG. 2 shows an example of the actual configuration of the device in FIG. 1. FIG. 3 is an explanatory diagram of the grammar rule table in FIG. 1, FIG. 4 is an explanatory diagram of the word dictionary in FIG. 1, and FIG. 5 is an explanatory diagram of the syntax analysis device in FIGS. FIG. 3 is an explanatory diagram of a syntax parsing tree during analysis. Hereinafter, a first embodiment of the present invention will be described in detail with reference to these drawings.
第1図において、符号1は語彙解析部、符号2は構文解
析部、符号3は文法規則テーブルを格納する第1の記憶
手段、符号4は単語辞書を格納する第2の記憶手段であ
る。In FIG. 1, reference numeral 1 is a vocabulary analysis section, reference numeral 2 is a syntactic analysis section, reference numeral 3 is a first storage means for storing a grammar rule table, and reference numeral 4 is a second storage means for storing a word dictionary.
前記語彙解析部1は、入力文を単語に分解してこの分解
した単語を含む情報を前記構文解析部2に送出する。The vocabulary analysis section 1 decomposes an input sentence into words and sends information including the decomposed words to the syntax analysis section 2.
前記構文解析部2は、前記語彙解析部1から分解された
単語を含む情報を入力し、前記第1の記憶手段3に格納
されている文法規則テーブル及び第2の記憶手段4に格
納されている単語辞書からそれぞれ句構造規則を含む情
報及び単語の種類を含む情報を読み出してこれら情報と
前記語彙解析部1から入力した単語を含む情報とによっ
て前記入力文の構文を解析してその解析結果及びメツセ
ージを図示しない他の情報処理部、例えば、自然言語処
理部等に送出する。The syntactic analysis unit 2 inputs information including decomposed words from the vocabulary analysis unit 1, and inputs the information including the decomposed words from the vocabulary analysis unit 1, and inputs the information including the grammar rule table stored in the first storage unit 3 and the grammar rule table stored in the second storage unit 4. Information including phrase structure rules and information including word types are read from each word dictionary, and the syntax of the input sentence is analyzed using these information and the information including words input from the vocabulary analysis unit 1, and the analysis result is obtained. and sends the message to another information processing section (not shown), such as a natural language processing section.
前記第1の記憶手段3には、第3図に示されるような文
法規則テーブルが、また、第2の記憶手段4には第4図
に示されるような単語辞書がそれぞれ格納されている。The first storage means 3 stores a grammar rule table as shown in FIG. 3, and the second storage means 4 stores a word dictionary as shown in FIG. 4.
前記文法規則テーブルは、句構造規則とメツセージとか
ら構成され、また、前記単語辞書は、単語とその単語の
品詞とから構成されている。The grammar rule table is composed of phrase structure rules and messages, and the word dictionary is composed of words and the parts of speech of the words.
前記句構造規則は、英語あるいは日本語等の入力文の種
類に応じてその語の正しい句構造と誤りの句構造に関す
る規則が示されている。なお、前記文法テーブルには、
英語なら英語の全ての句構造規則が掲げられるが、第3
図においては、説明を簡単にするためにその一部を掲げ
である。The phrase structure rules indicate rules regarding the correct phrase structure and incorrect phrase structure of a word depending on the type of input sentence, such as English or Japanese. In addition, in the grammar table,
In English, all the phrase structure rules of English are listed, but the third
In the figure, only a portion is shown to simplify the explanation.
第3図における句構造規則は、次のような内容を表すも
のである。The phrase structure rules in FIG. 3 represent the following contents.
すなわち、例えば、第3図における句構造規則■は正し
い句構造規則を示すものであって、np −−>art
l nl
であるが、これは、’np」 (名詞句)は、「art
l」 (冠詞)とrnL+ (名詞)とから構成され
るということを表す。ここで、第4図に示される単語辞
書によれば、rartl」は「a」という冠詞であり、
また、「nl」は「boOk」という名詞であるから、
ra book」という単語の組み合わせは、文法規
則テーブルの句構造規則■に示される規則に当てはめる
ことができ、正しい句構造であることがわかる。That is, for example, the phrase structure rule ■ in FIG. 3 indicates the correct phrase structure rule, and np --> art
l nl, which means 'np' (noun phrase) is 'art
It means that it is composed of "l" (article) and rnL+ (noun). Here, according to the word dictionary shown in Figure 4, "rartl" is the article "a",
Also, since "nl" is the noun "boOk",
The combination of words ``ra book'' can be applied to the rule shown in phrase structure rule ■ in the grammar rule table, and it can be seen that it has a correct phrase structure.
また、句構造規則■は誤りの句構造規則を表すものであ
って、
*np−−>artl n2
であるが、これは、*「np」 (名詞句)は、rar
tL+ (冠詞)とrn2」 (名詞)とから構成さ
れるが、これは誤りの句構造であるということを表す。In addition, phrase structure rule ■ represents an incorrect phrase structure rule, *np-->artl n2, which means that *"np" (noun phrase) is rar
It is composed of tL+ (article) and rn2'' (noun), which indicates that it is an incorrect phrase structure.
ここで、rartlJは「a」という冠詞であり、また
、「n2」はrorangeJという名詞であるから、
「a Orange」という単語の組み合わせは、文法
規則テーブルの句構造規則■に示される規則に当てはめ
ることができ、誤りの句構造であることがわかる。この
場合には、この誤りの句構造規則に対応して誤りの内容
を示すメツセージ「冠詞aは、子音で始まる単数名詞に
用います。」が付加される。Here, rartlJ is the article "a" and "n2" is the noun rorangeJ, so
The word combination "a Orange" can be applied to the rule shown in the phrase structure rule ■ of the grammar rule table, and it can be seen that it has an incorrect phrase structure. In this case, a message ``The article a is used for singular nouns starting with a consonant.'' is added to indicate the content of the error in accordance with the phrase structure rule of this error.
さらに、例えば、句構造規則■は、
vp−−>vnp
であるが、これは、「VpJ (動詞句)は「■」(
動詞)と「np」 (名詞句)とから構成されることを
表す。この場合、「np」は規則■〜■で示される句構
造である(なお、そのうち、規則■及び■は誤りの句構
造である)。Furthermore, for example, the phrase structure rule ■ is vp-->vnp, which means that "VpJ (verb phrase) is "■" (
(verb) and "np" (noun phrase). In this case, "np" is a phrase structure shown by rules ■ to ■ (note that rules ■ and ■ are incorrect phrase structures).
第5図は、上述の構成の構文解析装置によって、入力文
II have an book」を解析してい
く際の様子を示す構文解析木である。FIG. 5 is a syntactic analysis tree showing how the input sentence "II have an book" is analyzed by the syntax analysis device configured as described above.
まず、入力文rI have an book」
は、前記語彙解析部1によって、「■」、rhaVeJ
、ranJ、「bOOk」の各単語に分解され、その分
解された単語及びその配置関係等の情報が前記構文解析
部2に送出される。First, the input sentence rI have an book"
is determined by the vocabulary analysis unit 1 to be “■”, rhaVeJ
, ranJ, and "bOOk", and information such as the decomposed words and their arrangement relationships is sent to the syntax analysis unit 2.
前記構文解析部2では、この入力された情報に、前記第
1の記憶手段3及び第2の記憶手段4から読み出される
句構造規則を含む情報及び単語の種類を含む情報をあて
はめていく。すなわち、前記単語辞書から、rIJ =
rprom」、川’1aVe」=「■」、ran」=
rart2」、rb。The syntactic analysis unit 2 applies information including phrase structure rules and information including word types read from the first storage means 3 and second storage means 4 to this input information. That is, from the word dictionary, rIJ =
rprom”, 川’1aVe”=”■”, ran”=
rart2”, rb.
Ok」−「nl」であることがわかる。また、前記句構
゛造規則から、’promJ−’npJ、r’art2
nlJ = ’*npJであり、さらに、「V *
npJ:「vp」、「np vp」「S」であって、入
力文は、前記第5図の解析木に示される構文であると解
析される。なお、この場合、この構文は、’an b
ook」の部分が誤りであり、「冠詞aは、子音で始ま
る単数名詞に用います」というメツセージが付加される
。It can be seen that the result is "Ok" - "nl". Also, from the above phrase structure rules, 'promJ-'npJ, r'art2
nlJ = '*npJ, and furthermore, 'V*
npJ: "vp", "np vp", "S", and the input sentence is analyzed as having the syntax shown in the parse tree of FIG. Note that in this case, this syntax is 'an b
The part "ook" is incorrect, and the message "The article a is used for singular nouns starting with a consonant" is added.
以上のような構成を有する構文解析装置は、実際には、
第2図に示されるハード構成によって得ることができる
。The syntax analysis device having the above configuration actually has the following features:
This can be obtained by the hardware configuration shown in FIG.
第2図において、符号5は中央演算処理装置(CPU)
、符号6は主メモリ、符号7は磁気ディスク、符号8
はキーボード、符号9はデイスプレィである。In Fig. 2, reference numeral 5 indicates a central processing unit (CPU).
, 6 is the main memory, 7 is the magnetic disk, 8 is the magnetic disk.
9 is a keyboard, and 9 is a display.
前記CPUは、主メモリ6、磁気ディスク7、キーボー
ド8及びデイスプレィ9を制御して後述するプログラム
を実行するもので、通常のコンピュータ等の中央演算処
理部に用いられるLSI等で構成されている。The CPU controls the main memory 6, magnetic disk 7, keyboard 8, and display 9 to execute programs to be described later, and is composed of an LSI or the like used in a central processing unit of a normal computer.
また、前記主メモリ6は、前記CPUで実行するプログ
ラム等を一時格納するもので、ランダムアクセスメモリ
等で構成されている。The main memory 6 temporarily stores programs and the like to be executed by the CPU, and is composed of a random access memory and the like.
前記磁気ディスク7は、必要な情報を格納する記憶手段
であり、本実施例における第1の記憶手段3及び第2の
記憶手段4並びに語彙解析部1及び構文解析部2の内容
が含まれるプログラム等を格納しているものである。The magnetic disk 7 is a storage means for storing necessary information, and is a program containing the contents of the first storage means 3, the second storage means 4, the vocabulary analysis section 1, and the syntax analysis section 2 in this embodiment. etc. are stored.
さらに、前記キーボード8は入力文その他必要な入力処
理を行う入力手段であり、前記デイスプレィっけ前記キ
ーボード8による入力の内容その他必要な表示を行う表
示手段である。Further, the keyboard 8 is an input means for inputting sentences and other necessary input processing, and the display is a display means for displaying the contents inputted by the keyboard 8 and other necessary information.
以上説明したように、本実施例の構文解析装置によれば
、誤りを含む入力文をも極めてスムーズに解析すること
が可能であり、しかも、その誤りがどの部分についてど
のように誤っているかを明確に指摘することができる。As explained above, according to the syntax analysis device of this embodiment, it is possible to analyze an input sentence containing an error extremely smoothly, and also to identify in which part and how the error occurs. Can be clearly pointed out.
(第2実施例)
この実施例は、前記第1実施例における第1の記憶手段
3に格納される文法規則テーブルに、「句構造規則」及
び「メツセージ」のほかに「誤り発見ルール」及び「解
析木の上部に渡す情報」を加え、また、第2の記憶手段
4に格納される単語辞書に、「単語」及び「品詞」のほ
かに「語の情報」を加えるとともに、これにともなって
前記構文解析部2の一部を変更しているほかは、前記第
1実施例と基本的構成は同じである。したかつて、以下
の説明では、第2実施例に特徴的な部分のみを説明し、
前記第1実施例と共通ずる部分の説明は省略する。(Second Embodiment) In this embodiment, in addition to the "phrase structure rules" and "messages" in the grammar rule table stored in the first storage means 3 in the first embodiment, "error detection rules" and "Information to be passed to the top of the parse tree" is added, and "word information" is added in addition to "word" and "part of speech" to the word dictionary stored in the second storage means 4. The basic configuration is the same as that of the first embodiment, except that a part of the syntax analysis section 2 is changed. In the following explanation, only the parts characteristic of the second embodiment will be explained,
Description of parts common to the first embodiment will be omitted.
第6図は第2実施例の文法規則テーブルの説明図、第7
図は第2実施例の単語辞書の説明図である。Figure 6 is an explanatory diagram of the grammar rule table of the second embodiment;
The figure is an explanatory diagram of a word dictionary according to the second embodiment.
第6図において、句構造規則及びメツセージの意味は前
記第1実施例の場合と同じである。In FIG. 6, the phrase structure rules and the meanings of the messages are the same as in the first embodiment.
「解析木の上部に渡す情報」の意味は以下の通りである
。The meaning of "information passed to the top of the parse tree" is as follows.
すなわち、例えば、第6図における「解析木の上部に渡
す情報」、
vp、n1nsyou=v、n1nsyouvp、te
nse=v、tense
は、句構造「np >v np」において、’VP
J (動詞句〉の人称は、「■」 (動詞)の人称と
同じである。That is, for example, "information passed to the top of the parse tree" in FIG. 6, vp, n1nsyou=v, n1nsyouvp, te
nse=v,tense is 'VP
The personal name of J (verb phrase) is the same as the personal name of "■" (verb).
’vp」 (動詞句)のテンス(時制)は、「V」 (
動詞)のテンスと同じである。The tense of 'vp' (verb phrase) is 'V' (
It is the same as the tense of verb).
ということを表している。It means that.
また、「誤り発見ルール」の「条件部」における、
n、5uu=s & n、gotou=v& a
rt、hyousou=a
は、句構造’nl) −−>art n」において、
n(名詞)のsuu (数;単数形か複数形かの区別)
がS(単数)で、かつ、n(名詞)のgotou (最
初の文字)がV(母音)で、かつ、art (冠詞)の
hyousou (表層;aまたはan等の区別)がa
である場合は誤りの句構造である。Also, in the "condition part" of the "error detection rule", n, 5uu=s & n, gotou=v& a
rt, hyousou=a is the phrase structure 'nl) --> art n',
suu (number; singular or plural) of n (noun)
is S (singular), gotou (first letter) of n (noun) is V (vowel), and hyousou (superficial; distinction between a or an, etc.) of art (article) is a.
If , the phrase structure is incorrect.
ということを表している。そして、その条件部に対応し
て、メツセージとして「冠詞aは子音で始まる単数名詞
に用います。」が付加される。It means that. Then, corresponding to the conditional part, the message ``The article a is used for singular nouns starting with a consonant.'' is added.
また、同じ句構造rnp−−>art n」には、さ
らに、他の条件部、すなわち、
n、5uu=s & n、gotou=c& a
rt、hyousou=an
が設けられているが、これは、他の誤りの態様を示すも
ので、
n(名詞)のsuu C数;単数形か複数形かの区別〉
がS(単数)で、かつ、n(名詞)のgotou (最
初の文字)がc(子音)で、かつ、art(冠詞〉のh
yousou (表層aまたはan等の区別)がanで
ある場合は誤りの旬構造である。In addition, the same phrase structure rnp-->art n'' further includes other conditional parts, namely, n, 5uu=s & n, gotou=c& a
rt, hyousou=an is provided, but this indicates another form of error, such as suu C number of n (noun); distinction between singular or plural form>
is S (singular), gotou (first letter) of n (noun) is c (consonant), and h of art (article)
If yousou (distinction between surface layer a, an, etc.) is an, it is an incorrect seasonal structure.
ということを表している。この場合には、メ・ンセージ
として「冠詞anは母音で始まる単数名詞に用います。It means that. In this case, the message is ``The article an is used for singular nouns that start with a vowel.
」が付加される。" is added.
そして、前記第7図に示される単語辞書には、各単語の
品詞のほかに語の情報として、各単語毎にそのhyou
sou (表層;aまたはan等の区別)、n1nsy
ou (人称)、tense(テンス;時制)、5uu
(単数形または複数形の区別;Sが単数)及びgoto
u (最初の文字が母音であるか子音であるかの区別;
Vが母音、Cが子音)が示されている。In addition to the part of speech of each word, the word dictionary shown in FIG.
sou (surface layer; distinction of a or an, etc.), n1nsy
ou (person), tense (tense), 5uu
(singular or plural; S is singular) and goto
u (distinguishing whether the first letter is a vowel or a consonant;
V is a vowel and C is a consonant).
第2実施例における構文解析部(前記第1実施例の構文
解析部2に対応する)は、上述の文法規則及び単語辞書
を用いて以下の手順により構文解析を行う機能を有して
いる。The syntactic analysis unit in the second embodiment (corresponding to the syntactic analysis unit 2 in the first embodiment) has a function of performing syntactic analysis according to the following procedure using the above-mentioned grammar rules and word dictionary.
第8図は第2実施例の構文解析のフロー図である。以下
、第8図を参照しながら第2実施例の構文解析の手順を
説明する。なお、第8図では、語彙解析部く第1実施例
の語彙解析部1に対応する)によって入力文が単語に分
解された後、この分解された単語を含む情報を構文解析
部で解析する以降の処理を示しである。゛
5TARTの指令により構文解析が開始され、以下の処
理が実行される。なお、以下の■〜■の各ステップは、
第8図で■〜■で示されるステップに対応する。FIG. 8 is a flow diagram of syntax analysis in the second embodiment. Hereinafter, the syntax analysis procedure of the second embodiment will be explained with reference to FIG. In FIG. 8, after an input sentence is decomposed into words by a vocabulary analysis unit (corresponding to vocabulary analysis unit 1 of the first embodiment), information including the decomposed words is analyzed by a syntactic analysis unit. The subsequent processing is shown below. Syntax analysis is started by the 5TART command, and the following processing is executed. In addition, each step of the following ■~■
This corresponds to the steps indicated by ■ to ■ in FIG.
■ 解析木の上部に渡すための情報を保持する変数MS
Gを初期化し、■のステップに進む。■ Variable MS that holds information to be passed to the top of the analysis tree
Initialize G and proceed to step ■.
■ 文法規則テーブルの句構造規則中に入力文の句構造
に適用できる規則があるか否かを調べる。■ Check whether there is a rule applicable to the phrase structure of the input sentence among the phrase structure rules in the grammar rule table.
YESの場合には、■のステップに進み、NOの場合に
はFAILのステップに進み、解析を失敗して終了する
。If YES, proceed to step (2); if NO, proceed to step FAIL, where the analysis fails and ends.
■ このステップから誤り発見の処理に入る。■ From this step, error detection processing begins.
前記適用された句構造に対応する文法規則テーブルの誤
り発見ルールの各条件部に記述されているルールを指す
変数を1にセットし、ステップ■に進む。A variable indicating the rule described in each condition part of the error detection rule in the grammar rule table corresponding to the applied phrase structure is set to 1, and the process proceeds to step (2).
■ 誤り発見ルールの条件部にN番目のルールがあるか
否かを調べる。YESの場合には次の■のステップに進
み、NOの場合には■のステップに戻り、■以降の処理
を繰り返す。■ Check whether there is an Nth rule in the condition part of the error detection rule. If YES, proceed to the next step (2); if NO, return to step (2) and repeat the process from (2) onwards.
■ N番目のルールの条件部が真であるか否かを調べる
。YESの場合には次の■のステップに進み、NOの場
合には■のステップに進んだ後■に戻り、以後の処理を
繰り返す。■ Check whether the condition part of the Nth rule is true. If YES, proceed to the next step (2); if NO, proceed to step (2), then return to step (2), and repeat the subsequent processing.
■ N番目のルールのメツセージを出力し、次の■のス
テップに進む。■ Output the message of the Nth rule and proceed to the next step ■.
■ Nを1だけインクリメントして■のステップに進ん
で以降の処理を繰り返す。■ Increment N by 1, proceed to step ■, and repeat the subsequent processing.
■ 文法規則テーブルの解析木の上部に渡す情報をMS
Gに設定して、次の■のステップに進む。■ Information passed to the top of the parse tree of the grammar rule table is MS
Set it to G and proceed to the next step (■).
■ 規則の左辺がrsuccess、、1が否かを調べ
る。YESならば次の5uccessのステップに進ん
で解析を終了し、NOならば、ステップ■に戻って以降
の処理を繰り返す。■ Check whether the left side of the rule is rsuccess, 1. If YES, proceed to the next step of 5 success and end the analysis; if NO, return to step (2) and repeat the subsequent processing.
第9図は、誤りを含む入力文II has an
book」を、上述の手順によって解析した場合の構
文解析木を示すものである。第9図において、rhas
JとranJは文法的に誤りであるが、上記手順を踏む
ことにより、ran」に対しては、句構造’np−−>
art n」に対応する誤り発見ルールの第1番目の
条件部ルールrn、5uu==s & n、got
ou=v &art、hyousou=a」が適用さ
れ、それに対応するメツセージ「冠詞aは子音で始まる
単数名詞に用います。」が出力される。FIG. 9 shows an input sentence II containing an error.
This figure shows a syntactic analysis tree when ``book'' is analyzed using the above-described procedure. In FIG. 9, rhas
J and ranJ are grammatically incorrect, but by following the steps above, the phrase structure 'np-->
The first condition part rule rn, 5uu==s & n, got of the error discovery rule corresponding to "art n"
ou=v &art, hyousou=a" is applied, and the corresponding message "The article a is used for singular nouns starting with a consonant." is output.
一方、rhasJに対しては、句構造「S>np V
l)Jに対応する誤り発見ルールの第1番目の条件部ル
ールrvp、tense=present & n
p、n1nsyou:#vp、n1nsyou」が適用
され、それに対応するメツセージ「主語と動詞の人称が
一致していません。」が出力される。なお、句構造r
s −−> n p vp」に対応する誤り発見ルー
ルを適用する際、前記’VpJ ’nPJの句構造に
対応する「解析木の上部に渡す情報」が考慮される。On the other hand, for rhasJ, the phrase structure “S>np V
l) The first condition part rule rvp of the error detection rule corresponding to J, tense=present & n
p, n1nsyou: #vp, n1nsyou" is applied, and the corresponding message "The subject and verb persons do not match." is output. In addition, the phrase structure r
When applying the error discovery rule corresponding to 'VpJ 'nPJ', 'information passed to the top of the parse tree' corresponding to the phrase structure of 'VpJ 'nPJ' is taken into consideration.
このようにして、解析がスムーズに行われ、また、その
際、誤りの部分及びその誤りの内容が(メツセージとし
て)明確に指摘される。In this way, the analysis is carried out smoothly, and at the same time, the erroneous part and the content of the error are clearly pointed out (as a message).
上述の第2実施例によれば、前記第1実施例と同様の利
点が得られるほかに、以下の利点が得られる。すなわち
、前記第1実施例は、基本的には、あらかじめ作成した
誤りの句構造を入力文の誤り部分にあてはめる処理だけ
で誤りを発見しようとする例であるが、考えられる全て
の誤りを誤りの句構造規則で表すと、句構造規則の数が
膨大なものとなる。例えば、冠詞であればa、an、t
he等の区別毎に、あるいは、動詞や形容詞であればそ
の語の変化形毎に、また、名詞であればその名詞の単数
・複数形毎にそれぞれ句構造を作成する必要が生ずる。According to the second embodiment described above, in addition to the same advantages as the first embodiment, the following advantages are also obtained. That is, the first embodiment is basically an example in which errors are discovered simply by applying a pre-created erroneous phrase structure to the erroneous part of the input sentence, but all possible errors are When expressed in terms of phrase structure rules, the number of phrase structure rules becomes enormous. For example, for articles a, an, t
It is necessary to create a phrase structure for each distinction such as he, or for each inflected form of a verb or adjective, or for each singular or plural form of a noun.
したがって、この句構造規則を記憶しておくために記憶
容量の大きい記憶手段が必要になるとともに、解析時間
も長くなる。さらには、句構造規則だけでは、例えば、
主語と動詞の人称の不一致等の検出もしにくい。Therefore, in order to store these phrase structure rules, a storage device with a large storage capacity is required, and the analysis time becomes long. Furthermore, using only phrase structure rules, e.g.
It is also difficult to detect mismatches between the subject and verb.
これに対して、上述の第2実施例によれば、各句構造規
則に対応して「解析木の上部に渡す情報」及び「誤り発
見ルール」が加えられ、また、単語辞書に「語の情報」
を加えられているため、句構造規則自体の数を著しく少
なくすることができるととともに、主語と動詞の人称の
不一致等も容易に検出可能となり、誤りを含む入力文の
正確な解析をスムーズにかつス迅速に行うことができる
。On the other hand, according to the second embodiment described above, "information to be passed to the top of the parse tree" and "error detection rule" are added corresponding to each phrase structure rule, and "word information"
As a result, the number of phrase structure rules itself can be significantly reduced, and mismatches in the subject and verb person can also be easily detected, making it possible to smoothly and accurately analyze input sentences containing errors. And it can be done quickly.
なお、上述の第2実施例の文法規則中には、誤りの句構
造規則がない例を掲げたが、必要に応じて誤りの句構造
規則を含めてもよいことは勿論である。Although the grammar rules of the second embodiment described above are examples in which there are no incorrect phrase structure rules, it goes without saying that incorrect phrase structure rules may be included if necessary.
[発明の効果]
以上詳述したように、本発明は、文法規則テーブルに、
正しい句構造規則のほかに誤り句構造規則を含む誤り文
に関する情報を含めたことにより、誤りを含む文にこれ
ら誤り句構造規則を含む誤り文に関する情報をあてはめ
ていくことにより、正確な解析をスムーズにかつ迅速に
行うことを可能としたものである。[Effects of the Invention] As detailed above, the present invention has the following advantages:
By including information about erroneous sentences that include incorrect phrase structure rules in addition to correct phrase structure rules, accurate analysis can be performed by applying information about erroneous sentences that include these erroneous phrase structure rules to sentences containing errors. This allows the process to be carried out smoothly and quickly.
第1図は本発明の第1実施例にかかる構文解析装置の概
略構成を示す機能ブロック図、第2図は第1図における
装置の実際の構成例を示すブロック図、第3図は第1図
における文法規則テーブルの説明図、第4図は第1図に
おける単語辞書の説明図、第5図は第1図及び第2図の
構文解析装置による構文解析時における構文解析木の説
明図、第6図は第2実施例の文法規則テーブルの説明図
、第7図は第2実施例の単語辞書の説明図、第8図は第
2実施例の構文解析のフロー図、第9図は第2実施例の
構文解析木の説明図である。
1・・・語彙解析部、2・・・構文解析部、3・・・第
1の記憶手段、4・・・第2の記憶手段、5・・・中央
演算処理装置、6・・・主メモリ、7・・・磁気ディス
ク、8・・・キーボード、9・・・デイスプレィ。FIG. 1 is a functional block diagram showing a schematic configuration of a parsing device according to a first embodiment of the present invention, FIG. 2 is a block diagram showing an example of an actual configuration of the device in FIG. 1, and FIG. FIG. 4 is an explanatory diagram of the word dictionary in FIG. 1; FIG. 5 is an explanatory diagram of the syntactic parsing tree during syntax analysis by the parsing device of FIGS. 1 and 2; FIG. 6 is an explanatory diagram of the grammar rule table of the second embodiment, FIG. 7 is an explanatory diagram of the word dictionary of the second embodiment, FIG. 8 is a flowchart of syntax analysis of the second embodiment, and FIG. FIG. 7 is an explanatory diagram of a parsing tree of a second embodiment. DESCRIPTION OF SYMBOLS 1... Vocabulary analysis unit, 2... Syntactic analysis unit, 3... First storage means, 4... Second storage means, 5... Central processing unit, 6... Main Memory, 7...Magnetic disk, 8...Keyboard, 9...Display.
Claims (1)
出力する語彙解析部と、 入力文の種類に応じてあらかじめ作成された句構造規則
を含む情報を備えた文法規則テーブルを格納する第1の
記憶手段と、 入力文の種類に応じた各単語の種類を含む情報を備えた
単語辞書を格納する第2の記憶手段と、前記語彙解析部
から分解された単語を含む情報を入力し、前記第1の記
憶手段及び第2の記憶手段からそれぞれ句構造規則を含
む情報及び単語の種類を含む情報を読み出してこれら情
報と前記語彙解析部から入力した単語を含む情報とによ
って前記入力文の構文を解析する構文解析部とを有し、
前記第1の記憶手段に格納される文法規則テーブルに、
正しい句構造規則のほかに誤り句構造規則を含む誤り文
に関する情報を含めたことを特徴とした構文解析装置。[Claims] A grammar comprising: a lexical analysis unit that decomposes an input sentence into words and outputs information including the decomposed words; and information including phrase structure rules created in advance according to the type of input sentence. a first storage means for storing a rule table; a second storage means for storing a word dictionary including information including types of each word according to the type of input sentence; and words decomposed from the vocabulary analysis section. , and reads out information including phrase structure rules and information including word types from the first storage means and second storage means, respectively, and includes these information and the words input from the vocabulary analysis section. a syntactic analysis unit that analyzes the syntax of the input sentence based on the information;
In the grammar rule table stored in the first storage means,
A syntactic analysis device characterized by including information regarding erroneous sentences including incorrect phrase structure rules in addition to correct phrase structure rules.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1045499A JPH02226364A (en) | 1989-02-28 | 1989-02-28 | Syntax analyzing device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP1045499A JPH02226364A (en) | 1989-02-28 | 1989-02-28 | Syntax analyzing device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JPH02226364A true JPH02226364A (en) | 1990-09-07 |
Family
ID=12721095
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP1045499A Pending JPH02226364A (en) | 1989-02-28 | 1989-02-28 | Syntax analyzing device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH02226364A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0528180A (en) * | 1991-07-18 | 1993-02-05 | Csk Corp | Syntax analysis control system |
-
1989
- 1989-02-28 JP JP1045499A patent/JPH02226364A/en active Pending
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0528180A (en) * | 1991-07-18 | 1993-02-05 | Csk Corp | Syntax analysis control system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4024861B2 (en) | Natural language parser with dictionary-based part-of-speech probabilities | |
| JPH02226364A (en) | Syntax analyzing device | |
| JP4033093B2 (en) | Natural language processing system, natural language processing method, and computer program | |
| KR100420474B1 (en) | Apparatus and method of long sentence translation using partial sentence frame | |
| JP2632806B2 (en) | Language analyzer | |
| JP2807236B2 (en) | Morphological analysis method | |
| JP3036591B2 (en) | Voice recognition device | |
| JP4103311B2 (en) | Natural language processing apparatus and method | |
| JPH0333977A (en) | Grammatical error discovering method for syntax analyzer | |
| JP4036172B2 (en) | Natural language processing system, natural language processing method, and computer program | |
| JP2004280509A (en) | Natural language processing system, natural language processing method, and computer program | |
| JP2504449B2 (en) | Japanese phrase interdependency analysis device | |
| JP3007397B2 (en) | Language processor | |
| Ratnaparkhi | Modeling informational novelty in a conversational system with a hybrid statistical and grammar-based approach to natural language generation | |
| JP3339766B2 (en) | Japanese analyzer | |
| JPS63221476A (en) | Processing method for natural language | |
| JPH0550777B2 (en) | ||
| JPH09212507A (en) | Character processing device and character string analysis method | |
| 見上晃 et al. | A Study of a Simple Generalized Transition Network Parser for the Japanese Language (I) | |
| JPS62272358A (en) | Display system for interruption of translation in translating device | |
| JP2006139463A (en) | Morphological analyzer, morphological analysis method, and morphological analysis program | |
| JPH05120330A (en) | Syntax analysis control system | |
| JPH01245297A (en) | Clause candidate verification method in sentence speech recognition device | |
| JP2005092617A (en) | Natural language processing system, natural language processing method, and computer program | |
| JPH04280370A (en) | Japanese word processor |