## org.opencyc.chat
Class IrcChat

    java.lang.Object
      |
      +--java.lang.Thread
            |
            +--org.opencyc.chat.IrcChat

All Implemented Interfaces:
  ChatSender, java.lang.Runnable

public class IrcChat
extends java.lang.Thread
implements ChatSender

Inner Class Summary
`class` `IrcChat.DccClientHandlerThread`
`class` `IrcChat.DccServerThread`

Field Summary
`ChatterBot` `chatterBot` reference to ChatterBot
`CycAccess` `cyc` reference to CycAccess (OpenCyc server)
`java.lang.String` `ircChannel`
`java.lang.String` `ircComment`
`java.lang.String` `ircDebug`
`java.lang.String` `ircDestination`
`java.lang.String` `ircNick` IRC Bot details
`int` `ircPort`
`java.lang.String` `ircServer` IRC Sever details
`java.util.HashMap` `mtUser`
`java.util.ArrayList` `paraphrased`
`boolean` `running`
`static CycSymbol` `SYMBOL_NIL`

Fields inherited from class java.lang.Thread
`MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY`

Constructor Summary
`IrcChat()` Creates a basic unstarted IRC Bot
`IrcChat(CycAccess access, java.lang.String nick, java.lang.String comment, java.lang.String server, int port, java.lang.String channel)` Creates a full running IRC Bot

Method Summary
`java.lang.String` `attemptParaphrase(java.lang.Object post)`
`void` `ircConnect()` Connects Bot to an IRC server
`void` `ircDisconnect()` Disconnct Bot from an IRC server
`void` `ircJoin(java.lang.String channel)`
`void` `ircPart(java.lang.String channel)`
`boolean` `ircSend(java.lang.String message)` Sends a raw string to the IRC server
`boolean` `isParaphrased(java.lang.String destination)` Returns true if Paraphrased for a destination/returnpath
`void` `listenForConnections(int port)`
`static void` `main(java.lang.String[] args)` Provide a command line function to launch the IrcChat application.
`CycFort` `mtForUser(java.lang.String cyclist)` Returns a Mt for a user
`void` `recievedConsoleMsg(IrcChat.DccClientHandlerThread client, java.lang.String message)`
`void` `restartChatterBot()`
`void` `run()`
`void` `sendAnswers(java.lang.String returnpath, java.lang.Object results)` Sends the Answer message from Cyc to returnpath
`void` `sendChatMessage(java.lang.String chatMessage)` Sends the chat message from Cyc into the chat system.
`void` `sendDebug(java.lang.String message)`
`void` `sendHelp(java.lang.String returnpath, java.lang.String params)`
`boolean` `sendMessage(java.lang.String destination, java.lang.Object post)` Send a public message to an IRC user
`void` `sendNotice(java.lang.String destination, java.lang.String message)` Send a notice to an IRC user
`void` `serviceAssert(java.lang.String cyclist, java.lang.String returnpath, java.lang.String sentence)` Process an Assert command
`void` `serviceChatter(java.lang.String cyclist, java.lang.String identity, java.lang.String message, java.lang.String returnpath)` Process an Assert command
`void` `serviceIRCServer()` Receives and parses IRC Server messages
`void` `serviceIRCSession(java.lang.String message)` Receives and parses IRC Session messages
`void` `serviceIRCTransaction(java.lang.String from, java.lang.String hostmask, java.lang.String command, java.lang.String destination, java.lang.String params)` Process an IRC Transaction
`void` `serviceLoop()`
`boolean` `servicePlugin(java.lang.String from, java.lang.String hostmask, java.lang.String returnpath, java.lang.String token, java.lang.String params)`
`void` `serviceProve(java.lang.String cyclist, java.lang.String returnpath, java.lang.String query)` Process a Prove command (Query with proof)
`void` `servicePublicMessage(java.lang.String from, java.lang.String hostmask, java.lang.String returnpath, java.lang.String params)` Process a Public message (PRIVMSG to Channel)
`void` `serviceQuery(java.lang.String cyclist, java.lang.String returnpath, java.lang.String query)` Process a Query command
`void` `serviceQueryUser(java.lang.String cyclist, java.lang.String returnpath, java.lang.String query)` Process an Ask command
`void` `serviceSubL(java.lang.String cyclist, java.lang.String returnpath, java.lang.String subl)` Process a SubL command
`boolean` `serviceToken(java.lang.String from, java.lang.String hostmask, java.lang.String returnpath, java.lang.String token, java.lang.String params)` Process a Token message
`void` `startChatterBot()`
`void` `startPlugins()`
`void` `terminateChatterBot()`
`CycList` `toCycList(java.lang.String sentence)` Cyclifys a sentence a string
`java.lang.String` `toCycListString(java.lang.String sentence)` Cyclifys a sentence to a string

