JP3064323B2 - Character string replacement device with attributes - Google Patents

Character string replacement device with attributes

Info

Publication number
JP3064323B2
JP3064323B2 JP2064177A JP6417790A JP3064323B2 JP 3064323 B2 JP3064323 B2 JP 3064323B2 JP 2064177 A JP2064177 A JP 2064177A JP 6417790 A JP6417790 A JP 6417790A JP 3064323 B2 JP3064323 B2 JP 3064323B2
Authority
JP
Japan
Prior art keywords
character string
search
character
replacement
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.)
Expired - Fee Related
Application number
JP2064177A
Other languages
Japanese (ja)
Other versions
JPH03266066A (en
Inventor
邦宏 柳
高明 野村
信丈 佐藤
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)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は文書編集に係わり、特に正規表現指定の文字
列サーチ機能を有し、文字列置換を文字属性付きで行う
ことのできる文書編集装置に関する。
Description: BACKGROUND OF THE INVENTION The present invention relates to document editing, and more particularly to a document editing apparatus having a character string search function for specifying a regular expression and capable of performing character string replacement with a character attribute. About.

〔従来の技術〕[Conventional technology]

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

また、「実用化UNIXシステム」(工学社刊Mark.G.Sob
ell著 安居院猛監訳456〜465)に示すように、正規表
現によつて文字列サーチを実現しているものもある。
In addition, "Practical UNIX System" (Mark.G.Sob published by Kogakusha)
As shown in ell's translation by Takeshi Yasui, 456-465), some character strings are implemented using regular expressions.

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

上記従来技術では、特定の文字列を別の文字列に置換
することは可能であるが、例えば、本文中で図を参照し
ている箇所をサーチし、参照箇所の文字属性を変える作
業を考えると、特定の文字列同士のサーチ機能では、
「図」をサーチ文字列とした場合、図参照箇所だけでは
なく「図形」などの、無関係の文字列もサーチによつて
選択されてしまい、効率が悪いという問題点があつた。
また、正規表現によつてサーチ文字列を指定した場合、
図参照位置のみをサーチによつて選択することは可能で
あるが、参照箇所の文字属性を変更するためには、サー
チモードを抜けて、文字属性設定機能を用いて、一つ一
つ文字属性を設定し、またサーチモードにはいつて、サ
ーチを継続しなければならなかつた。以上、従来システ
ムでは、文字列同士のサーチ置換機能にとどまつてお
り、文字属性を同時に変えることが考慮されていないと
いう問題があつた。
In the above prior art, it is possible to replace a specific character string with another character string, but for example, consider a task of searching for a part in the text that refers to a figure and changing the character attribute of the reference part. And the search function between specific strings,
When "Figure" is used as a search character string, an unrelated character string such as "Figure" as well as a figure reference point is selected by a search, resulting in a problem of poor efficiency.
Also, if you specify a search string using a regular expression,
Although it is possible to select only the figure reference position by search, in order to change the character attribute of the reference portion, exit the search mode and use the character attribute setting function to set the character attribute one by one. And set the search mode to continue the search. As described above, the conventional system is limited to the search replacement function between character strings, and there is a problem that changing the character attribute at the same time is not considered.

また、正規表現を用いたサーチ機能では、正規表現と
して、文字属性を指定することができないため、例え
ば、大文字と小文字で記述されている「COMPUTER」と
「computer」をサーチする場合には、別々に正規表現を
用いて記述する必要がある。
In addition, in the search function using a regular expression, character attributes cannot be specified as a regular expression. For example, when searching for “COMPUTER” and “computer” described in uppercase and lowercase, separate Must be described using a regular expression.

本発明の目的は、文字列のサーチ置換処理の時に、サ
ーチ文字列として、正規表現を許し、且つ、正規表現単
位に文字属性指定を可能とした文字列サーチ機能と、置
換データとして文字列だけでなく、文字属性も同時に設
定できるようにした、文字処理装置を提供することにあ
る。
An object of the present invention is to provide a character string search function that allows a regular expression as a search character string and allows a character attribute to be specified in units of a regular expression at the time of character string search and replacement processing. Another object of the present invention is to provide a character processing device capable of simultaneously setting a character attribute.

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

上記目的を達成するために本発明においては、正規表
現に従つたサーチ文字列指定手段と、正規表現単位にサ
ーチ文字列の文字属性を指定する手段と、文字属性付き
正規表現文字サーチ機能と、置換文字列指定手段とし
て、従来の文字列入力機能と文字属性指定機能を合わせ
持たせ、置換処理にあたつては、サーチによつて発見さ
れた文字列を置換文字列に置き換えたのち、指定された
文字属性を設定することによつて実現される。
In order to achieve the above object, in the present invention, a search character string specifying means according to a regular expression, a means for specifying a character attribute of a search character string in a regular expression unit, a regular expression character search function with a character attribute, As a replacement character string designating means, a conventional character string input function and a character attribute designating function are combined, and in the replacement process, a character string found by a search is replaced with a replacement character string, and then a specification is made. This is realized by setting the specified character attribute.

〔作用〕[Action]

上記方法は、サーチ文字列と置換文字列の単純文字列
置換機能と、サーチ文字列に文字属性設定を行う機能
と、サーチ文字列を置換文字列に置き換え、さらに文字
属性を設定する機能で構成され、サーチ置換機能を連続
して行うものである。
The above method consists of a simple string replacement function for the search string and the replacement string, a function to set the character attribute to the search string, a function to replace the search string with the replacement string, and a function to set the character attribute. The search replacement function is performed continuously.

〔実施例〕〔Example〕

以下、本発明の実施例を図面に基づいて説明する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings.

第1図は、本発明が提供する属性付き文字列置換方式
の処理フロー、第2図は、本発明を適用する文書処理装
置の全体構成を示すブロツク図である。キーボード100
から入力されたテキストデータやコマンドは、インタフ
エース回路110を介してレジスタ120に入力され、CPU130
に読み取られる。CPU130は、入力コマンドに応じて、メ
モリ140に格納されている制御プログラムを実行する。
メモリ141は、文書データを格納するメモリである。メ
モリ141の内容は、「文書呼出し」コマンドによつて、
文書フアイル150からメモリ141に展開され、「文書格
納」コマンドによつてメモリ141から文書フアイル150に
格納される。文書編集機能によつて、メモリ141の文書
データが更新されると、CPU130は、編集形式の文書デー
タを表示データに変換し、ビツト・マツプ・プロセツサ
(BMP)160に順次転送される。BMP160は、表示データを
フレームメモリ170上に展開し、CRTコントローラ180が
上記フレームメモリ170の内容を順次読み出して、CRT19
0上へ展開する。
FIG. 1 is a processing flow of a character string replacement method with attributes 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
The text data and command input from the CPU 130 are input to the register 120 through the interface circuit 110,
Is read. CPU 130 executes a control program stored in memory 140 according to the input command.
The memory 141 is a memory for storing document data. The contents of the memory 141 are stored by a “recall document” command.
The document file 150 is developed in the memory 141, and stored in the document file 150 from the memory 141 by a "store document" command. When the document data in the memory 141 is updated by the document editing function, the CPU 130 converts the document data in the editing format into display data, which are sequentially transferred to the bit map processor (BMP) 160. The BMP 160 expands the display data on the frame memory 170, and the CRT controller 180 sequentially reads the contents of the frame memory 170, and
Expand to 0.

