Download Improving and Evaluating a Software Tool for Providing Animated
Transcript
Appendix I: Problems with EnACT 2.0 and Solutions implemented in EnACT
3.0
Problem 1: Dialogues do not load properly in SEA
EnACT version 2.0 code snippet
private ArrayList parseDialogue () {
ArrayList emotions = new ArrayList (10);
emotion _emotion;
while (reader.Read ()) {
if (reader.NodeType != XmlNodeType.Element)
continue;
if (reader.Name.ToLower () != "emotion")
break;
_emotion = new emotion ();
// Emotion
try {
_emotion.type = (Emotion) int.Parse
(reader.GetAttribute ("type"));
_emotion.intensity = (Intensity) int.Parse
(reader.GetAttribute("intensity"));
}
catch (Exception) {
_emotion.type = Emotion.None;
_emotion.intensity = Intensity.None;
}
// Text
try {
_emotion.text = reader.ReadString ();
}
catch (Exception) {
continue;
}
emotions.Add (_emotion);
}
emotions.TrimToSize ();
return emotions;
}
EnACT version 3.0 code snippet
private ArrayList parseDialogue () {
ArrayList emotions = new ArrayList (10);
emotion _emotion;
112