Methods inherited from class java.lang.Thread
`activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ircNick

    public java.lang.String ircNick

  IRC Bot details

### ircComment

    public java.lang.String ircComment

### ircChannel

    public java.lang.String ircChannel

### ircServer

    public java.lang.String ircServer

  IRC Sever details

### ircPort

    public int ircPort

### ircDestination

    public java.lang.String ircDestination

### paraphrased

    public java.util.ArrayList paraphrased

### ircDebug

    public java.lang.String ircDebug

### cyc

    public CycAccess cyc

  reference to CycAccess (OpenCyc server)

### chatterBot

    public ChatterBot chatterBot

  reference to ChatterBot

### running

    public boolean running

### mtUser

    public java.util.HashMap mtUser

### SYMBOL_NIL

    public static CycSymbol SYMBOL_NIL

Constructor Detail

### IrcChat

    public IrcChat()

  Creates a basic unstarted IRC Bot

### IrcChat

    public IrcChat(CycAccess access,
                   java.lang.String nick,
                   java.lang.String comment,
                   java.lang.String server,
                   int port,
                   java.lang.String channel)

  Creates a full running IRC Bot

Method Detail

### main

    public static void main(java.lang.String[] args)

  Provide a command line function to launch the IrcChat application.

### ircConnect

    public void ircConnect()

  Connects Bot to an IRC server

### ircDisconnect

    public void ircDisconnect()

  Disconnct Bot from an IRC server

### run

    public void run()

  Overrides:
    `run` in class `java.lang.Thread`

### restartChatterBot

    public void restartChatterBot()

### terminateChatterBot

    public void terminateChatterBot()

### startChatterBot

    public void startChatterBot()

### serviceLoop

    public void serviceLoop()
                     throws java.lang.Exception

### ircSend

    public boolean ircSend(java.lang.String message)

  Sends a raw string to the IRC server

### ircJoin

    public void ircJoin(java.lang.String channel)

### ircPart

    public void ircPart(java.lang.String channel)

### sendNotice

    public void sendNotice(java.lang.String destination,
                           java.lang.String message)

  Send a notice to an IRC user
  Parameters:
    `destination` - String
    `message` - String

### sendMessage

    public boolean sendMessage(java.lang.String destination,
                               java.lang.Object post)

  Send a public message to an IRC user
  Parameters:
    `destination` - String
    `message` - String

### attemptParaphrase

    public java.lang.String attemptParaphrase(java.lang.Object post)

### serviceIRCServer

    public void serviceIRCServer()
                          throws java.lang.Exception

  Receives and parses IRC Server messages

### serviceIRCSession

    public void serviceIRCSession(java.lang.String message)

  Receives and parses IRC Session messages

### serviceIRCTransaction

    public void serviceIRCTransaction(java.lang.String from,
                                      java.lang.String hostmask,
                                      java.lang.String command,
                                      java.lang.String destination,
                                      java.lang.String params)

  Process an IRC Transaction
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### servicePublicMessage

    public void servicePublicMessage(java.lang.String from,
                                     java.lang.String hostmask,
                                     java.lang.String returnpath,
                                     java.lang.String params)

  Process a Public message (PRIVMSG to Channel)
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### serviceToken

    public boolean serviceToken(java.lang.String from,
                                java.lang.String hostmask,
                                java.lang.String returnpath,
                                java.lang.String token,
                                java.lang.String params)

  Process a Token message
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### servicePlugin

    public boolean servicePlugin(java.lang.String from,
                                 java.lang.String hostmask,
                                 java.lang.String returnpath,
                                 java.lang.String token,
                                 java.lang.String params)

### startPlugins

    public void startPlugins()

### sendHelp

    public void sendHelp(java.lang.String returnpath,
                         java.lang.String params)

### serviceSubL

    public void serviceSubL(java.lang.String cyclist,
                            java.lang.String returnpath,
                            java.lang.String subl)

  Process a SubL command
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### serviceQuery

    public void serviceQuery(java.lang.String cyclist,
                             java.lang.String returnpath,
                             java.lang.String query)

  Process a Query command
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### serviceProve

    public void serviceProve(java.lang.String cyclist,
                             java.lang.String returnpath,
                             java.lang.String query)

  Process a Prove command (Query with proof)
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### serviceQueryUser

    public void serviceQueryUser(java.lang.String cyclist,
                                 java.lang.String returnpath,
                                 java.lang.String query)

  Process an Ask command
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form <my nick> :<message> or <my nick> <message>

### serviceAssert

    public void serviceAssert(java.lang.String cyclist,
                              java.lang.String returnpath,
                              java.lang.String sentence)

  Process an Assert command
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form assert:<message> or <my nick> <message>

### serviceChatter

    public void serviceChatter(java.lang.String cyclist,
                               java.lang.String identity,
                               java.lang.String message,
                               java.lang.String returnpath)

  Process an Assert command
  Parameters:
    `destination` - String nickname of the user who sentence the message
    `message` - String the command params are in the form assert:<message> or <my nick> <message>

### mtForUser

    public CycFort mtForUser(java.lang.String cyclist)

  Returns a Mt for a user

### isParaphrased

    public boolean isParaphrased(java.lang.String destination)

  Returns true if Paraphrased for a destination/returnpath

### toCycList

    public CycList toCycList(java.lang.String sentence)

  Cyclifys a sentence a string

### toCycListString

    public java.lang.String toCycListString(java.lang.String sentence)

  Cyclifys a sentence to a string

### sendAnswers

    public void sendAnswers(java.lang.String returnpath,
                            java.lang.Object results)

  Sends the Answer message from Cyc to returnpath

### sendDebug

    public void sendDebug(java.lang.String message)

### sendChatMessage

    public void sendChatMessage(java.lang.String chatMessage)

  Sends the chat message from Cyc into the chat system.
  Specified by:
    `sendChatMessage` in interface `ChatSender`

### recievedConsoleMsg

    public void recievedConsoleMsg(IrcChat.DccClientHandlerThread client,
                                   java.lang.String message)

### listenForConnections

    public void listenForConnections(int port)