次に、第1図を用いて属性付き文字列置換方式の処理
フローを説明する。まず、ユーザが文字列サーチ機能を
選択すると、第3図および第6図に示す、サーチ定義シ
ート200が表示され、ユーザはサーチ対象文字列を、サ
ーチ定義シート200内のサーチ文字列入力エリア210に入
力する。(ステップ10)ここで、入力文字列は、一般の
文字列を記述しても、正規表現を用いて記述しても、複
数の正規表現の結合で記述しても良い。本実施例で用い
る正規表現は、UNIX(工学社刊「実用UNIXシステム」46
5ページ)に基づき規定したものであり、以下の特殊文
字を持つ。
Next, a processing flow of the character string replacement method with attributes will be described with reference to FIG. First, when the user selects the character string search function, a search definition sheet 200 shown in FIGS. 3 and 6 is displayed, and the user inputs a search target character string into the search character string input area 210 in the search definition sheet 200. To enter. (Step 10) Here, the input character string may be described as a general character string, described using a regular expression, or described by combining a plurality of regular expressions. The regular expression used in this embodiment is UNIX ("Practical UNIX System", published by Kogakusha).
5) and has the following special characters.

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

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

「[...]」:...の中のどれか1つの文字を意味す
る。C1−C2のような範囲指定と、C1C2C3のような選択形
式が混在してもよい。
"[...]" means any one of the characters in .... A range specification such as C 1 -C 2 and a selection form such as C 1 C 2 C 3 may be mixed.

「[^...]」:...の中のどれとも一致しない1つの文
字を意味する。C1−C2ような範囲指定と、C1C2C3のよう
な選択形式が混在してもよい。
"[^ ...]" means a single character that does not match any of the ... A range specification such as C 1 -C 2 and a selection form such as C 1 C 2 C 3 may be mixed.

「C*」:文字Cのゼロ回以上の繰返しを意味する。 "C *" means zero or more repetitions of the character C.

「.*」:任意文字列を意味する。 ". *": Means an arbitrary character string.

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

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

本実施例では、第3図,第4図,第5図を用いて、本
文中から正規表現で記述されたサーチ文字列を検索し、
発見した文字列の文字属性を変更する場合(第1の実施
例)を説明する。また、第6図,第7図,第8図,第9
図を用いて、結合された正規表現で記述されたサーチ文
字列に属性を付加した文字列を検索し、発見した文字列
に対して、正規表現単位で文字列置換と属性変更を行う
場合(第2の実施例)を説明する。
In this embodiment, a search character string described by a regular expression is searched from the text using FIGS. 3, 4, and 5, and
A case where the character attribute of the found character string is changed (first embodiment) will be described. 6, 7, 8, 9.
When a character string in which an attribute is added to a search character string described by a combined regular expression is searched using a figure, and the found character string is replaced with a character string and an attribute is changed in units of a regular expression ( Example 2) will be described.

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

第3図のサーチ定義シート200のサーチ文字列定義エ
リア210に正規表現を用いて「図[1−9][0−9]
*.[1−9][0−9]*」と入力する。これは、
「図」で始まり、「.」をはさんで0以外の数字を先頭
にもつ1文字以上の数字列で構成される文字列を表現す
る正規表現であり、「図X.X」という形式を持つ図番参
照位置を検索対象とする。
Using a regular expression in the search character string definition area 210 of the search definition sheet 200 shown in FIG. 3, “FIG. [1-9] [0-9]
*. [1-9] [0-9] * ". this is,
This is a regular expression that starts with "Figure" and expresses a character string composed of one or more character strings with a number other than 0 at the beginning, sandwiched by ".", And has the form "Figure XX". The number reference position is the search target.

次に、サーチ文字列に対して属性指定を行うか否かを
サーチ定義シート200内のサーチ文字列属性指定選択フ
イールド220を用いて、指定を行う場合「有」を、指定
を行わない場合は「無」を選択する。(ステツプ20)本
第1の実施例では「無」を選択した。「有」を選択した
場合は、サーチ文字列属性入力(ステツプ21)にすすむ
が、ステツプ21に関しては、第2の実施例で詳述する。
Next, using the search character string attribute specification selection field 220 in the search definition sheet 200, whether or not to specify the attribute for the search character string is set to “Yes”. Select "None". (Step 20) In the first embodiment, "none" is selected. If "Yes" is selected, the process proceeds to the search character string attribute input (step 21), but step 21 will be described in detail in the second embodiment.

