class AiTools::DuckSearch

Public Class Methods

do_translate() click to toggle source
# File lib/ai_tools.rb, line 40
def self.do_translate
  print "What do you want me to translate? >> "
  translate_this = gets.chomp
  
  print "What file name do you want me to give it? >> "
  your_name = gets.chomp
  
  translate_file = File.read("data/#{translate_this}")
  
  system("trans -brief -no-auto -t ja+en --output data/#{your_name} #{translate_file}")
end
espeak_file() click to toggle source
# File lib/ai_tools.rb, line 28
def self.espeak_file
  require "espeak"
  
  print "Which file do you want me to read? >> "
  file = gets.chomp
  
  read_file = File.read("data/#{file}")
  
  speech = ESpeak::Speech.new( read_file )
  speech.speak
end