JP3316884B2 - Language translator - Google Patents
Language translatorInfo
- Publication number
- JP3316884B2 JP3316884B2 JP26997192A JP26997192A JP3316884B2 JP 3316884 B2 JP3316884 B2 JP 3316884B2 JP 26997192 A JP26997192 A JP 26997192A JP 26997192 A JP26997192 A JP 26997192A JP 3316884 B2 JP3316884 B2 JP 3316884B2
- Authority
- JP
- Japan
- Prior art keywords
- word
- program
- kana
- dictionary
- variable
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、自然語を入力とする情
報処理装置に係り、特に、カナ漢字文章をCOBOL等
のプログラミング言語に変換する言語翻訳装置に関す
る。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an information processing apparatus using natural language as an input, and more particularly to a language translation apparatus for converting kana-kanji sentences into a programming language such as COBOL.
【0002】[0002]
【従来の技術】ソフトウェアの需要の爆発的増大によ
り、ソフトウェアの開発コストを低下させたいという要
求が高まっている。しかし、これまでに開発されてきた
プログラミング言語は、記述方法を習得するのに時間が
かかる。また、プログラムの理解にも時間がかかるた
め、デバッグやプログラム保守が容易でない。そこで、
これらの課題を解決する方法として、自然語プログラミ
ングがある。これまでの技術は、例えば、情報処理学会
論文誌Vol.25 No.2(pp.204〜215)お
よび情報処理学会論文誌Vol.27 No.11(pp.
1112〜1128)に記載されているように、曖昧性
のない自然言語(英語)によって仕様を記述し、これを
解析して論理式に展開し、最終的にプログラミング言語
Prologに変換するという技術がある。仕様を階層的に記
述し、最上位に記述された英文の中に出現する単語の定
義とその意味の定義をそれ以下の階層で記述していき、
階層が下がるにつれて原始的な記述となるようにしてい
る。これらの単語の定義から意味規則を生成し、これら
の意味規則と一般的な単語(is,every等)に関する意味
規則から論理式を生成し、それを基にPrologに展開す
る。2. Description of the Related Art With the explosive increase in demand for software, there is an increasing demand for lowering software development costs. However, programming languages that have been developed so far take time to learn how to write. Also, it takes time to understand the program, so that debugging and program maintenance are not easy. Therefore,
As a method of solving these problems, there is natural language programming. The conventional techniques include, for example, IPSJ Transactions Vol.25 No.2 (pp.204-215) and IPSJ Transactions Vol.27 No.11 (pp.204-215).
As described in (1112 to 1128), the specification is described in an unambiguous natural language (English), which is analyzed and expanded into a logical expression.
There is a technology to convert to Prolog. The specifications are described hierarchically, and the definitions of the words that appear in the English sentence written at the highest level and the definitions of their meanings are described at lower levels,
As the hierarchy goes down, it becomes a primitive description. A semantic rule is generated from the definition of these words, a logical expression is generated from these semantic rules and semantic rules related to general words (is, every, etc.), and based on the logical expression, is developed into Prolog.
【0003】[0003]
【発明が解決しようとする課題】上記従来技術では、使
用する単語の定義を仕様の中にすべて定義する必要があ
り、定義の中で使用した単語についてはさらに定義する
必要がある。また、自然語による仕様記述の効率を向上
させるための手法については言及していない。In the above-mentioned prior art, it is necessary to define all definitions of words to be used in the specification, and it is necessary to further define words used in the definitions. Also, it does not mention a method for improving the efficiency of specification description in natural language.
【0004】本発明の目的は、(1)自然語によってプ
ログラム記述できる言語翻訳装置を提供すること、
(2)自然語によるプログラム生成を効率良く行うこと
のできる言語翻訳装置を提供することにある。It is an object of the present invention to provide (1) a language translator capable of describing a program in natural language.
(2) An object of the present invention is to provide a language translator capable of efficiently generating a program in natural language.
【0005】[0005]
【課題を解決するための手段】本発明は、利用者の定義
した変数等のデータに対応する自然語文字列あるいは記
号文字列を見出しとする変数辞書と、このデータを参照
して変数辞書を生成する手段と、プログラミング言語に
おける予約語を見出しとする予約語辞書と、変数辞書お
よび予約語辞書を参照した自然語解析手段(形態素解析
手段)とを備えた言語翻訳装置を提供することにより、
上記課題(1)を解決する。SUMMARY OF THE INVENTION The present invention provides a variable dictionary in which a natural language character string or a symbol character string corresponding to data of a variable or the like defined by a user is used as a heading, and a variable dictionary with reference to the data. By providing a language translating apparatus comprising: a generating unit; a reserved word dictionary whose heading is a reserved word in a programming language; and a natural language analyzing unit (morphological analyzing unit) referring to the variable dictionary and the reserved word dictionary.
Solution to Problem (1)
【0006】また、本発明は、自然語の入力と自然語の
解析を並行して行い、未登録語の存在等のエラーをリア
ルタイムに報知する手段を備え、さらに、変数辞書の内
容を更新した際に、更新内容を解析結果に反映させるこ
とを可能とする言語翻訳装置を提供することにより、上
記課題(2)を解決する。The present invention further comprises means for simultaneously inputting a natural language and analyzing the natural language, notifying an error such as the existence of an unregistered word in real time, and further updating the contents of the variable dictionary. At this time, the above-mentioned problem (2) is solved by providing a language translator capable of reflecting the updated content in the analysis result.
【0007】[0007]
【作用】プログラミングを自然語で記述することによ
り、可読性が向上するので、プログラム開発,デバッ
グ,メンテナンス,引継ぎ等の作業効率が向上する。自
然語を解析(単語分割,翻訳)する際に必須となる変数
辞書を利用者の定義情報から自動的に生成するので、利
用者は、自然語プログラミングのための辞書そのものの
作成を一切しなくてすむ。また、変数辞書の書式を予め
提供する予約語辞書の書式と同一にすることにより、形
態素解析の処理効率および辞書メンテナンス作業が向上
する。[Function] Since the readability is improved by describing the programming in a natural language, the work efficiency of program development, debugging, maintenance, handover, etc. is improved. Variable dictionaries, which are indispensable for analyzing natural words (word division and translation), are automatically generated from user definition information, so users do not have to create dictionaries for natural language programming at all. Help me. Further, by making the format of the variable dictionary the same as the format of the reserved word dictionary provided in advance, the processing efficiency of morphological analysis and the dictionary maintenance work are improved.
【0008】また、利用者が指定した言語単位毎に、逐
次、自然語解析を実行し、未登録語の存在については即
座にエラーとして表示するので、従来、コンパイルして
初めて判明する未定義語をあたかも自然語入力エラーと
して報知でき、プログラム開発の効率が向上する。In addition, natural language analysis is sequentially performed for each language unit specified by the user, and the presence of unregistered words is immediately displayed as an error. As a natural language input error, and the efficiency of program development is improved.
【0009】さらに、プログラム編集の途中で変数等の
定義情報を変更し変数辞書内容を更新した場合、その時
点までに自然語解析の終了した部分についての解析結果
に対して変数辞書の更新内容を反映させ、解析結果をそ
の都度自動的に修正することにより、変数辞書を途中で
更新した場合に、それに対応する自然語の修正作業を効
率良く行うことができる。Furthermore, when definition information such as variables is changed in the course of program editing and the contents of the variable dictionary are updated, the updated contents of the variable dictionary are compared with the results of analysis of the part for which natural language analysis has been completed up to that point. By reflecting the results and automatically correcting the analysis result each time, when the variable dictionary is updated on the way, it is possible to efficiently correct the natural language corresponding thereto.
【0010】さらに、予約語辞書あるいは変数辞書に登
録されている見出しの代わりに、利用者が好んで用いる
語句を定義することができるので、プログラム作成の効
率および保守効率が向上する。[0010] Further, since words and phrases used by the user can be defined instead of headings registered in the reserved word dictionary or the variable dictionary, the efficiency of program creation and maintenance are improved.
【0011】[0011]
【実施例】以下では、本発明をプログラム開発支援シス
テムに適用した実施例をもとに本発明を説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below based on an embodiment in which the present invention is applied to a program development support system.
【0012】また、本発明は、特定のプログラミング言
語のみに適用するためのものではなく、さまざまなプロ
グラミング言語に適用できるが、本実施例では、プログ
ラミング言語COBOLを対象としたプログラム開発支
援システムに適用した場合について説明する。本実施例
で述べるシステムの入力は、COBOLで記述すべきプ
ログラムの内容をカナ漢字で記述した文(文章)であ
る。The present invention is not intended to be applied to only a specific programming language, but can be applied to various programming languages. In this embodiment, the present invention is applied to a program development support system for a programming language COBOL. A description will be given of the case in which this is done. The input of the system described in this embodiment is a sentence (sentence) in which the contents of a program to be described in COBOL are described in kana-kanji.
【0013】図1は、本実施例で述べるシステムの構成
の概要を表したブロック図である。本システムは、大き
く二つのモジュールから構成される。一つは、変数辞書
12を生成するモジュール(10,11)であり、他の
一つは、カナ漢字プログラム文2を解析してCOBOL
プログラム14に変換するモジュール(3,4,6,
8)である。FIG. 1 is a block diagram showing the outline of the configuration of the system described in this embodiment. This system is roughly composed of two modules. One is a module (10, 11) for generating a variable dictionary 12, and the other is a module for analyzing a kana-kanji program sentence 2 and performing COBOL.
Modules (3, 4, 6,
8).
【0014】変数辞書12を生成するモジュールは、利
用者が画面,ファイル,帳票,データベースのスキーマ
等に関する仕様を定義するための定義エディタ9と、定
義エディタ9で定義された内容を格納,保持する利用者
定義情報格納テーブル10と、このテーブルの情報を参
照して変数辞書12を生成する変数辞書生成処理部11
とからなる。A module for generating the variable dictionary 12 stores and holds a definition editor 9 for a user to define specifications relating to screens, files, forms, database schemas, and the like, and contents defined by the definition editor 9. A user definition information storage table 10 and a variable dictionary generation processing unit 11 that generates a variable dictionary 12 with reference to the information in the table.
Consists of
【0015】一方、カナ漢字文2を解析してCOBOL
プログラム14に変換するモジュールは、カナ漢字プロ
グラム2を作成するための編集エディタ1と、作成した
カナ漢字プログラム2を形態素解析するための前処理で
ある入力文チェック処理部3と、カナ漢字文2を単語分
割し、辞書(12,13)から単語情報を取得する形態
素解析処理部4と、形態素解析4によって取得した単語
情報を格納,保持する単語情報格納テーブル5と、形態
素解析結果に基づいてカナ漢字文2を中間表現である半
角カナ文に変換するカナ変換処理部6と、半角カナ文を
COBOLプログラム14に変換するCOBOL変換処
理部8とからなる。On the other hand, Kana Kanji sentence 2 is analyzed and COBOL
The modules to be converted into the program 14 include an editing editor 1 for creating the kana-kanji program 2, an input sentence check processing unit 3 which is a pre-processing for morphological analysis of the created kana-kanji program 2, and a kana-kanji sentence 2 Is divided into words and word information is obtained from the dictionaries (12, 13). A word information storage table 5 that stores and holds the word information obtained by the morphological analysis 4. The kana kanji sentence 2 is composed of a kana conversion processing unit 6 for converting half-width kana sentences into an half-width kana sentence, which is an intermediate expression, and a COBOL conversion processing unit 8 for converting half-width kana sentences to a COBOL program 14.
【0016】また、上述の各処理においてエラーが発生
した場合の出力情報として、利用者の作業を支援するた
めのメッセージ情報を格納したエラー情報格納テーブル
7を用意する。Further, an error information storage table 7 storing message information for supporting a user's work is prepared as output information when an error occurs in each of the above-described processes.
【0017】なお、本実施例では、形態素解析処理部4
については、機械翻訳、あるいは対話システム等で使用
されている形態素解析モジュールをそのまま流用可能で
ある。なぜならば、本実施例で用いる形態素解析処理部
4では、適切と思われるレベル以上の精度で単語分割が
でき、分割した単語の情報を辞書から抽出できればよい
からである。そこで、本実施例で採用する形態素解析処
理モジュールおよび辞書構造として、情報処理学会第4
4回全国大会講演論文集3−181記載により公知の汎
用日本語形態素解析ツールを採用する。従って、後述す
る形態素解析処理4の説明では、この汎用日本語形態素
解析ツールの内部処理には触れないことにし、その入出
力についてのみ触れることにする。In this embodiment, the morphological analysis processing unit 4
As for, the morphological analysis module used in the machine translation or the interactive system can be used as it is. The reason is that the morphological analysis processing unit 4 used in the present embodiment can perform word division with an accuracy higher than an appropriate level and can extract information on the divided words from the dictionary. Therefore, the morphological analysis module and the dictionary structure adopted in this embodiment are the IPSJ 4th
A publicly-known general-purpose Japanese morphological analysis tool is adopted as described in the 4th National Convention Lecture Paper 3-181. Therefore, in the following description of the morphological analysis processing 4, the internal processing of the general-purpose Japanese morphological analysis tool will not be described, and only the input and output thereof will be described.
【0018】また、カナ文をCOBOLプログラム14
に変換するCOBOL変換処理部8は、プログラムの開
発を効率良く開発するため(株)日立製作所が開発したプ
ログラム開発支援システムEAGLE2(Effective Ap
proach to Achieving HighLevel Software Productivit
y 2,マニュアル#6180−3−822,823,8
24)によって既に公知である。EAGLE2では、半
角カナ文により記述されたプログラムをCOBOLプロ
グラム14に変換するためのプリコンパイラを搭載して
いる。本実施例では、COBOL変換処理部8にこのプ
リコンパイラを採用する。従って、カナ文からCOBO
Lプログラム14に変換する処理方法については触れな
いことにし、以下では、カナ漢字文をカナ文に変換する
までの処理方法およびそれを実現するためのシステム構
成について説明する。Also, the kana sentence is converted into a COBOL program 14
The COBOL conversion processing unit 8 that converts the program into a program is a program development support system EAGLE2 (Effective Appointment) developed by Hitachi, Ltd. for efficient program development.
proach to Achieving HighLevel Software Productivit
y 2, manual # 6180-3-822, 823, 8
24). EAGLE2 is equipped with a precompiler for converting a program described in half-width kana sentences into a COBOL program 14. In the present embodiment, this precompiler is employed for the COBOL conversion processing unit 8. Therefore, from the Kana sentence, COBO
The processing method for converting to the L program 14 will not be described. Hereinafter, a processing method for converting a kana-kanji sentence to a kana sentence and a system configuration for realizing the same will be described.
【0019】図2は、本実施例の処理の流れの概要を示
したフローチャートである。まず、利用者によって、カ
ナ漢字プログラムを作成するか、変数等を定義するかを
モード選択させる(ステップ21)。カナ漢字プログラ
ムを作成するモードを選択した場合、プログラム編集エ
ディタを起動し、利用者にカナ漢字プログラムを入力編
集させる(ステップ1)。プログラム編集エディタは、
フルスクリーンエディタでもラインエディタでもその他
の形式のエディタでも良い。また、カナ漢字文の入力手
段は、キーボードからのキー入力とするが、他の方法と
して音声入力や手書き文字入力等でも容易に代替可能で
ある。FIG. 2 is a flowchart showing the outline of the flow of the processing of this embodiment. First, the user selects a mode to create a kana-kanji program or define variables and the like (step 21). When the mode for creating a kana-kanji program is selected, a program editing editor is started, and the user inputs and edits the kana-kanji program (step 1). The program editor is
It can be a full screen editor, a line editor, or any other type of editor. The input means of the Kana-Kanji sentence is a key input from a keyboard. However, as another method, a voice input, a handwritten character input, or the like can be easily substituted.
【0020】本実施例では、変換処理速度を向上させる
ため、利用者がカナ漢字プログラムを入力する作業と並
行して、自然語解析処理(3,4,6)を実行する。本
実施例では、利用者がプログラムを入力して改行キーを
押下したか否かをトリガとして(ステップ22)、その
部分のカナ漢字文を解析し、中間表現である半角カナ文
に変換する。これらは、マルチプロセスで実行させるこ
とにより、容易に実現できる。なお、解析のトリガを改
行キーが押下されたか否かで判定する以外の判定方法
は、利用者によって解析が直接指示されたか否か(例え
ば「解析実行」のスイッチがオンされたか否か)による
判定方法や、句読点入力をトリガとする判定方法や、解
析単位行数の指定等でも容易に代替可能である。In this embodiment, in order to improve the conversion processing speed, the natural language analysis processing (3, 4, 6) is executed in parallel with the operation of the user inputting the kana-kanji program. In the present embodiment, whether or not the user inputs a program and presses a line feed key is triggered (step 22), and the kana-kanji sentence of that part is analyzed and converted into an half-width kana sentence as an intermediate expression. These can be easily realized by executing them in a multi-process. The determination method other than determining whether a trigger for analysis is performed based on whether the line feed key is pressed depends on whether the analysis is directly instructed by the user (for example, whether the “analysis execution” switch is turned on). A determination method, a determination method using a punctuation mark as a trigger, or a designation of the number of analysis unit lines can be easily replaced.
【0021】トリガにより、解析実行が指示されると、
まず、入力されたカナ漢字文が適当な文であるかをチェ
ックする(ステップ3)。本実施例では、全角文字変換
や字数制限チェック等を行うことにより、それ以下の処
理が実行可能であるかをチェックする。不適当な文につ
いては(ステップ23)、エラーメッセージを報知する
ことにより(ステップ27)、利用者に修正を促す。When the execution of analysis is instructed by a trigger,
First, it is checked whether the input kana kanji sentence is an appropriate sentence (step 3). In the present embodiment, by performing double-byte character conversion, character number limit check, and the like, it is checked whether the following processing can be executed. For improper sentences (step 23), an error message is notified (step 27) to urge the user to make corrections.
【0022】次に、形態素解析処理で、カナ漢字文字列
を単語分割し、変数辞書12および予約語辞書13から
単語情報を抽出して、単語情報格納テーブル5に格納,
保持する。形態素解析処理でエラーが発生した場合も、
エラーメッセージを表示し(ステップ27)、利用者に
修正を促す。Next, in a morphological analysis process, the kana-kanji character string is divided into words, word information is extracted from the variable dictionary 12 and the reserved word dictionary 13, and stored in the word information storage table 5.
Hold. If an error occurs during morphological analysis,
An error message is displayed (step 27) to urge the user to make a correction.
【0023】形態素解析の結果、単語分割されたカナ漢
字文について、それらの単語をカナに変換する(ステッ
プ6)。まず、形態素解析処理における単語分割結果
が、本システムにとって好ましくない部分について、そ
れらを補正する。次に、各単語のカナ情報を参照して、
カナに変換し、ファイルに変換結果を出力する。この
際、変数の未定義やタイプミス等で、辞書(12,1
3)に登録されていない単語(未知語)が存在している
場合、エラーメッセージを表示し(ステップ27)、利
用者に確認・修正を促す。As a result of the morphological analysis, the words are converted into kana for the kana kanji sentence that has been word-divided (step 6). First, the result of the word division in the morphological analysis processing is corrected for a part that is not preferable for the present system. Next, referring to the kana information of each word,
Convert to Kana and output the conversion result to a file. At this time, the dictionary (12, 1)
If there is a word (unknown word) not registered in 3), an error message is displayed (step 27), and the user is urged to confirm and correct.
【0024】さて、モード選択において、変数定義を選
択した場合、変数定義用のエディタを提供し、利用者に
必要情報を入力させる(ステップ9)。本実施例で変数
という場合、画面や帳票の名称やその項目の名称,デー
タベースのスキーマ情報やグローバル変数等があり、こ
れらのすべてを定義させるためのエディタが必要であ
る。When a variable definition is selected in the mode selection, an editor for the variable definition is provided, and the user is required to input necessary information (step 9). In the present embodiment, when referring to variables, there are names of screens and forms, names of their items, schema information of database, global variables, and the like, and an editor for defining all of them is necessary.
【0025】利用者によって定義された変数定義情報
は、利用者定義情報格納テーブル10に格納されるが、
このテーブルの情報を参照して、変数辞書12を生成す
る(ステップ11)。変数辞書12の構造・書式は、予
約語やシステム変数情報を格納した予約語辞書13と同
一であり、これらは、前述の汎用日本語形態素解析ツー
ルに適合するような構造となっている。なお、以下の説
明で述べる辞書(12,13)は、これらの辞書の持つ
情報のうちの必要最小限の情報を抜き取って一つのテー
ブルとしてまとめたものとする。この必要最小限の情報
を持つ変数辞書12の構成を図11に示し、同じく予約
語辞書13の構成を図13に示す。The variable definition information defined by the user is stored in the user definition information storage table 10.
The variable dictionary 12 is generated with reference to the information in this table (step 11). The structure and format of the variable dictionary 12 are the same as those of the reserved word dictionary 13 storing reserved words and system variable information, and have a structure suitable for the above-mentioned general-purpose Japanese morphological analysis tool. The dictionaries (12, 13) described in the following description are assumed to extract necessary minimum information from the information held in these dictionaries and combine them into one table. FIG. 11 shows a configuration of the variable dictionary 12 having the minimum necessary information, and FIG. 13 shows a configuration of the reserved word dictionary 13.
【0026】図1および図2からも明らかなように、入
力文チェック処理部3,形態素解析処理部4,カナ変換
処理部6,COBOL変換処理部8,変数辞書生成処理
部11は処理を表し、カナ漢字プログラム2,単語情報
格納テーブル5,エラー情報格納テーブル7,利用者定
義情報格納テーブル10,変数辞書12,予約語辞書1
3,COBOLプログラム14はファイル(テーブル)
を示している。As is clear from FIGS. 1 and 2, the input sentence check processing unit 3, morphological analysis processing unit 4, kana conversion processing unit 6, COBOL conversion processing unit 8, and variable dictionary generation processing unit 11 represent processing. , Kana-Kanji program 2, Word information storage table 5, Error information storage table 7, User definition information storage table 10, Variable dictionary 12, Reserved word dictionary 1
3. The COBOL program 14 is a file (table)
Is shown.
【0027】また、各機能ブロックはプログラム論理に
より構成されているため、各機能ブロック単位にLSI
化が可能であり、カナ漢字によるプログラム作成を支援
する装置として処理の高速化を図ることができる。Since each functional block is constituted by program logic, an LSI is provided for each functional block.
It is possible to increase the processing speed as a device that supports the creation of a program using kana-kanji characters.
【0028】図3は、本実施例のハードウェア構成のブ
ロック図である。40は入出力装置であり、編集エディ
タ,定義エディタを介して利用者からの入力を受容し、
また、エラーメッセージ等によって、システムメッセー
ジを利用者に伝達するための装置である。45はプロセ
ッサであり、記憶装置50に記憶されたプログラムに基
づいて、記憶装置50や入出力装置40とデータをやり
とりしながら演算処理を行うための装置である。50は
記憶装置であり、以下の記憶エリアからなる。51はカ
ナ漢字プログラム格納エリア、52は単語情報テーブル
格納エリア、53は利用者定義情報格納エリア、54は
入力文チェック処理部格納エリア、55は形態素解析処
理部格納エリア、56はカナ変換処理部格納エリア、5
7はCOBOL変換処理部格納エリア、58は変数辞書
生成処理部格納エリア、59はCOBOLプログラム格
納エリア、60はエラー情報格納エリア、61は予約語
辞書格納エリア、62は変数辞書格納エリア、63はワ
ーキングエリアをそれぞれ表している。FIG. 3 is a block diagram of the hardware configuration of the present embodiment. Reference numeral 40 denotes an input / output device, which receives an input from a user via an editing editor and a definition editor,
Further, the device is a device for transmitting a system message to a user by an error message or the like. Reference numeral 45 denotes a processor which performs arithmetic processing based on a program stored in the storage device 50 while exchanging data with the storage device 50 and the input / output device 40. Reference numeral 50 denotes a storage device, which includes the following storage areas. 51 is a kana kanji program storage area, 52 is a word information table storage area, 53 is a user definition information storage area, 54 is an input sentence check processing unit storage area, 55 is a morphological analysis processing unit storage area, 56 is a kana conversion processing unit Storage area, 5
7 is a COBOL conversion processing unit storage area, 58 is a variable dictionary generation processing unit storage area, 59 is a COBOL program storage area, 60 is an error information storage area, 61 is a reserved word dictionary storage area, 62 is a variable dictionary storage area, and 63 is a variable dictionary storage area. Each represents a working area.
【0029】図4は、カナ漢字プログラム2の入力例を
示した説明図であり、以下では、このプログラムを具体
例として説明する。図4において、文字列“在庫画面”
は画面の名称を表しており、利用者が定義すべき単語で
ある。この単語に関するデータは、以下で述べる変数辞
書生成処理11によって、変数辞書12に格納される。
また、1行目および7行目の“#”は、ラベルを表す記
号であり、直後に数字列を伴う。さらに、2行目では、
画面に入力されたデータを読みとり、3行目では、終了
条件が記述され、4行目では、数値計算がなされ、5行
目では、#20へスキップする。8行目では、画面に書
き込みがなされ、9行目で終了する。このように、プロ
グラム内容をカナ漢字で記述でき、これがそのままプロ
グラムとしても仕様書としても利用できるので、プログ
ラムの開発,保守,引継ぎを容易に行うことができる。FIG. 4 is an explanatory diagram showing an example of input of the kana-kanji program 2. Hereinafter, this program will be described as a specific example. In FIG. 4, the character string "stock screen"
Represents the name of the screen, and is a word to be defined by the user. The data relating to this word is stored in the variable dictionary 12 by the variable dictionary generation processing 11 described below.
“#” On the first and seventh lines is a symbol representing a label, and is accompanied by a numeric string immediately after. In the second line,
The data input to the screen is read, the end condition is described in the third line, the numerical calculation is performed in the fourth line, and the process skips to # 20 in the fifth line. In the eighth line, writing is performed on the screen, and the process ends in the ninth line. As described above, since the program contents can be described in Kana-Kanji and can be used as a program or as a specification as it is, development, maintenance, and handover of the program can be easily performed.
【0030】図5は、図4のカナ漢字プログラムをカナ
に変換した後のプログラムを示した説明図である。各文
は、単語に分割され、単語間は半角スペースで区切ら
れ、各単語は半角カナ表現で記述されている。このよう
なカナ表記のプログラムを前述のCOBOLプリコンパ
イラに送ると、最終的なCOBOLプログラムを自動的
に生成できる。FIG. 5 is an explanatory view showing a program after converting the kana-kanji program of FIG. 4 into kana. Each sentence is divided into words, each word is separated by a half-width space, and each word is described in a half-width kana expression. When such a program in kana notation is sent to the above-mentioned COBOL precompiler, a final COBOL program can be automatically generated.
【0031】図6は、変数辞書生成処理11の処理概要
を示したPAD図(Problem Analysis Diagram)であ
る。本処理では、まず、変数辞書12の初期化を行った
後(ステップ111)、画面名称取得処理(ステップ1
12),データ項目名称取得処理(ステップ113),
ファイル名称取得処理(ステップ114)等によって、
さまざまな種類の定義情報から変数を収集し、変数辞書
12に必要な情報を格納する。ここでは、画面の名前を
表す画面名称,表などに記述する項目の名前であるデー
タ項目名称,ファイルの名前を表すファイル名称に関す
る変数を変数辞書12に格納する処理について説明する
が、帳票定義等、この他の類の変数についてもこれらと
全く同様の方法で変数情報を変数辞書12に格納可能で
あるので、それらについてはここでは細かく述べない。
この変数辞書生成処理11の結果、図11に示すような
変数辞書12が生成される。FIG. 6 is a PAD (Problem Analysis Diagram) showing an outline of the process of the variable dictionary generation process 11. In this process, first, the variable dictionary 12 is initialized (step 111), and then the screen name acquisition process (step 1)
12), data item name acquisition processing (step 113),
By the file name acquisition processing (step 114) and the like,
Variables are collected from various types of definition information, and necessary information is stored in the variable dictionary 12. Here, a description will be given of a process of storing variables relating to a screen name representing a screen name, a data item name which is a name of an item described in a table or the like, and a file name representing a file name in the variable dictionary 12. For other types of variables, the variable information can be stored in the variable dictionary 12 in exactly the same manner as described above, and thus they will not be described in detail here.
As a result of the variable dictionary generation process 11, a variable dictionary 12 as shown in FIG. 11 is generated.
【0032】図7から図9までは、変数辞書生成処理1
1で行う、変数情報を取得する処理であり、図7は、画
面名称取得処理(ステップ112)、図8は、データ項
目名名称取得処理(ステップ113)、図9は、ファイ
ル名称取得処理(ステップ114)を表す各々PAD図
である。これらの処理で参照するデータは、すべて、図
10に示す利用者定義情報格納テーブル10に格納され
ている。このテーブルは、利用者が変数定義エディタを
用いて定義した変数情報を格納,保持するテーブルであ
り、利用者がエディタを用いて変数の定義をする際に、
それらの情報を図10のように自動的に格納していくこ
とにより生成される。図10に示すように、利用者定義
情報格納テーブル10の構成要素は、どの定義エディタ
から取得した変数情報かを識別する種別(5001),変
数名称を表す見出し(5002),見出しに対応するカナ
情報(5003),変数の種類を表す分類(5004)
等がある。もちろん、この他にもプログラムを実行する
際に必須となる情報(オプション指定情報等)などもこ
のテーブルに格納するが、本実施例における以下の処理
では、これらの情報は必要としないのでここでは触れな
いことにする。FIGS. 7 to 9 show a variable dictionary generation process 1.
7 is a process for acquiring variable information, FIG. 7 is a screen name acquisition process (step 112), FIG. 8 is a data item name acquisition process (step 113), and FIG. 9 is a file name acquisition process (step 113). It is each PAD figure showing step 114). All the data referred to in these processes are stored in the user definition information storage table 10 shown in FIG. This table stores and holds variable information defined by the user using the variable definition editor. When the user defines variables using the editor,
It is generated by automatically storing such information as shown in FIG. As shown in FIG. 10, the components of the user definition information storage table 10 include a type (5001) for identifying from which definition editor the variable information is acquired, a heading (5002) representing the variable name, and a key corresponding to the heading. Information (5003), classification indicating the type of variable (5004)
Etc. Of course, other information (such as option designation information) that is essential when executing the program is also stored in this table. However, in the following processing in the present embodiment, such information is not necessary, so I will not touch it.
【0033】以下、図7の画面名称取得処理を、PAD
図に従って説明する。まず、利用者定義情報格納テーブ
ル10から、種別5001を参照して、画面名称を表す
部分の見出し5002を抽出する(ステップ1120
1)。その見出し5002が予約語辞書13の見出しと
重複しているか否かを予約語辞書13を参照して判定し
(ステップ11202)、予約語辞書13の見出しと重
複するならば、エラー情報格納テーブル7を参照してエ
ラーメッセージを出力する(ステップ11203)。例え
ば、ここでのエラーコードを−5と定義すれば、図12
に示すエラー情報格納テーブル7を参照し、エラーコー
ド−5に対応するエラーメッセージ“登録エラー:「当
該単語」 この単語は予約語ですので利用者定義語とし
て使用できません。他の語に修正して下さい。”を出力
する。ここで、図12において、記号“@”で囲まれた
部分は、可変部分であり、状況に応じて適当な文字列に
置き換えることを示している。また、各エラーメッセー
ジは、エラーコードと1対1に対応しており、エラーの
内容に応じたエラーメッセージを適切に選択できる。ス
テップ11202において、重複していない場合は、見
出し5002を変数辞書12の見出しの欄に格納する
(ステップ11204)。次に、変数辞書12の品詞の
欄に“名詞”を格納する(ステップ11205)。これ
は、変数はすべて名詞として扱うことを意味するが、変
数名は、他の変数と区別するためのものであり、プログ
ラム文の構成要素としてみればすべて名詞として扱って
も差し支えない。次に、利用者定義情報格納テーブル1
0から見出しに対応するカナ情報5003を抽出して変
数辞書12のカナ情報の欄に格納する(ステップ1120
6)。そして、次に、変数辞書12の単語分類の欄に文字
列“画面名称”を格納する(ステップ11207)。Hereinafter, the screen name acquisition processing of FIG.
Description will be made with reference to the drawings. First, a heading 5002 of a portion representing a screen name is extracted from the user definition information storage table 10 with reference to the type 5001 (step 1120).
1). It is determined with reference to the reserved word dictionary 13 whether or not the heading 5002 overlaps with the heading of the reserved word dictionary 13 (step 11202). , And outputs an error message (step 11203). For example, if the error code here is defined as -5, FIG.
Refer to the error information storage table 7 shown in the table below, and the error message “Registration error:“ the relevant word ”corresponding to the error code -5 This word is a reserved word and cannot be used as a user-defined word. Please correct to another word. 12. Here, in FIG. 12, the portion surrounded by the symbol “@” is a variable portion, and indicates that the character string is to be replaced with an appropriate character string depending on the situation. , An error code corresponding to the content of the error can be appropriately selected.In step 11202, if there is no overlap, the heading 5002 is stored in the heading column of the variable dictionary 12. (Step 11204) Next, “noun” is stored in the part of speech field of the variable dictionary 12 (Step 11205), which means that all variables are treated as nouns. This can be treated as a noun when viewed as a component of a program sentence.
The kana information 5003 corresponding to the heading is extracted from 0 and stored in the kana information column of the variable dictionary 12 (step 1120).
6). Then, the character string "screen name" is stored in the word classification column of the variable dictionary 12 (step 11207).
【0034】図8のデータ項目名称取得処理(ステップ
113)および図9のファイル名称取得処理(ステップ
114)についても処理手順は同様であり、データ項目
名称については、変数辞書12の単語分類の欄に文字列
“データ項目”を格納し(ステップ11307)、ファ
イル名称については、文字列“ファイル名称”を格納す
る(ステップ11407)処理部分だけが異なる。The processing procedure is the same for the data item name acquisition processing (step 113) of FIG. 8 and the file name acquisition processing (step 114) of FIG. The character string "data item" is stored (step 11307), and the file name is different only in the processing part that stores the character string "file name" (step 11407).
【0035】図10は、利用者定義情報格納テーブル1
0の構成を示した説明図である。前述したように、この
テーブルは、種別5001,見出し5002,カナ情報
5003,分類5004等からなる。FIG. 10 shows a user definition information storage table 1.
FIG. 4 is an explanatory diagram showing a configuration of a zero. As described above, this table has a type 5001, a heading 5002, and kana information.
5003, classification 5004, etc.
【0036】図11は、図4のプログラムについて、変
数辞書生成処理11の結果として生成される変数辞書1
2の構成を示した説明図である。変数辞書12は、見出
し5011,品詞5012,カナ情報5013,単語分
類5014からなり、画面名称“在庫画面”は、画面名
称取得処理(ステップ112)により、データ項目“金
額”,“単価”,“数量”はデータ項目名称取得処理
(ステップ113)により取得した変数である。FIG. 11 shows a variable dictionary 1 generated as a result of the variable dictionary generation processing 11 for the program of FIG.
FIG. 2 is an explanatory diagram showing a configuration of FIG. The variable dictionary 12 includes a heading 5011, a part of speech 5012, kana information 5013, and a word classification 5014. The screen name “stock screen” is obtained by screen name acquisition processing (step 112), and the data items “amount”, “unit price”, “unit price” "Quantity" is a variable acquired by the data item name acquisition process (step 113).
【0037】図12は、エラー情報格納テーブルの構成
を示した説明図であり、前述したように、エラーコード
5021とエラーメッセージ5022とが1対1に対応
した形で格納されている。記号“@”で囲まれた部分は
可変部分を表し、その状況に応じて適当な文字列に置き
換えることを示している。FIG. 12 is an explanatory diagram showing the configuration of the error information storage table. As described above, the error code 5021 and the error message 5022 are stored in a one-to-one correspondence. The portion surrounded by the symbol "@" indicates a variable portion, and indicates that the character string is replaced with an appropriate character string according to the situation.
【0038】図13は、予約語辞書13の構成を示した
説明図である。前述したように、予約語辞書13は、変
数辞書12と構成が同一であり、これらの構成は、形態
素解析で採用している汎用日本語形態素解析ツールの仕
様に基づいている。図11および図13では、これらの
うち、必要不可欠な情報のみを記述してある。図13に
示すように、予約語辞書13は、見出し5031,品詞
5032,カナ情報5033,単語分類5034からな
る。予約語辞書13の見出し5031は、大きく予約語
とシステム変数とに分類できる。なお、ここでいう予約
語およびシステム変数とは、カナ漢字文をカナ文に変換
するために提供する予約語と、カナ文をCOBOLに変
換するために提供する予約語およびシステム変数との両
方を含む。FIG. 13 is an explanatory diagram showing the configuration of the reserved word dictionary 13. As described above, the reserved word dictionary 13 has the same configuration as the variable dictionary 12, and these configurations are based on the specifications of a general-purpose Japanese morphological analysis tool used in morphological analysis. In FIGS. 11 and 13, only essential information is described. As shown in FIG. 13, the reserved word dictionary 13 includes a heading 5031, a part of speech 5032, kana information 5033, and a word classification 5034. The heading 5031 of the reserved word dictionary 13 can be roughly classified into reserved words and system variables. The reserved words and system variables referred to here are both reserved words provided for converting kana-kanji sentences to kana sentences and reserved words provided for converting kana sentences to COBOL. Including.
【0039】図14は、入力文チェック処理3のPAD
図であり、以下、この処理をPAD図に基づいて説明す
る。FIG. 14 shows the PAD of the input sentence check process 3.
This process will be described below with reference to a PAD diagram.
【0040】解析の対象となる入力文中に半角のアルフ
ァベットあるいは特殊記号あるいは空白文字が存在する
か否かを判別し(ステップ301)、存在する場合は、
文字を全角文字に変換する(ステップ302)。存在し
ない場合は、入力文字数が250文字以上であるか否か
を判別し(ステップ303)、250文字以上である場
合は、エラー情報格納テーブル7を参照して文字数オー
バーを表すエラーメッセージを出力する(ステップ30
4)。It is determined whether a half-width alphabet, a special symbol, or a blank character exists in an input sentence to be analyzed (step 301).
The characters are converted to full-width characters (step 302). If not, it is determined whether the number of input characters is 250 characters or more (step 303). If the number of input characters is 250 characters or more, an error message indicating the number of characters is exceeded is output with reference to the error information storage table 7. (Step 30
4).
【0041】図15は、形態素解析処理4の結果生成さ
れる単語情報格納テーブル5の構成を示した図である。
前述したように、本実施例では、汎用日本語形態素解析
ツールを採用する。このツールは、全角日本語文字列を
入力とし、単語分割した結果を表す単語テーブル(単語
情報格納テーブル5ではない)を出力する。単語テーブ
ルには、見出し,品詞,活用情報や、付属語の意味を表
すコードなどの単語情報が格納されるが、ここでは、後
の処理で必要な単語情報のみを単語テーブルから抽出
し、新たに単語情報格納テーブル5を生成している。図
15に示すように、単語情報格納テーブル5は、見出し
5041,品詞5042,カナ情報5043,単語分類
5044からなる。FIG. 15 is a diagram showing a configuration of the word information storage table 5 generated as a result of the morphological analysis processing 4.
As described above, the present embodiment employs a general-purpose Japanese morphological analysis tool. This tool takes a full-width Japanese character string as input and outputs a word table (not the word information storage table 5) representing the result of word division. The word table stores word information such as headings, parts of speech, inflection information, and codes representing the meaning of attached words. In this case, only word information necessary for subsequent processing is extracted from the word table, The word information storage table 5 is generated. As shown in FIG. 15, the word information storage table 5 includes a heading 5041, a part of speech 5042, kana information 5043, and a word classification 5044.
【0042】図16は、カナ変換処理6のPAD図であ
り、以下、この処理の説明をPAD図に従って行う。FIG. 16 is a PAD diagram of the kana conversion process 6. Hereinafter, this process will be described with reference to the PAD diagram.
【0043】まず、各単語について以下の処理を行う
(ステップ601)。品詞5042が“数字列”である
か否かを判別し(ステップ602)、数字列である場合
は、数字列(全角)を半角数字列に変換し、単語情報格納
テーブルの「カナ情報5043」の欄に格納する(ステ
ップ603)。数字列は変数辞書12あるいは予約語辞
書13には登録できないため、カナ情報(5013,5
033)を保持していない。よってこの処理が必要とな
る。First, the following processing is performed for each word (step 601). It is determined whether or not the part of speech 5042 is a “numerical string” (step 602). If the part of speech 5042 is a numeric string, the numeric string (full-width) is converted into a half-width numeric string, and “kana information 5043” in the word information storage table is converted. (Step 603). Since the numeric string cannot be registered in the variable dictionary 12 or the reserved word dictionary 13, the kana information (5013,513)
033) is not held. Therefore, this processing is required.
【0044】次に、各単語について以下の処理を行う
(ステップ604)。見出し5041がラベル記号
“#”であるか否かを判別し(ステップ605)、ラベル
記号“#”である場合は、その直後の単語が数字列であ
るか否かを判別し(ステップ606)、数字列である場合
は、ラベル記号“#”と数字列とを結合して一単語とす
る(ステップ607)。その際、新しくできた単語に対
応するカナ情報5043は、それぞれの単語についての
カナ情報を結合したカナ文字列とする。Next, the following processing is performed for each word (step 604). It is determined whether or not the heading 5041 is a label symbol "#" (step 605). If the heading 5041 is a label symbol "#", it is determined whether or not the word immediately after that is a digit string (step 606). If it is a numeric string, the label symbol "#" and the numeric string are combined into one word (step 607). At this time, the kana information 5043 corresponding to the newly created word is a kana character string obtained by combining kana information for each word.
【0045】次に、各単語について以下の処理を行う
(ステップ608)。品詞5042が“未知語”であ
る、すなわち、予約語辞書13にも変数辞書12にも登
録されていない単語であるか否かを判別し(ステップ6
09)、“未知語”である場合は、エラー情報格納テー
ブル7を参照して、カナに変換できないことを表すエラ
ーメッセージを出力する(ステップ610)。未知語で
ない場合は、単語に対応するカナ情報を出力ファイルに
書き込む(ステップ611)。Next, the following processing is performed for each word (step 608). It is determined whether or not the part of speech 5042 is “unknown word”, that is, whether the word is not registered in the reserved word dictionary 13 or the variable dictionary 12 (step 6).
09), if the word is "unknown word", an error message indicating that it cannot be converted to kana is output with reference to the error information storage table 7 (step 610). If the word is not an unknown word, kana information corresponding to the word is written to an output file (step 611).
【0046】図17は、カナ漢字プログラム編集エディ
タの一例を示した図である。エディタは、大きく操作メ
ニュー表示部6001,編集エリア6002,メッセー
ジ表示部6003,カナ漢字変換部6004からなる。
操作メニュー表示部6001はさらに、変数定義に切り
替えるときに選択する変数定義アイコン6011,カナ
漢字プログラム編集に切り替えるときに選択する編集ア
イコン6012,利用者の好きなときに変換を実行する
際に選択する変換アイコン6013,他のファイルを呼
び出したりして文章を加工する際に選択する文章加工ア
イコン6014,編集したプログラムをファイルにセー
ブする際に選択するセーブアイコン6015,ガイダンス等
を参照したい場合に選択するヘルプアイコン6016,
処理を終了したい場合に選択する終了アイコン6017
からなる。図17では、図4に示すカナ漢字プログラム
を入力しているところを示している。FIG. 17 is a diagram showing an example of the kana-kanji program editing editor. The editor mainly comprises an operation menu display section 6001, an editing area 6002, a message display section 6003, and a kana-kanji conversion section 6004.
The operation menu display section 6001 further includes a variable definition icon 6011 to be selected when switching to variable definition, an edit icon 6012 to be selected when switching to kana kanji program editing, and selection when performing conversion when the user likes. A conversion icon 6013, a text processing icon 6014 selected when processing a text by calling another file, a save icon 6015 selected when saving an edited program to a file, and a selection when the user wants to refer to guidance, etc. Help icon 6016,
End icon 6017 to be selected when processing is to be ended
Consists of FIG. 17 shows that the kana kanji program shown in FIG. 4 is being input.
【0047】図18は、自然語解析処理が終了したこと
を示す画面の例である。先述したように、本実施例で
は、改行記号をトリガとして自然語解析を自然語入力と
並行して行う。図18では、自然語解析が終了した部分
については、ゴシック表示することによって、解析が終
了し正常に解析されたことを、他と区別した表示にする
ことによって報知する。もちろん、ゴシック表示の他に
も、色分けによる表示や、下線表示などによって区別す
るのも良い。FIG. 18 is an example of a screen indicating that the natural language analysis processing has been completed. As described above, in this embodiment, the natural language analysis is performed in parallel with the input of the natural language, using the line feed symbol as a trigger. In FIG. 18, the part where the natural language analysis has been completed is displayed in Gothic, so that the fact that the analysis has been completed and the analysis has been normally performed is displayed by making a display different from the others. Of course, in addition to the Gothic display, the display may be distinguished by color-coded display or underlined display.
【0048】図19は、自然語解析で解析エラーが発見
された場合のエラー情報出力を示した図である。ここ
で、仮に図4のカナ漢字文において、3行目に存在する
文字列“終了”を入力する際に、変換ミスにより、文字
列“修了”を入力してしまったとする。そして、文字列
“修了”は、予約語辞書13にも変数辞書12にも登録
されていない未知語であるとする。改行キーが押下され
ると、この行の解析が行われるが、形態素解析処理4の
結果、この単語の品詞として“未知語”が格納される。
カナ変換処理6で、この未知語が検出されると、エラー
情報格納テーブル7を参照して、図19のメッセージ表
示部6003に、エラーメッセージをリアルタイムに出
力する。と同時に、文字列“修了”の部分を他と異なる
態様で表示する。表示方法としては、白黒反転させる方
法,点滅させる方法,エラーメッセージの種類に応じて
異なる色(文字色,背景色)で表示する方法等がある
が、この場合はどの方法でも実現可能である。利用者
は、このようなメッセージ情報を参照することにより、
語彙的な誤り箇所を容易に発見することができる。FIG. 19 is a diagram showing error information output when an analysis error is found in natural language analysis. Here, suppose that in the kana kanji sentence of FIG. 4, when the character string “end” existing in the third line is input, the character string “completed” is input due to a conversion error. The character string “completion” is an unknown word that is not registered in the reserved word dictionary 13 or the variable dictionary 12. When the line feed key is pressed, this line is analyzed. As a result of the morphological analysis processing 4, “unknown word” is stored as the part of speech of this word.
When this unknown word is detected in the kana conversion processing 6, an error message is output in real time to the message display section 6003 of FIG. 19 with reference to the error information storage table 7. At the same time, the part of the character string "completion" is displayed in a different manner from the others. As a display method, there are a method of inverting black and white, a method of blinking, a method of displaying in a different color (character color, background color) according to the type of the error message, and the like. In this case, any method can be used. By referring to such message information, the user can
Lexical errors can be easily found.
【0049】図20は、カナ漢字プログラム2の入力の
他の例を示した図である。図20の一行目では、局所変
数“ワーク1”がプログラム中で定義されていることを
示す。文頭の文字“V”は、その文が変数定義文である
ことを示すラベルであり、本実施例では、このような特
殊な文字を定義するエリアが文頭に設けてある。さら
に、その文の中では、変数名称およびそのカナ表記およ
び型・大きさが定義される。この文の自然語解析では、
まず、文頭に“V”が記述されているかを判別し、記述
されている場合には、その直後の単語を変数の見出し5
011とし、その次の括弧内の文字列をカナ情報501
3として取得する。これらの情報を変数辞書12に格納
し、保持する。ここで、これらの変数の品詞5012は
すべて名詞とし、単語分類5013は局所変数とする。FIG. 20 is a diagram showing another example of the input of the kana-kanji program 2. The first line in FIG. 20 indicates that the local variable “work 1” is defined in the program. The letter "V" at the beginning of the sentence is a label indicating that the sentence is a variable definition sentence. In this embodiment, an area for defining such a special character is provided at the beginning of the sentence. Further, in the statement, a variable name, its kana notation, and its type and size are defined. In the natural language analysis of this sentence,
First, it is determined whether or not "V" is described at the beginning of the sentence.
011 and the next character string in parentheses is Kana information 501.
Acquire as 3. The information is stored in the variable dictionary 12 and held. Here, the parts of speech 5012 of these variables are all nouns, and the word classification 5013 is a local variable.
【0050】一方、図20の局所変数“ワーク1”が変
数辞書12に格納された際に、それまでに自然語解析が
終了した文の中で“ワーク1”が未登録語として解析さ
れていないかを探索し、もし存在する場合、未登録語と
して解析された“ワーク1”の単語情報として、いま変
数辞書に格納された単語情報を付与する。そして、未登
録語としてエディタ上に表示されていたものを未登録語
でない単語としての表示に切り替える。この処理は、局
所変数を変数辞書12に格納した場合のみでなく、利用
者が定義エディタ9で新たにデータを登録したり、既存
のデータを更新したりした場合でも同様に行う。また、
前述とは逆に、変数辞書を更新したことによって、未登
録語でなかった単語が未登録語となる場合についても更
新前の情報を基にして文字列探索することによって、変
数辞書12の更新によって未登録語となってしまった文
字列を報知することもできる。On the other hand, when the local variable "work 1" in FIG. 20 is stored in the variable dictionary 12, "work 1" has been analyzed as an unregistered word in the sentences for which natural language analysis has been completed. A search is performed to determine whether or not the word information is present, and the word information now stored in the variable dictionary is added as word information of “work 1” analyzed as an unregistered word. Then, what is displayed on the editor as an unregistered word is switched to display as a word that is not an unregistered word. This processing is performed not only when the local variables are stored in the variable dictionary 12 but also when the user registers new data with the definition editor 9 or updates existing data. Also,
Contrary to the above, even when a word that was not an unregistered word becomes an unregistered word by updating the variable dictionary, a character string search is performed based on the information before update, thereby updating the variable dictionary 12. Character strings that have become unregistered words.
【0051】本実施例によれば、変数辞書12および予
約語辞書13を参照してカナ漢字文を解析しカナ文に変
換し、さらにカナ文からCOBOLに変換するので、利
用者は可読性に優れているカナ漢字文によるプログラム
生成を実現できる。また、辞書内容の更新とプログラム
編集とを連動させることによって、変数の更新情報をプ
ログラム編集にリアルタイムに反映させることができ
る。According to the present embodiment, the Kana-Kanji sentence is analyzed with reference to the variable dictionary 12 and the reserved word dictionary 13 and converted to Kana sentence, and further converted from Kana sentence to COBOL, so that the user has excellent readability. It is possible to generate a program by using the kana-kanji sentence. Also, by linking the update of the dictionary contents with the program editing, the update information of the variables can be reflected in the program editing in real time.
【0052】本実施例の変形例・拡張例としては、予約
語あるいは定義した変数名称に対して、利用者の使い慣
れた語句を同義語として登録し、プログラムの中で記述
可能とすることが挙げられる。図21に示すように、あ
る予約語あるいは定義した変数名称に対する同義語を登
録するための定義画面を設ける。図21では、予約語
「読む」の同義語として文字列「読み込む」を登録して
いる。文字列「読み込む」は変数辞書12の見出しとし
て登録され、単語情報についても、図21の定義情報あ
るいは「読む」の持つ単語情報を参照することによっ
て、変数辞書12に格納する。これによって、図4の文
“在庫画面を読む”は、“在庫画面を読み取る”と記述
しても、翻訳結果として、“ザイコガメン オ ヨム
.”を得ることができる。As a modified example or extended example of this embodiment, for a reserved word or a defined variable name, a user-familiar word or phrase is registered as a synonym so that it can be described in a program. Can be As shown in FIG. 21, a definition screen is provided for registering a reserved word or a synonym for a defined variable name. In FIG. 21, the character string "read" is registered as a synonym for the reserved word "read". The character string “read” is registered as a heading of the variable dictionary 12, and word information is stored in the variable dictionary 12 by referring to the definition information in FIG. 21 or the word information of “read”. As a result, even if the sentence “Read inventory screen” in FIG. 4 is described as “Read inventory screen”, as a translation result, “Zaiko Gamen O Yom
. ”Can be obtained.
【0053】[0053]
【発明の効果】本発明によれば、プログラムの可読性が
向上し、プログラムのコーディング,デバッグ,テス
ト,保守管理,引継ぎ等の作業効率が向上する。また、
利用者の定義したデータから変数辞書を自動生成するの
で、辞書作成コストを軽減できる。また、変数辞書の書
式とプログラミング言語固有である予約語の辞書の書式
が同一の書式構造になっているので、辞書の保守が容易
となり、形態素解析の処理効率が向上する。また、利用
者がプログラムを編集する一方で入力された自然語の解
析を行うので、未登録語の存在等のエラーメッセージを
あたかも自然語入力時のエラーとして報知できる。さら
に、変数辞書を更新した場合、更新内容をそれまでに編
集したプログラムに反映させることにより、プログラム
の修正を効率良く行うことができる。According to the present invention, the readability of the program is improved, and the work efficiency of coding, debugging, testing, maintenance management, takeover, etc. of the program is improved. Also,
Since a variable dictionary is automatically generated from data defined by the user, dictionary creation costs can be reduced. In addition, since the format of the variable dictionary and the format of the dictionary of reserved words specific to the programming language have the same format structure, maintenance of the dictionary is facilitated and the processing efficiency of morphological analysis is improved. In addition, since the user analyzes the input natural language while editing the program, an error message such as the presence of an unregistered word can be reported as an error at the time of inputting the natural language. Furthermore, when the variable dictionary is updated, the program can be efficiently corrected by reflecting the updated content in the program edited so far.
【図1】本発明の一実施例のブロック図。FIG. 1 is a block diagram of one embodiment of the present invention.
【図2】本発明の実施例の処理のフローチャート。FIG. 2 is a flowchart of a process according to an embodiment of the present invention.
【図3】本発明の実施例のハードウェアのブロック図。FIG. 3 is a block diagram of hardware according to the embodiment of the present invention.
【図4】カナ漢字プログラムの入力を示した説明図。FIG. 4 is an explanatory diagram showing input of a kana-kanji program.
【図5】カナに変換後のプログラムを示した説明図。FIG. 5 is an explanatory diagram showing a program after conversion into kana;
【図6】変数辞書生成処理の処理概要を示したPAD
図。FIG. 6 is a PAD showing an outline of a variable dictionary generation process;
FIG.
【図7】画面名称取得処理のPAD図。FIG. 7 is a PAD diagram of a screen name acquisition process.
【図8】データ項目名称取得処理のPAD図。FIG. 8 is a PAD diagram of a data item name acquisition process.
【図9】ファイル名称取得処理のPAD図。FIG. 9 is a PAD diagram of a file name acquisition process.
【図10】利用者定義情報格納テーブルの構成を示した
説明図。FIG. 10 is an explanatory diagram showing a configuration of a user definition information storage table.
【図11】変数辞書の構成を示した説明図。FIG. 11 is an explanatory diagram showing a configuration of a variable dictionary.
【図12】エラー情報格納テーブルの構成を示した説明
図。FIG. 12 is an explanatory diagram showing a configuration of an error information storage table.
【図13】予約語辞書の構成を示した説明図。FIG. 13 is an explanatory diagram showing a configuration of a reserved word dictionary.
【図14】入力文チェック処理のPAD図。FIG. 14 is a PAD diagram of an input sentence check process.
【図15】単語情報格納テーブルの構成を示した説明
図。FIG. 15 is an explanatory diagram showing a configuration of a word information storage table.
【図16】カナ変換処理のPAD図。FIG. 16 is a PAD diagram of kana conversion processing.
【図17】カナ漢字プログラム編集エディタを示した説
明図。FIG. 17 is an explanatory diagram showing a kana-kanji program editing editor.
【図18】自然語解析終了を示した説明図。FIG. 18 is an explanatory diagram showing the end of natural language analysis.
【図19】エラー情報の出力を示した説明図。FIG. 19 is an explanatory diagram showing output of error information.
【図20】カナ漢字プログラムの入力の他の例を示した
説明図。FIG. 20 is an explanatory view showing another example of the input of the kana-kanji program.
【図21】同義語の登録画面を示した説明図。FIG. 21 is an explanatory view showing a synonym registration screen.
1…カナ漢字プログラム編集エディタ、2…カナ漢字プ
ログラム、3…入力文チェック処理部、4…形態素解析
処理部、5…単語情報格納テーブル、6…カナ変換処理
部、7…エラー情報格納テーブル、8…COBOL変換
処理部、9…変数定義エディタ、10…利用者定義情報
格納テーブル、11…変数辞書生成処理部、12…変数
辞書、13…予約語辞書、14…COBOLプログラ
ム。DESCRIPTION OF SYMBOLS 1: Kana-kanji program editing editor, 2: Kana-kanji program, 3: Input sentence check processing unit, 4: Morphological analysis processing unit, 5: Word information storage table, 6: Kana conversion processing unit, 7: Error information storage table, 8 COBOL conversion processing unit, 9 variable definition editor, 10 user definition information storage table, 11 variable dictionary generation processing unit, 12 variable dictionary, 13 reserved word dictionary, 14 COBOL program.
フロントページの続き (72)発明者 川村 隆雄 神奈川県横浜市戸塚区戸塚町5030番地 株式会社 日立製作所 ソフトウェア開 発本部内 (56)参考文献 特開 昭62−267829(JP,A) 特開 平3−271828(JP,A) 特開 昭62−282329(JP,A) 特開 昭59−125447(JP,A) 特開 平2−129756(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/06 - 9/45 Continuation of the front page (72) Inventor Takao Kawamura 5030 Totsukacho, Totsuka-ku, Yokohama-shi, Kanagawa Pref. Software Development Division, Hitachi, Ltd. (56) References JP-A-62-267829 (JP, A) JP-A-3 JP-A-271828 (JP, A) JP-A-62-282329 (JP, A) JP-A-59-125447 (JP, A) JP-A-2-129756 (JP, A) (58) Fields investigated (Int. . 7, DB name) G06F 9/06 - 9/45
Claims (1)
と、前記 プログラムの中で使用する変数あるいは定数等のデ
ータを定義する定義エディタと、 前記定義エディタで定義したデータあるいはプログラム
の中で定義したデータに対応する前記自然語の文字列あ
るいは記号文字列を見出しとし意味情報を付与した変数
辞書を生成する手段と、 前記プログラムのプログラミング言語における予約語を
見出しとし意味情報を付与した予約語辞書と、前記変数
辞書とに基づいて前記編集された自然語を解析する自然
語解析手段と、 前記自然語の解析結果に基づいて前記自然語をプログラ
ミング言語に翻訳する翻訳手段と、 前記翻訳結果を出力する出力手段とを備えた言語翻訳装
置。And 1. A means for inputting a natural language program, the editor for editing the natural language program the input, the definition editor to define the data such as variables or constants used in the program, the definition editor Means for generating a variable dictionary to which a character string or a symbol character string of the natural language corresponding to the data defined in the above or the data defined in the program as a heading and to which semantic information is added, a reserved word in a programming language of the program A natural word analyzing means for analyzing the edited natural language based on a reserved word dictionary to which semantic information is added as a heading, and the variable dictionary; and programming the natural language based on the analysis result of the natural language A language translation device comprising: translation means for translating into a language; and output means for outputting the translation result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26997192A JP3316884B2 (en) | 1992-10-08 | 1992-10-08 | Language translator |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP26997192A JP3316884B2 (en) | 1992-10-08 | 1992-10-08 | Language translator |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH06119183A JPH06119183A (en) | 1994-04-28 |
JP3316884B2 true JP3316884B2 (en) | 2002-08-19 |
Family
ID=17479782
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP26997192A Expired - Fee Related JP3316884B2 (en) | 1992-10-08 | 1992-10-08 | Language translator |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3316884B2 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115048102B (en) * | 2022-03-31 | 2025-03-14 | 阿里巴巴(中国)有限公司 | Code generation method, device, equipment and storage medium |
-
1992
- 1992-10-08 JP JP26997192A patent/JP3316884B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH06119183A (en) | 1994-04-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5200893A (en) | Computer aided text generation method and system | |
US4829423A (en) | Menu-based natural language understanding system | |
JPS62163173A (en) | Mechanical translating device | |
JPS63231674A (en) | Word processing system | |
Aarts et al. | Computational tools for the syntactic analysis of corpora | |
US5289376A (en) | Apparatus for displaying dictionary information in dictionary and apparatus for editing the dictionary by using the above apparatus | |
EP0118187A1 (en) | Menu-based natural language understanding system | |
JPH08106474A (en) | Method and device for displaying similar example sentence search result | |
JP3316884B2 (en) | Language translator | |
Kempen et al. | Author environments: Fifth generation text processors | |
JPH07146785A (en) | Program automatic generation method and device | |
JPH05282361A (en) | Data base production back-up device and mechanical translating device | |
JP3236027B2 (en) | Machine translation equipment | |
JPH04174069A (en) | Language understanding support device | |
JP2723886B2 (en) | Machine translation apparatus and translation rule creation method | |
JPH0561902A (en) | Mechanical translation system | |
JP2023152349A (en) | Kanji-kana conversion for Japanese input system | |
JPS6366663A (en) | Control system for document structure | |
JP3313810B2 (en) | Aspect processing device | |
Segal | Machine translation of natural languages: the TOVNA MTS solution | |
JPH03122717A (en) | Device for forming program comment sentence | |
JPH04367073A (en) | Grammar creation support method in machine translation system | |
Rajendran | A SURVEY OF THE STATE OF THE ART IN TAMIL LANGUAGE TECHNOLOGY. | |
JPH0778166A (en) | Translating method and machine translation system | |
BANASIAK et al. | DETECTION AND CORRECTION OF ERRORS IN POLISH BASED ON DEPENDENCY GRAMMAR |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
LAPS | Cancellation because of no payment of annual fees |