次に、サーチ文字列に対して置換処理を行うか否かを
サーチ定義シート200内の文字置換選択フイールド230を
用いて、置換を行う場合は「有」を、サーチのみの場合
は「無」を選択する(ステップ30)。
Next, using the character replacement selection field 230 in the search definition sheet 200 to determine whether or not to perform the replacement process on the search character string, “Yes” when performing the replacement, and “No” when performing only the search Is selected (step 30).

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

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

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

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

ここで、置換文字列として「&」を入力し、文字属性
置換「無」を選択した(サーチ文字列と置換文字列が同
一で、かつ属性変更なし)場合、処理として意味を成さ
ないためエラーとする。又、置換文字列として、任意の
文字列(&以外)を入力し、文字属性置換「有」を選択
した場合、文字置換を行つた後、対象文字列の属性変更
を行う。
Here, if "&" is entered as the replacement character string and character attribute replacement "None" is selected (the search character string and the replacement character string are the same and the attribute is not changed), the processing does not make sense. Error. If 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 performing character replacement.

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

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

置換文字列属性定義シート300は、本実施例では、書
体310,「倍角」320,「アンダーライン」330,「文字種
別」340,「アルフアベツト」350から構成されている
が、システムの持つ文字属性に従つて、拡張することは
可能である。
In the present embodiment, the replacement character string attribute definition sheet 300 is composed of a typeface 310, “double-width” 320, “underline” 330, “character type” 340, and “alphabet” 350. It is possible to extend according to:

ここでは、書体310として「ゴシツク体」,倍角320と
して「横倍」,アンダーライン330でアンダーライン
「有」,文字種別340として「変更無」,アルフアベツ
ト350として「変更無」が選択されたものとする。
In this case, “Gothic” is selected as the typeface 310, “horizontal double” as the double-width 320, underline “Yes” with the underline 330, “No change” as the character type 340, and “No change” as the alphabet 350 And

各属性の選択が終了した後、置換文字列属性定義シー
ト300内の実行フイールド360を選択すると、文字属性と
して選択された値を有効値として、サーチ定義シート20
0へ戻る。又、取消フイールド370を選択すると、文字属
性として選択された値は無効となつて、サーチ定義シー
ト200へ戻る。
After the selection of each attribute is completed, when the execution field 360 in the replacement character string attribute definition sheet 300 is selected, the value selected as the character attribute is set as a valid value, and the search definition sheet 20 is set.
Return to 0. When the cancel field 370 is selected, the value selected as the character attribute is invalidated, and the process returns to the search definition sheet 200.

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

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

文字列置換処理は、従来の文書処理でおこなわれてい
たものと同様に、サーチによつて発見された文字列を置
換文字列によつて置き換えるものであり、サーチ文字列
と置換文字列の文字数は同じである必要はない。また、
サーチと置換文字列が同じ場合は、文字列置換処理71を
スキツプする。
The character string replacement process replaces a character string found by a search with a replacement character string in the same manner as that performed in the conventional document processing, and includes the number of characters in the search character string and the replacement character string. Need not be the same. Also,
If the search and the replacement character string are the same, the character string replacement processing 71 is skipped.

次に、サーチ定義シート200の文字属性置換選択フイ
ールド250で、選択された情報に従つて、属性変更が必
要か否かを判断する(ステツプ80)。属性変更が必要な
場合、文字属性設定処理(ステツプ81)を行う。文字属
性設定処理は、従来の文書処理システムにおける文字属
性設定機能と同じであり、属性設定シート300で設定さ
れた文字属性を対象文字列に設定するものである。ま
た、属性変更が不要の場合は、文字属性設定処理81をス
キツプする。
Next, it is determined in the character attribute replacement selection field 250 of the search definition sheet 200 whether or not the attribute needs to be changed according to the selected information (step 80). If the attribute needs to be changed, a character attribute setting process (step 81) is performed. The character attribute setting process is the same as the character attribute setting function in the conventional document processing system, and sets the character attribute set on the attribute setting sheet 300 to the target character string. If the attribute does not need to be changed, the character attribute setting process 81 is skipped.

