Class ElizaParse


  • public class ElizaParse
    extends java.lang.Object
    Eliza in Java. Adapted from a BASIC program I found floating on the net. Eliza was originally written by Joseph Weizenbaum. This version is an adaption of the program as it appeared in the memorable magazine Create Computing around 1981.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean exit  
      java.util.Vector<java.lang.String> msg
      Vector holding strings that have been added using PRINT.
    • Constructor Summary

      Constructors 
      Constructor Description
      ElizaParse()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void handleLine​(java.lang.String I)  
      void PRINT​(java.lang.String s)
      Cute hack to make it look like BASIC.
      static java.lang.String removeChar​(java.lang.String s, char c)
      Utility function that removes a char from a String.
      static java.lang.String replaceString​(java.lang.String s, java.lang.String oldstring, java.lang.String newstring)
      Utility function that replaces all occurences of a specific string with another string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • msg

        public java.util.Vector<java.lang.String> msg
        Vector holding strings that have been added using PRINT.
      • exit

        public boolean exit
    • Constructor Detail

      • ElizaParse

        public ElizaParse()
    • Method Detail

      • PRINT

        public void PRINT​(java.lang.String s)
        Cute hack to make it look like BASIC. This adds a String to the msg Vector.
      • handleLine

        public void handleLine​(java.lang.String I)
      • removeChar

        public static java.lang.String removeChar​(java.lang.String s,
                                                  char c)
        Utility function that removes a char from a String.
      • replaceString

        public static java.lang.String replaceString​(java.lang.String s,
                                                     java.lang.String oldstring,
                                                     java.lang.String newstring)
        Utility function that replaces all occurences of a specific string with another string.