input
stringlengths
10
828
output
stringlengths
5
107
protected void process response string response vhmloutput reader vhmloutputreader vhmloutputreader new vhmloutput reader response set frames vhmloutputreader get frames set phonemes vhmloutputreader get phonemes set browser updates vhmloutputreader get browser updates set text vhmloutputreader get text
process a response from the interaction manager in accordance with client
public void set eye blink parameters int interval int interval margin int duration down int duration hold int duration up int duration margin eye blink interval interval eye blink interval margin interval margin eye blink duration down duration down eye blink duration hold duration hold eye blink duration up duration up eye blink duration margin duration margin
sets the eye blink parameters attribute of the vhmlsemantics object
protected void process response string response vhmlparser vhmlparser parse vhml file vhmlparser new vhmlparser response get frame rate get dsp nlp set data for sending to client set frames vhmlparser get frames set phonemes vhmlparser get phonemes set browser updates vhmlparser get browser updates set text vhmlparser get text
process a response from the interaction manager in accordance with client
public void run while true try socket s server socket accept hashtable data new hashtable data put socket s data put meta face httpserver this pool perform work data catch exception e e print stack trace
thread to accept connections
public void remove httplistener httplistener l if listener null synchronized this stop true pending tid destroy listener null
removes the httplistener
public boolean match client socket s if clientmachine equals ignore case s get inet address get host address return true return false
determines whether the clients socket matches the argument
public void add httplistener httplistener l throws too many listeners exception if listener null listener l synchronized this stop false pending tid start else throw new too many listeners exception
adds the httplistener
public void write response data output stream out throws ioexception out write bytes http response
convience method to write the http response header
private http urlconnection send pending throws ioexception url url new url url connection http urlconnection url open connection connection set use caches false connection set do output true connection set request property keep alive timeout 300 max 300 return connection
convience method to send the pending connection to the server
public object run try xmlreader parse eca synthesis file catch saxexception e system err println xml error parsing vhml output file e print stack trace catch ioexception e system err println io error parsing vhml output file e print stack trace return null
main processing method for the vhmloutput access object in order to execute
public void hide user text set visible false
hide the text field
public void run while exit check for browser changes poll web pages play speech audio from phoneme buffer play audio render faps in buffer render animation check if idle and do idle behaviour idle buffering scheme sleep to allow other threads to run try thread yield thread sleep 10 catch exception e system out println error while sleeping e print stack trace
main processing method for the meta face independent client object
public void show user text set visible true
show the text field
public void set input input stream data try string inputtemp2 input new string buffered reader inputtemp new buffered reader new input stream reader data inputtemp2 inputtemp read line while inputtemp2 length 0 input input concat inputtemp2 inputtemp2 inputtemp read line data close catch exception e
sets the data input for the meta face service
public void set text color color c user text set background c
sets the text color attribute of the text control object
public int get height return int dim get height
gets the height attribute of the text control object
public jtext field get text field return user text
gets the text field attribute of the text control object
public vector get frames return faps
allows access to the mpeg 4 faps retrieved
public hashtable get browser updates return browserupdates
allows access to the urls and targets retrieved
public void characters char ch int start int length throws saxexception store the character data as encountered between tags tempchar tempchar concat new string ch start length
the parser calls this when encountering character data
protected void clear fapbuffer fapdatabuffer clear
clear all data from the fap buffer
public void start element string namespace uri string local name string raw name attributes atts throws saxexception get the key and determine what tag has been encountered string key raw name if key compare to eca synthesis 0 else if key compare to text 0 reset character string tempchar else if key compare to url 0 store the target target atts get value 0 tempchar else if key compare to phonemes 0 tempchar else if key compare to faps 0 tempchar
the parser calls this for each element in a document
public void start client if debug system out println starting client ignore incoming fapdata false ignore incoming ph data false
this method is called when the client starts
public vector get frames return vhmlreader get frames
allows access to the mpeg 4 faps retrieved
protected void clear phoneme buffer phonemedatabuffer clear
clear all data from the phoneme buffer
public vector get phonemes return vhmlreader get phonemes
allows access to the phonemes retrieved
public void set client meta face client mfc dmfc mfc
sets the client attribute of the default meta face applet object
public string get text return vhmlreader get text
allows access to the plain text retrieved
public void start try dmfc new default meta face client applet da jsobject get window this catch exception e e print stack trace
start the applet
public hashtable get browser updates return vhmlreader get browser updates
allows access to the urls and targets retrieved
public void add sub topic sub topic element subtopics add element
adds a subtopic to the topic object
public vector get sub topics return subtopics
gets the subtopics within the topic object
public string get word int i return string wc element at i
gets a word from a postiion in the word chain
public int size return wc size
size of the word chain
public best list match stimulus interaction context ic stack path best list bestlist int i boolean process sub topic tmpsubtopic process true path push name only process if visisted in the previous interaction and processing entry states if ic processingtype interaction manager entry visited process false if process process all subtopics for i 0 i subtopics size i tmpsubtopic sub topic subtopics element at i bestlist tmpsubtopic match stimulus ic path bestlist path pop return bestlist
performs a match on user stimulus such as natural language or a hypertext
public string to string string temp int i temp new string seperate each word by a space leave off start node and end node for i 1 i wc size 1 i temp temp concat string wc element at i if i wc size 2 temp temp concat if temp length 0 return null return temp
prints the word chain to a string
public response get response stack path int i sub topic tmpsubtopic string subtopicname string temp visited true search all subtopics for i 0 i subtopics size i if path name matches subtopic name process tmpsubtopic sub topic subtopics element at i subtopicname tmpsubtopic get name if subtopicname equals ignore case string path peek temp string path pop if dmtldebugger debug system out println traversing temp get the response from the subtopic return tmpsubtopic get response path return null
gets a response based on a state reference
public best list match stimulus interaction context ic stack path best list bestlist boolean process process false check that this state can be processed correct context if ic processingtype interaction manager allentry process true else if ic processingtype interaction manager entry process true else if ic processingtype interaction manager linked process true go ahead and score the match if process return super match stimulus ic path bestlist return bestlist
performs a match on user stimulus such as natural language or a hypertext
public best list match stimulus interaction context ic stack path best list bestlist boolean process process false check that this state can be processed correct context if ic processingtype interaction manager allentry process false else if ic processingtype interaction manager entry process false else if ic processingtype interaction manager linked process true go ahead and score the match if process return super match stimulus ic path bestlist return bestlist
performs a match on user stimulus such as natural language or a hypertext
public void add weight float w weight weight w
adds a weight to the weight of the word graph node
public int size return bestlist size
the size of the best list vector
public void add child string childword float childweight childrenwords add element childword childrenweights add element new float childweight
adds a child to the word graph node
public void reset bestlist clear
description of the method
public void set base path string path if path char at path length 1 path char at path length 1 basepath path else basepath path
sets the base path for response files
public vector get next states at int i if i bestlist size 1 return new vector return best list item bestlist element at i get next states
gets the next states at attribute of the best list object
public string get children words int i return string childrenwords element at i
gets a childs word of the word graph node
public void print int i stack path system out println printing list of matched states for i 0 i bestlist size i system out print best list item bestlist element at i get score path best list item bestlist element at i get state reference system out println path peek
debugging method for printing the list of best matches to system
public string get text return speechtext
allows access to the plain text retrieved
public void add to child weight int i float w float f float childrenweights remove i float value childrenweights add i new float f w
adds a weight to a childs weight of the word graph node
public void set child weight int i float w childrenweights remove i childrenweights insert element at new float w i
sets the weight of a childs of the word graph node
public vector get knowledge bases return knowledgebases
gets the knowledge bases parsed from the dmtl documents
public float get children weights int i return float childrenweights element at i float value
gets a childs weight attribute of the word graph node object
public boolean links to stack paths string tmppath int i if paths null return true if paths size 0 return true get the path of the previous state tmppath tmppath concat string paths element at 0 if tmppath index of link 0 return true return false
does this pre state object link to a state
public string get base path return basepath
gets the base path for response files
public int num children return childrenwords size
the number of children of the word graph node
public stack get state reference return stack statereference clone
gets the reference full path of the state
public string get stimulus return stimulus
gets the dmlt stimulus attribute of the stimulus object
public vector get next states return vector nextstates clone
gets the dmtl next states of this state
public void add knowledge base knowledge base kb knowledgebases add kb
adds a knowledge base to the interaction manager object
public void reset visited false lastresponse 0
resets any internal state variables
public string get keyword string return keywordstring
gets the keywords attribute of the sub topic
public string get evaluate string return evaluatestring
gets the evaluate string attribute of the sub topic
public vector get states return states
gets the states within the sub topic object
public void add stimulus stimulus element stimuli add element
adds a stimulus element to the state
public knowledge base get knowledge base return knowledgebase
gets the knowledge base of the dmtltag reader object
public void add response response element responses add element
adds a response element to the state
public void add state state element states add element
adds a state to the sub topic object
protected boolean evaluate string evualuatestr return true
the method that is called when processing the state for matching and based
public void add next state next state element nextstates add element
adds a next state element to the state
private boolean is bit set vector faps int fapnum int bitord string fapmask char fapmarray fapmask string faps element at fapnum fapmarray fapmask to char array if fapmarray 2 bitord 2 1 return true return false
gets whether the bit mask is set for a fap index
protected boolean keyword evaluate string keywordstr string stimulus boolean process false word chain tmpstimulus int i seperate words tmpstimulus new word chain stimulus for each word match to keywords for i 0 i tmpstimulus size i if keywordstring index of tmpstimulus get word i 1 process true i tmpstimulus size return process
the method that is called when processing the state for matching and based
public void start document throws saxexception if dmtldebugger debug system out println starting document
parser calls this once at the beginning of a document
public void add topic topic element topics add element
adds a topic element to the knowledge base object
public void add pre state pre state element prestates add element
adds a pre state element to the state
public void add default topic default topic element defaulttopic element
adds a default topic element to the knowledge base object
public vector get topics return topics
gets the topics of the knowledge base
public default topic get default topic return defaulttopic
gets the default topics of the knowledge base
public void set state int i current state i
set state to one of the definitions nostate dialog etc
public void end document throws saxexception if dmtldebugger debug system out println ending document
parser calls this once after parsing a document
public void start document throws saxexception semantics reset faceexpressionlist new vector natpause 0 breakpause 0 gesturelist new vector facialanimationlist new vector speechlist new vector excessfaps new vector plaintext new string
the parser calls this once at the beginning of a document
public best list match stimulus interaction context ic int i boolean process topic tmptopic stack path best list bestlist initialisation bestlist new best list process true path new stack path push filename if processing entry states the knowledge base can only be processed if it yielded a response in the previous interation if ic processingtype interaction manager entry visited process false if process process each topic for i 0 i topics size i tmptopic topic topics element at i bestlist tmptopic match stimulus ic path bestlist path pop return bestlist
performs matching of the dmtl representation to a users stimulus e
public response get response stack path int i topic tmptopic string topicname visited true search each topic for a matching name in the path stack for i 0 i topics size i tmptopic topic topics element at i topicname tmptopic get name if found then process the subtopic if topicname equals ignore case string path peek path pop return tmptopic get response path return null
gets a response based on the path
public void set if read stimulus boolean flag stimulus flag
set flag to read character data as stimulus
public response get default response return defaulttopic get default response
gets a default response
public boolean get if read stimulus return stimulus
get flag to read character data as stimulus
public vector get stimuli return stimuli
gets the stimuli of the state
public stack get reference return referencepath
gets the reference to another response
public boolean get if first response return firstresponse
see if this is first response of multiple responses for a state
public void set if first response boolean flag firstresponse flag
set if this is first response of multiple responses for a state
public void set if macro boolean flag macro flag
set if to read character data as a macro
public vector get responses return responses
gets the responses of the state
public boolean get if macro return macro
get if to read character data as a macro
public void set macro name string name macro name name to upper case
store name of macro
public void set stimulus type int type stimulustype type
sets the stimulus type attribute of the dmtlmemory state object
public void add macro string name string macrostring vector macrovector if in table then add new macro string to list if macros contains key name macrovector vector macros get name macrovector add macrostring macros put name macrovector else make a new macro and add to table macrovector new vector macrovector add macrostring macros put name macrovector
adds a macro to the macros object
public int get stimulus type return stimulustype
gets the stimulus type attribute of the dmtlmemory state object
public vector get next states return nextstates
gets the next states of the state
public void set response type int type responsetype type
sets the response type attribute of the dmtlmemory state object
public int get response type return responsetype
gets the response type attribute of the dmtlmemory state object
public void set response reference string ref if ref null responsereference null else responsereference new string ref
sets the response reference attribute of the dmtlmemory state object