次に、ステツプ60で置換無しの場合、又は、文字列置
換処理71および文字属性設定処理81を終了すると、サー
チを継続するか否かを選択する(ステツプ90)。継続す
る場合は、文字列サーチ処理50へ戻つて処理を継続し、
継続しない場合は、処理を終了する。
Next, when there is no replacement in step 60, or when the character string replacement processing 71 and the character attribute setting processing 81 are completed, it is selected whether or not to continue the search (step 90). When continuing, it returns to the character string search processing 50 and continues the processing,
If not, the process ends.

第5図は、以上説明した処理フローに従つて実際にサ
ーチと属性付き文字列置換をおこなつた例である。同図
(a)の元文書400内には、「図2.1」410と「図2.2」42
0という2つのサーチ対象文字列が存在している。これ
に対して、サーチ定義シート200、置換文字列属性定義
シート300を用いてゴシツク体,横倍,アンダーライン
属性を付けたものが、同図(b)である。処理終了後の
文書430は、「図2.1」]440と「図2.2」450がゴシツク
体,倍角,アンダーライン付きに変更され、それに伴つ
た配置変更が行われた。
FIG. 5 shows an example in which search and character string replacement with attributes are actually performed according to the processing flow described above. In the original document 400 of FIG. 10A, “FIG. 2.1” 410 and “FIG. 2.2” 42
There are two search target character strings 0. On the other hand, FIG. 9B shows a case where the godskin, the double-width, and the underline attributes are added using the search definition sheet 200 and the replacement character string attribute definition sheet 300. In the document 430 after the processing is completed, “FIG. 2.1”] 440 and “FIG. 2.2” 450 have been changed to gossip, double-width, and underlined, and the arrangement has been changed accordingly.

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

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

第6図のサーチ定義シート200のサーチ文字列定義エ
リア210に連結した正規表現を用いて「¥(computer
¥)¥([0−9]*¥)」と入力する。これは、「¥
(」と「¥)」で区切られた2つの正規表現から構成さ
れており、「¥(computer¥)」500は、computerその
ものを表現し、「¥([0−9]*¥)」510は、0個
を含む数字列を表現している。「computer数字列」とい
う形状を持つ文字列を検索対象とする。
Using a regular expression linked to the search character string definition area 210 of the search definition sheet 200 in FIG.
\) ¥ ([0-9] * ¥) ". This is "¥
It consists of two regular expressions separated by () and “¥”, and “¥ (computer ¥)” 500 expresses the computer itself and “¥ ([0-9] * ¥)” 510 Represents a numeric string including zero. A character string having the shape of "computer numeric string" is searched.

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

サーチ文字列属性入力21は、第7図に示すサーチ文字
列属性定義シート600を表示する。サーチ文字列属性定
義シート600は、本実施例では、「書体」610,「倍角」6
20,「アンダーライン」630,「文字種別」640,「アルフ
アベツト」650から構成されているが、システムの持つ
文字属性に従つて、拡張することは可能である。
The search character string attribute input 21 displays a search character string attribute definition sheet 600 shown in FIG. In the present embodiment, the search character string attribute definition sheet 600 is “typeface” 610, “double size” 6
20, "underline" 630, "character type" 640, and "alphabet" 650, but can be extended according to the character attributes of the system.

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

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

次に、サーチ文字列に対して置換処理を行うか否かを
サーチ定義シート200内の文字置換選択フイールド230を
用いて、置換を行う場合は「有」を、サーチのみの場合
は「無」を選択する(ステツプ30)。
Next, using the character replacement selection field 230 in the search definition sheet 200 to determine whether or not to perform the replacement process on the search character string, “Yes” when performing the replacement, and “No” when performing only the search Select (Step 30).

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

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

ここで、置換文字列入力エリア240に特殊文字として
「¥数字」を入力した場合、サーチ文字列が正規表現の
結合で表現されているとき、その正規表現の先頭から何
番目の正規表現かを数字で現し、その正規表現に対応す
る置換文字列となる。
Here, when “¥ number” is entered as a special character in the replacement character string input area 240, when the search character string is expressed by combining regular expressions, the number of the regular expression from the beginning of the regular expression is determined. Expressed as a number, it becomes the replacement string corresponding to the regular expression.

本第2の実施例では、置換文字列入力エリア240に、
「コンピユータ¥2」と入力した。これは、第1の正規
表現に該当する部分を「コンピユータ」530に変更し、
第2の正規表現に該当する部分は、「¥2」540で、文
字列の置換をおこなわないことを現している。
In the second embodiment, the replacement character string input area 240
"Computer # 2" was entered. This changes the part corresponding to the first regular expression to "Computer" 530,
The portion corresponding to the second regular expression is “$ 2” 540, which indicates that the character string is not replaced.

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

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

本第2の実施例では、置換文字列属性定義シート300
において、書体310として「ゴシツク体」,倍角320とし
て「通常倍」,アンダーライン330でアンダーライン
「無」,文字種別340として「全角」,アルフアベツト3
50として「変更無」が選択されたものとする。
In the second embodiment, the replacement character string attribute definition sheet 300
, The typeface 310 is “gothic”, the double-width 320 is “normal double”, the underline 330 is underlined “none”, the character type 340 is “full-width”, and the alphabet 3
It is assumed that "no change" is selected as 50.

各属性の選択が終了した後、置換文字列属性定義シー
ト300内の実行フイールド360を選択すると、文字属性と
して選択された値を有効値として、サーチ定義シート20
0へ戻る。又、取消フイールド370を選択すると、文字属
性として選択された値は無効となつて、サーチ定義シー
ト200へ戻る。
After the selection of each attribute is completed, when the execution field 360 in the replacement character string attribute definition sheet 300 is selected, the value selected as the character attribute is set as a valid value, and the search definition sheet 20 is set.
Return to 0. When the cancel field 370 is selected, the value selected as the character attribute is invalidated, and the process returns to the search definition sheet 200.

サーチ定義シート200に戻つた後、サーチ定義シート2
00内の実行フイールド260を選択すると、サーチ定義シ
ート200及びサーチ文字列属性定義シート600及び置換文
字列属性定義シート300で選択された値を有効として、
文字列サーチ処理50へすすむ。また、取消フイールド27
0を選択した場合は、サーチ処理を終了する。
After returning to search definition sheet 200, search definition sheet 2
When the execution field 260 in 00 is selected, the values selected in the search definition sheet 200, the search character string attribute definition sheet 600, and the replacement character string attribute definition sheet 300 are validated,
Proceed to character string search processing 50. Also, cancel field 27
If “0” is selected, the search process ends.

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

次に、サーチ定義シート200の文字属性置換選択フイ
ールド250で、選択された情報に従つて、属性変更が必
要か否かを判断する(ステツプ80)。属性変更が必要な
場合、文字属性設定処理(ステツプ81)を行う。文字属
性設定処理は、従来の文書処理システムにおける文字属
性設定機能と同じであり、属性設定シート300で選択さ
れた文字属性を対象文字列に設定するものである。ま
た、属性変更が不要の場合は、文字属性設定処理81をス
キツプする。
Next, it is determined in the character attribute replacement selection field 250 of the search definition sheet 200 whether or not the attribute needs to be changed according to the selected information (step 80). If the attribute needs to be changed, a character attribute setting process (step 81) is performed. The character attribute setting process is the same as the character attribute setting function in the conventional document processing system, and sets the character attribute selected on the attribute setting sheet 300 to the target character string. If the attribute does not need to be changed, the character attribute setting process 81 is skipped.

