Sha256: b47f20f61f75b29a1816eb4e6af406a14a3cc209be8c7ee1ffc6a1e6b4b419e2

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

# process statements

BEGIN {
	$LOAD_PATH.unshift File::dirname(File::dirname( __FILE__ )) + "/lib"
	require 'linguistics'
       require 'linkparser'
	
}

def process_eliza_sentence
Linguistics::use( :en )

# Just 




  
  # Test to see whether or not the link parser is loaded.
#Linguistics::EN.has_link_parser?
temp_sentence = "unknown"
if ! @a_sentence_in.to_s.empty?
temp_sentence = @a_sentence_in.to_s.downcase
end

@showelizaresult = "\n"
@showelizaresult += "Sentence = "

@showelizaresult += "#{temp_sentence}" 
begin 

 temp_elizaresponse_directory = $rwdelizadata_directory + "/" + $rwdelizaresponse_directory 

fileList      = Dir.new(temp_elizaresponse_directory).entries.sort.delete_if { |x| ! (x =~ /res$/) }
  
  temp_index_num = rand(4) 
  temp_resfile = fileList[temp_index_num]
  fileName = File.join(temp_elizaresponse_directory,temp_resfile)
  fd = File.open(fileName,"r")
  temp_response = fd.readline.chomp
 @showelizaresult = temp_response
  @eventrecordsresult = "error opening response"
  end # end of error function
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rwdeliza-0.03 code/superant.com.rwdeliza/eliza01.rb
rwdeliza-0.05 code/superant.com.rwdeliza/eliza01.rb
rwdeliza-0.04 code/superant.com.rwdeliza/eliza01.rb