JPH03266066A - Character-string substitution system with attribute - Google Patents

Character-string substitution system with attribute

Info

Publication number
JPH03266066A
JPH03266066A JP2064177A JP6417790A JPH03266066A JP H03266066 A JPH03266066 A JP H03266066A JP 2064177 A JP2064177 A JP 2064177A JP 6417790 A JP6417790 A JP 6417790A JP H03266066 A JPH03266066 A JP H03266066A
Authority
JP
Japan
Prior art keywords
character
string
replacement
search
attribute
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.)
Granted
Application number
JP2064177A
Other languages
Japanese (ja)
Other versions
JP3064323B2 (en
Inventor
Kunihiro Yanagi
柳 邦宏
Takaaki Nomura
野村 高明
Nobutake Sato
信丈 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2064177A priority Critical patent/JP3064323B2/en
Publication of JPH03266066A publication Critical patent/JPH03266066A/en
Application granted granted Critical
Publication of JP3064323B2 publication Critical patent/JP3064323B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Machine Translation (AREA)
  • Document Processing Apparatus (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PURPOSE:To improve the operability and the work efficiency by realizing a character attribute setting function as a part of a search substitution processing. CONSTITUTION:The system is provided with a simple character-string substitution function of a search character-string and a substitute charcter-string, a function for executing character attribute setting to the search character-string, and a function for substituting the substitute character-string for zero of a search character, and also, setting a character attribute. Also, the system is allowed to have both of a character-string input function and a character attribute designating function as a substitute character-string designating means, and at the time of executing the substitution processing, the substitute character- string is substituted for the character-string detected by the search, and thereafter, a designated character stribute is set. In such a way, the character-string substitution can be executed together with the character attribute, and the work efficiency is improved.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は文書編集に係わり、特に正規表現指定の文字列
サーチ機能を有し、文字列置換を文字属性付きで行うこ
とのできる文書編集装置に関する。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to document editing, and in particular to a document editing device that has a regular expression specified character string search function and can perform character string replacement with character attributes. Regarding.

〔従来の技術〕[Conventional technology]

従来のワードプロセッサ等の文書処理装置における文字
列のサーチ置換機能は、単なるサーチ文字列を置換文字
列に置き換える文字列同士の置換機能であった。又、特
開昭63−167960に示すようにサーチ文字列の先
頭の文字属性を置換文字列に対しても有効とする機能を
持つシステムもある。
The search and replacement function for character strings in conventional document processing devices such as word processors is simply a function for replacing character strings with each other by replacing a search string with a replacement string. Furthermore, as shown in Japanese Patent Application Laid-Open No. 63-167960, there is also a system having a function of validating the character attribute at the beginning of a search string also for a replacement string.

また、「実用化UNIXシステム」 (工学社刊Mar
k、G、5obe11著 安居院猛監訳456〜465
)に示すように、正規表現によって文字列サーチを実現
しているものもある。
Also, ``Practical UNIX System'' (published by Kogakusha, Mar.
Written by K, G, 5obe11, Translated by Takeshi Angoin, 456-465
), some methods implement string searches using regular expressions.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

上記従来技術では、特定の文字列を別の文字列に置換す
ることは可能であるが、例えば1本文中で図を参照して
いる箇所をサーチし、参照箇所の文字属性を変える作業
を考えると、特定の文字列同士のサーチ機能では、「図
」をサーチ文字列とした場合、図参照箇所だけではなく
「図形」などの、無関係の文字列もサーチによって選択
されてしまい、効率が悪いという問題点があった。また
、正規表現によってサーチ文字列を指定した場合、図参
照位置のみをサーチによって選択することは可能である
が、参照箇所の文字属性を変更するためには、サーチモ
ードを抜けて、文字属性設定機能を用いて、一つ一つ文
字属性を設定し、またサーチモードにはいって、サーチ
を継続しなければならなかった。以上、従来システムで
は、文字列同士のサーチ置換機能にとどまっており、文
字属性を同時に変えることが考慮されていないという問
題があった。
In the above conventional technology, it is possible to replace a specific character string with another character string, but for example, consider searching for a part in a text that references a figure and changing the character attributes of the reference part. With the search function for specific strings, if you use "figure" as the search string, the search will select not only figure references but also unrelated strings such as "shape", which is inefficient. There was a problem. In addition, when specifying a search string using a regular expression, it is possible to select only the figure reference position by searching, but in order to change the character attributes of the reference location, exit search mode and set the character attributes. You had to use the functions to set character attributes one by one, and then enter search mode to continue searching. As described above, the conventional system has a problem in that it is limited to a search and replace function between character strings, and does not consider changing character attributes at the same time.

また、正規表現を用いたサーチ機能では、正規表現とし
て、文字属性を指定することができないため1例えば、
大文字と小文字で記述されているrcOMPυTERJ
とrcOlffiPuterJ をサーチする場合には
、別々に正規表現を用いて記述する必要がある。
In addition, in the search function using regular expressions, character attributes cannot be specified as regular expressions.
rcOMPυTERJ written in uppercase and lowercase letters
When searching for and rcOlffiPuterJ, it is necessary to write them separately using regular expressions.

本発明の目的は、文字列のサーチ置換処理の時に、サー
チ文字列として、正規表現を許し、且つ、正規表現単位
に文字属性指定を可能とした文字列サーチ機能と、置換
データとして文字列だけでなく、文字属性も同時に設定
できるようにした、文書処理装置を提供することにある
The purpose of the present invention is to provide a string search function that allows regular expressions as search strings and to specify character attributes for each regular expression when performing string search and replacement processing, and to provide a string search function that allows only strings to be used as replacement data. It is an object of the present invention to provide a document processing device in which character attributes can also be set at the same time.

〔課題を解決するための手段〕[Means to solve the problem]

上記目的を達成するために本発明においては、正規表現
に従ったサーチ文字列指定手段と、正規表現単位にサー
チ文字列の文字属性を指定する手段と5文字属性付き正
規表現文字サーチ機能と。
In order to achieve the above object, the present invention provides a means for specifying a search string according to a regular expression, a means for specifying character attributes of a search string in units of regular expressions, and a regular expression character search function with 5-character attributes.

置換文字列指定手段として、従来の文字列入力機能と文
字属性指定機能を合わせ持たせ、置換処理にあたっては
、サーチによって発見された文字列を置換文字列に置き
換えたのち、指定された文字属性を設定することによっ
て実現される。
The replacement string specification means combines the conventional character string input function and character attribute specification function, and in the replacement process, after replacing the character string found by the search with the replacement string, the specified character attribute is This is achieved by setting.

〔作用〕[Effect]

上記方法は、サーチ文字列と置換文字列の単純文字列置
換機能と、サーチ文字列に文字属性設定を行う機能と、
サーチ文字列を置換文字列に置き換え、さらに文字属性
を設定する機能で構成され。
The above method has a simple string replacement function between the search string and replacement string, a function to set character attributes to the search string,
It consists of functions to replace search strings with replacement strings and to set character attributes.

サーチ置換機能を連続して行うものである。It performs search and replace functions continuously.

〔実施例〕〔Example〕

以下、本発明の実施例を図面に基づいて説明する。 Embodiments of the present invention will be described below based on the drawings.

第1図は1本発明が提供する属性付き文字列置換方式の
処理フロー、第2図は、本発明を適用する文書処理装置
の全体構成を示すブロック図である。キーボード100
から入力されたテキストデータやコマンドは、インタフ
ェース回路110を介してレジスタ120に入力され、
 CPt1130に読み取られる。CPt1130は、
入力コマンドに応じて、メモリ140に格納されている
制御プログラムを実行する。メモリ141は、文書デー
タを格納するメモリである。メモリ141の内容は、「
文舌、呼出し」コマンドによって、文書ファイル150
がらメモリ141に展開され、「文書格納」コマンドに
よってメモリ141から文書ファイル150に格納され
る。文書編集機能によって、メモリ141の文書データ
が更新されると、CPU130は、編集形式の文書デー
タを表示データに変換し、ビット・マツプ・プロセッサ
(BMP)160に順次転送される。BMP160は、
表示データをフレームメモリ170上に展開し、CRT
コントローラ180が上記フレームメモリ170の内容
を順次読み出して、 CRT190上へ展開する。
FIG. 1 is a processing flow of the attribute string replacement method provided by the present invention, and FIG. 2 is a block diagram showing the overall configuration of a document processing apparatus to which the present invention is applied. keyboard 100
Text data and commands input from are input to the register 120 via the interface circuit 110,
Read by CPt1130. CPt1130 is
A control program stored in memory 140 is executed in response to an input command. Memory 141 is a memory that stores document data. The contents of the memory 141 are “
The document file 150 can be accessed by
The document is expanded into the memory 141 and stored from the memory 141 into the document file 150 by the "Document storage" command. When the document data in the memory 141 is updated by the document editing function, the CPU 130 converts the edited document data into display data, which is sequentially transferred to the bit map processor (BMP) 160. BMP160 is
The display data is developed on the frame memory 170 and transferred to the CRT.
The controller 180 sequentially reads out the contents of the frame memory 170 and develops them onto the CRT 190.

次に、第1図を用いて属性付き文字列置換方式の処理フ
ローを説明する。まず、ユーザが文字列サーチ機能を選
択すると、第3図および第6図に示す、サーチ定義シー
ト200が表示され、ユーザはサーチ対象文字列を、サ
ーチ定義シート200内のサーチ文字刺入カニリア21
0に入力する。
Next, the processing flow of the attribute string replacement method will be explained using FIG. First, when the user selects the character string search function, the search definition sheet 200 shown in FIG. 3 and FIG.
Enter 0.

(ステップ10)ここで、入力文字列は、一般の文字列
を記述しても、正規表現を用いて記述しても、複数の正
規表現の結合で記述しても良い。本実施例で用いる正規
表現は、UNIX(工学社刊「実用UNIXシステム」
465ページ)に基づき規定したものであり、以下の特
殊文字を持つ。
(Step 10) Here, the input character string may be written as a general character string, written using a regular expression, or written as a combination of a plurality of regular expressions. The regular expression used in this example is based on UNIX (Kogakusha's "Practical UNIX System")
465) and has the following special characters.

「°」:“で始まるとき、パラグラフ(改行または改頁
の間の文字列)の先頭にある文字列を意味する。′のみ
の時はパラグラフの先頭文字を意味する。
"°": When it starts with ", it means the character string at the beginning of a paragraph (the character string between line breaks or page breaks). When it starts with ', it means the first character of the paragraph.

r$」 :$で終るとき、パラグラフの末尾にある文字
列を意味する。$のみの時、パラグラフの末尾文字を意
味する。
r$": When ending with $, it means the character string at the end of the paragraph. When only $ is used, it means the last character of the paragraph.

r [、、、] J  : 、、、の中のどれか1つの
文字を意味する。Cニー02のような範囲指定と、01
C2C3のような選択形式が混在してもよい。
r [,,,] J: means any one character from , , . Range specification like C knee 02 and 01
Selection formats such as C2C3 may be mixed.

r[’、、、コJ:、、、の中のどれとも一致しない1
つの文字を意味する。C,−C,のような範囲指定と、
C工C2C,のような選択形式が混在してもよい。
r[', , koJ: 1 that does not match any of , ,
means one character. Range specification such as C, -C,
Selection formats such as C-C2C may be mixed.

rC傘」:文字Cのゼロ回以上の繰返しを意味する。``rC umbrella'': means zero or more repetitions of the letter C.

「、傘」:任意文字列を意味する。"Umbrella": means any character string.

「¥」:特殊文字に用いられる文字を通常の意味の文字
として扱う。
"\": Characters used as special characters are treated as characters with normal meaning.

[¥(」「¥)」:正規表現を結合するときの正規表現
の先頭と末尾を意味する。
[\(''``\)'': Means the beginning and end of regular expressions when combining regular expressions.

本実施例では、第3図、第4図、第5図を用いて、本文
中から正規表現で記述されたサーチ文字列を検索し、発
見した文字列の文字属性を変更する場合(第1の実施例
)を説明する。また、第6図、第7図、第8図、第9図
を用いて、結合された正規表現で記述されたサーチ文字
列に属性を付加した文字列を検索し、発見した文字列に
対して、正規表現単位で文字列置換と属性変更を行う場
合(第2の実施例)を説明する。
In this embodiment, using Figs. 3, 4, and 5, we will search for a search string written in a regular expression in the text and change the character attributes of the found string (first Example) will be explained. Also, using Figures 6, 7, 8, and 9, search for strings with attributes added to the search string written using the combined regular expression, and Next, a case (second embodiment) in which character string replacement and attribute change are performed in units of regular expressions will be explained.

まず、第3図、第4図、第5図を用いて、本文中から正
規表現で記述されたサーチ文字列を検索し、発見した文
字列の文字属性を変更する場合を説明する。
First, with reference to FIGS. 3, 4, and 5, a case will be described in which a search character string written in a regular expression is searched from a text and the character attributes of the found character string are changed.

第3図のサーチ定義シート200のサーチ文字列定義エ
リア210に正規表現を用いて1図[1−91[0−9
] *、[i−9]  [0−91*」と入力する。こ
れは、1図」で始まり、「、」をはさんで0以外の数字
を先頭にもつ1文字以上の数字列で構成される文字列を
表現する正規表現であり、「図X、XJという形式を持
つ図番参照位置を検索対象とする。
Using regular expressions in the search string definition area 210 of the search definition sheet 200 in FIG.
] *, [i-9] [0-91*]. This is a regular expression that expresses a string consisting of one or more numeric characters starting with ``Figure 1'', followed by ``,'' and a non-zero number at the beginning, and ``Figure X, XJ''. The figure number reference position with the format is searched.

次に、サーチ文字列に対して属性指定を行うか否かをサ
ーチ定義シート2oo内のサーチ文字列属性指定選択フ
ィールド220を用いて、指定を行う場合「有」を、指
定を行わない場合は「無」を選択する。(ステップ20
)本第1の実施例では「無」を選択した。「有」を選択
した場合は、サーチ文字列属性入力(ステップ21)に
すすむが、ステップ21に関しては、第2の実施例で詳
述する9 次に、サーチ文字列に対して置換処理を行うが否かをサ
ーチ定義シート200内の文字置換選択フィールド23
0を用いて、置換を行う場合は「有」を、サーチのみの
場合は「無」を選択する(ステップ30)。
Next, use the search string attribute specification selection field 220 in the search definition sheet 2oo to determine whether or not to specify attributes for the search string. Select "None". (Step 20
) In the first embodiment, "None" was selected. If "Yes" is selected, the process proceeds to the search string attribute input (step 21), but step 21 will be described in detail in the second embodiment.9 Next, replacement processing is performed on the search string. Character replacement selection field 23 in the search definition sheet 200
0 is used to perform replacement, select "Yes", and select "No" when performing only a search (step 30).

置換を行う場合は、サーチ定義シート200内の置換文
字刺入カニリア240に、置換文字列を入力する(ステ
ップ31)。
When performing a replacement, a replacement character string is input into the replacement character insertion field 240 in the search definition sheet 200 (step 31).

置換を行わない場合は、ステップ50(文字列サーチ処
理)へすすむ。
If no replacement is to be performed, the process proceeds to step 50 (character string search process).

ここで、置換文字刺入カニリア240に特殊文字として
「&」を入力した場合、サーチ文字列をそのまま用いる
ことを意味する。すなわち、属性変更のみを行うときに
用いる。
Here, when "&" is input as a special character to the replacement character insertion canilia 240, it means that the search character string is used as is. In other words, it is used when only changing attributes.

次に、文字属性置換を行うか否かをサーチ定義シート2
00内の置換文字列属性指定選択フィールド250を用
いて、文字置換を行う場合は「有」を、行わない場合は
「無」を選択する(ステップ40)。
Next, search definition sheet 2 determines whether or not to perform character attribute replacement.
Using the replacement character string attribute designation selection field 250 in 00, select "Yes" if character replacement is to be performed, or "No" if character replacement is not to be performed (step 40).

ここで、置換文字列として「&」を入力し、文字属性置
換「無」を選択した(サーチ文字列と置換文字列が同一
で、かつ属性変更なし)場合、処理として意味を成さな
いためエラーとする。又、置換文字列として、任意の文
字列(&以外)を入力し、文字属性置換「有」を選択し
た場合、文字置換を行った後、対象文字列の属性変更を
行う。
Here, if you enter "&" as the replacement string and select "None" for character attribute replacement (the search string and replacement string are the same and there is no attribute change), it will not make sense as a process. It is treated as an error. Further, when an arbitrary character string (other than &) is input as the replacement character string and character attribute replacement "Yes" is selected, the attribute of the target character string is changed after character replacement.

ステップ40で、文字属性置換「有」を選択した場合、
第4図の如き置換文字列属性定義シート300を表示し
、設定する文字属性を選択する(ステップ41)。
If character attribute replacement "Yes" is selected in step 40,
A replacement character string attribute definition sheet 300 as shown in FIG. 4 is displayed, and a character attribute to be set is selected (step 41).

文字属性置換「無」の場合は、ステップ50(文字列サ
ーチ処理)へすすむ。
If the character attribute replacement is "none", the process advances to step 50 (character string search process).

置換文字列属性定義シート300は、本実施例では、[
書体J310.r倍角J320.rアンダーラインJ3
30.r文字種別J340.rアルファベット」350
から構成されているが、システムの持つ文字属性に従っ
て、拡張することは可能である。
In this embodiment, the replacement character string attribute definition sheet 300 is [
Typeface J310. r double angle J320. r underline J3
30. r character type J340. r alphabet” 350
However, it is possible to expand it according to the character attributes of the system.

ここでは、書体310として「ゴシック体」。Here, the font 310 is "Gothic".

倍角320として「横倍」、アンダーライン330でア
ンダーライン「有」4文字種別340として「変更熱」
、アルファベット350として「変更熱」が選択された
ものとする。
Double angle 320 is "width double", underline 330 is "with underline", 4 character type 340 is "change heat"
, it is assumed that "change heat" is selected as the alphabet 350.

各属性の選択が終了した後、置換文字列属性定義シート
300内の実行フィールド360を選択すると、文字属
性として選択された値を有効値として、サーチ定義シー
ト200へ戻る。又、取消フィールド370を選択する
と、文字属性として選択された値は無効となって、サー
チ定義シート200へ戻る。
After selecting each attribute, if the execution field 360 in the replacement character string attribute definition sheet 300 is selected, the process returns to the search definition sheet 200 with the value selected as the character attribute as the valid value. If the cancel field 370 is selected, the value selected as the character attribute becomes invalid and the process returns to the search definition sheet 200.

サーチ定義シート200に戻った後、サーチ定義シート
200内の実行フィールド260を選択すると、サーチ
定義シート200及び置換文字列属性定義シート300
で選択された値を有効として、文字列サーチ処理50へ
すすむ。また、取消フィールド270を選択した場合は
、サーチ処理を終了する。
After returning to the search definition sheet 200 and selecting the execution field 260 in the search definition sheet 200, the search definition sheet 200 and replacement string attribute definition sheet 300 are displayed.
The value selected in is set as valid, and the process proceeds to character string search processing 50. Furthermore, if the cancel field 270 is selected, the search process is ended.

文字列サーチ処理50によって、対応する文字列が発見
されると、サーチ定義シー1−200および置換文字列
属性定義シート300で設定された情報に基づき、文字
列の置換処理を行う。まず、サーチ定義シート200の
文字置換選択フィールド230で、選択された情報に従
って、文字置換の有無を判断する(ステップ60)。置
換有りの場合、サーチ文字列と置換文字列が同じかどう
かを判断する(ステップ70)。同じとは、サーチ定義
シート200内の置換文字刻入カニリア240への入力
データが「&」であることである。サーチと置換文字列
が異なる場合、文字列置換処理(ステップ71)を行う
When a corresponding character string is found by the character string search process 50, a character string replacement process is performed based on the information set in the search definition sheet 1-200 and the replacement character string attribute definition sheet 300. First, the presence or absence of character replacement is determined according to the information selected in the character replacement selection field 230 of the search definition sheet 200 (step 60). If there is a replacement, it is determined whether the search string and the replacement string are the same (step 70). The same means that the input data to the replacement character engraving canilia 240 in the search definition sheet 200 is "&". If the search and replacement character strings are different, character string replacement processing (step 71) is performed.

文字列置換処理は、従来の文書処理でおこなわれていた
ものと同様に、サーチによって発見された文字列を置換
文字列によって置き換えるものであり、サーチ文字列と
置換文字列の文字数は同じである必要はない。また、サ
ーチと置換文字列が同じ場合は1文字列置換処理71を
スキップする。
String replacement processing, similar to what is done in conventional document processing, replaces a string found by a search with a replacement string, and the number of characters in the search string and replacement string are the same. There's no need. Furthermore, if the search and replacement character strings are the same, the one character string replacement process 71 is skipped.

次に、サーチ定義シー1−200の文字属性置換選択フ
ィールド250で、選択された情報に従って、属性変更
が必要か否かを判断する(ステップ80)。属性変更が
必要な場合、文字属性設定処理(ステップ81)を行う
。文字属性設定処理は、従来の文書処理システムにおけ
る文字属性設定機能と同じであり、属性設定シート30
0で選択された文字属性を対象文字列に設定するもので
ある。
Next, in accordance with the information selected in the character attribute replacement selection field 250 of the search definition sheet 1-200, it is determined whether an attribute change is necessary (step 80). If an attribute change is required, character attribute setting processing (step 81) is performed. The character attribute setting process is the same as the character attribute setting function in conventional document processing systems, and is performed using the attribute setting sheet 30.
The character attribute selected in 0 is set to the target character string.

また、属性変更が不要の場合は、文字属性設定処理81
をスキップする。
In addition, if attribute change is not necessary, character attribute setting processing 81
Skip.

次に、ステップ60で盾換無しの場合、又は、文字列置
換処理71および文字属性設定処理81を終了すると、
サーチを継続するか否かを選択する(ステップ90)。
Next, if there is no shield replacement in step 60, or if the character string replacement process 71 and character attribute setting process 81 are completed,
It is selected whether or not to continue the search (step 90).

継続する場合は、文字列サーチ処理50へ戻って処理を
継続し、継続しない場合は、処理を終了する。
If the process is to be continued, the process returns to the character string search process 50, and if the process is not to be continued, the process is ended.

第5図は、以上説明した処理フローに従って実際にサー
チと属性付き文字列置換をおこなった例である。同図(
a)の元文書400内には、1図2、IJ 410と1
図2.2J 420という2つのサーチ対象文字列が存
在している。これに対して、サーチ定義シート200.
置換文字列属性定義シート300を用いてゴシック体、
横倍、アンダーライン属性を付けたものが、同図(b)
である。処理終了後の文書430は、1図2.1」44
0と「図2.2J 450がゴシック体1倍角。
FIG. 5 shows an example in which a search and attribute-attached character string replacement were actually performed according to the processing flow described above. Same figure (
In the original document 400 of a), 1 Figure 2, IJ 410 and 1
There are two search target character strings 420 in Figure 2.2J. In contrast, search definition sheet 200.
Gothic font using the replacement character string attribute definition sheet 300,
The image with horizontal double and underline attributes is shown in figure (b).
It is. The document 430 after processing is
0 and ``Figure 2.2J 450 is Gothic 1x angle.

アンダーライン付きに変更され、それに伴った配置変更
が行われた。
It was changed to underlined text, and the layout was changed accordingly.

以上の実施例では、置換は一括して自動的に行われてし
まうが、置換の可否をユーザが選択(逐次置換)するこ
とを可能とするためには、第1図のステップ60とステ
ップ7oの間にユーザの選択処理を行うことによって容
易に実現できる。
In the above embodiment, the replacement is automatically performed all at once, but in order to enable the user to select whether or not to perform the replacement (successive replacement), steps 60 and 7o in FIG. This can be easily realized by performing user selection processing during the process.

次に、第6図、第7図、第8図、第9図を用いて、結合
された正規表現で記述されたサーチ文字列に属性を付加
した文字列を検索し、発見した文字列に対して、正規表
現単位で文字列置換と属性変更を行う場合(第2の実施
例)を説明する。
Next, using Figure 6, Figure 7, Figure 8, and Figure 9, search for a character string with attributes added to the search string written by the combined regular expression, and add the found character string. On the other hand, a case (second embodiment) in which character string replacement and attribute change are performed in units of regular expressions will be described.

第6図のサーチ定義シート200のサーチ文字列定義エ
リア210に連結した正規表現を用いて「¥(comp
uter¥)¥([0−9]*¥)」と入力する。
Using the regular expression connected to the search string definition area 210 of the search definition sheet 200 in FIG.
Enter "uter\)\([0-9]*\)".

これは、「¥(」と「¥)」で区切られた2つの正規表
現から構成されており、[¥(computer¥)」
500は、computerそのものを表現し、「¥(
[0−9]傘¥)J510は、0個を含む数字列を表現
している・ rcomputer数字列」という形状を
持つ文字列を検索対象とする。
This consists of two regular expressions separated by "\(" and "\)", and "[\(computer\)"]
500 represents the computer itself, and is ``¥(
[0-9] Umbrella\) J510 searches for character strings with the form ``rcomputer numeric string'' that expresses a numeric string containing 0.

次に、サーチ定義シート200内のサーチ文字列属性指
定選択フィールド220で「有」を選択し、サーチ文字
列属性入力(ステップ21)にすすむ。ここで、サーチ
文字列入力フィールド210内のサーチ文字列を正規表
現単位に指定して、指定された正規表現単位でサーチ文
字列属性入力を行うことができる。サーチ文字列入力フ
ィールド210で、範囲指定を行わない場合、サーチ文
字列属性は、サーチ文字列全体に有効となる。
Next, select "Yes" in the search character string attribute designation selection field 220 in the search definition sheet 200, and proceed to input the search character string attribute (step 21). Here, the search string in the search string input field 210 can be specified in units of regular expressions, and the search string attributes can be input in units of the specified regular expressions. If no range is specified in the search string input field 210, the search string attribute is valid for the entire search string.

サーチ文字列属性入力21は、第7図に示すサーチ文字
列属性定義シート600を表示する。サーチ文字列属性
定義シート600は、本実施例では、「書体J610.
r倍角」620.rアンダーライン」630.r文字種
別」640.[アルファベット」650から構成されて
いるが、システムの持つ文字属性に従って、拡張するこ
とは可能である。
The search string attribute input 21 displays a search string attribute definition sheet 600 shown in FIG. In this embodiment, the search character string attribute definition sheet 600 is “Typeface J610.
r times angle” 620. r underline” 630. r character type” 640. [Alphabet] 650, but it can be expanded according to the character attributes of the system.

ここでは、すべての項目に関してr区別無」が選択され
たこととする。すなわち、文字属性にかかわらずサーチ
文字列に該当する文字コードを持つものが発見されるこ
とになる。
Here, it is assumed that "r-no distinction" has been selected for all items. In other words, a search character string with a character code corresponding to the search character string is found regardless of character attributes.

各属性の選択が終了した後、サーチ文字列属性定義シー
ト600内の実行フィールド660を選択すると、文字
属性として選択された値を有効値として、サーチ定義シ
ート200へ戻る。又、取消フィールド670を選択す
ると、文字属性として選択された値は無効となって、サ
ーチ定義シート200へ戻る。
After selecting each attribute, when the execution field 660 in the search character string attribute definition sheet 600 is selected, the process returns to the search definition sheet 200 with the value selected as the character attribute as the valid value. If the cancel field 670 is selected, the value selected as the character attribute becomes invalid and the process returns to the search definition sheet 200.

次に、サーチ文字列に対して置換処理を行うか否かをサ
ーチ定義シート20o内の文字置換選択フィールド23
0を用いて、置換を行う場合は「有」を、サーチのみの
場合は「無」を選択する(ステップ30)。
Next, select whether or not to perform replacement processing on the search string using the character replacement selection field 20 in the search definition sheet 20o.
0 is used to perform replacement, select "Yes", and select "No" when performing only a search (step 30).

置換を行う場合は、サーチ定義シート200内の置換文
字刺入カニリア240に、置換文字列を入力する(ステ
ップ31)。
When performing a replacement, a replacement character string is input into the replacement character insertion field 240 in the search definition sheet 200 (step 31).

置換を行わない場合は、ステップ50(文字列サーチ処
理)へすすむ。
If no replacement is to be performed, the process proceeds to step 50 (character string search process).

ここで、置換文字刺入カニリア240に特殊文字として
「¥数字」を入力した場合、サーチ文字列が正規表現の
結合で表現されているとき、その正規表現の先頭から何
番目の正規表現かを数字で現し、その正規表現に対応す
る置換文字列となる。
Here, if you enter "\Number" as a special character in the replacement character insertion canilia 240, and the search string is expressed by a combination of regular expressions, you can check the number of regular expressions from the beginning of the regular expression. It is expressed as a number and becomes the replacement string corresponding to the regular expression.

本箱2の実施例では、置換文字刺入カニリア240に、
「コンピュータ¥2」と入力した。これは、第1の正規
表現に該当する部分を「コンピュータ」530に変更し
、第2の正規表現に該当する部分は、[¥24540で
、文字列の置換をおこなわないことを現している。
In the embodiment of the bookcase 2, in the replacement character inserting canilia 240,
I entered "computer ¥2". This means that the part corresponding to the first regular expression is changed to "computer" 530, and the part corresponding to the second regular expression is [¥24,540], indicating that no character string replacement is performed.

次に、文字属性置換を行うか否かをサーチ定義シート2
00内の置換文字列属性指定選択フィールド250を用
いて、文字置換を行う場合は「有」を、行わない場合は
「無」を選択する(ステップ40)。
Next, search definition sheet 2 determines whether or not to perform character attribute replacement.
Using the replacement character string attribute designation selection field 250 in 00, select "Yes" if character replacement is to be performed, or "No" if character replacement is not to be performed (step 40).

ステップ40で、文字属性置換「有」を選択した場合、
第8図に示す置換文字列属性定義シート300を表示し
、設定する文字属性を選択する(ステップ41)。ここ
で、置換文字列入力フィールド240内の置換文字列を
正規表現単位に指定して、指定された正規表現単位で置
換文字列属性入力を行うことができる。置換文字列入力
フィールド240で、範囲指定を行わない場合、置換文
字列属性は、置換文字列全体に有効となる。本第2の実
施例では、「¥2J 530の部分が選択されて、第8
図の置換文字列属性定義シート300が表示されたもの
とする。
If character attribute replacement "Yes" is selected in step 40,
The replacement character string attribute definition sheet 300 shown in FIG. 8 is displayed, and the character attribute to be set is selected (step 41). Here, the replacement string in the replacement string input field 240 can be specified in units of regular expressions, and the replacement string attributes can be input in the specified regular expression units. If no range is specified in the replacement string input field 240, the replacement string attribute is valid for the entire replacement string. In this second example, the part “¥2J 530” is selected and the
It is assumed that the replacement character string attribute definition sheet 300 shown in the figure is displayed.

本第2の実施例では、置換文字列属性定義シート300
において、書体310として「ゴシック体」9倍角32
0として「通常倍」、アンダーライン330でアンダー
ライン「無」2文字種別340として「全角」、アルフ
ァベット350として「変更熱」が選択されたものとす
る。
In the second embodiment, the replacement character string attribute definition sheet 300
, the font 310 is "Gothic" 9x 32
It is assumed that ``normal double'' is selected as 0, ``no underline'' is selected as the underline 330, ``full-width'' is selected as the two-character type 340, and ``change heat'' is selected as the alphabet 350.

各属性の選択が終了した後、置換文字列属性定義シート
300内の実行フィールド360を選択すると、文字属
性として選択された値を有効値として、サーチ定義シー
ト200へ戻る。又、取消フィールド370を選択する
と、文字属性として選択された値は無効となって、サー
チ定義シート200へ戻る。
After selecting each attribute, if the execution field 360 in the replacement character string attribute definition sheet 300 is selected, the process returns to the search definition sheet 200 with the value selected as the character attribute as the valid value. If the cancel field 370 is selected, the value selected as the character attribute becomes invalid and the process returns to the search definition sheet 200.

サーチ定義シート200に戻った後、サーチ定義シー1
〜200内の実行フィールド260を選択すると、サー
チ定義シート200及びサーチ文字列属性定義シート6
00及び置換文字列属性定義シート300で選択された
値を有効として、文字列サーチ処理50へすすむ。また
、取消フィールド270を選択した場合は、サーチ処理
を終了する。
After returning to search definition sheet 200, search definition sheet 1
When the execution field 260 in ~200 is selected, the search definition sheet 200 and the search string attribute definition sheet 6 are displayed.
00 and the value selected in the replacement character string attribute definition sheet 300 are validated and the process proceeds to character string search processing 50. Furthermore, if the cancel field 270 is selected, the search process is ended.

文字列サーチ処理50によって、対応する文字列が発見
されると、サーチ定義シート200および置換文字列属
性定義シート300で設定された情報に基づき、文字列
の置換処理を行う。まず、サーチ定義シート200の文
字置換選択フィールド230で、選択された情報に従っ
て、文字置換の有無を判断する(ステップ60)。置換
有りの場合、サーチ文字列と置換文字列が同じかどうか
を正規表現単位に判断する(ステップ70)。同じとは
、サーチ定義シート200内の置換文字刻入カニリア2
40への入力データが「¥数字」であることである。サ
ーチと置換文字列が異なる場合、正規表現単位で文字列
置換処理(ステップ71)を行う。文字列置換処理は、
従来の文書処理でおこなわれていたものと同様に、サー
チによって発見された文字列を置換文字列によって置き
換えるものであり、サーチ文字列と置換文字列の文字数
は同じである必要はない。また、サーチと置換文字列が
同じ場合は、文字列置換処理71をスキップする。
When a corresponding character string is found by the character string search process 50, a character string replacement process is performed based on the information set in the search definition sheet 200 and the replacement character string attribute definition sheet 300. First, the presence or absence of character replacement is determined according to the information selected in the character replacement selection field 230 of the search definition sheet 200 (step 60). If there is a replacement, it is determined whether the search string and the replacement string are the same for each regular expression (step 70). The same means the replacement character engraving Canilia 2 in the search definition sheet 200.
The input data to 40 is "¥ number". If the search and replacement character strings are different, character string replacement processing (step 71) is performed for each regular expression. The string replacement process is
Similar to what is done in conventional document processing, a character string found through a search is replaced with a replacement string, and the number of characters in the search string and replacement string do not have to be the same. Furthermore, if the search and replacement character strings are the same, the character string replacement process 71 is skipped.

次に、サーチ定義シート200の文字属性置換選択フィ
ールド250で、選択された情報に従つて、属性変更が
必要か否かを判断する(ステップ80)。属性変更が必
要な場合、文字属性設定処理(ステップ81)を行う。
Next, in accordance with the information selected in the character attribute replacement selection field 250 of the search definition sheet 200, it is determined whether an attribute change is necessary (step 80). If an attribute change is required, character attribute setting processing (step 81) is performed.

文字属性設定処理は、従来の文書処理システムにおける
文字属性設定機能と同じであり、属性設定シート300
で選択された文字属性を対象文字列に設定するものであ
る。
The character attribute setting process is the same as the character attribute setting function in a conventional document processing system, and is performed using the attribute setting sheet 300.
The character attribute selected in is set to the target character string.

また、属性変更が不要の場合は、文字属性設定処理81
をスキップする。
In addition, if attribute change is not necessary, character attribute setting processing 81
Skip.

次に、ステップ60で置換無しの場合、又は、文字列置
換処理71および文字属性設定処理81を終了すると、
サーチを継続するか否かを選択する(ステップ90)。
Next, if there is no replacement in step 60, or if the character string replacement process 71 and character attribute setting process 81 are completed,
It is selected whether or not to continue the search (step 90).

継続する場合は、文字列サーチ処理50へ戻って処理を
継続し、継続しない場合は、処理を終了する。
If the process is to be continued, the process returns to the character string search process 50, and if the process is not to be continued, the process is ended.

第9図は、以上説明した処理フローに従って実際にサー
チと属性付き文字列置換をおこなった例である。同図(
、)の元文書700内には、全半角、大文字小文字の区
別なく、rcO1llPuter数字列」に該当するr
cOMPUTERJ 710とrcomputer 1
2 J720とrcomputer 25 J 730
の3つのサーチ対象文字列が存在している。これに対し
て、サーチ定義シート200、置換文字列属性定義シー
ト300を用いてrcomputerJの部分を「コン
ピュータ」に置換し、「数字列」の部分をゴシック体。
FIG. 9 shows an example in which a search and attribute-attached character string replacement were actually performed according to the processing flow described above. Same figure (
In the original document 700 of
cOMPUTERJ 710 and rcomputer 1
2 J720 and rcomputer 25 J730
There are three search target character strings. On the other hand, using the search definition sheet 200 and replacement character string attribute definition sheet 300, the part rcomputerJ is replaced with "computer", and the part "number string" is written in Gothic.

通常倍、アンダーライン無、全角属性を付けたものが、
同図(b)である。処理終了後の文書740は′、 「
コンピュータ」 750と「コンピュータ12J760
と「コンピュータ25J 770に変更され、それに伴
った配置変更が行われる。
Normally double, without underlining, with full-width attributes,
It is the same figure (b). The document 740 after processing is ', '
Computer” 750 and “Computer 12J760
"The computer will be changed to 25J 770, and the layout will be changed accordingly.

以上の実施例では、置換は一括して自動的に行われてし
まうが、置換の可否をユーザが選択(逐次置換)するこ
とを可能とするためには、第1図のステップ50とステ
ップ60の間にユーザの選択処理を行うことによって容
易に実現できる。
In the above embodiment, the replacement is automatically performed all at once, but in order to enable the user to select whether or not to perform the replacement (sequential replacement), steps 50 and 60 in FIG. This can be easily realized by performing user selection processing during the process.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、あるパターンに適合する文字列に対し
て、同じ文字属性を付加する場合、文字属性設定機能を
サーチ置換処理の一部として実現できるため、ユーザの
操作性および、作業効率が向上する。
According to the present invention, when adding the same character attribute to a character string that matches a certain pattern, the character attribute setting function can be implemented as part of the search replacement process, improving user operability and work efficiency. improves.

また、サーチ文字列および置換文字列を正規表現の結合
で表現し、その正規表現単位で文字属性を定義可能とし
たことにより、サーチ置換のバリエーションが増大し、
−括して多様な文字列置換が可能となり作業効率が向上
する。
In addition, by expressing the search string and replacement string by combining regular expressions, and by making it possible to define character attributes for each regular expression, variations in search and replacement are increased.
- It is possible to perform various character string replacements at once, improving work efficiency.

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

第1図は、本発明の一実施例のフローチャート、第2図
は本発明における文書処理装置のブロック図、第3図、
第6図はサーチ置換処理に用いるサーチ定義シートを示
す図、第4図、第8図はサーチ置換処理に用いる置換文
字列属性定義シートを示す図、第7図はサーチ置換処理
に用いるサーチ文字列属性定義シートを示す図、第5図
、第9図は本発明を施した文書の処理例を示す図である
。 100・・・入力装置、130・・・CPU、140゜
141・・・メモリ、150・・・文書ファイル、16
0・・・BMP、190・・・CRT、200・・・サ
ーチ定義シート、300・・・置換文字列属性定義シー
ト、600・・・サーチ文字列属性定義シート。 図面の浄書に内容に変更なし) 第1図 第2図 図面の浄書(内容に変更なし) テ32 図面の浄書(内容に変更なし) 課乙口 第72 第5図 (a ) 図面の浄書(内容に変更なし) 第δ2 M9図 (a) 手 続 補 正 書 (方式) %式% 事件の表示 平成 2年 特 許 願 第064177号 発明の名称 属性付き文字列置換方式 (510)株式会社 日 立 製 作 所 代 理 人
FIG. 1 is a flowchart of an embodiment of the present invention, FIG. 2 is a block diagram of a document processing device according to the present invention, and FIG.
Figure 6 is a diagram showing a search definition sheet used in search replacement processing, Figures 4 and 8 are diagrams showing replacement character string attribute definition sheets used in search replacement processing, and Figure 7 is a diagram showing search characters used in search replacement processing. The column attribute definition sheet, FIG. 5, and FIG. 9 are diagrams showing examples of document processing to which the present invention is applied. 100... Input device, 130... CPU, 140° 141... Memory, 150... Document file, 16
0...BMP, 190...CRT, 200...Search definition sheet, 300...Replacement string attribute definition sheet, 600...Search string attribute definition sheet. Fig. 1 Fig. 2 Engraving of the drawing (no change in content) Te 32 Engraving of the drawing (no change in content) Section Otsuguchi No. 72 Figure 5 (a) Engraving of the drawing ( No change in content) Part δ2 Figure M9 (a) Procedural amendment (method) % formula % Display of case 1990 Patent Application No. 064177 Invention Name Attribute String Replacement Method (510) Hitachi, Ltd. Agent

Claims (1)

【特許請求の範囲】 1、文字列およびコマンドの入力装置と文書を構成する
頁の表示装置と文書データを格納するメモリ装置と、文
字の書体や倍角やアンダーライン等の文字属性を文字列
に付加する文字属性設定手段と、入力された文字列につ
いて上記文書データ格納メモリを検索し、その検索され
たサーチ文字列データを、入力された置換文字列データ
と置き換えるサーチ置換処理手段と、上記サーチ文字列
として、正規表現での記述を許し、正規表現の文字列を
上記文書データ格納メモリから検索する文字列サーチ手
段を持つ文書処理装置において、サーチ置換処理の際、
置換情報として置換文字列データだけでなく、文字属性
を指定する手段を設け、置換処理時に、文字列の置換と
文字属性の設定を同時に行うことができることを特徴と
する属性付き文字列置換方式。 2、特許請求の範囲第1項に記載した文書処理装置にお
いて、複数の正規表現を結合することによつて、サーチ
文字列を指定可能とし、正規表現単位にサーチ文字列の
文字属性を指定する手段を持ち、属性付きの正規表現文
字列サーチ機能を有することを特徴とする属性付き文字
列置換方式。 3、特許請求の範囲第1項に記載した文書処理装置にお
いて、複数の正規表現を結合することによつて、サーチ
文字列を指定可能とし、正規表現単位に置換文字列を指
定する手段と、正規表現単位の置換文字列に対して置換
時の文字属性を指定する手段を設け、置換処理時に正規
表現単位に異なる文字列置換と文字属性設定を行うこと
を可能としたことを特徴とする属性付き文字列置換方式
[Claims] 1. An input device for character strings and commands, a display device for pages constituting a document, a memory device for storing document data, and a device for converting character attributes such as character font, double-width, and underline into character strings. a character attribute setting means for adding; a search and replacement processing means for searching the document data storage memory for the input character string and replacing the searched search character string data with the input replacement character string data; In a document processing device that allows the description of a regular expression as a character string and has a character string search means for searching the document data storage memory for the regular expression character string, during search replacement processing,
A character string replacement method with attributes, characterized in that a means for specifying character attributes as well as replacement character string data as replacement information is provided, and character string replacement and character attribute setting can be performed at the same time during replacement processing. 2. In the document processing device described in claim 1, a search string can be specified by combining a plurality of regular expressions, and character attributes of the search string can be specified for each regular expression. 1. A string replacement method with attributes, characterized in that it has a regular expression string search function with attributes. 3. In the document processing device according to claim 1, means for specifying a search string by combining a plurality of regular expressions and specifying a replacement string for each regular expression; An attribute characterized by providing a means for specifying character attributes at the time of replacement for replacement character strings in regular expression units, and making it possible to perform different character string replacement and character attribute settings in regular expression units during replacement processing. String replacement method.
JP2064177A 1990-03-16 1990-03-16 Character string replacement device with attributes Expired - Fee Related JP3064323B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2064177A JP3064323B2 (en) 1990-03-16 1990-03-16 Character string replacement device with attributes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2064177A JP3064323B2 (en) 1990-03-16 1990-03-16 Character string replacement device with attributes

Publications (2)

Publication Number Publication Date
JPH03266066A true JPH03266066A (en) 1991-11-27
JP3064323B2 JP3064323B2 (en) 2000-07-12

Family

ID=13250523

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2064177A Expired - Fee Related JP3064323B2 (en) 1990-03-16 1990-03-16 Character string replacement device with attributes

Country Status (1)

Country Link
JP (1) JP3064323B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165820A (en) * 1991-12-13 1993-07-02 Sharp Corp Information processor
JPH0744555A (en) * 1993-08-02 1995-02-14 Nec Ic Microcomput Syst Ltd Character string replacing device
JPH0863480A (en) * 1994-08-19 1996-03-08 Ricoh Co Ltd Document data base management system
JP2007164368A (en) * 2005-12-12 2007-06-28 Sunmoretec Co Ltd Method and device for creating document

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05165820A (en) * 1991-12-13 1993-07-02 Sharp Corp Information processor
JPH0744555A (en) * 1993-08-02 1995-02-14 Nec Ic Microcomput Syst Ltd Character string replacing device
JPH0863480A (en) * 1994-08-19 1996-03-08 Ricoh Co Ltd Document data base management system
JP2007164368A (en) * 2005-12-12 2007-06-28 Sunmoretec Co Ltd Method and device for creating document

Also Published As

Publication number Publication date
JP3064323B2 (en) 2000-07-12

Similar Documents

Publication Publication Date Title
JP3337161B2 (en) Methods for editing structured documents
JPH03266066A (en) Character-string substitution system with attribute
JPH0785058A (en) Information retrieval device
JPH0424759A (en) Document processor
JPH0585929B2 (en)
JPH03129461A (en) Document edit processor
JP3129375B2 (en) Document processing device with space / tab conversion function
JP3313490B2 (en) Keyword creation device
JP2761606B2 (en) Document data processing device
JP2864418B2 (en) Document processing device
JP2802142B2 (en) Document input editing device
JPH0721189A (en) Translation assisting system
JPH05101068A (en) Document processor
JPH09185618A (en) Character processing device
JPS59165124A (en) Japanese language word processor
JPH05197718A (en) Sentence preparing device
JPH07325844A (en) Electronized dictionary retrieval device
JPH07129554A (en) Document processing device
JPH04282755A (en) Word processor
JPH07105219A (en) Machine translating device
JPH03156667A (en) Document editing processor
JPH07200565A (en) Character processor
JPH02130674A (en) Character string retrieving system
JPS62271015A (en) Document editing device
JPH06243136A (en) Document preparing device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees