JP2000020525A - Program annotation machine translation device and recording medium recording program for operating this device - Google Patents
Program annotation machine translation device and recording medium recording program for operating this deviceInfo
- Publication number
- JP2000020525A JP2000020525A JP10207241A JP20724198A JP2000020525A JP 2000020525 A JP2000020525 A JP 2000020525A JP 10207241 A JP10207241 A JP 10207241A JP 20724198 A JP20724198 A JP 20724198A JP 2000020525 A JP2000020525 A JP 2000020525A
- Authority
- JP
- Japan
- Prior art keywords
- annotation
- program
- translation
- storage means
- language
- 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
Landscapes
- Devices For Executing Special Programs (AREA)
- Machine Translation (AREA)
- Stored Programmes (AREA)
Abstract
(57)【要約】
【課題】 プログラムの注釈部分のみ機械的に翻訳し、
ロジック部分に変更を加えずそのまま活用できるプログ
ラムを出力する。
【解決手段】 プログラム読込手段12が、外部記憶装置
11よりプログラムを読込み、翻訳前プログラム記憶手段
13に記憶し、プログラム言語指定手段17はプログラム言
語の種別を注釈抽出手段18に通知する。注釈抽出手段18
は、翻訳前プログラム記憶手段に保持されたプログラム
を構成するロジック部分と注釈部分の内、注釈部分を抽
出して注釈記憶手段19に保存する。機械翻訳手段14は注
釈記憶手段に保持された注釈を、その記述される言語か
ら他の指定された言語へと翻訳し、注釈記憶手段に保存
する。翻訳された注釈は注釈組込手段191 によってプロ
グラムに組込まれ、翻訳後プログラム記憶手段15に保存
される。翻訳後プログラム記憶手段はプログラム書込手
段16により、外部記憶装置11に書込む。
(57) [Summary] [Problem] Only the annotation part of the program is mechanically translated,
Outputs a program that can be used as is without changing the logic. SOLUTION: A program reading means 12 is an external storage device.
Read program from 11 and store program before translation
13 and the program language designation means 17 notifies the annotation extraction means 18 of the type of the program language. Annotation extraction means 18
Extracts the annotation part from the logic part and the annotation part constituting the program stored in the pre-translation program storage means and stores it in the annotation storage means 19. The machine translation means 14 translates the annotation held in the annotation storage means from the written language to another specified language, and stores it in the annotation storage means. The translated comment is incorporated into the program by the comment incorporating means 191 and stored in the program storage means 15 after translation. The translated program storage means writes the program into the external storage device 11 by the program writing means 16.
Description
【0001】[0001]
【発明の属する技術分野】本発明は、プログラムの注釈
を記述する言語を他の言語に翻訳するプログラム注釈機
械翻訳装置とこの装置を動作させるためのプログラムを
記録した記録媒体に関する。[0001] 1. Field of the Invention [0002] The present invention relates to a program annotation machine translator for translating a language describing a program annotation into another language, and a recording medium storing a program for operating the device.
【0002】[0002]
【従来の技術】一般にプログラムは、そのプログラムが
開発された国で使用される言語で注釈が記述される。し
かし、プログラムの保守や改造は、そのプログラムの開
発を行なった技術者以外が行なうことがあり、かつ、そ
の技術者が注釈を記述する言語と異なる言語圏の人間の
こともある。2. Description of the Related Art Generally, a program is annotated in a language used in a country where the program is developed. However, maintenance and modification of the program may be performed by a person other than the engineer who developed the program, and there may be a person in a language sphere different from the language in which the engineer writes annotations.
【0003】このような場合の対応の1つとして、プロ
グラム開発時の注釈は世界共用的な言語、例えば英語で
注釈を付ける。保守も英語で行なう。この場合、技術者
には英語の能力が必要とされる。又、世界共用的でない
地域的な言語で注釈が記述されたプログラムの改造を行
なうこともありうる。As one of measures to cope with such a case, an annotation at the time of program development is annotated in a universal language, for example, English. Maintenance is also conducted in English. In this case, the technicians need English skills. In addition, it is possible to remodel a program in which annotations are described in a local language that is not universal to the world.
【0004】技術者に英語等の他国語の能力が無い場合
に、その言語で注釈の記述されたプログラムを改造する
時は、別の翻訳者により注釈を書替えるか、又は電子計
算機上で動作する汎用の機械翻訳手段をプログラム注釈
機械翻訳装置として使用し、これによりプログラムの注
釈部分を翻訳する。図21はこのようなプログラム注釈機
械翻訳装置を示すブロック構成図である。When a technician does not have the ability to speak another language such as English, and remodels a program in which annotations are described in that language, the translators may rewrite the annotations or operate on a computer. A general-purpose machine translation means is used as a program annotation machine translation apparatus, and thereby translates the annotation part of the program. FIG. 21 is a block diagram showing such a program annotation machine translation apparatus.
【0005】プログラム注釈機械翻訳装置1は、プログ
ラムを外部記憶装置11から読込むプログラム読込手段12
と、読込まれたプログラムを保持する翻訳前プログラム
記憶手段13と、プログラムを文章と見なして翻訳する機
械翻訳手段14と、翻訳後のプログラムを保持する翻訳後
プログラム記憶手段15と、プログラムを外部記憶装置に
書込むプログラム書込手段16から構成される。[0005] The program annotation machine translation device 1 reads a program from an external storage device 11 by a program reading means 12.
Pre-translation program storage means 13 for holding the read program, machine translation means 14 for translating the program as a sentence, post-translation program storage means 15 for holding the translated program, and external storage of the program. It comprises a program writing means 16 for writing to the device.
【0006】図21に示す従来のプログラム注釈機械翻訳
装置では、ロジック部分と注釈部分の区別を付けずに翻
訳を行なっている。したがって翻訳前プログラム記憶手
段13は、ロジック部分と注釈部分が混在して記述されて
いる。注釈部分は、各プログラム言語の仕様に則る形で
ロジック部分と区別されているが、プログラム注釈機械
翻訳装置では図22に示すように、その区別を付けずにプ
ログラム全体を1つの文章と見なして翻訳する。The conventional program annotation machine translation apparatus shown in FIG. 21 performs translation without distinguishing between a logic part and an annotation part. Therefore, the pre-translation program storage means 13 is described with a mixture of a logic part and an annotation part. The annotation part is distinguished from the logic part according to the specification of each programming language. However, as shown in FIG. 22, the program annotation machine translator regards the entire program as one sentence without making any distinction. Translate.
【0007】図22は英語の注釈のプログラムを日本語の
注釈のプログラムに翻訳する例であるが、変数名but
tonが「ボタン」と翻訳されている。このように、ロ
ジック部分にたまたま言語と同じ文字がある場合は翻訳
され、翻訳後プログラムはロジック部分としての機能を
果たさないものとなる。又、ロジック部分と注釈部分の
区別が付かないために、プログラム注釈機械翻訳装置は
正確に文脈を判断することができず、翻訳結果の正確さ
が期待できない。FIG. 22 shows an example of translating an English annotation program into a Japanese annotation program.
ton is translated as "button". In this way, if the logic part happens to have the same character as the language, it is translated, and the translated program does not function as the logic part. Further, since the logic part and the annotation part cannot be distinguished from each other, the program annotation machine translator cannot accurately determine the context and cannot expect the accuracy of the translation result.
【0008】[0008]
【発明が解決しようとする課題】このように、従来の技
術ではプログラムのロジック部分と注釈部分の区別を付
けた機械翻訳ができず、人間系により手作業で注釈部分
を翻訳するか、又は汎用の機械翻訳装置で注釈部分だけ
でなくロジック部分も書替えた翻訳しかできなかった。As described above, in the prior art, machine translation in which a logic part and an annotation part of a program are distinguished from each other cannot be performed, and the annotation part is manually translated by a human system, or general-purpose translation is performed. Could translate only the rewritten not only the annotation part but also the logic part.
【0009】本発明は上記課題を解決するためになされ
たものであり、プログラムの注釈部分のみ機械的に翻訳
し、ロジック部分に変更を加えずそのまま活用できるプ
ログラムを出力するプログラム注釈機械翻訳装置とこの
装置を動作させるプログラムを記録した記録媒体を提供
することを目的としている。SUMMARY OF THE INVENTION The present invention has been made to solve the above-mentioned problems, and a program annotation machine translation apparatus for mechanically translating only an annotation portion of a program and outputting a program which can be utilized as it is without changing a logic portion. It is an object of the present invention to provide a recording medium on which a program for operating this device is recorded.
【0010】[0010]
【課題を解決するための手段】本発明の[請求項1]に
係るプログラム注釈機械翻訳装置は、電子計算機上で動
作するソフトウェアプログラムを外部記憶装置から読込
むプログラム読込手段と、読込まれたプログラムを保持
する翻訳前プログラム記憶手段と、プログラムを構成す
るロジック部分と注釈部分の内、注釈部分を前記プログ
ラムから抽出する注釈抽出手段と、前記注釈抽出手段に
プログラム言語の種別を与えるプログラム言語指定手段
と、抽出された注釈を保持する注釈記憶手段と、抽出さ
れた注釈をその記述される言語から他の言語へと翻訳す
る機械翻訳手段と、他の言語に翻訳された注釈を前記プ
ログラムに組込む注釈組込手段と、翻訳後の注釈が組込
まれたプログラムを保持する翻訳後プログラム記憶手段
と、前記翻訳後のプログラムを外部記憶装置に書込むプ
ログラム書込手段とを備えた。According to a first aspect of the present invention, there is provided a program translation machine translation device, comprising: a program reading unit for reading a software program operating on an electronic computer from an external storage device; Pre-translational program storage means for storing the program, annotation extraction means for extracting the annotation part from the program out of the logic part and the annotation part constituting the program, and program language designation means for giving the annotation extraction means a program language type And an annotation storage means for holding the extracted annotations, a machine translation means for translating the extracted annotations from the written language to another language, and incorporating the annotations translated into other languages into the program. Annotation incorporation means, a post-translation program storage means for holding a program into which the post-translation annotation has been incorporated, and And a writing program writing means in the external storage device program.
【0011】[請求項1]の発明では、プログラム読込
手段が、外部記憶装置よりプログラムを読込み、翻訳前
プログラム記憶手段に記憶する。プログラム言語指定手
段はプログラム言語の種別を注釈抽出手段に通知する。
注釈抽出手段は、翻訳前プログラム記憶手段に保持され
たプログラムを構成するロジック部分と注釈部分の内、
注釈部分を抽出して注釈記憶手段に保存する。機械翻訳
手段は注釈記憶手段に保持された注釈を、その記述され
る言語から他の指定された言語へと翻訳し、注釈記憶手
段に保存する。翻訳された注釈は注釈組込手段により、
プログラムに組込まれ、翻訳後プログラム記憶手段に保
存される。翻訳後プログラム記憶手段はプログラム書込
手段により、外部記憶装置に書込まれる。In the invention of claim 1, the program reading means reads the program from the external storage device and stores it in the pre-translation program storage means. The program language designation means notifies the annotation extraction means of the type of the program language.
The annotation extracting means is a logic part and an annotation part constituting the program held in the pre-translation program storage means.
The annotation part is extracted and stored in the annotation storage means. The machine translation means translates the annotation held in the annotation storage means from the written language to another specified language, and stores the translation in the annotation storage means. Translated annotations are translated by annotation
It is incorporated in the program and stored in the program storage means after translation. The translated program storage means is written into the external storage device by the program writing means.
【0012】本発明の[請求項2]に係るプログラム注
釈機械翻訳装置は、[請求項1]記載のプログラム注釈
機械翻訳装置において、注釈組込手段は、注釈記憶手段
に保存された翻訳後の注釈の文字数を判定して、翻訳前
プログラム記憶手段の翻訳前プログラムの注釈部分との
文字数を比較し、翻訳後の注釈の文字数が多いとき、翻
訳後プログラム記憶手段に対して別の行を注釈行として
作成する注釈組込手段を備えた。According to a second aspect of the present invention, there is provided a program annotation machine translation apparatus according to the first aspect, wherein the annotation incorporation means includes a post-translation machine stored in the annotation storage means. Judge the number of characters in the comment, compare the number of characters with the comment part of the pre-translation program in the pre-translation program storage means, and if the number of characters in the post-translation comment is large, add another line to the post-translation program storage means. An annotation incorporation means for creating a line was provided.
【0013】[請求項2]の発明では、注釈組込手段
は、注釈記憶手段に保存された翻訳後の注釈の文字数を
判定し、翻訳前プログラム記憶手段の翻訳前プログラム
の注釈部分との文字数と比較し、翻訳後の注釈の文字数
の方が多い場合は、プログラム記憶手段に対して別の行
を注釈行として作成して、プログラムの1行の幅を揃え
る。[0013] In the invention of claim 2, the annotation embedding means determines the number of characters of the translated comment stored in the comment storage means, and determines the number of characters between the comment part of the pre-translation program in the pre-translation program storage means. If the number of characters of the comment after translation is larger than that of, another line is created in the program storage means as a comment line, and the width of one line of the program is made uniform.
【0014】本発明の[請求項3]に係るプログラム注
釈機械翻訳装置は、[請求項1]記載のプログラム注釈
機械翻訳装置において、注釈記憶手段に代えて、注釈管
理情報記憶手段と翻訳前注釈文記憶手段と翻訳後注釈文
記憶手段とを備えると共に、注釈管理情報記憶手段には
注釈文のある位置を記憶し、翻訳前注釈文記憶手段と翻
訳後注釈文記憶手段では電子計算機の扱えるテキストフ
ァイルの形式で記憶することにより、前記機械翻訳手段
として汎用の機械翻訳手段を使用するように構成した。According to a third aspect of the present invention, there is provided a program annotating machine translating apparatus according to the first aspect of the present invention, wherein the annotation managing information storing means and the pre-translation annotation are replaced with the annotation storing means. A sentence storage means and a post-translation comment storage means are provided. The comment management information storage means stores the position of the comment sentence. The pre-translation comment storage means and the post-translation comment storage means use text which can be handled by a computer. By storing in the form of a file, a general-purpose machine translation unit is used as the machine translation unit.
【0015】[請求項3]の発明では、注釈抽出手段
は、翻訳前プログラム記憶手段に保持されたプログラム
を構成するロジック部分と注釈部分の内、注釈部分を抽
出して、電子計算機の扱えるテキストファイルの形式で
翻訳前注釈文記憶手段に記憶し、注釈文のある位置は注
釈管理情報記憶手段に保存し、電子計算機上で動作する
汎用の機械翻訳手段により翻訳前注釈文記憶手段に記憶
された注釈文を翻訳し、その結果を翻訳後注釈記憶手段
に記憶する。In the invention according to claim 3, the annotation extracting means extracts the annotation part from the logic part and the annotation part constituting the program stored in the pre-translation program storage means, and extracts the text which can be handled by the computer. It is stored in the pre-translation comment storage means in the form of a file, the position of the comment sentence is stored in the comment management information storage means, and is stored in the pre-translation comment storage means by general-purpose machine translation means operating on a computer. The comment sentence is translated, and the result is stored in the comment storage means after translation.
【0016】本発明の[請求項4]に係るプログラム注
釈機械翻訳装置は、[請求項1]記載のプログラム注釈
機械翻訳装置において、前記機械翻訳手段が注釈の言語
を他の言語に翻訳する時に、翻訳範囲を操作員が指定で
きる翻訳範囲指示手段を備えた。According to a fourth aspect of the present invention, there is provided a program annotation machine translation apparatus according to the first aspect, wherein the machine translation means translates the annotation language into another language. And a translation range instructing means for designating a translation range by an operator.
【0017】[請求項4]の発明では、注釈範囲指示手
段が人間系からの指示によりプログラムの注釈変換対象
となる範囲の指示とその言語の指示を受付け、注釈抽出
手段が注釈範囲指示手段から渡された注釈範囲に従い注
釈を抽出する。In the invention according to claim 4, the annotation range designating means receives an instruction of a range to be subjected to the annotation conversion of the program and an instruction of its language in accordance with an instruction from the human system, and the annotation extracting means receives the instruction from the annotation range designating means. Extract annotations according to the passed annotation range.
【0018】本発明の[請求項5]に係るプログラム注
釈機械翻訳装置は、[請求項1]ないし[請求項4]記
載のプログラム注釈機械翻訳装置において、前記注釈抽
出手段は翻訳対象の注釈を抽出する際に、翻訳する必要
のない注釈の定型化されたパターンを認識し、当該パタ
ーンを含む注釈文を翻訳対象外として抽出しないよう構
成した。According to a fifth aspect of the present invention, there is provided a program annotating machine translation apparatus according to the first to fourth aspects, wherein the annotation extracting means converts the annotation to be translated. At the time of extraction, a stylized pattern of an annotation that does not need to be translated is recognized, and an annotation sentence including the pattern is not extracted as a translation target.
【0019】[請求項5]の発明では、注釈抽出手段
は、翻訳対象の注釈を抽出する時に、レビジョン記号等
の翻訳する必要のない注釈の定型化されたパターンを認
識し翻訳対象外とし抽出せず、それ以外の注釈を注釈記
憶手段に書込む。機械翻訳手段は注釈記憶手段に記憶さ
れた注釈だけを翻訳するので、翻訳対象となる注釈だけ
を翻訳する。In the invention of claim 5, when extracting the annotation to be translated, the annotation extracting means recognizes a stylized pattern of the annotation that does not need to be translated, such as a revision symbol, and excludes it as a translation target. Instead, other annotations are written to the annotation storage means. Since the machine translation means translates only the annotation stored in the annotation storage means, it translates only the annotation to be translated.
【0020】本発明の[請求項6]に係るプログラム注
釈機械翻訳装置は、[請求項1]ないし[請求項5]記
載のプログラム注釈機械翻訳装置において、前記機械翻
訳手段は、注釈を翻訳する際に、翻訳不可能な単語を羅
列し記憶することにより、機械翻訳手段の保守のための
資料を作成するように構成した。According to a sixth aspect of the present invention, there is provided a program annotating machine translation apparatus according to any one of the first to fifth aspects, wherein the machine translating means translates the annotation. At this time, by constructing and storing untranslatable words, a material for maintenance of the machine translation means is created.
【0021】[請求項6]の発明では、機械翻訳手段は
注釈記憶手段に保持された注釈を、その記述される言語
から他の指定された言語へと翻訳して注釈記憶手段に保
存し、かつ、翻訳不可能な単語を、翻訳不可能単語記憶
手段に保存する。According to the invention of claim 6, the machine translation means translates the annotation held in the annotation storage means from the written language to another specified language, and stores it in the annotation storage means. In addition, the non-translatable words are stored in the non-translatable word storage means.
【0022】本発明の[請求項7]に係るプログラム注
釈機械翻訳装置は、[請求項1]ないし[請求項6]記
載のプログラム注釈機械翻訳装置において、注釈の言語
を他の言語に翻訳する際に、機械翻訳手段が翻訳不可能
な注釈がある場合、人間系からの入力により注釈を修正
する会話型の注釈修正手段を備えた。According to a seventh aspect of the present invention, there is provided a program annotating machine translation apparatus according to the first to sixth aspects, wherein the language of the annotation is translated into another language. At this time, when the machine translation means has a comment that cannot be translated, an interactive annotation correction means for correcting the annotation by input from a human system is provided.
【0023】[請求項7]の発明では、機械翻訳手段は
注釈記憶手段に保持された注釈を、その記述される言語
から他の指定された言語へと翻訳し、注釈記憶手段に保
存する。注釈修正機能は翻訳前の注釈と翻訳後の注釈を
人間系に対し表示し、翻訳前注釈の修正を受付ける。人
間系による翻訳前注釈の修正後、再度、機械翻訳手段に
より翻訳が実行され、再翻訳後の注釈を注釈記憶手段に
保存する。翻訳された注釈は注釈組込手段により、プロ
グラムに組込まれ、翻訳後プログラム記憶手段に保存さ
れる。In the invention of claim 7, the machine translation means translates the annotation held in the annotation storage means from the written language to another specified language and stores it in the annotation storage means. The annotation modification function displays the annotation before translation and the annotation after translation to a human system, and accepts the modification of the annotation before translation. After the correction of the pre-translation annotation by the human system, the translation is executed again by the machine translation means, and the re-translated annotation is stored in the annotation storage means. The translated annotation is incorporated into the program by the annotation incorporating means, and is stored in the program storage means after translation.
【0024】本発明の[請求項8]に係る記録媒体は、
プログラムを外部記憶装置から読込むプログラム読込手
段を実行する機能と、読込まれたプログラムを保持する
翻訳前プログラム記憶手段を実行する機能と、プログラ
ムを構成するロジック部分と注釈部分の内、注釈部分を
プログラムから抽出する注釈抽出手段を実行する機能
と、注釈抽出手段にプログラム言語の種別を与えるプロ
グラム言語指定手段を実行する機能と、抽出された注釈
を保持する注釈記憶手段を実行する機能と、抽出された
注釈をその記述される言語から他の言語へと翻訳する機
械翻訳手段を実行する機能と、他の言語に翻訳された注
釈をプログラムに組込む注釈組込手段を実行する機能
と、翻訳後の注釈が組込まれたプログラムを保持する翻
訳後プログラム記憶手段を実行する機能と、翻訳後のプ
ログラムを外部記憶装置に書込むプログラム書込手段を
実行する機能とを実現するためのプログラムを記録し
た。The recording medium according to claim 8 of the present invention is:
A function of executing a program reading means for reading a program from an external storage device, a function of executing a pre-translation program storing means for holding the read program, and a comment part of a logic part and a comment part constituting the program. A function for executing an annotation extracting means for extracting from a program, a function for executing a program language designating means for giving a type of a programming language to the annotation extracting means, a function for executing an annotation storing means for holding the extracted annotation, Executing the machine translation means for translating the written annotation from the written language into another language, executing the annotation incorporation means for incorporating the annotation translated into another language into a program, A function for executing a post-translation program storing means for holding a program in which the annotations are incorporated, and an external storage device for storing the translated program. Recording a program for realizing the function of executing the writing program writing means.
【0025】[0025]
【発明の実施の形態】図1はプログラム注釈機械翻訳装
置の実施の形態を示す構成図である。図1において、図
21と同一部分については同一符号を付して説明を省略す
る。図において新たに付加したものは、プログラム言語
指定手段17と、注釈抽出手段18と、注釈記憶手段19と、
注釈組込手段191 とである。FIG. 1 is a configuration diagram showing an embodiment of a program annotation machine translation apparatus. In FIG.
The same parts as in FIG. In the figure, what is newly added is a program language designation means 17, an annotation extraction means 18, an annotation storage means 19,
Annotation embedding means 191.
【0026】図2は図1の実施の形態の処理の流れを示
すフローチャートである。プログラム読込手段12は外部
記憶装置11からプログラムを読込み、翻訳前プログラム
記憶手段13に保持する(S21)。翻訳前プログラム記憶
手段13は図3に示すように、読込み時の各プログラムの
ロジック部分32と行数31を同時に保持する。FIG. 2 is a flowchart showing the flow of the processing in the embodiment of FIG. The program reading means 12 reads the program from the external storage device 11 and stores it in the pre-translation program storage means 13 (S21). As shown in FIG. 3, the pre-translation program storage means 13 simultaneously holds the logic part 32 and the number of lines 31 of each program at the time of reading.
【0027】行数31を保持する理由としては、翻訳前後
では言語が変換されていて注釈の文字数が異なるため、
翻訳前後の注釈の行数が異なる可能性がある。したがっ
て注釈の組込み先の行数が変わることがあるため、翻訳
後の注釈を注釈組込手段191により、組込む時の組込み
先の目印にするためである。The reason why the number of lines 31 is retained is that the language is converted before and after the translation and the number of characters of the annotation is different.
The number of lines in the comment before and after translation may be different. Therefore, since the number of lines at which the annotation is incorporated may change, the translated annotation is used as a mark of the integration destination when the annotation is incorporated by the annotation incorporating means 191.
【0028】プログラム言語指定手段17は、人間系から
の指示によりプログラム言語の種別を決定し、注釈抽出
手段18に通知する。又、一般にプログラムの名称はその
言語により拡張子の名称が決まっているので、人間系か
らの指示が無い場合は、プログラムの拡張子からプログ
ラムの言語を判定する。The program language specifying means 17 determines the type of the program language according to an instruction from a human system, and notifies the annotation extracting means 18 of the type. In general, the extension of the program name is determined by its language. Therefore, when there is no instruction from a human system, the language of the program is determined from the extension of the program.
【0029】注釈抽出手段18は翻訳前プログラム記憶手
段13に保持されるプログラムから、プログラム言語指定
手段17に指定されるプログラム言語の規約に基づき、注
釈を抽出する(S22)。The annotation extracting means 18 extracts annotations from the program stored in the pre-translation program storage means 13 based on the rules of the program language specified by the program language specifying means 17 (S22).
【0030】図4にC言語で記述されるプログラムのコ
メント抽出のアルゴリズムを示す。又、他の言語の場
合、例えばFORTRANの場合は、@記号間で挟まれ
る記述、JAVAの場合はC言語と同じか、”//”で
始まる行が注釈であるなど、言語毎にロジック部分と注
釈部分を分ける規約が定まっており、C言語以外の言語
においても実現可能である。FIG. 4 shows an algorithm for extracting comments of a program described in the C language. In the case of other languages, for example, in the case of FORTRAN, a description sandwiched between symbols is used. In the case of JAVA, the description is the same as that of the C language, or a line beginning with "//" is a comment. And the rules for separating the annotation part are defined, and it can be realized in languages other than C language.
【0031】図4は注釈抽出手段の処理内容を示すフロ
ーチャートである。図4では翻訳前プログラム記憶手段
13に保存されたプログラム行数分、ループで以下の処理
を繰り返す(S41)。1行目から始めて順次、該当行数
のプログラムを取出して、取出し行数をカウントアップ
する(S42)。FIG. 4 is a flowchart showing the processing contents of the annotation extracting means. In FIG. 4, the pre-translation program storage means
The following processing is repeated in a loop for the number of program lines stored in 13 (S41). Starting from the first line, the program corresponding to the number of lines is sequentially extracted, and the number of extracted lines is counted up (S42).
【0032】取出したプログラムの中に始端記号(C言
語の場合は”/*”)があれば(S43)、終端記号(C
言語の場合は”*/”)が見つかるまで(S44)1行取
出し、処理及び取出し行数のカウントアップを行なう
(S45)。見つかった始端と終端の間を注釈とし(S4
6)、行数と共に注釈記憶手段19に保存する(S47)。
抽出された注釈は注釈記憶手段19に保存される。If there is a start symbol ("/ *" in the case of C language) in the extracted program (S43), the terminal symbol (C
Until "* /" is found in the language (S44), one line is fetched, processed, and the number of fetched lines is counted up (S45). Annotate between the found start and end (S4
6) The data is stored in the annotation storage means 19 together with the number of lines (S47).
The extracted annotation is stored in the annotation storage unit 19.
【0033】図5は注釈記憶手段の構成例図であり、図
に示されるように注釈記憶手段19は、一連No.51と、
注釈行52と、注釈の文章である注釈文53と、翻訳後注釈
文54とから構成される。注釈行52は注釈抽出前のプログ
ラムでの行数位置を示す。行数を保存することにより、
機械翻訳手段14による翻訳後にプログラム上の元の位置
に戻すことが可能となる。FIG. 5 is a diagram showing a configuration example of the annotation storage means. As shown in FIG. 51,
It is composed of a comment line 52, a comment sentence 53 which is a text of the comment, and a translated comment sentence 54. The comment line 52 indicates the line number position in the program before the comment extraction. By saving the number of rows,
After translation by the machine translation means 14, it can be returned to the original position on the program.
【0034】機械翻訳手段14は注釈記憶手段19の注釈文
53の各注釈を読取って、これを指定された言語に翻訳
し、翻訳後注釈文54に保存する(S23)。注釈組込手段
191 は翻訳後注釈文54と翻訳前プログラム記憶手段13か
ら、図6に示すアルゴリズムで翻訳後プログラム記憶手
段15を作成する(S24)。The machine translation means 14 is a comment sentence stored in the comment storage means 19
The respective annotations 53 are read, translated into the designated language, and stored in the translated annotation 54 (S23). Annotation embedding means
191 creates the translated program storage means 15 from the post-translation annotation 54 and the pre-translation program storage means 13 by the algorithm shown in FIG. 6 (S24).
【0035】注釈組込手段191 では注釈記憶手段19に保
存された注釈行数、即ち、一連No.51の最大数分、ル
ープで以下の処理を繰り返す(S61)。注釈記憶手段19
の各一連No.(N)の行の注釈行52(=Mとする)を
順次取出し(S62)、翻訳前プログラム記憶手段13から
M行目のプログラム行を取出し(S63)、該当する注釈
を取出されたプログラムに組込む(S64)。次に、翻訳
後プログラム記憶手段15にその結果を書込む(S65)。
プログラム書込手段16は外部記憶装置に翻訳後プログラ
ムを書込む(S25)。In the annotation embedding means 191, the number of annotation lines stored in the annotation storage means 19, that is, the series No. The following processing is repeated in a loop for the maximum number of 51 (S61). Annotation storage means 19
Of each series No. The comment line 52 (= M) of the line (N) is sequentially fetched (S62), the Mth program line is fetched from the pre-translation program storage means 13 (S63), and the corresponding annotation is fetched into the program. Incorporation (S64). Next, the result is written into the translated program storage means 15 (S65).
The program writing means 16 writes the translated program into the external storage device (S25).
【0036】本実施の形態によればロジック部分に変更
を加えず、注釈部分のみ翻訳された図7に示す例のよう
なプログラムが作成できる。図8に本実施の形態による
効果の概念図を示す。英語注釈プログラムを本実施の形
態のプログラム注釈機械翻訳装置に与えることにより、
日本語注釈のプログラムが自動的に作成される。本装置
を利用することにより、技術者の語学力にとらわれず、
他国語で記述されたプログラムの保守や、複数国間での
プログラムの開発を行なうことが可能となる。According to the present embodiment, a program such as the example shown in FIG. 7 in which only the annotation part is translated without changing the logic part can be created. FIG. 8 is a conceptual diagram of the effect of the present embodiment. By giving the English annotation program to the program annotation machine translation device of the present embodiment,
A program for Japanese annotations is automatically created. By using this device, regardless of the language skills of engineers,
It is possible to maintain programs written in other languages and develop programs between multiple countries.
【0037】図9は注釈組込手段の他の実施の形態の処
理内容を示すフローチャートである。なお、ハード構成
は図1と同様であるためその説明を省略する。本実施の
形態では上記した図1の実施の形態に対し、注釈組込手
段191 が注釈記憶手段19に保存された翻訳後の注釈の文
字数を判定し、翻訳前プログラム記憶手段13の組込先の
注釈部分との文字数と比較し、翻訳後の注釈の文字数の
方が多い場合は、翻訳後プログラム記憶手段15の次の行
を注釈行として新たに作成して、プログラムの1行の幅
を揃えるようにしたものである。FIG. 9 is a flow chart showing the processing contents of another embodiment of the annotation embedding means. Note that the hardware configuration is the same as that of FIG. In the present embodiment, the annotation incorporation means 191 determines the number of characters of the translated annotation stored in the annotation storage means 19 in comparison with the embodiment of FIG. If the number of characters in the comment after translation is larger than the number of characters in the comment part of the translation, the next line of the translated program storage means 15 is newly created as a comment line, and the width of one line of the program is reduced. They are aligned.
【0038】注釈組込手段191 は翻訳後注釈文54と翻訳
前プログラム記憶手段13とから、図9で示すアルゴリズ
ムで翻訳後プログラム記憶手段15を作成する。注釈組込
手段191 では注釈記憶手段19に保存された注釈行数、即
ち、一連No.51の最大数分、ループで以下の処理を繰
り返す(S91)。注釈記憶手段19の各一連No.(N)
の行の注釈行52(=Mとする)を順次取出し(S92)、
翻訳前プログラム記憶手段13からM行目のプログラム行
を取出す(S93)。Annotation incorporation means 191 creates post-translation program storage means 15 from post-translation annotation 54 and pre-translation program storage means 13 using the algorithm shown in FIG. In the annotation incorporation means 191, the number of annotation lines stored in the annotation storage means 19, that is, the series No. The following processing is repeated in a loop for the maximum number of 51 (S91). Each series No. of the annotation storage means 19 (N)
The comment lines 52 (= M) of the line are sequentially taken out (S92),
The Mth program line is fetched from the pre-translation program storage means 13 (S93).
【0039】取出したM行目のプログラムの注釈に使用
できる文字数を判定する(=Pとする)。文字数と翻訳
後の当該注釈文字数とを比較する。この時、翻訳後の注
釈文字数からは連続するブランク文字を1文字のブラン
クに置換した文字数で比較する。Pより翻訳後の当該注
釈文字数が少なければ(S95)、上記M行目のプログラ
ムに、連続するブランク文字を1文字のブランクに置換
した翻訳後注釈文を組込む。The number of characters that can be used for the annotation of the program on the M-th line taken out is determined (= P). The number of characters is compared with the number of annotation characters after translation. At this time, based on the number of comment characters after translation, the number of consecutive blank characters replaced with one blank is compared. If the number of commentary characters after translation is smaller than P (S95), a post-translation commentary statement in which continuous blank characters are replaced with one blank is incorporated into the program on the Mth line.
【0040】又、逆にPより当該注釈文字数が多ければ
(S95)、上記M行目のプログラムに、連続するブラン
ク文字を1文字に置換した翻訳後注釈文を組込み、又、
超過文字数分をプログラムのM行目の次の(M+1)行
目に追加する(S97)。連続したブランク文字を1文字
のブランク文字に置換する理由は、翻訳前の注釈部分は
ブランク文字で横の行数が揃えられているため、翻訳後
にブランク文字数を減らさないと容易に1行の文字数が
超過してしまうためである。次に、翻訳後プログラム記
憶手段191 にその結果を書込む(S98)。On the other hand, if the number of commentary characters is larger than P (S95), a post-translation commentary statement in which continuous blank characters are replaced with one character is incorporated into the program on the M-th line.
The excess characters are added to the (M + 1) -th line following the M-th line of the program (S97). The reason for replacing consecutive blank characters with one blank character is that the comment part before translation is blank characters and the number of horizontal lines is aligned, so if the number of blank characters is not reduced after translation, the number of characters in one line can be easily changed Is exceeded. Next, the result is written into the translated program storage means 191 (S98).
【0041】図10は本実施の形態による翻訳結果の例で
あり、2行目の注釈文「display SS ske
lton2」が翻訳の結果、2行に渡って翻訳されてい
る。このようにプログラムの1行の幅の揃った機械翻訳
を行なうことができる。FIG. 10 shows an example of the translation result according to the present embodiment. The comment sentence “display SS ske” on the second line is shown in FIG.
"ton2" is translated over two lines as a result of translation. In this way, it is possible to perform machine translation with one line width of the program.
【0042】図11は更に他の実施の形態を示す構成図で
ある。図11において、図1と同一部分については同一符
号を付して説明を省略する。本実施の形態では図1の注
釈記憶手段19の代わりに、電子計算機の扱えるテキスト
ファイルの形式で記憶する翻訳前注釈文記憶手段192 と
翻訳後注釈文記憶手段193 ,注釈管理情報記憶手段194
を備え、機械翻訳手段14の代わりに汎用機械翻訳手段14
1 を備えるようにしたものである。FIG. 11 is a configuration diagram showing still another embodiment. 11, the same parts as those in FIG. 1 are denoted by the same reference numerals, and the description will be omitted. In the present embodiment, instead of the annotation storage unit 19 of FIG. 1, the pre-translation annotation storage unit 192, the post-translation annotation storage unit 193, and the annotation management information storage unit 194 that store in the form of a text file that can be handled by a computer.
General-purpose machine translation means 14 instead of the machine translation means 14
1 is provided.
【0043】図1の機械翻訳手段14と本実施の形態によ
る汎用機械翻訳手段141 との違いは、機械翻訳手段14の
入力及び出力の対象が主記憶装置上の注釈記憶手段19で
あり、注釈記憶手段19が図5に示す通り注釈文以外の情
報を持つため汎用の機械翻訳手段が使用できないのに対
し、本実施の形態では注釈文とその他の情報を分離する
と共に、注釈文をテキストファイルの形式で保持するた
めに汎用機械翻訳手段141 が使用可能となる点である。The difference between the machine translation means 14 in FIG. 1 and the general-purpose machine translation means 141 according to the present embodiment is that the input and output of the machine translation means 14 are the annotation storage means 19 on the main storage device, As shown in FIG. 5, the storage means 19 has information other than the comment text, so that general-purpose machine translation means cannot be used. In the present embodiment, the comment text and other information are separated, and the comment text is stored in a text file. The point is that the general-purpose machine translation means 141 can be used to hold in the format of.
【0044】なお、既に説明した通り、注釈抽出手段18
は翻訳前プログラム記憶手段13に保持されるプログラム
から、プログラムの記述されるプログラミング言語の規
約に基づいて注釈を抽出する。ここで抽出された注釈は
翻訳前注釈文記憶手段192 に保持され、注釈の位置を注
釈管理情報記憶手段194 に保持するものである。なお、
図12は注釈管理情報記憶手段194 の構成例を示す。As described above, the annotation extracting means 18
Extracts an annotation from the program stored in the pre-translation program storage means 13 based on the rules of the programming language in which the program is described. The annotations extracted here are stored in the pre-translation annotation storage unit 192, and the positions of the annotations are stored in the annotation management information storage unit 194. In addition,
FIG. 12 shows a configuration example of the annotation management information storage means 194.
【0045】又、翻訳前注釈文記憶手段192 は電子計算
機上のテキストファイルの形式で保存され、汎用機械翻
訳手段141 によって翻訳可能である。汎用機械翻訳手段
141は翻訳前注釈文記憶手段192 を指定された言語に翻
訳し、翻訳後注釈文記憶手段193 に保存する。The pre-translation comment storage means 192 is stored in the form of a text file on a computer and can be translated by the general-purpose machine translation means 141. General-purpose machine translation means
141 translates the pre-translation comment storage 192 into the specified language and stores it in the post-translation comment storage 193.
【0046】注釈組込手段191 は翻訳後注釈文記憶手段
193 と注釈管理情報記憶手段194 と翻訳前プログラム記
憶手段13から、翻訳後プログラム記憶手段15を作成す
る。本実施の形態によれば、図1で示す実施の形態と異
なり機械翻訳手段14の代わりに汎用の機械翻訳手段を利
用することが可能となる。Annotation incorporation means 191 is a post-translation annotation sentence storage means.
The post-translation program storage unit 15 is created from the 193, the annotation management information storage unit 194, and the pre-translation program storage unit 13. According to the present embodiment, unlike the embodiment shown in FIG. 1, a general-purpose machine translation unit can be used instead of the machine translation unit 14.
【0047】図13は更に他の実施の形態を示す構成図で
ある。図13において、図1と同一部分に対しては同一符
号を付して説明を省略する。図13では図1に示す実施の
形態に対し、一部のモジュールのみ注釈を翻訳したい時
の対応として、翻訳範囲を操作員が指定できる翻訳範囲
指示手段195 と、翻訳範囲記憶手段196 と翻訳範囲記憶
手段196 に従い注釈を抽出する注釈抽出手段を備える。FIG. 13 is a configuration diagram showing still another embodiment. In FIG. 13, the same parts as those in FIG. 13, the translation range designating means 195 which allows the operator to specify the translation range, the translation range storage means 196, and the translation range An annotation extracting means for extracting an annotation according to the storage means 196 is provided.
【0048】翻訳範囲指示手段195 はマンマシン装置19
7 から翻訳対象の指示を受付け、翻訳範囲記憶手段196
に保存する。図14は翻訳範囲記憶手段196 を示す。注釈
抽出手段18は翻訳範囲指示手段195 の翻訳開始行142
と、翻訳終了行143 を参照して翻訳前プログラム記憶手
段13から注釈を抽出し、注釈記憶手段19に保存する。The translation range indicating means 195 is
7 and receives the translation target instruction from the translation range storage means 196.
To save. FIG. 14 shows the translation range storage means 196. The annotation extracting means 18 is a translation start line 142 of the translation range designating means 195.
Then, an annotation is extracted from the pre-translation program storage means 13 with reference to the translation end line 143 and stored in the annotation storage means 19.
【0049】図15は更に他の実施の形態を示す構成図で
ある。図15において、図1と同一部分については同一符
号を付して説明を省略する。一般に、プログラムの注釈
中には、「Rev」等の英語で記述された定型的な言い
回しの注釈があり、それらは翻訳対象外としたい要求が
ある。FIG. 15 is a configuration diagram showing still another embodiment. 15, the same components as those in FIG. 1 are denoted by the same reference numerals, and the description will be omitted. Generally, in program annotations, there are annotations of a fixed phrase written in English such as “Rev”, and there is a demand to exclude them from translation.
【0050】このことに対応するために、本実施の形態
では図1に示す実施の形態に対し、注釈の内の定型化さ
れたパターンを認識して当該パターンを含むコメント行
を翻訳対象外として抽出せず、それ以外の注釈行だけを
注釈記憶手段19に書込むようにした注釈抽出手段18と、
注釈対象外のパターンを憶える翻訳対象外パターン記憶
手段151 と、定型化されたパターンだけでなく当該パタ
ーン以外の翻訳対象とするべき文字を含む注釈文である
場合に、当該注釈文を翻訳対象として抽出するか否かを
設定する注釈抽出方式指定手段152 を備えるようにし
た。In order to cope with this, this embodiment differs from the embodiment shown in FIG. 1 in that a stylized pattern in an annotation is recognized and a comment line including the pattern is excluded from translation. An annotation extracting unit 18 that does not extract, but writes only the other annotation lines into the annotation storing unit 19;
A non-translatable pattern storage unit 151 that stores a pattern that is not to be annotated, and an annotated sentence that includes not only a stylized pattern but also a character to be translated other than the pattern, the corresponding annotated sentence is regarded as a translation target. An annotation extraction method designation means 152 for setting whether or not to extract is provided.
【0051】図16は翻訳対象パターン記憶手段を説明す
る図である。翻訳対象外パターン記憶手段への登録は、
事前に人間系により行なわれる。一連No.161 は翻訳
対象外パターン文162 に付けられた一連No.であり、
翻訳対象外パターンは翻訳対象外とするパターンを記憶
する。FIG. 16 is a diagram for explaining the translation target pattern storage means. Registration in the non-translatable pattern storage means
It is performed by a human system in advance. Series No. 161 is a series No. assigned to the non-translatable pattern sentence 162. And
The non-translation target pattern stores a pattern that is not to be translated.
【0052】注釈抽出手段18は翻訳前プログラム記憶手
段13に保持されるプログラムから、プログラムの記述さ
れるプログラミング言語の規約に基づき、かつ、翻訳対
象外パターン記憶手段151 を参照して翻訳対象外でない
ことを確認しつつ注釈を抽出する。図17にC言語で記述
されるプログラムのコメント抽出のアルゴリズムを示
す。The annotation extraction means 18 is not excluded from the translation target from the program stored in the pre-translation program storage means 13 based on the rules of the programming language in which the program is described and referring to the non-translation target pattern storage means 151. Extract annotations while confirming that FIG. 17 shows an algorithm for extracting comments of a program described in C language.
【0053】図17のフローチャートでは翻訳前プログラ
ム記憶手段13に保存されたプログラム行数分、ループで
以下の処理を繰り返す(S171 )。1行目から始めて順
次、該当行数のプログラムを取出して、取出行数をカウ
ントアップする(S172 )。取出したプログラムの中に
始端記号(C言語の場合は”/*”)があれば(S173
)、終端記号(C言語の場合は”*/”)が見つかる
まで(S174 )、1行取出処理及び取出行数のカウント
アップを行なう(S175 )。In the flowchart of FIG. 17, the following processing is repeated in a loop for the number of program lines stored in the pre-translation program storage means 13 (S171). Starting from the first line, the program corresponding to the number of lines is sequentially extracted, and the number of extracted lines is counted up (S172). If there is a start symbol ("/ *" in the case of C language) in the extracted program (S173)
), Until a terminal symbol ("* /" in the case of C language) is found (S174), one-line fetching processing and counting of the number of fetched lines are performed (S175).
【0054】見つかった始端と終端の間を注釈とする
(S176 )。そして、翻訳対象パターン一連No.161
の最大数分まで繰り返し(S178 )、パターンと一致す
る単語を含むかを調べ、全て一致しない場合は、行数と
共に注釈記憶手段19に保存する(S179 )。An annotation is made between the found start end and end end (S176). Then, the series of translation target patterns No. 161
Is repeated up to the maximum number of times (S178), it is checked whether or not a word that matches the pattern is included.
【0055】又、この時、パターンと一致する単語があ
る場合で、かつ、パターンと一致しない別の単語を同一
注釈文に含む場合は、注釈抽出方式指示手段で抽出しな
いとする指定になっている場合は、当該注釈文を注釈記
憶手段19に保存しないようにする(S178 )。本実施の
形態によれば、レビジョン記号等の翻訳する必要のない
注釈の定型化されたパターンについては翻訳しないよう
な注釈の機械翻訳が可能となる。At this time, when there is a word that matches the pattern, and when another word that does not match the pattern is included in the same annotation sentence, it is specified that the extraction is not to be performed by the annotation extraction method instruction means. If so, the comment sentence is not stored in the comment storage means 19 (S178). According to the present embodiment, it is possible to perform machine translation of an annotation that does not translate a fixed pattern of an annotation such as a revision symbol that does not need to be translated.
【0056】図18は更に他の実施の形態を示す構成図で
ある。図18において、図1と同一部分については同一符
号を付して説明を省略する。本実施の形態では図1の実
施の形態に対し、注釈記憶手段19に保持された注釈を、
その記述される言語から他の指定された言語へと翻訳し
注釈記憶手段19に保存し、かつ、翻訳不可能な単語を翻
訳不可能単語記憶手段に保存する機械翻訳手段14と、翻
訳不可能な単語を記憶する翻訳不可能単語記憶手段187
を備えるようにした。FIG. 18 is a configuration diagram showing still another embodiment. 18, the same parts as those in FIG. 1 are denoted by the same reference numerals, and the description will be omitted. In the present embodiment, the annotation held in the annotation storage means 19 is compared with the embodiment of FIG.
A machine translation means 14 for translating the written language into another specified language and storing it in the annotation storage means 19, and for storing a non-translatable word in the non-translatable word storage means, Untranslatable word storage means 187 for storing various words
Was prepared.
【0057】機械翻訳手段14は注釈記憶手段19に保持さ
れた注釈を、その記述される言語から他の指定された言
語へと翻訳するが、その時に翻訳不可能であった単語
を、翻訳不可能単語記憶手段181 に保存する。The machine translation means 14 translates the annotation held in the annotation storage means 19 from the written language to another specified language. It is stored in the possible word storage means 181.
【0058】本実施の形態によれば翻訳不可能な単語が
記憶されているため、本装置の操作員は翻訳不可能単語
記憶手段に記憶される単語を参照してプログラムを作る
ことにより、翻訳可能なプログラムを作成することが可
能となる。According to the present embodiment, words that cannot be translated are stored. Therefore, the operator of this apparatus creates a program by referring to the words stored in the non-translatable word storage means, thereby performing translation. A possible program can be created.
【0059】図19は更に他の実施の形態を示す構成図で
ある、図19において、図1と同一部分については同一符
号を付して説明を省略する。本実施の形態では図1の実
施の形態に対し、機械翻訳手段14が翻訳不可能な注釈文
53がある場合、人間系からの入力により注釈文53を修正
する会話型の注釈修正手段171 を備えるようにしたもの
である。図20は注釈修正手段171 が人間系に対しディス
プレイ173 に表示する表の例を示す。FIG. 19 is a block diagram showing still another embodiment. In FIG. 19, the same parts as those in FIG. 1 are denoted by the same reference numerals and description thereof will be omitted. This embodiment differs from the embodiment shown in FIG.
In the case where 53 exists, an interactive annotation correcting means 171 for correcting the annotation 53 based on input from a human system is provided. FIG. 20 shows an example of a table displayed by the annotation correction means 171 on the display 173 for a human system.
【0060】翻訳前の注釈文53はつづりのミス,文法の
ミス又は特殊な単語の使用等により、機械翻訳手段14に
より翻訳不可能であるか、又は誤って翻訳されることが
ある。人間系は翻訳前の注釈文53と翻訳後注釈文54を比
べ、マンマシン装置172 より翻訳前の注釈文53を修正す
る。The comment sentence 53 before translation may be untranslatable or may be incorrectly translated by the machine translation means 14 due to spelling errors, grammatical errors, or the use of special words. The human system compares the comment text 53 before translation with the comment text 54 after translation, and corrects the comment text 53 before translation by the man-machine device 172.
【0061】人間系による翻訳前の注釈文53の修正後、
再度、機械翻訳手段14により翻訳が実行され、再翻訳後
の翻訳後注釈文54に注釈記憶手段19に保存する。翻訳さ
れた注釈は注釈組込手段191 により、プログラムに組込
まれ、翻訳後プログラム記憶手段15に保存される。本実
施の形態によれば、機械翻訳手段14により翻訳不可能な
注釈を人間系からの指示により修正することが可能とな
る。After correcting the annotation sentence 53 before translation by a human system,
The translation is executed again by the machine translation means 14 and stored in the annotation storage means 19 in the post-translation annotation sentence 54 after the re-translation. The translated annotation is incorporated into the program by the annotation incorporating means 191 and is stored in the translated program storage means 15. According to the present embodiment, it is possible to correct a comment that cannot be translated by the machine translation means 14 according to an instruction from a human system.
【0062】上記した各説明において記載した手法は、
コンピュータに実行させることのできるプログラムとし
て、例えば磁気ディスク,光ディスク,半導体メモリな
どの記録媒体に書込んで、各種装置に適用したり、通信
媒体により伝送して各種装置に適用することも可能であ
る。コンピュータは、記録媒体に記録されたプログラム
を読込み、このプログラムによって動作が制御されるこ
とにより、上述した処理を実行する。The method described in each of the above descriptions is as follows.
As a program that can be executed by a computer, the program can be written in a recording medium such as a magnetic disk, an optical disk, or a semiconductor memory and applied to various devices, or transmitted to a communication medium and applied to various devices. . The computer reads the program recorded on the recording medium, and executes the above-described processing by controlling the operation of the program.
【0063】[0063]
【発明の効果】以上説明したように、本発明によれば任
意の言語で注釈の記述されたプログラムに対して、プロ
グラムのロジックはそのままで注釈のみ翻訳したプログ
ラムを出力することが可能となり、異なる言語間でのプ
ログラムの保守・開発が容易となる。As described above, according to the present invention, it is possible to output a program in which only the annotation is translated without changing the logic of the program with respect to the program in which the annotation is described in an arbitrary language. Maintenance and development of programs between languages becomes easy.
【図1】本発明によるプログラム注釈機械翻訳装置の実
施の形態を示す構成図。FIG. 1 is a configuration diagram showing an embodiment of a program annotation machine translation device according to the present invention.
【図2】図1の処理内容を示すフローチャート。FIG. 2 is a flowchart showing the processing contents of FIG. 1;
【図3】図1の翻訳前プログラム記憶手段の構成図。FIG. 3 is a configuration diagram of a pre-translation program storage unit of FIG. 1;
【図4】図1の注釈抽出手段の処理内容を示すフローチ
ャート。FIG. 4 is a flowchart showing processing contents of an annotation extracting unit in FIG. 1;
【図5】図1の注釈記憶手段の構成図。FIG. 5 is a configuration diagram of an annotation storage unit in FIG. 1;
【図6】図1の注釈組込手段の処理内容を示すフローチ
ャート。FIG. 6 is a flowchart showing the processing contents of the annotation embedding means of FIG. 1;
【図7】図1の翻訳後プログラム例図。FIG. 7 is a diagram showing an example of a program after translation in FIG. 1;
【図8】図1の実施の形態の効果の概念図。FIG. 8 is a conceptual diagram of the effect of the embodiment of FIG. 1;
【図9】他の実施の形態の注釈組込手段の処理内容を示
すフローチャート。FIG. 9 is a flowchart showing processing contents of an annotation embedding unit according to another embodiment.
【図10】図9の実施の形態における翻訳結果を示す図。FIG. 10 is a diagram showing a translation result in the embodiment of FIG. 9;
【図11】更に他の実施の形態を示す構成図。FIG. 11 is a configuration diagram showing still another embodiment.
【図12】図11の注釈管理情報記憶手段の構成図。FIG. 12 is a configuration diagram of an annotation management information storage unit in FIG. 11;
【図13】更に他の実施の形態を示す構成図。FIG. 13 is a configuration diagram showing still another embodiment.
【図14】図13の翻訳範囲記憶手段の構成図。FIG. 14 is a configuration diagram of a translation range storage unit in FIG. 13;
【図15】更に他の実施の形態の構成図。FIG. 15 is a configuration diagram of still another embodiment.
【図16】図15の翻訳対象外パターン記憶手段の構成図。FIG. 16 is a configuration diagram of a non-translation target pattern storage unit in FIG. 15;
【図17】図15の注釈抽出手段の処理内容を示すフローチ
ャート。FIG. 17 is a flowchart showing the processing content of the annotation extraction unit in FIG. 15;
【図18】更に他の実施の形態を示す構成図。FIG. 18 is a configuration diagram showing still another embodiment.
【図19】更に他の実施の形態を示す構成図。FIG. 19 is a configuration diagram showing still another embodiment.
【図20】図19の注釈修正手段の構成図。FIG. 20 is a configuration diagram of an annotation correction unit in FIG. 19;
【図21】従来技術を示す図。FIG. 21 is a diagram showing a conventional technique.
【図22】従来技術の翻訳結果の説明図。FIG. 22 is an explanatory diagram of a translation result according to the related art.
10 電子計算機 11 外部記憶装置 12 プログラム読込手段 13 翻訳前プログラム記憶手段 14 機械翻訳手段 15 翻訳後プログラム記憶手段 16 プログラム書込手段 17 プログラム言語指定手段 18 注釈抽出手段 19 注釈記憶手段 191 注釈組込手段 31 行数 32 ロジック部 51 一連No. 52 注釈行 53 注釈文 54 翻訳後注釈文 141 汎用機械翻訳手段 192 翻訳前注釈文記憶手段 193 翻訳後注釈文記憶手段 194 注釈管理情報記憶手段 195 注釈範囲指示手段 196 注釈範囲記憶手段 197 マンマシン装置 151 翻訳対象外パターン記憶手段 152 注釈抽出方式指定手段 181 翻訳不可能単語記憶手段 171 注釈修正手段 10 Computer 11 External storage device 12 Program reading means 13 Pre-translation program storage means 14 Machine translation means 15 Post-translation program storage means 16 Program writing means 17 Program language designation means 18 Annotation extraction means 19 Annotation storage means 191 Annotation embedding means 31 Number of rows 32 Logic part 51 52 Annotation line 53 Annotation sentence 54 Annotation sentence after translation 141 General-purpose machine translation means 192 Annotation sentence storage means before translation 193 Annotation sentence storage means after translation 194 Annotation management information storage means 195 Annotation range indicating means 196 Annotation range storage means 197 Man-machine device 151 Non-translatable pattern storage means 152 Annotation extraction method designation means 181 Non-translatable word storage means 171 Annotation correction means
Claims (8)
ログラムを外部記憶装置から読込むプログラム読込手段
と、読込まれたプログラムを保持する主記憶装置上の翻
訳前プログラム記憶手段と、プログラムを構成するロジ
ック部分と注釈部分の内、注釈部分を前記プログラムか
ら抽出する注釈抽出手段と、前記注釈抽出手段にプログ
ラム言語の種別を与えるプログラム言語指定手段と、抽
出された注釈を保持する注釈記憶手段と、抽出された注
釈をその記述される言語から他の言語へと翻訳する機械
翻訳手段と、他の言語に翻訳された注釈を前記プログラ
ムに組込む注釈組込手段と、翻訳後の注釈が組込まれた
プログラムを保持する翻訳後プログラム記憶手段と、前
記翻訳後のプログラムを外部記憶装置に書込むプログラ
ム書込手段とを備えたことを特徴とするプログラム注釈
機械翻訳装置。1. A program reading means for reading a software program operating on a computer from an external storage device, a pre-translation program storage means on a main storage device for holding the read program, and a logic part constituting the program An annotation extracting unit for extracting an annotation portion from the program, a program language specifying unit for giving the type of a programming language to the annotation extracting unit, an annotation storage unit for holding the extracted annotation, Machine translation means for translating the comment from the written language to another language, comment incorporating means for incorporating the comment translated into another language into the program, and a program incorporating the translated comment. And a program writing means for writing the translated program into an external storage device. A machine translation device for program annotation.
に保存された翻訳後の注釈の文字数を判定して、前記翻
訳前プログラム記憶手段の翻訳前プログラムの注釈部分
との文字数を比較し、翻訳後の注釈の文字数が多いと
き、前記翻訳後プログラム記憶手段に対して別の行を注
釈行として作成することを特徴とする請求項1記載のプ
ログラム注釈機械翻訳装置。2. The comment embedding means judges the number of characters of the translated comment stored in the comment storage means, and compares the number of characters with the comment part of the pre-translation program in the pre-translation program storage means. 2. The program annotation machine translation apparatus according to claim 1, wherein when the number of characters of the translated annotation is large, another line is created as an annotation line in the translated program storage means.
手段と翻訳前注釈文記憶手段と翻訳後注釈文記憶手段と
を備えると共に、前記注釈管理情報記憶手段には注釈文
のある位置を記憶し、翻訳前注釈文記憶手段と翻訳後注
釈文記憶手段では電子計算機の扱えるテキストファイル
の形式で記憶することにより、前記機械翻訳手段として
汎用の機械翻訳手段を使用することを特徴とする請求項
1記載のプログラム注釈機械翻訳装置。3. The annotation storage means includes an annotation management information storage means, a pre-translation annotation sentence storage means, and a post-translation annotation sentence storage means, and the annotation management information storage means stores a position of the annotation sentence. The pre-translation comment storage means and the post-translation comment storage means use a general-purpose machine translation means as the machine translation means by storing them in a text file format that can be handled by a computer. 1. The program annotation machine translation device according to 1.
言語に翻訳する時に、翻訳範囲を操作員が指定できる翻
訳範囲指示手段を備えたことを特徴とする請求項1記載
のプログラム注釈機械翻訳装置。4. The program annotation according to claim 1, wherein said machine translation means includes a translation range designating means capable of designating a translation range by an operator when translating the language of the annotation into another language. Machine translation device.
抽出する際に、翻訳する必要のない注釈の定型化された
パターンを認識し、当該パターンを含む注釈文を翻訳対
象外として抽出しないことを特徴とする請求項1ないし
請求項4記載のプログラム注釈機械翻訳装置。5. When extracting an annotation to be translated, the annotation extracting unit recognizes a stylized pattern of an annotation that does not need to be translated, and does not extract an annotation sentence including the pattern as a non-translation target. 5. The program annotation machine translation apparatus according to claim 1, wherein:
に、翻訳不可能な単語を羅列して記憶することにより、
機械翻訳手段の保守のための資料を作成することを特徴
とする請求項1ないし請求項5記載のプログラム注釈機
械翻訳装置。6. The machine translation means stores a list of untranslatable words when translating an annotation,
6. The program annotation machine translation apparatus according to claim 1, wherein a material for maintenance of the machine translation means is created.
言語に翻訳する際に、翻訳不可能な注釈がある場合、人
間系からの入力により注釈を修正する会話型の注釈修正
手段を備えたことを特徴とする請求項1ないし請求項6
記載のプログラム注釈機械翻訳装置。7. The machine translation means, wherein when translating the language of the annotation into another language, if there is an untranslatable annotation, the conversational annotation modification means for modifying the annotation by input from a human system. 7. The image forming apparatus according to claim 1, wherein:
The described program annotation machine translation device.
ログラム読込手段を実行する機能と、読込まれたプログ
ラムを保持する翻訳前プログラム記憶手段を実行する機
能と、プログラムを構成するロジック部分と注釈部分の
内、注釈部分をプログラムから抽出する注釈抽出手段を
実行する機能と、注釈抽出手段にプログラム言語の種別
を与えるプログラム言語指定手段を実行する機能と、抽
出された注釈を保持する注釈記憶手段を実行する機能
と、抽出された注釈をその記述される言語から他の言語
へと翻訳する機械翻訳手段を実行する機能と、他の言語
に翻訳された注釈をプログラムに組込む注釈組込手段を
実行する機能と、翻訳後の注釈が組込まれたプログラム
を保持する翻訳後プログラム記憶手段を実行する機能
と、翻訳後のプログラムを外部記憶装置に書込むプログ
ラム書込手段を実行する機能とを実現するためのプログ
ラムを記録したコンピュータ読込可能な記録媒体。8. A function for executing a program reading means for reading a program from an external storage device, a function for executing a pre-translation program storage means for holding the read program, and a logic part and a comment part constituting the program. Executing an annotation extracting means for extracting an annotation part from a program, executing a program language designating means for giving a type of a programming language to the annotation extracting means, and executing an annotation storing means for holding the extracted annotation Executing the machine translation means for translating the extracted annotations from the written language to another language, and executing the annotation incorporation means for incorporating the annotations translated into other languages into the program A function for executing a post-translation program storing means for holding a program in which a post-translation annotation is incorporated, and a post-translation program And a computer readable storage medium storing a program for realizing a function of executing a program writing unit for writing the program into an external storage device.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10207241A JP2000020525A (en) | 1998-07-07 | 1998-07-07 | Program annotation machine translation device and recording medium recording program for operating this device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP10207241A JP2000020525A (en) | 1998-07-07 | 1998-07-07 | Program annotation machine translation device and recording medium recording program for operating this device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2000020525A true JP2000020525A (en) | 2000-01-21 |
Family
ID=16536562
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP10207241A Pending JP2000020525A (en) | 1998-07-07 | 1998-07-07 | Program annotation machine translation device and recording medium recording program for operating this device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2000020525A (en) |
Cited By (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006111735A (en) * | 2004-10-15 | 2006-04-27 | Kanebo Ltd | POLYLACTIC ACID RESIN COMPOSITION, FOAM PARTICLE, AND FOAM MOLDED BODY |
| WO2007013418A1 (en) * | 2005-07-28 | 2007-02-01 | National Institute Of Advanced Industrial Science And Technology | System for writing software documentation in natural languages |
| JP2007310653A (en) * | 2006-05-18 | 2007-11-29 | Fuji Electric Fa Components & Systems Co Ltd | Language converter for source program |
| JP2008041004A (en) * | 2006-08-10 | 2008-02-21 | Fuji Xerox Co Ltd | Document review system, document management apparatus, terminal device and program |
| JP2008117376A (en) * | 2006-09-29 | 2008-05-22 | Rockwell Automation Technologies Inc | Custom language support for project documentation and editing |
| JP2008522249A (en) * | 2005-12-29 | 2008-06-26 | 松下電工株式会社 | System and method for providing a user configurable software library |
| WO2008093734A1 (en) * | 2007-01-31 | 2008-08-07 | National Institute Of Advanced Industrial Science And Technology | Source file management system |
| JP2008186311A (en) * | 2007-01-31 | 2008-08-14 | National Institute Of Advanced Industrial & Technology | File conversion system for source files with comments in multiple natural languages |
| JP2008204446A (en) * | 2007-01-26 | 2008-09-04 | National Institute Of Advanced Industrial & Technology | Source file editing system |
| JP2010211719A (en) * | 2009-03-12 | 2010-09-24 | Toshiba Corp | Translation apparatus, method and program |
| JP2012164231A (en) * | 2011-02-08 | 2012-08-30 | Nippon Telegr & Teleph Corp <Ntt> | Language conversion device, language conversion method, and language convers |
| JP5998239B1 (en) * | 2015-03-31 | 2016-09-28 | エヌ・ティ・ティ・コムウェア株式会社 | Software test apparatus, software test method, and software test program |
| JP2023056240A (en) * | 2021-10-07 | 2023-04-19 | 株式会社日立製作所 | Computer system and document presentation method |
| JP7776048B1 (en) * | 2025-03-14 | 2025-11-26 | 三菱電機株式会社 | Translation device, translation system, and translation method |
-
1998
- 1998-07-07 JP JP10207241A patent/JP2000020525A/en active Pending
Cited By (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006111735A (en) * | 2004-10-15 | 2006-04-27 | Kanebo Ltd | POLYLACTIC ACID RESIN COMPOSITION, FOAM PARTICLE, AND FOAM MOLDED BODY |
| WO2007013418A1 (en) * | 2005-07-28 | 2007-02-01 | National Institute Of Advanced Industrial Science And Technology | System for writing software documentation in natural languages |
| JP2007034813A (en) * | 2005-07-28 | 2007-02-08 | National Institute Of Advanced Industrial & Technology | Software description generation system for multiple natural languages |
| JP2008522249A (en) * | 2005-12-29 | 2008-06-26 | 松下電工株式会社 | System and method for providing a user configurable software library |
| JP2007310653A (en) * | 2006-05-18 | 2007-11-29 | Fuji Electric Fa Components & Systems Co Ltd | Language converter for source program |
| JP2008041004A (en) * | 2006-08-10 | 2008-02-21 | Fuji Xerox Co Ltd | Document review system, document management apparatus, terminal device and program |
| JP2008117376A (en) * | 2006-09-29 | 2008-05-22 | Rockwell Automation Technologies Inc | Custom language support for project documentation and editing |
| JP2008204446A (en) * | 2007-01-26 | 2008-09-04 | National Institute Of Advanced Industrial & Technology | Source file editing system |
| JP2008186311A (en) * | 2007-01-31 | 2008-08-14 | National Institute Of Advanced Industrial & Technology | File conversion system for source files with comments in multiple natural languages |
| WO2008093734A1 (en) * | 2007-01-31 | 2008-08-07 | National Institute Of Advanced Industrial Science And Technology | Source file management system |
| JPWO2008093734A1 (en) * | 2007-01-31 | 2010-05-20 | 独立行政法人産業技術総合研究所 | Source file management system |
| JP2010211719A (en) * | 2009-03-12 | 2010-09-24 | Toshiba Corp | Translation apparatus, method and program |
| JP2012164231A (en) * | 2011-02-08 | 2012-08-30 | Nippon Telegr & Teleph Corp <Ntt> | Language conversion device, language conversion method, and language convers |
| JP5998239B1 (en) * | 2015-03-31 | 2016-09-28 | エヌ・ティ・ティ・コムウェア株式会社 | Software test apparatus, software test method, and software test program |
| JP2023056240A (en) * | 2021-10-07 | 2023-04-19 | 株式会社日立製作所 | Computer system and document presentation method |
| JP7776048B1 (en) * | 2025-03-14 | 2025-11-26 | 三菱電機株式会社 | Translation device, translation system, and translation method |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP2000020525A (en) | Program annotation machine translation device and recording medium recording program for operating this device | |
| CN102592299B (en) | File generating device and file generating method | |
| JP5372110B2 (en) | Information output device, information output method, and computer program | |
| CN100416591C (en) | Character recognition electronic device and character recognition method | |
| JP2004220616A (en) | Machine translation system for simultaneously displaying and editing three or more parallel translation screens | |
| US20240394466A1 (en) | Document masking device, document masking method, and program storage medium | |
| JP2022074852A (en) | Dictionary editing device, dictionary editing method, and dictionary editing program | |
| JP2006252048A (en) | Translation apparatus, translation program, and translation method | |
| CN118036571A (en) | Composition correction interaction method and device based on artificial intelligence and electronic equipment | |
| JP7770086B2 (en) | Program design support system | |
| JP4350566B2 (en) | Machine translation system | |
| KR101038298B1 (en) | Multilingual Book Information Automatic Generation Device and Method | |
| JP2723886B2 (en) | Machine translation apparatus and translation rule creation method | |
| WO2025084424A1 (en) | Program, storage medium, and information processing device | |
| JPS63213067A (en) | translation device | |
| JPH1031585A (en) | Automatic programming generating system by inputting specification | |
| JP2002197082A (en) | Machine translation method and apparatus | |
| JPH1063667A (en) | Document processing system | |
| JP2007164289A (en) | Translation result list output system | |
| JP2000067050A (en) | Machine translation device, machine translation method, and recording medium | |
| JPH08179938A (en) | Device and method for generating automatic specification | |
| JPH04114275A (en) | English-Japanese machine translation device | |
| JPH10177577A (en) | Language conversion system and language conversion method | |
| JPS63115263A (en) | Japanese grammar proofing device | |
| JPH07141365A (en) | Machine translation device |