JP3129427B2 - Document processing method and apparatus - Google Patents

Document processing method and apparatus

Info

Publication number
JP3129427B2
JP3129427B2 JP02232457A JP23245790A JP3129427B2 JP 3129427 B2 JP3129427 B2 JP 3129427B2 JP 02232457 A JP02232457 A JP 02232457A JP 23245790 A JP23245790 A JP 23245790A JP 3129427 B2 JP3129427 B2 JP 3129427B2
Authority
JP
Japan
Prior art keywords
length
line
longest
continuous space
line length
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
JP02232457A
Other languages
Japanese (ja)
Other versions
JPH04113453A (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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP02232457A priority Critical patent/JP3129427B2/en
Publication of JPH04113453A publication Critical patent/JPH04113453A/en
Application granted granted Critical
Publication of JP3129427B2 publication Critical patent/JP3129427B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION 【産業上の利用分野】[Industrial applications]

本発明は、例えばワードプロセツサ等のように文書情
報を入力して、文書の作成・編集できる文書処理方法及
び装置に関するものである。
The present invention relates to a document processing method and apparatus capable of creating and editing a document by inputting document information such as a word processor.

【従来の技術】[Prior art]

従来のワードプロセツサ等では、既に作成されている
文書の行の長さを短くする場合には、各行毎に、行末の
文字列を次の行の行頭へ移動する操作を順次行う必要が
ある。また逆に、文書の各行の長さを長くする場合に
は、次の行の行頭の文字列を、1つ前の行の行末に移動
する動作を順次行なつて、行を所望の長さにする必要が
あつた。 また、行末に改行記号を含む行の場合には、その行は
改行記号以降すべてスペースであるとみなし、前述のよ
うに行の長さを短くする場合には、行末のスペースの削
除が必要となり、また、行の長さを長くする場合には、
行末にスペースを追加することによつて、行の長さを長
くすることにより、次の行に影響を与えないようにして
いた。
In a conventional word processor or the like, when shortening the line length of a document already created, it is necessary to sequentially perform an operation of moving a character string at the end of a line to the beginning of the next line for each line. . Conversely, when the length of each line of the document is to be increased, the operation of moving the character string at the beginning of the next line to the end of the previous line is sequentially performed, so that the line has a desired length. I needed to. If the line contains a line feed symbol at the end of the line, it is assumed that the line is all spaces after the line feed symbol. To shorten the line length as described above, it is necessary to delete the space at the end of the line. , Or to increase the line length,
By adding a space at the end of a line, the length of the line was increased so that it did not affect the next line.

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

第2図は、上記従来例により、1行当たり25桁の文書
を、1行が30桁及び20桁の文書に変換した例を示す図で
ある。第2図(A)は元の文書を示し、第2図(B)は
第2図(A)の文書を1行30桁に伸長した場合を示し、
第2図(C)は逆に1行を20桁に縮小した例を示してい
る。30桁に変換した第2図(B)の場合は、この文書の
宛名“山田 部長殿”が2行に分割されてしまつてい
る。また20桁に変換した第2図(C)の場合は、日付
“90年1月5日”や差出会社名“XYZ商事 横浜支社”
が2行に分割されてしまつている。 一般に、前述の日付や会社名等のような単独で意味の
ある文字列では、文字列の途中で行が変更されると見苦
しくなる。従つて、このような文字列は、文や1つのま
とまつた文字列の区切りで改行されるほうが、文書とし
て整つたものになる。しかしながら、上記従来例では、
文字列の区切りを全く考慮していないため、第2図
(B)(C)で示されるように、行の桁数を変更する
と、文字列の途中で改行されてしまい、その文書全体が
見苦しいものになる虞れがある。 また、第3図は各行の末尾の改行コードを含む文書
を、上記従来例により、1行当り25桁の文書から、1行
が30桁及び20桁の文書に変換した例を示した図である。
第3図(B)は30桁に伸長した例を示し、改行コードの
後に伸長された分に相当するスペースが挿入され、日付
や差出会社名の右側が大きく空いてしまつている。又、
第3図(C)に示す20桁に変換した場合は、第2図
(C)の場合と同様に、日付や差出社名が2行に分割さ
れてしまつている。 一般に、第2図(A)や第3図(A)に示すように、
日付や差出会社名等のように、予め右寄せでレイアウト
された文字列は、行の長さを変換した後も同様に右寄せ
されているほうが好ましい。しかしながら上記従来例で
は、行の長さを長くすると、改行記号以降のスペース量
も、その伸長された長さに応じて変更されてしまうた
め、第3図(A)に示すように行末のスペース量を意識
してレイアウトされた文書であつても、その文書の配置
がが崩れてしまうという欠点があつた。また、第3図
(C)のように、行が短くなる場合も、前述の第2図
(C)に示したのと同様に、文字列の途中の改行による
文字列の分割が発生する。 本発明は上記従来例に鑑みてなされたもので、元の文
書フオーマツトを生かした形で、その文書情報の行長を
指示された行長に変換できる文書処理方法及び装置を提
供することを目的とする。
FIG. 2 is a diagram showing an example in which a document having 25 columns per line is converted into a document having 30 columns and 20 columns per line according to the conventional example. 2 (A) shows the original document, FIG. 2 (B) shows a case where the document of FIG. 2 (A) is expanded to 30 lines per line,
FIG. 2C shows an example in which one line is reduced to 20 digits. In the case of FIG. 2 (B) converted to 30 digits, the address of this document, "Yamada, director" is divided into two lines. In the case of Fig. 2 (C) converted to 20 digits, the date "January 5, 1990" and the sending company name "XYZ Shoji Yokohama Branch"
Is split into two lines. In general, a character string having a single meaning, such as the date or the company name described above, becomes unsightly if a line is changed in the middle of the character string. Therefore, such a character string is more complete as a document if a line break is performed at the end of a sentence or a single character string. However, in the above conventional example,
Since the delimitation of the character string is not considered at all, if the number of digits in the line is changed as shown in FIGS. 2B and 2C, the line is broken in the middle of the character string and the whole document is unsightly. There is a risk of becoming something. FIG. 3 is a diagram showing an example in which a document including a line feed code at the end of each line is converted from a document having 25 columns per line to a document having 30 columns and 20 columns per line according to the conventional example. is there.
FIG. 3 (B) shows an example of extension to 30 digits, in which a space corresponding to the extension is inserted after the line feed code, and the right side of the date or the sending company name is largely vacant. or,
When converted to the 20 digits shown in FIG. 3 (C), the date and the company name are divided into two lines as in the case of FIG. 2 (C). Generally, as shown in FIG. 2 (A) and FIG. 3 (A),
It is preferable that a character string laid out right-adjusted in advance, such as a date and a sending company name, be similarly right-adjusted after the line length is converted. However, in the above-described conventional example, if the length of the line is increased, the amount of space after the line feed symbol is also changed according to the expanded length, and therefore, as shown in FIG. Even if the document is laid out in consideration of the amount, the arrangement of the document is broken. Also, when the line becomes short as in FIG. 3 (C), the character string is divided by a line feed in the middle of the character string as in the case of FIG. 2 (C). SUMMARY OF THE INVENTION The present invention has been made in view of the above conventional example, and has as its object to provide a document processing method and apparatus capable of converting the line length of document information into a designated line length while utilizing the original document format. And

【課題を解決するための手段】[Means for Solving the Problems]

上記目的を達成するために本発明の文書処理装置は以
下のような構成を備える。即ち、 1行当りの文字数を示す第1の行長に基づいて作成さ
れた文書情報の行長の変換後の行長である第2の行長を
指定する行長指定手段と、 前記文書情報の各行における最長の連続スペース長を
求める最長スペース検出手段と、 前記行長指定手段により指定された前記第2の行長と
前記第1の行長との差分量に基づいて前記最長の連続ス
ペース長の変更量を求めて前記最長の連続スペース長を
変換する変換手段と、 を有することを特徴とする。 また上記目的を達成するために本発明の文書処理方法
は以下のような工程を備える。即ち、 少なくとも入力部、表示部及びメモリを有し、文書デ
ータを処理する文書処理装置による文書処理方法であっ
て、 1行当りの文字数を示す第1の行長に基づいて、作成
され前記メモリに記憶された文書情報を前記表示部に表
示する表示工程と、 前記入力部における入力に応じて、前記表示部に表示
されている前記文書情報の1行当りの文字数を示す第1
の行長を第2の行長に変更すべく指定する行長指定工程
と、 前記メモリに記憶された前記文書情報の各行における
最長の連続スペース長を求める最長スペース検出工程
と、 前記行長指定工程で指定された前記第2の行長と前記
第1の行長との差分量に基づいて前記最長の連続スペー
ス長の変更量を求めて前記最長の連続スペース長を変換
する変換工程と、 前記メモリに記憶された文書情報を、前記変換工程で
変換した前記最長の連続スペース長に基づいて作成され
た文書情報に変更して前記表示部に表示する表示変更工
程と、 を有することを特徴とする。 [作用] 以上の構成により、文書情報の各行における最長の連
続スペース長を検出し、変換後の行長として指定された
第2の行長と、現在の文書情報の第1の行長との差分量
に基づいて最長の連続スペース長の変更量を求めて前記
最長の連続スペース長を変換するように動作する。
In order to achieve the above object, a document processing apparatus of the present invention has the following configuration. Line length designating means for designating a second line length which is a converted line length of the document information created based on the first line length indicating the number of characters per line; A longest space detecting means for determining a longest continuous space length in each line of the line; and a longest continuous space based on a difference amount between the second line length and the first line length specified by the line length specifying means. Conversion means for converting the longest continuous space length by calculating the length change amount. In order to achieve the above object, a document processing method of the present invention includes the following steps. That is, a document processing method by a document processing apparatus that has at least an input unit, a display unit, and a memory and processes document data, wherein the memory is created based on a first line length indicating the number of characters per line. A display step of displaying the document information stored in the display unit on the display unit; and a first step of displaying the number of characters per line of the document information displayed on the display unit in response to an input on the input unit.
A line length designating step of designating the line length of the document information to be changed to a second line length; a longest space detecting step of finding a longest continuous space length in each line of the document information stored in the memory; A conversion step of calculating a change amount of the longest continuous space length based on a difference amount between the second line length and the first line length specified in the step, and converting the longest continuous space length; A display changing step of changing the document information stored in the memory into document information created based on the longest continuous space length converted in the conversion step and displaying the document information on the display unit. And [Operation] With the above configuration, the longest continuous space length in each line of the document information is detected, and the second line length designated as the converted line length and the first line length of the current document information are detected. It operates to convert the longest continuous space length by obtaining the change amount of the longest continuous space length based on the difference amount.

【実施例】【Example】

以下、添付図面を参照して本発明の好適な実施例を詳
細に説明する。 <ワードプロセツサの構成説明 (第1図)> 第1図は本実施例のワードプロセツサの概略構成を示
すブロツク図である。 第1図において、1は文書情報を入力する文書入力部
である。10はキーボード(KBD)で、このキーボード10
より入力された文字コードやや制御コード等は、CPU11
が実行するROM12内のプログラムによつて解釈され、文
書データとしてRAM13に保存される。この文書データ
は、CPU11の制御により、CRT14に表示したり、プリンタ
(PRT)15等に出力することができる。また、既に作成
された文書情報或いは作成中の文書情報の1行の長さ
は、キーボード10より入力される。 2は文書入力部1より入力した文書データの行長を変
換する行長変換部で、文書入力部1のキーボード10より
入力された行長変換指示により、CPU11がその内容をCPU
21に送出する。これにより、CPU21はROM22に格納されて
いる制御プログラムを実行して、文書データの行の長さ
を指定された長さに変換することができる。こうして、
新たなレイアウトに変更された文書データは、文書出力
部3へ出力される。 文書出力部3では、行長変換部2よりの文書データ
(文字コードや制御コード)は、CPU31がROM32の制御プ
ログラムを実行することによつて解釈され、最終的な文
書データとしてRAM33に保存される。この文書データはC
RT34に表示出力したり、プリンタ35等により印刷出力す
ることができる。 なお、第1図では、各部がCPUとROMとで構成されるよ
うに説明したが、これに限定されるものでなく、CPU11
とCPU21とCPU31、ROM12とROM22とROM32、RAM13とRAM23
とRAM33、CRT14とCRT34、及びプリンタ15とプリンタ35
はそれぞれ共通であつても良く、或は第1図の如く分離
していても良い。 この実施例のワードプロセツサにおける文書データの
変換例を第4図に示す。 いま、第4図(A)に示す1行当たり25桁の文書デー
タが入力されたものとする。同図において、宛先社名
“ABC株式会社”及び宛名“山田 部長殿”は、左端か
らのスペース量を意識して左寄せでレイアウトされたも
のである。また、日付“90年1月5日”及び差出人名
“XYZ商事 横浜支社”は右端からのスペース量を意識
して右寄せでレイアウトされたものであると考えられ
る。従つて、宛先社名と日付との間、宛名の右側及び差
出人名の左側の各スペース量は、行の長さに応じて従属
的に決定されるものである。そこで文書の各行の長さを
変換する際に、これらの従属的なスペース量を変更する
ことにより、行の長さを変えることができれば、入力者
が意識したレイアウトを維持したままで、行長を変更し
て文書データを変換することができる。 このようにして処理された文書例を、第4図(B)
(C)に示す。第4図(B)は行長を25桁から30桁に伸
長した例を示し、第4図(C)は行長を25桁から20桁に
縮小した例を示す図である。このように、各行における
最も長いスペース部分を、従属的なスペースとみなすこ
とにより、行の長さを変更する際のレイアウトの崩れを
最小限にしている。以下、このような文書データの変換
動作について説明する。 <動作説明 (第5図)> 第5図は本実施例のワードプロセツサにおける文書デ
ータの1行の長さを変換する処理を示すフローチヤート
で、この処理を実行する制御プログラムは行長変換部2
のROM22に記憶されている。 まず、ステツプS1において、この行に含まれる連続す
るスペース長を検索し、連続するスペースのそれぞれの
長さを求める。その中から連続する最長のスペース長を
選択し、その位置と長さを記憶しておく。次にステツプ
S2に進み、変換前後の行の長さを比較し、変換後の行の
長さ(新行長)が変換前の行の長さ(旧行長)より長い
場合(行長が長く伸ばされる時)はステツプS3へ進む。
ステツプS3では、その行の最長スペースの直前に(新行
長−旧行長)に相当する長さのスペースを挿入する。こ
れによつて、行の長さが(新行長−旧行長)だけ長くな
り、この行長の変換処理が完了する。 一方、ステツプS2において、新行長が旧行長より短い
場合(行長が縮小される時)はステツプS4へ進む。ステ
ツプS4において、その行の最長スペースの長さが(旧行
長−新行長)より長い場合はステツプS5へ進み、その最
長スペースの長さから(旧行長−新行長)の長さ分のス
ペースを削除する。これによつて、行の長さが(旧行長
−新行長)だけ短くなり、この行の短縮変換が完了した
ことになる。 一方、ステツプS4において、最長スペースの長さが
(旧行長−新行長)以下であればステツプS6へ進む。ス
テツプS6において、最長スペースの長さが2以上であれ
ばステツプS7へ進み、最長スペースの長さを1スペース
分とする。次にステツプS8に進み、この行に対して本処
理を再帰的に実行することにより、スペースが連続する
次に長いスペース部分を削除する。 一方、ステツプS6において、最長スペースの長さが1
スペース以下であればステツプS9へ進む。ステツプS9で
は、もうこれ以上スペースを削除することができないの
で、従来例で説明したのと同じ方法により、行末の文字
列を次の行の行頭へ移動することによつて、行の長さを
指定された長さに変換する。 第6図は第5図のステツプS1で示された連続する最長
のスペースを検出する処理を詳しく示したフローチヤー
トである。 まず、ステツプS11において、現在の桁を示す変数j
を“0"(行の先頭)に初期化する。また、ステツプS12
では、最長のスペース長を示す変数s1を“0"に初期化す
る。次に、ステツプS13に進み、現在の桁jが、指定さ
れた行の桁数Jより小さければステツプS14へ進む。 ステツプS14では、その行の、jで指示される桁から
連続するスペースの長さsを求める。ステツプS15にお
いて、連続するスペースの長さsが最長スペースs1より
長いかどうかを判別して、長ければステツプS16に進ん
で、sを新たに最長スペースS1として記憶する。そし
て、ステツプS17において、現在の桁を示すjを最長ス
ペースの位置j1として記憶しておく。次にステツプS18
に進み、現在の桁jを、検出した連続するスペース長s
だけ進めるために、桁jに(s+1)を加えてステツプ
S13へ戻る。 また、ステツプS13において、現在の桁jが行の桁数
Jに達すると、その行の最終コードまで検査されたもの
として処理を終了する。 こうして、その行の連続する最長スペースの長さs1及
び、最長スペース位置j1が求められる。 第7図は第6図のステツプS14で示されたi行目のj
桁目より、連続するスペースの長さを求める処理を詳し
く示したフローチヤートである。この実施例では、簡単
のため、スペースコードによつてのみスペース量が発生
するとする。 まず、ステツプS21において、スペースの長さsを
“0"に初期化する。ステツプS22及びステツプS23におい
て、i行、(j+s)桁目の文字A(i,j+s)がスペ
ースコードならばステツプS24に進み、sを+1する。 そして、ステツプS22において、(j+s)桁目が行
の桁数Jに達する、即ち、その行の最終桁に到達する
か、ステツプS23でスペースコードでないときは処理を
終了する。 このようにして、その行における連続するスペースの
長さsが求められる。 以上述べたようにして、各行のスペースのうち最も長
い連続するスペースの長さを、その指定された行長に応
じて変更することによつて、文字列の配置のくずれを最
小限に留めて、行の長さを変更することができる。 なお、上記実施例では、スペース・コードのみを検出
して連続するスペース長を求めるように説明した。しか
し、このようなスペースは、改行記号やタブ記号等の制
御記号によつても発生するため、例えば、改行記号が存
在する場合は、改行記号以降、行末までをスペースコー
ドで埋め、またタブ記号が存在する場合は、タブ記号以
降、次のタブ位置までをスペースコードで埋めることに
より、前述と同様の方法で、連続する最長スペースの長
さを求めることができる。また、倍角スペースや半角ス
ペース等が存在する場合、それぞれ2文字分,1/2文字分
のスペースとして計算することにより、その行の最長ス
ペース長を求めることができる。 なお、特に、改行記号で終わる行の場合、従来の方法
では行末のスペース量が保存されないが(第3図(B)
参照)、本実施例によれば、行末のスペース量より長い
連続するスペースがその行中に存在すれば、例えば第4
図(B)に示すように、行末のスペースは保存されるの
で、例えば右寄せなどが維持された状態になり、文書の
レイアウトが保存されることなる。 以上説明したように本実施例によれば、指定された行
長に応じて、各行の中で連続する最長のスペース長を変
更することによつて、行長の変換を行う。これにより、
前後の行への文字列の移動を最小限に留めると共に、意
味のある連続するスペース部分を優先的に保存するの
で、行長変換前の文書データのレイアウト情報を崩さず
に、行の長さを変換できるという効果がある。
Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings. <Description of Configuration of Word Processor (FIG. 1)> FIG. 1 is a block diagram showing a schematic configuration of the word processor of this embodiment. In FIG. 1, reference numeral 1 denotes a document input unit for inputting document information. 10 is a keyboard (KBD), this keyboard 10
Character codes and control codes input from the
Are interpreted by a program in the ROM 12 executed by the CPU and stored in the RAM 13 as document data. This document data can be displayed on the CRT 14 or output to the printer (PRT) 15 or the like under the control of the CPU 11. The length of one line of the document information that has already been created or the document information that is being created is input from the keyboard 10. Reference numeral 2 denotes a line length conversion unit for converting the line length of the document data input from the document input unit 1. The line length conversion instruction input from the keyboard 10 of the document input unit 1 causes the CPU 11 to change the content.
Send to 21. Thereby, the CPU 21 can execute the control program stored in the ROM 22 and convert the line length of the document data to the designated length. Thus,
The document data changed to the new layout is output to the document output unit 3. In the document output unit 3, the document data (character codes and control codes) from the line length conversion unit 2 is interpreted by the CPU 31 executing the control program in the ROM 32, and is stored in the RAM 33 as final document data. You. This document data is C
It can be displayed on the RT 34 or printed out by the printer 35 or the like. In FIG. 1, each unit is described as including a CPU and a ROM. However, the present invention is not limited to this.
And CPU21 and CPU31, ROM12 and ROM22 and ROM32, RAM13 and RAM23
And RAM33, CRT14 and CRT34, and Printer 15 and Printer 35
May be common to each other, or may be separated as shown in FIG. FIG. 4 shows an example of conversion of document data in the word processor of this embodiment. Assume that document data of 25 digits per line shown in FIG. 4A has been input. In the figure, the destination company name "ABC Co., Ltd." and the address "Manager Yamada" are laid out left-justified in consideration of the amount of space from the left end. In addition, it is considered that the date “January 5, 1990” and the sender name “XYZ Shoji Yokohama Branch” were laid out right-justified in consideration of the amount of space from the right end. Therefore, the amount of space between the destination company name and the date, on the right side of the destination name and on the left side of the sender's name, is determined dependently on the line length. Therefore, when converting the length of each line of the document, if the length of the line can be changed by changing these subordinate space amounts, the line length can be changed while maintaining the layout conscious of the input user. Can be changed to convert the document data. FIG. 4 (B) shows a document example processed in this way.
It is shown in (C). FIG. 4 (B) shows an example in which the line length is extended from 25 digits to 30 digits, and FIG. 4 (C) shows an example in which the line length is reduced from 25 digits to 20 digits. In this manner, the longest space portion in each row is regarded as a subordinate space, thereby minimizing layout collapse when changing the length of the row. Hereinafter, such a document data conversion operation will be described. <Description of Operation (FIG. 5)> FIG. 5 is a flowchart showing a process of converting the length of one line of document data in the word processor of the present embodiment. The control program for executing this process is a line length conversion. Part 2
Is stored in the ROM22. First, in step S1, the length of continuous spaces included in this row is searched, and the length of each continuous space is determined. The longest continuous space length is selected from these, and its position and length are stored. Then step
Go to S2, compare the line length before and after conversion, if the line length after conversion (new line length) is longer than the line length before conversion (old line length) (line length is extended longer Time) proceeds to step S3.
In step S3, a space having a length corresponding to (new line length-old line length) is inserted immediately before the longest space of the line. As a result, the line length is increased by (new line length−old line length), and the conversion processing of this line length is completed. On the other hand, in step S2, if the new line length is shorter than the old line length (when the line length is reduced), the process proceeds to step S4. In step S4, if the length of the longest space of the line is longer than (old line length-new line length), the process proceeds to step S5, and from the length of the longest space, the length of (old line length-new line length) Remove minute space. As a result, the line length is shortened by (old line length−new line length), and the shortened conversion of this line is completed. On the other hand, if the length of the longest space is equal to or less than (old line length−new line length) in step S4, the process proceeds to step S6. In step S6, if the length of the longest space is 2 or more, the process proceeds to step S7, and the length of the longest space is set to one space. Next, the process proceeds to step S8, and the process is recursively executed on this line, thereby deleting the next longest space portion where the space is continuous. On the other hand, in step S6, the length of the longest space is 1
If it is less than the space, the process proceeds to step S9. In step S9, it is not possible to delete any more spaces, so by moving the character string at the end of the line to the beginning of the next line in the same manner as described in the conventional example, the length of the line is reduced. Convert to the specified length. FIG. 6 is a flowchart showing in detail the processing for detecting the longest continuous space shown in step S1 of FIG. First, in step S11, a variable j indicating the current digit is set.
Is initialized to “0” (the beginning of the line). Step S12
Then, a variable s1 indicating the longest space length is initialized to “0”. Next, the process proceeds to step S13, and if the current digit j is smaller than the number J of the designated line, the process proceeds to step S14. In step S14, the length s of the continuous space from the digit indicated by j in the line is determined. In step S15, it is determined whether or not the length s of the continuous space is longer than the longest space s1, and if it is longer, the process proceeds to step S16, and s is newly stored as the longest space S1. Then, in step S17, j indicating the current digit is stored as the position j1 of the longest space. Next, step S18
To the current digit j and the detected continuous space length s
Add (s + 1) to digit j to advance
Return to S13. Further, in step S13, when the current digit j reaches the digit number J of the line, the processing is terminated assuming that the last code of the line has been checked. Thus, the length s1 of the longest continuous space in the row and the longest space position j1 are obtained. FIG. 7 shows j of the i-th row shown in step S14 of FIG.
This is a flowchart showing in detail a process for obtaining the length of a continuous space from the first digit. In this embodiment, for simplicity, it is assumed that the space amount is generated only by the space code. First, in step S21, the length s of the space is initialized to "0". In steps S22 and S23, if the character A (i, j + s) at the i-th row and the (j + s) -th digit is a space code, the process proceeds to step S24, and s is incremented by one. Then, in step S22, if the (j + s) th digit reaches the digit number J of the row, that is, reaches the last digit of the row, or if it is not a space code in step S23, the process is terminated. In this way, the length s of the continuous space in the row is obtained. As described above, by changing the length of the longest continuous space among the spaces on each line according to the specified line length, the dislocation of the character string can be minimized. , Line length can be changed. In the above embodiment, the description has been made such that only the space code is detected and the continuous space length is obtained. However, since such a space is also generated by a control symbol such as a line feed symbol or a tab symbol, for example, when a line feed symbol is present, the space after the line feed symbol to the end of the line is filled with a space code, and a tab symbol is used. Exists, the space after the tab symbol and up to the next tab position is filled with a space code, whereby the length of the longest continuous space can be obtained in the same manner as described above. When a double-width space, a half-width space, or the like exists, the longest space length of the line can be obtained by calculating the space for two characters and the space for half a character. In particular, in the case of a line ending with a line feed symbol, the space amount at the end of the line is not preserved by the conventional method (FIG. 3B).
According to this embodiment, if a continuous space longer than the space amount at the end of the line exists in the line, for example, the fourth
As shown in FIG. 2B, the space at the end of the line is saved, so that, for example, the right alignment is maintained, and the layout of the document is saved. As described above, according to this embodiment, the line length is converted by changing the longest continuous space length in each line according to the designated line length. This allows
Since the movement of character strings to the previous and next lines is kept to a minimum, and meaningful continuous space parts are saved with priority, the line length is maintained without breaking the layout information of the document data before line length conversion. Has the effect that it can be converted.

【発明の効果】【The invention's effect】

以上説明したように本発明によれば、元の文書フオー
マツトを生かした形で、その文書情報の行長を指示され
た行長に変換できる効果がある。
As described above, according to the present invention, there is an effect that the line length of the document information can be converted to the specified line length while utilizing the original document format.

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

第1図は本実施例のワードプロセツサの概略構成を示す
ブロツク図、 第2図(A)〜(C)及び第3図(A)〜(C)は従来
例による行長変換の実行結果を示した図、 第4図(A)〜(C)は本実施例のワードプロセツサに
おける行長変換の実行結果を説明するための図、 第5図は本実施例のワードプロセツサにおける文書1行
における行長変換処理を示したフローチヤート、 第6図は第5図のステツプS1の最長のスペースを検出す
る処理を示したフローチヤート、そして 第7図は第6図のステツプS14の連続するスペース長を
求める処理を示したフローチヤートである。 図中、1……文書入力部、2……行長変換部、3……文
書出力部、10……キーボード(KBD)、11,21,31……CP
U、12,22,32……ROM、13,23,33……RAM、14,34……CR
T、15,35……プリンタ(PRT)である。
FIG. 1 is a block diagram showing a schematic configuration of a word processor according to this embodiment. FIGS. 2 (A) to 2 (C) and 3 (A) to 3 (C) show execution results of a line length conversion according to a conventional example. FIGS. 4 (A) to 4 (C) are diagrams for explaining the execution result of the line length conversion in the word processor of the present embodiment, and FIG. 5 is a document in the word processor of the present embodiment. FIG. 6 is a flow chart showing the processing for detecting the longest space of step S1 in FIG. 5, and FIG. 7 is a flow chart showing the processing for detecting the longest space in step S1 in FIG. 5 is a flowchart illustrating a process of obtaining a space length to be performed. In the figure, 1 ... document input unit, 2 ... line length conversion unit, 3 ... document output unit, 10 ... keyboard (KBD), 11,21,31 ... CP
U, 12, 22, 32 …… ROM, 13,23,33 …… RAM, 14,34 …… CR
T, 15, 35 ... Printer (PRT).

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 平1−134560(JP,A) 特開 昭60−175089(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 17/21 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-1-134560 (JP, A) JP-A-60-175089 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 17/21

Claims (10)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】1行当りの文字数を示す第1の行長に基づ
いて作成された文書情報の行長の変換後の行長である第
2の行長を指定する行長指定手段と、 前記文書情報の各行における最長の連続スペース長を求
める最長スペース検出手段と、 前記行長指定手段により指定された前記第2の行長と前
記第1の行長との差分量に基づいて前記最長の連続スペ
ース長の変更量を求めて前記最長の連続スペース長を変
換する変換手段と、 を有することを特徴とする文書処理装置。
1. Line length designating means for designating a second line length, which is a line length after conversion of the line length of document information created based on a first line length indicating the number of characters per line; A longest space detecting unit for obtaining a longest continuous space length in each line of the document information; and a longest space based on a difference amount between the second line length and the first line length specified by the line length specifying unit. A conversion unit that calculates the amount of change in the continuous space length and converts the longest continuous space length.
【請求項2】前記第1の行長より前記第2の行長の方が
長い場合、前記変換手段は、前記最長スペース検出手段
で検出した最長の連続スペース長に前記変更量を加算し
て前記最長の連続スペース長を変換することを特徴とす
る請求項1に記載の文書処理装置。
2. When the second line length is longer than the first line length, the conversion means adds the change amount to the longest continuous space length detected by the longest space detection means. 2. The document processing apparatus according to claim 1, wherein the longest continuous space length is converted.
【請求項3】前記第1の行長より前記第2の行長の方が
短い場合において、前記最長の連続スペース長が前記差
分量より長い場合、前記変換手段は、前記最長スペース
検出手段で検出した最良の連続スペース長から前記差分
量を減算することによって前記最長の連続スペース長を
変換することを特徴とする請求項1に記載の文書処理装
置。
3. When the second continuous line length is shorter than the first continuous line length, and when the longest continuous space length is longer than the difference amount, the conversion means includes a first longest space detection means. The document processing apparatus according to claim 1, wherein the longest continuous space length is converted by subtracting the difference amount from the detected best continuous space length.
【請求項4】前記第1の行長より前記第2の行長の方が
短い場合において、前記最長の連続スペース長が前記差
分量より短く、かつ前記最長のスペース長が2以上の場
合、前記変換手段は、前記最長の連続スペース長を1と
し、前記最長スペース検出手段による最長の連続スペー
ス長の検出と前記変換手段による最長の連続スペース長
の変換とを繰返すことにより行長を調整することを特徴
とする請求項1に記載の文書処理装置。
4. When the second line length is shorter than the first line length, the longest continuous space length is shorter than the difference amount and the longest space length is 2 or more. The conversion unit adjusts the line length by setting the longest continuous space length to 1 and repeating the detection of the longest continuous space length by the longest space detection unit and the conversion of the longest continuous space length by the conversion unit. The document processing apparatus according to claim 1, wherein:
【請求項5】前記第1の行長より前記第2の行長の方が
短い場合において、前記最長の連続スペース長が1以下
の場合、当該行の行末から前記差分量に相当する数の文
字を当該行の次の行へ移動する移動手段を更に有するこ
とを特徴とする請求項1に記載の文書処理装置。
5. In a case where the second line length is shorter than the first line length, and when the longest continuous space length is 1 or less, a number corresponding to the difference amount from the end of the line of the line is used. 2. The document processing apparatus according to claim 1, further comprising moving means for moving a character to a line following the line.
【請求項6】少なくとも入力部、表示部及びメモリを有
し、文書データを処理する文書処理装置による文書処理
方法であって、 1行当りの文字数を示す第1の行長に基づいて、作成さ
れ前記メモリに記憶された文書情報を前記表示部に表示
する表示工程と、 前記入力部における入力に応じて、前記表示部に表示さ
れている前記文書情報の1行当りの文字数を示す第1の
行長を第2の行長に変更すべく指定する行長指定工程
と、 前記メモリに記憶された前記文書情報の各行における最
長の連続スペース長を求める最長スペース検出工程と、 前記行長指定工程で指定された前記第2の行長と前記第
1の行長との差分量に基づいて前記最長の連続スペース
長の変更量を求めて前記最長の連続スペース長を変換す
る変換工程と、 前記メモリに記憶された文書情報を、前記変換工程で変
換した前記最長の連続スペース長に基づいて作成された
文書情報に変更して前記表示部に表示する表示変更工程
と、 を有することを特徴とする文書処理方法。
6. A document processing method for a document processing apparatus having at least an input unit, a display unit, and a memory, and processing document data, wherein the document processing method is based on a first line length indicating the number of characters per line. A display step of displaying the document information stored in the memory on the display unit; and a first step of displaying the number of characters per line of the document information displayed on the display unit in response to an input on the input unit. A line length designating step of designating the line length of the document information to be changed to a second line length; a longest space detecting step of finding a longest continuous space length in each line of the document information stored in the memory; A conversion step of calculating a change amount of the longest continuous space length based on a difference amount between the second line length and the first line length specified in the step, and converting the longest continuous space length; Stored in the memory And a display changing step of changing the converted document information into document information created based on the longest continuous space length converted in the conversion step and displaying the document information on the display unit. Method.
【請求項7】前記変換工程では、前記第1の行長より前
記第2の行長の方が長い場合、前記最長スペース検出工
程で検出した最長のスペース長に前記変更量を加算して
前記最長の連続スペース長を更新することを特徴とする
請求項6に記載の文書処理方法。
7. In the converting step, when the second line length is longer than the first line length, the change amount is added to a longest space length detected in the longest space detecting step to add the change amount. 7. The document processing method according to claim 6, wherein the longest continuous space length is updated.
【請求項8】前記変換工程では、前記第1の行長より前
記第2の行長の方が短い場合において、前記最長の連続
スペースが前記差分量より長い場合、前記最長スペース
検出工程で検出した前記最長の連続スペース長から前記
差分量を減算することによって前記最長の連続スペース
長を変更することを特徴とする請求項6に記載の文書処
理方法。
8. In the conversion step, when the second line length is shorter than the first line length, and when the longest continuous space is longer than the difference amount, the longest space detection step detects the longest continuous space. 7. The document processing method according to claim 6, wherein the longest continuous space length is changed by subtracting the difference amount from the longest continuous space length.
【請求項9】前記第1の行長より前記第2の行長の方が
短い場合において、前記最長の連続スペース長が前記差
分量より短く、かつ前記最長の連続スペース長が2以上
の場合、前記変更工程では、前記最長の連続スペース長
を1とし、前記最長スペース検出工程による最長の連続
スペース長の検出と前記変換工程による最長の連続スペ
ース長の変換とを繰返すことにより前記文書情報の行長
を調整することを特徴とする請求項6に記載の文書処理
方法。
9. When the second line length is shorter than the first line length, the longest continuous space length is shorter than the difference amount, and the longest continuous space length is 2 or more. In the changing step, the longest continuous space length is set to 1, and the detection of the longest continuous space length in the longest space detecting step and the conversion of the longest continuous space length in the converting step are repeated to thereby obtain the document information. 7. The document processing method according to claim 6, wherein the line length is adjusted.
【請求項10】前記第1の行長より前記第2の行長の方
が短い場合において、前記最長の連続スペース長が1以
下の場合、当該行の行末から前記差分量に相当する数の
文字を当該行の次の行へ移動する移動工程を更に有する
ことを特徴とする請求項7に記載の文書処理方法。
10. When the second line length is shorter than the first line length, and when the longest continuous space length is 1 or less, a number corresponding to the difference amount from the line end of the line is 8. The document processing method according to claim 7, further comprising a moving step of moving a character to a line next to the line.
JP02232457A 1990-09-04 1990-09-04 Document processing method and apparatus Expired - Fee Related JP3129427B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP02232457A JP3129427B2 (en) 1990-09-04 1990-09-04 Document processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP02232457A JP3129427B2 (en) 1990-09-04 1990-09-04 Document processing method and apparatus

Publications (2)

Publication Number Publication Date
JPH04113453A JPH04113453A (en) 1992-04-14
JP3129427B2 true JP3129427B2 (en) 2001-01-29

Family

ID=16939591

Family Applications (1)

Application Number Title Priority Date Filing Date
JP02232457A Expired - Fee Related JP3129427B2 (en) 1990-09-04 1990-09-04 Document processing method and apparatus

Country Status (1)

Country Link
JP (1) JP3129427B2 (en)

Also Published As

Publication number Publication date
JPH04113453A (en) 1992-04-14

Similar Documents

Publication Publication Date Title
JP3129427B2 (en) Document processing method and apparatus
JP2959473B2 (en) Document processing device
JPH032964A (en) Document data processor
JP3443239B2 (en) Character processor
JPS5819936A (en) Kanji (chinese character) input device
JP3052339B2 (en) Document data processing device
JPS6365988B2 (en)
JP2798076B2 (en) String output device
JP3497263B2 (en) Method and apparatus for generating fixed format document from marked document
JP3402759B2 (en) Document processing apparatus and document processing method
JP2959490B2 (en) String addition method
JP2655900B2 (en) Character processor
JPH0666066B2 (en) Document processor with furigana addition function
JPH0750480B2 (en) Text data editing device
JP3104655B2 (en) Document data processing device
JP2864418B2 (en) Document processing device
JPH0731315Y2 (en) Electronics
JPH0193857A (en) Document printer
JPH0746356B2 (en) Kana-Kanji conversion device
JPH0512267A (en) Automatic paragraphing system
JPH086941A (en) Document preparing device
JPH06203031A (en) Character input device
JPH0743715B2 (en) Document processor
JPS5816328A (en) Japanese word processor
JPS60104373A (en) Character processor

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081117

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20081117

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20091117

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees