2
Behavior Research Methods & Instrumentation 1976, Vol. 8 (4),401·402 A generalized computer program for editing narrative text JOHN D. MORRIS and LINDA A. MORRIS Georgia Southern College Statesboro, Georgia 30458 Some attention and effort have been devoted to the computer storage and retrieval of narrative information for purposes ranging from the production of output diagnostic of a subject's score profile on attitudinal or personality measures (Myers, 1962; Guertin, Litcher, Hedges, & Wilson, 1975) to storing clinical interview material in narrative form (Danskin, Unger, & Kennedy, 1970). In the former case, the narrative data must be stored in memory and, upon consideration of each component of a subject's score vector, appropriate diagnostic narrative paragraphs can be retrieved and out- put. This procedure has the advantage of a standardized interpretation by a clinical specialist (usually the test author and/or those consorting with the author). With only the score profile and scale names, the interpreting counselor or the subject may make vast interpretive errors. Accordingly, the purpose of this paper is to describe a computer program which will read in alpha- meric narrative text and edit it to a specified left- and right-justified line length and also code and punch FORTRAN "DATA" statements containing the edited output. The narrative text could then be compiled by a scoring program and sections would be selected and output diagnostic of a subject's score profile. Alterna- tively, scoring could be accomplished independently and a purely interpretive program could be built based on these DATA statements. Program procedure. The narrative text is read from the desired input unit with a desired record length. Right justification is accomplished by inserting blanks into positions selected by the following algorithm setting position priorities. If there is a period in the line with only one blank after it, a blank is first inserted after that period. If no period is found, a blank is inserted after any comma with only one blank following it. In order to facilitate readability and appearance, remaining blanks are inserted between words, beginning from the end of the line, with the most nonblank characters. After extra blanks are inserted between all the words in the line, the "character density" is recalculated and the blank insertion begins from the appropriate end of the line. When the line is right justified, the algorithm stops and edits a new line. In addition, the program provides for a character to signify the premature end of an input record. This is necessary in inserting records or parts This study was supported in part by a Georgia Southern College Faculty Research Grant. of records into the input me. A paragraph end character is input which signals the algorithm to bypass right justification, ending the paragraph in normal text form. A character can be entered which insures the occurrence of a blank. This is useful in paragraph indentation or centering headings. Also, the user can enter a character signifying a possible syllabication split. This is useful if the text contains large words and is to be output in relatively short lines. Whenever a word appears to be so long that it might cause excessive blanks in right justification, the syllabication character can be entered between syllables. The algorithm will split the word with a hyphen if it appears at the end of an edited line and the split is necessary; otherwise, the syllabication characters are deleted. FORTRAN DATA statements are coded and punched, manifesting the edited text. These statements are output in a continuous stream of 680 four-character word vectors (constituting the allowable FORTRAN 19 continuation statements). The names of the vectors are an input alphabetic character plus the sequential vector number. Noting where the diagnostic segments of the text begin and end, the user can compile these vectors into a large matrix and select the appropriate segments through the indices of the words. Input. The user must enter a variable format for reading alphameric text records, the number of records to be edited, the number of characters per record, the line length desired for output (must be a multiple of four), the character the user wishes to specify a pre- maturely ending input record, the character entered when a blank is specifically desired, the character signifying the end of a paragraph, and the character desired for the alphameric portion of the output DATA statement vector's name. If a blank is entered, no DATA statements will be generated, with the program yielding only the edited printed text. Output. The left- and right-justified text is printed along with the line numbers and serial number of the four character words contained on each line. It has been found advantageous to iteratively refme the narrative descriptions through a jury method before actually punching the DATA statements. Also of use at this point is the premature end of a record character, allow- ing the user to change, insert, or delete sections of text without affecting adjacent portions of the text. After satisfaction with the text has been achieved, the user can produce FORTRAN DATA statements which would be compiled into the narrative text when incorporated into a scoring or interpretive program. The DATA statements are each composed of 680 four- character words coded in a Hollerith format, with the vector name being composed of the desired alpha character and the sequential number of the vector. Computer and Language. This FORTRAN IV pro- 401

A generalized computer program for editing narrative text

Embed Size (px)

Citation preview

Behavior Research Methods & Instrumentation1976, Vol. 8 (4),401·402

A generalized computer programfor editing narrative text

JOHN D. MORRIS and LINDA A. MORRISGeorgia Southern College

Statesboro, Georgia 30458

