Project Report: ACTORS
Computing Dramatic Characters
that are on Stage Simultaneously

by
Eric Johnson

Published in Computers and the Humanities, 28.6(December, 1994-1995), 393-400.

"Now name the rest of the players"
-- Midsummer Night's Dream
Abstract: The ACTORS computer program processes the electronic text of a play, and, based on entrance-and-exit stage directions, it provides information about which characters are on stage simultaneously; such information can inform dramatic performances, and it can indicate errors and omissions in the text. Based on a table indexed for each character showing which characters appear on stage at least once with the indexed character and on a table showing which characters never appear on stage with the indexed character, possible doubling can be calculated for a production, often with the minimum number of actors.

Key words: electronic texts, drama, characters, doubling, SNOBOL4, SPITBOL.

Introduction

A literary researcher or dramaturge may find it significant as well as interesting to know which characters in a play are on stage at the same time, and which are not. For a director of a production of a play, such information is the basis of possible doubling of roles for actors; it can provide essential practical knowledge needed for casting and costuming. Detailed data about which characters are on stage are provided by a computer program created by this writer called ACTORS -- an acronym based on Actors Computed To be on stage (OR not) Simultaneously. More specifically, ACTORS gives three kinds of information:

  1. listings of the characters that are on stage simultaneously -- generated each time there is an entrance or exit -- identified by act, scene, and beginning line number (Figure 1 is an example);
  2. a table indexed for each character showing which characters appear on stage at least once with the indexed character; and the converse: a table showing which characters never appear on stage with the indexed character (see Figure 2 and Figure 3);
  3. a listing of possible doubling of roles for a performance of a play (see Figure 4 and Figure 5).
      ACTORS is a three-part computer program written in SPITBOL, a high-performance implementation of the SNOBOL4 computer language (see note 1. The output of the three program parts corresponds to the three kinds of information listed just above. The first part of the program uses as input a play in electronic form that contains unique identifications of characters' entrances and exits, and contains unique tags holding the current act, scene, and line numbers. The second and third parts of ACTORS use output of the first part as their input.

Processing the Text

      ACTORS starts its analysis by advancing through the text line by line; it identifies entrances and exits, and it uses that information to calculate which characters are on stage simultaneously. The program uses patterns especially constructed to isolate stage directions that give information about entrances and exits of characters (see note 2). Each time a character enters or exits the stage, a listing of the characters currently on stage is generated along with the act, scene, and line numbers and a count of required actors (see note 3). A portion of the output for Act 3, Scene 2 of Hamlet is shown in Figure 1.

      During the performance of "The Mousetrap," the play within the play in Act 3, Scene 2, of Hamlet starting at line 130, fifteen actors are required (they are shown in Figure 1). It so happens that fifteen is the maximum number of characters on stage simultaneously at any time in Hamlet. Here, as elsewhere in a play like Hamlet, a "character" like "Lords" is counted as one character, but more than one actor might, of course, be used in a particular production.

      The stage directions in the text that indicate characters' entrances and exits are extremely important since the analysis of ACTORS is based on them. The stage directions indicate that Horatio remains on stage with Hamlet following the conclusion of "The Mousetrap" (Act 3, Scene 2, following line 258), and there is no indicated exit for Horatio before the end of scene two. Therefore, Horatio is on stage during Hamlet's famous speech about "the very witching time of night" (Act 3, Scene 2, starting at line 376) although that speech sounds very much like a soliloquy.

      At some points, a researcher may feel compelled to make minor changes in the stage directions in the text. For example, at line 331 of act 3, scene 2, of Hamlet, a stage direction says "{Enter one with a recorder}." In order for ACTORS to properly tabulate that entrance, a small change was made in the text: the character's name was spelled with an initial upper-case letter and with no internal spaces; in addition, two lower-case letters were changed to upper-case letters in order to make the name more recognizable to the user: "{Enter OneWithRecorder}." This is a rather trivial change in the text that will assure that the program will identify the character's entrance and provide readable output. The presence of OneWithRecorder in this scene raises other questions because, in the text analyzed, there is no stage direction telling of the exit of this recorder bearer before the end of the scene. It is interesting, but really unlikely, that Horatio listens to Hamlet speak about "the very witching time of night," but it would seem ridiculous that the OneWithRecorder would listen. Is this character too far from Hamlet to hear what he says? Does this character softly play the recorder while Hamlet speaks? Has a stage direction indicating an exit been omitted in this text? Basing his decision on other texts of the play, this researcher inserted an exit for the OneWithRecorder two lines after the entrance.

      These kinds of issues demonstrate one of the values of ACTORS: it identifies with rigorous literalness who is on stage simultaneously based on the stage directions in the text. It can therefore point out interesting performance possibilities, and it can also indicate errors or omissions in the text.

Tables Indexed for Each Character

      It is difficult to form generalizations about all the characters that are on stage together at least once in a play (or about those who are never on stage at the same time) from the multi- part listings of ACTORS generated each time there is an entrance or exit (shown in Figure 1). Therefore, ACTORS processes these multi-part listings in order to construct tables indexed by each character that appears in a play. See Figure 2.

      ACTORS builds an array and a table to process the multi-part listings (see note 4). The array is filled with names of characters as they appear on stage. The table is indexed by one after another of the characters from the array, and it is filled with the names of characters on stage simultaneously with the indexed character. Duplicate names are, of course, removed.

      Using the array and table, it is fairly straight-forward to build another table that is indexed by each character and holds the names of characters never appearing on stage with the indexed character. Using the complete list of characters in the array, a name was added to the never-on-stage table if it was not in the table of those who were (at least once) on stage with the indexed character. Thus, the names for a particular indexed character that appear in Figure 2 do not appear for that indexed character in Figure 3; all characters in a play will appear indexed by a given character in one or the other tables.

Doubling

      The most complex algorithms of ACTORS are in the third part that computes possible doubling (multiple casting) of roles for each actor for a production of a play. It is assumed that an actor can be cast in any number of characters' roles as long as none of the characters are on stage simultaneously. Given the information (shown in Figure 2 and in Figure 3) about which characters are and are not on stage simultaneously, it certainly seems possible to calculate the smallest number of actors that can perform all of the roles. However, it is not obvious how to proceed with the calculations. The program could start with the maximum number of actors (one for each character) and then eliminate one actor after another as doubling was determined to be possible, or the program could start with one actor and add others as necessary when doubling was found to be impossible. Either procedure seemed to require vast numbers of computer iterations.

      The first part of ACTORS calculates the largest number of characters that are on stage at any time, and it lists those characters (see the list of fifteen characters in act 3, scene 2, of Hamlet starting at line 130 in Figure 1). That is an ideal starting point for calculation of possible doubling: there is no point in attempting to compute whether fewer than fifteen actors could perform the play since that is clearly impossible, and, of course, it would be senseless to attempt to determine whether an actor can play more than one of these fifteen characters.

      Thus the third part of ACTORS starts with a listing of the largest number of characters on stage. By consulting a table holding the characters that do not appear on stage simultaneously, the program attempts to determine if actors playing the characters in the largest scene can be multiple cast to perform additional roles in the play. An array of numbered actors holds the names of characters for which each actor can be cast. As the characters are thus assigned to an actor, an entry of "yes" is made in a casting table containing all of the characters in the play. When each character in the casting table has been assigned a "yes," the program is finished and the listing of possible doubling of roles is printed (see Figure 4).

      If ACTORS is processing Hamlet, the array of numbered actors will first be filled with the names of the fifteen characters in act 3, scene 2, starting at line 130 (since this is the largest number of characters on stage simultaneously). The program will then determine which additional roles can be performed by each of the fifteen actors. It will select a character from a complete list and (1) test whether this character is already assigned to an actor and, if not, (2) it will test whether the character ever appears on stage with any character assigned to actor one; if so, then another character is selected for testing, but if not, the character is assigned to actor one. The program continues in this manner until as many characters as possible are assigned to the first actor, and then it moves to actor two and performs the same series of tests and assignments. When assignments are made for actor fifteen, the program checks the casting table to determine whether all characters have been assigned to an actor. If so (and this is the case with Hamlet), the program prints the output and ends. The output will indicate that the doubling is for a performance with the minimum number of actors. If characters remain to be cast when the fifteenth actor's assignments are made, the current version of ACTORS simply adds actors and assigns characters to them until all characters are cast. In this case, the output does not state that the doubling was calculated for the minimum number of actors -- although it may be the minimum number.

      A university theatre director told this writer that the doubling for Hamlet shown in Figure 4 would be very unusual for a serious modern production; she said that a woman would be cast in the role of Gertrude, and she would certainly not also be cast as the Captain and Francisco. ACTORS allows the user to specify which roles are to be performed by a male, which by a female, and which may be performed by either a male or female. Figure 5 shows the output when the roles of Gertrude, Ophelia, the PlayerQueen, and Prologue are cast as female and all others as male.

Future Versions of ACTORS

      Many plays can easily be cast using no more actors than appear in the largest scene, and therefore ACTORS should usually be able to assign all characters to the minimum number of actors. Nevertheless, ACTORS could test to make sure that no combination of doubling is possible before adding actors. When it finds that characters remain unassigned, the program could shuffle the order of the original assignments and start the process anew. It could also shuffle the order of the assignment of additional characters to the actors. If the program were to always calculate the minimum number of actors for a performance, an additional actor would be added only when all combinations of shuffling the original assignments and the order in which characters are added do not result in all characters being assigned to actors. However, the execution time of a program that thus examines all combinations of doubling for a large-cast play will be vastly greater than the present version of the program, and it will almost certainly be unacceptably slow on present-day computing hardware.

      As Figure 4 and Figure 5 show, ACTORS sometimes proposes rather unbalanced doublings: actor 1 is cast in eight roles while many of the other actors are cast in only one or two roles. The program could be modified to make doubling more uniform, but perhaps lopsided casting is exactly what a director wants (actor 13 or 15 could also be the stage manager). Possibly the user could be given the option of selecting uniform or lopsided doubling.

      It would be possible to add algorithms to the program so that it counts the number of lines between appearances of characters on stage, and casts as actor in two roles only if the exit of one character and the entrance of the other are separated by, say, at least fifty lines -- in order to allow time for costume changes. Also, the program could calculate the number of lines of dialogue assigned to each character, and the number of scenes in which the character appears, and thereby determine the major and minor characters.

      At present, ACTORS runs only on microcomputers with DOS or Windows. It could be recompiled to run as an OS/2 application. Since SPITBOL code is relatively portable, only minor changes would be needed to run the program on Macintosh and some Unix and mainframe systems.

Conclusion

      Significant numbers of literary works are currently available in electronic versions, and publishers, organizations, and individuals are increasingly making additional works accessible. Therefore, ACTORS and similar computer programs can be used increasingly to provide analyses of texts available in electronic versions.

      ACTORS was designed as a tool to process the electronic text of a play in order to tell which dramatic characters are on stage simultaneously, and thus to suggest possible doubling of roles for a performance. Additional literary or dramatic insights might be gained by researchers' noting which characters are on stage together, when, and how often. The program can probably be used to document a character's role in ways its creator never imagined.


Eric Johnson is a former Editor of TEXT Technology. He has published many articles and reviews about computers, writing, and literary study. He is Dean of the College of Liberal Arts at Dakota State University.


Notes
  1. The ACTORS program was written to use the SPITBOL-386 compiler from Catspaw, Inc. It was developed and tested on an MS-DOS microcomputer with a 486 processor running at 25 Mhz with 16 MB of RAM (although 640 KB of RAM is sufficient for the analysis of plays no more complex than Hamlet).
  2. ACTORS was designed to read the text of the Electronic Edition of William Shakespeare: The Complete Works, ed. Stanley Wells and Gary Taylor (Oxford University Press, 1989). The program could be used with other electronic texts, but it may require changes in the patterns used to recognize stage directions (entrances and exits) and the patterns used to recognize the numbers of acts, scenes, and lines.

  3.  

     

  4. The following five forms of stage directions are recognized and processed:
  5.          {Enter Hamlet and Horatio}
             {Exit Hamlet}
             {Exeunt Ghost with Hamlet following}
             {Exeunt all}
             {Exeunt all but Hamlet}
    When the pattern "{Enter" is matched, all names of characters following and up to the pattern "}" are entered into a table and the notation "ON" is attached to each character. A name of a character is defined in the program as any string of uninterrupted letters that begins with an upper-case letter. The pattern "{Exit" is handled similarly, except that the notation "OFF" is attached to the character's name in the table. Discovery of the pattern "{Exeunt" can require two rounds of pattern matching. If " all " is not found following "{Exeunt" and before "}" then the names following "{Exeunt" are looked up in the table and are set to "OFF." If "{Exeunt" is followed by "all}" then all names in the table are set to "OFF." If "all but" is found, then "OFF" is first attached to all names, then "ON" is attached to the names following "all but."

          In the Oxford Electronic Edition text, the first four columns give the line number. Tags enclosed in angle brackets indicate act and scene numbers. Thus, for example,

    1 <X 3> <Y 2>
    indicates the first line of act 3, scene 2: the number following X is always the act number, and the number following Y is the scene number. Act, scene, and line numbers are captured and held in variables for each line of text processed. When there is an entrance or an exit, the names of the characters in the table set to "ON" are printed along with the current act, scene, and line.

  6. More precisely, in terms of SNOBOL4 data types, the second part of ACTORS fills a one-dimensional array, and it builds a table; elements of the array are subscripts for the table; then the table is converted to a two-dimensional array for output.

 

Figure 1. Actors Required on Stage Simultaneously in Hamlet.


Act 3, Scene 2, starting at line 130 requires 15 actors:
Claudius
Gertrude
Guard
Guildenstern
Hamlet
Horatio
Lords
Ophelia
PlayerFive
PlayerFour
PlayerKing
PlayerQueen
PlayerThree
Polonius
Rosencrantz

.
.
.

Act 3, Scene 2, starting at line 258 requires 2 actors:
Hamlet
Horatio

Act 3, Scene 2, starting at line 278 requires 4 actors:
Guildenstern
Hamlet
Horatio
Rosencrantz

Act 3, Scene 2, starting at line 331 requires 5 actors:
Guildenstern
Hamlet
Horatio
OneWithRecorder
Rosencrantz

Act 3, Scene 2, starting at line 333 requires 4 actors:
Guildenstern
Hamlet
Horatio
Rosencrantz

Act 3, Scene 2, starting at line 360 requires 5 actors:
Guildenstern
Hamlet
Horatio
Polonius
Rosencrantz

Act 3, Scene 2, starting at line 375 requires 4 actors:
Guildenstern
Hamlet
Horatio
Rosencrantz

Act 3, Scene 2, starting at line 376 requires 2 actors:
Hamlet
Horatio
.
.
.

Figure 2. Characters that Appear On Stage Simultaneously in Hamlet Character: Appears on stage at least once with: --------- ----------------------------------- . . . Gertrude Claudius, Council, Hamlet, Laertes, Ophelia, Others, Polonius, Cornelius, Valtemand, Guildenstern, Rosencrantz, Lords, Horatio, Guard, PlayerKing, PlayerQueen, PlayerThree, PlayerFive, PlayerFour, Prologue, Lucianus, Ghost, Messenger, Followers, FirstClown, Priest, Attendants, Osric, Ambassadors, Colours, Drummer, Fortinbras Ghost Barnardo, Horatio, Marcellus, Hamlet, Gertrude, Polonius Guard Claudius, Gertrude, Guildenstern, Hamlet, Horatio, Lords, Ophelia, Polonius, Rosencrantz, PlayerKing, PlayerQueen, PlayerThree, PlayerFive, PlayerFour, Prologue, Lucianus Guildenstern Claudius, Gertrude, Others, Rosencrantz, Hamlet, Polonius, PlayerFive, PlayerFour, PlayerKing, PlayerQueen, PlayerThree, Lords, Ophelia, Horatio, Guard, Prologue, Lucianus, OneWithRecorder Hamlet Claudius, Council, Gertrude, Laertes, Ophelia, Others, Polonius, Cornelius, Valtemand, Barnardo, Horatio, Marcellus, Ghost, Guildenstern, Rosencrantz, PlayerFive, PlayerFour, PlayerKing, PlayerQueen, PlayerThree, Lords, Guard, Prologue, Lucianus, OneWithRecorder, FirstClown, SecondClown, Priest, Osric, Attendants, Ambassadors, Colours, Drummer, Fortinbras Horatio Barnardo, Francisco, Marcellus, Ghost, Hamlet, Claudius, Gertrude, Guildenstern, Lords, Ophelia, Polonius, Rosencrantz, Guard, PlayerKing, PlayerQueen, PlayerThree, PlayerFive, PlayerFour, Prologue, Lucianus, OneWithRecorder, Servant, Sailors, FirstClown, SecondClown, Laertes, Priest, Osric, Attendants, Ambassadors, Colours, Drummer, Fortinbras . . .


Figure 3. Characters that do not Appear On Stage Simultaneously in Hamlet. Character: Never appears on stage with: --------- --------------------------- . . . Gertrude Army, Barnardo, Captain, Francisco, Marcellus, OneWithRecorder, Reynaldo, Sailors, SecondClown, Servant Ghost Ambassadors, Army, Attendants, Captain, Claudius, Colours, Cornelius, Council, Drummer, FirstClown, Followers, Fortinbras, Francisco, Guard, Guildenstern, Laertes, Lords, Lucianus, Messenger, OneWithRecorder, Ophelia, Osric, Others, PlayerFive, PlayerFour, PlayerKing, PlayerQueen, PlayerThree, Priest, Prologue, Reynaldo, Rosencrantz, Sailors, SecondClown, Servant, Valtemand Guard Ambassadors, Army, Attendants, Barnardo, Captain, Colours, Cornelius, Council, Drummer, FirstClown, Followers, Fortinbras, Francisco, Ghost, Laertes, Marcellus, Messenger, OneWithRecorder, Osric, Others, Priest, Reynaldo, Sailors, SecondClown, Servant, Valtemand Guildenstern Ambassadors, Army, Attendants, Barnardo, Captain, Colours, Cornelius, Council, Drummer, FirstClown, Followers, Fortinbras, Francisco, Ghost, Laertes, Marcellus, Messenger, Osric, Priest, Reynaldo, Sailors, SecondClown, Servant, Valtemand Hamlet Army, Captain, Followers, Francisco, Messenger, Reynaldo, Sailors, Servant Horatio Army, Captain, Cornelius, Council, Followers, Messenger, Others, Reynaldo, Valtemand . . .


Figure 4. Possible Doubling for Performance of Hamlet with Minimum Number of Actors Actor 1 Claudius, Army, Barnardo, OneWithRecorder, Reynaldo, Sailors, SecondClown, Servant Actor 2 Gertrude, Captain, Francisco Actor 3 Guard, Ambassadors, Cornelius, FirstClown, Followers, Ghost Actor 4 Guildenstern, Attendants, Council, Marcellus, Messenger, Priest Actor 5 Hamlet Actor 6 Horatio, Others Actor 7 Lords, Valtemand Actor 8 Ophelia, Colours Actor 9 PlayerFive, Drummer, Lucianus, Prologue Actor 10 PlayerFour, Fortinbras Actor 11 PlayerKing, Laertes Actor 12 PlayerQueen, Osric Actor 13 PlayerThree Actor 14 Polonius Actor 15 Rosencrantz


Figure 5. Possible Doubling for Performance of Hamlet with Minimum Number of Actors and Consideration given to Male and Female Roles. Actor 1 Claudius, Army, Barnardo, OneWithRecorder, Reynaldo, Sailors, SecondClown, Servant Actor 2 Gertrude Actor 3 Guard, Ambassadors, Captain, Cornelius, FirstClown, Followers, Francisco, Ghost Actor 4 Guildenstern, Attendants, Council, Marcellus, Messenger, Priest Actor 5 Hamlet Actor 6 Horatio, Others Actor 7 Lords, Valtemand Actor 8 Ophelia Actor 9 PlayerFive, Colours, Lucianus Actor 10 PlayerFour, Drummer Actor 11 PlayerKing, Fortinbras Actor 12 PlayerQueen, Prologue Actor 13 PlayerThree, Laertes Actor 14 Polonius, Osric Actor 15 Rosencrantz



Página creada y actualizada por grupo "mmm".
     Para cualquier cambio, sugerencia,etc. contactar con: fores@uv.es
     © a.r.e.a./Dr.Vicente Forés López
      Universitat de València Press
    Creada: 15/09/2000 Última Actualización: 18/06/2001