次に、ステツプ60で置換無しの場合、又は、文字列置
換処理71および文字属性設定処理81を終了すると、サー
チを継続するか否かを選択する(ステツプ90)。継続す
る場合は、文字列サーチ処理50へ戻つて処理を継続し、
継続しない場合は、処理を終了する。
Next, when there is no replacement in step 60, or when the character string replacement processing 71 and the character attribute setting processing 81 are completed, it is selected whether or not to continue the search (step 90). When continuing, it returns to the character string search processing 50 and continues the processing,
If not, the process ends.

第9図は、以上説明した処理フローに従つて実際にサ
ーチと属性付き文字列置換をおこなつた例である。同図
(a)の元文書700内には、全半角、大文字小文字の区
別なく、「computer数字列」に該当する「COMPUTER」71
0と「computer12」720と「computer25」730の3つのサ
ーチ対象文字列が存在している。これに対して、サーチ
定義シート200、置換文字列属性定義シート300を用いて
「computer」の部分を「コンピユータ」に置換し、「数
字列」の部分をゴシツク体,通常倍,アンダーライン
無,全角属性を付けたものが、同図(b)である。処理
終了後の文書740は、「コンピユータ」750と「コンピユ
ータ12」760と「コンピユータ25」770に変更され、それ
に伴つた配置変更が行われる。
FIG. 9 shows an example in which search and character string replacement with attributes are actually performed according to the processing flow described above. In the original document 700 of FIG. 7A, “COMPUTER” 71 corresponding to “computer numeric string” is not case-sensitive.
There are three search target character strings of 0, “computer12” 720, and “computer25” 730. On the other hand, the “computer” part is replaced with “computer” using the search definition sheet 200 and the replacement character string attribute definition sheet 300, and the “numerical string” part is in gothic type, normal double, no underline, FIG. 14B shows a case where the full-width attribute is added. The document 740 after the processing is changed to “computer” 750, “computer 12” 760, and “computer 25” 770, and the arrangement is changed accordingly.

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

〔発明の効果〕〔The invention's effect〕

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

また、サーチ文字列および置換文字列を正規表現の結
合で表現し、その正規表現単位で文字属性を定義可能と
したことにより、サーチ置換のバリエーシヨンが増大
し、一括して多様な文字列置換が可能となり作業効率が
向上する。
In addition, the search character string and the replacement character string are expressed by combining regular expressions, and character attributes can be defined in units of the regular expression, thereby increasing the variety of search replacement and collectively performing various character string replacements. Work efficiency is improved.

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

第1図は、本発明の一実施例のフローチヤート、第2図
は本発明における文書処理装置のブロツク図、第3図,
第6図はサーチ置換処理に用いるサーチ定義シートを示
す図、第4図,第8図はサーチ置換処理に用いる置換文
字列属性定義シートを示す図、第7図はサーチ置換処理
に用いるサーチ文字列属性定義シートを示す図、第5
図,第9図は本発明を施した文書の処理例を示す図であ
る。 100……入力装置、130……CPU、140,141……メモリ、15
0……文書フアイル、160……BMP、190……CRT、200……
サーチ定義シート、300……置換文字列属性定義シー
ト、600……サーチ文字列属性定義シート。
FIG. 1 is a flowchart of one embodiment of the present invention, and FIG. 2 is a block diagram of a document processing apparatus according to the present invention.
FIG. 6 is a diagram showing a search definition sheet used in the search replacement process, FIGS. 4 and 8 are diagrams showing a replacement character string attribute definition sheet used in the search replacement process, and FIG. 7 is a search character used in the search replacement process. The figure which shows a column attribute definition sheet, 5th
FIG. 9 and FIG. 9 are diagrams showing an example of processing a document according to the present invention. 100 ... input device, 130 ... CPU, 140, 141 ... memory, 15
0… Document file, 160… BMP, 190… CRT, 200…
Search definition sheet, 300: Replacement character string attribute definition sheet, 600: Search character string attribute definition sheet.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 佐藤 信丈 神奈川県横浜市戸塚区戸塚町5030番地 株式会社日立製作所ソフトウエア工場内 (56)参考文献 特開 平2−112061(JP,A) 特開 平2−3860(JP,A) 特開 平2−64771(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 17/21,17/24 ────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Nobunaga Sato 5030 Totsuka-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Inside the Hitachi, Ltd. software factory (56) References JP-A-2-1122061 (JP, A) JP-A-2-3860 (JP, A) JP-A-2-64771 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 17/21, 17/24

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】文字列およびコマンドの入力装置と、文書
を構成する頁の表示装置と、文書データを格納するメモ
リ装置と、文字の書体や倍角やアンダーラインを含む文
字属性を文字列に付加する文字属性設定手段と、入力さ
れた文字列に基づいて、正規表現を含む文字列をサーチ
文字列として前記メモリ装置から検索する文字列サーチ
手段と、前記検索されたサーチ文字列を、前記入力され
た文字列である置換文字列と置き換えるサーチ置換処理
手段とからなる文字列置換装置において、 複数の正規表現を結合することによって指定されたサー
チ文字列に対し、正規表現単位に置換文字列を指定する
手段と、正規表現単位の置換文字列に対して置換時の文
字属性を指定する手段とを設けることにより、置換処理
時に正規表現単位に異なる文字列置換と文字属性設定を
行なうことを特徴とする属性付き文字列置換装置。
An input device for inputting a character string and a command; a display device for displaying pages constituting a document; a memory device for storing document data; and a character attribute including a character typeface, a double-width character and an underline are added to the character string. Character attribute setting means for searching, a character string search means for searching a character string including a regular expression as a search character string from the memory device based on the input character string, and inputting the searched search character string to the input device. A character string replacement device comprising: a search character replacement unit that replaces a replacement character string that is a converted character string; and a search character string specified by combining a plurality of regular expressions. By providing a means for specifying the character attribute at the time of replacement for the replacement character string of the regular expression unit, A character string replacement device with attributes, which performs column replacement and character attribute setting.
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 JPH03266066A (en) 1991-11-27
JP3064323B2 true 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)

Families Citing this family (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
JP3138571B2 (en) * 1993-08-02 2001-02-26 日本電気アイシーマイコンシステム株式会社 String replacement device
JP3498926B2 (en) * 1994-08-19 2004-02-23 株式会社リコー Document database 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
JPH03266066A (en) 1991-11-27

Similar Documents

Publication Publication Date Title
JP3064323B2 (en) Character string replacement device with attributes
JPH024938B2 (en)
JPS6049424A (en) Document input system
JP3290451B2 (en) Electronic dictionary
JPH0585929B2 (en)
JP3498635B2 (en) Information retrieval method and apparatus, and computer-readable recording medium
JPH07219939A (en) Document processor and method therefor
JPH025175A (en) Character processor
JPH0424759A (en) Document processor
JP2675298B2 (en) Information processing device
JP2659907B2 (en) Document processing device
JPH0765014A (en) Document retrieving device
JP3342028B2 (en) Kana-Kanji conversion device
JP2504867B2 (en) Display method in text processing device
JP2671978B2 (en) Document processing device
JP3129375B2 (en) Document processing device with space / tab conversion function
JPH05101068A (en) Document processor
JPH06231119A (en) Character processor
JPH077397B2 (en) Kana-Kanji conversion method and device
JPH03129461A (en) Document edit processor
JPH11195022A (en) Character processor, method for character processing and record medium
JPS62251962A (en) Word processor
JPS59128622A (en) Processing device of character
JPS61177568A (en) Document processor
JPH08329053A (en) Automatic document preparation device

Legal Events

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