Some attention and effort have been devoted to thecomputer storage and retrieval of narrative informationfor purposes ranging from the production of outputdiagnostic of a subject's score profile on attitudinal orpersonality measures (Myers, 1962; Guertin, Litcher,Hedges, & Wilson, 1975) to storing clinical interviewmaterial in narrative form (Danskin, Unger, & Kennedy,1970). In the former case, the narrative data must bestored in memory and, upon consideration of eachcomponent of a subject's score vector, appropriatediagnostic narrative paragraphs can be retrieved and out­put. This procedure has the advantage of a standardizedinterpretation by a clinical specialist (usually the testauthor and/or those consorting with the author). Withonly the score profile and scale names, the interpretingcounselor or the subject may make vast interpretiveerrors. Accordingly, the purpose of this paper is todescribe a computer program which will read in alpha­meric narrative text and edit it to a specified left- andright-justified line length and also code and punchFORTRAN "DATA" statements containing the editedoutput. The narrative text could then be compiled bya scoring program and sections would be selected andoutput diagnostic of a subject's score profile. Alterna­tively, scoring could be accomplished independently anda purely interpretive program could be built based onthese DATA statements.

Program procedure. The narrative text is read fromthe desired input unit with a desired record length. Rightjustification is accomplished by inserting blanks intopositions selected by the following algorithm settingposition priorities. If there is a period in the line withonly one blank after it, a blank is first inserted after thatperiod. If no period is found, a blank is inserted afterany comma with only one blank following it. In orderto facilitate readability and appearance, remainingblanks are inserted between words, beginning from theend of the line, with the most nonblank characters.After extra blanks are inserted between all the words inthe line, the "character density" is recalculated and theblank insertion begins from the appropriate end of theline. When the line is right justified, the algorithm stopsand edits a new line. In addition, the program providesfor a character to signify the premature end of an inputrecord. This is necessary in inserting records or parts

This study was supported in part by a Georgia SouthernCollege Faculty Research Grant.

of records into the input me. A paragraph end characteris input which signals the algorithm to bypass rightjustification, ending the paragraph in normal text form.A character can be entered which insures the occurrenceof a blank. This is useful in paragraph indentation orcentering headings. Also, the user can enter a charactersignifying a possible syllabication split. This is useful ifthe text contains large words and is to be output inrelatively short lines. Whenever a word appears to beso long that it might cause excessive blanks in rightjustification, the syllabication character can be enteredbetween syllables. The algorithm will split the wordwith a hyphen if it appears at the end of an edited lineand the split is necessary; otherwise, the syllabicationcharacters are deleted.

FORTRAN DATA statements are coded andpunched, manifesting the edited text. These statementsare output in a continuous stream of 680 four-characterword vectors (constituting the allowable FORTRAN 19continuation statements). The names of the vectors arean input alphabetic character plus the sequential vectornumber. Noting where the diagnostic segments of thetext begin and end, the user can compile these vectorsinto a large matrix and select the appropriate segmentsthrough the indices of the words.

Input. The user must enter a variable format forreading alphameric text records, the number of recordsto be edited, the number of characters per record, theline length desired for output (must be a multiple offour), the character the user wishes to specify a pre­maturely ending input record, the character enteredwhen a blank is specifically desired, the charactersignifying the end of a paragraph, and the characterdesired for the alphameric portion of the output DATAstatement vector's name. If a blank is entered, no DATAstatements will be generated, with the program yieldingonly the edited printed text.

Output. The left- and right-justified text is printedalong with the line numbers and serial number of thefour character words contained on each line. It has beenfound advantageous to iteratively refme the narrativedescriptions through a jury method before actuallypunching the DATA statements. Also of use at thispoint is the premature end of a record character, allow­ing the user to change, insert, or delete sections of textwithout affecting adjacent portions of the text.

After satisfaction with the text has been achieved,the user can produce FORTRAN DATA statementswhich would be compiled into the narrative text whenincorporated into a scoring or interpretive program. TheDATA statements are each composed of 680 four­character words coded in a Hollerith format, with thevector name being composed of the desired alphacharacter and the sequential number of the vector.

Computer and Language. This FORTRAN IV pro-

401

402 MORRIS AND MORRIS

gram is in use both on a CDC CYBER 74, in both batchand interactive modes, and on an IBM 370/165.

Availability. The program, with complete documen­tation and sample input and output illustrating theoptions described, is available at no cost on requestfrom the senior author at the Department of SchoolServices, Box 8143, Georgia Southern College,Statesboro, Georgia 30458.

REFERENCES

DANSKlN. D. G.. UNGER. B.. & KENNEDY. C. E. Adapting thecomputer for narrative material: A progress report. Journalq( Counseling Psychology. 1970. 17. 63-66.

GUERTlN. W. H •• LITCHER. J. H •• HEDGES, W. D.• & WILSON.J. T. Multidimensional assessment ofphilosophy of education.Gainesville, F1: Parauniversity Resources. 1975.

MYERS. I. B. Manual: The Myers-Briggs type indicator.Princeton: Educational Testing Service. 1962.