Class: ProgramR::Person

Inherits:
ReplaceTag show all
Defined in:
lib/programr/aiml_elements.rb

Constant Summary collapse

Map =
{
  /\b(she|he|i|me|my|myself|mine)\b/i => -> (match, environment) do
    gender = environment.get('gender')
    @@swap[gender][match[1].downcase]
  end
}
@@swap =
{'male' => {'me'     => 'him',
                       'my'     => 'his',
                       'myself' => 'himself',
                       'mine'   => 'his',
                       'i'      => 'he',
                       'he'     => 'i',
                       'she'    => 'i'},

            'female' => {'me'   => 'her',
'my'     => 'her',
'myself' => 'herself',
	                       'mine'   => 'hers',
'i'      => 'she',
'he'     => 'i',
'she'    => 'i'}}

Instance Method Summary collapse

Methods inherited from ReplaceTag

#add, #execute

Methods inherited from AimlTag

#inspect, #to_s

Constructor Details

#initialize(environment) ⇒ Person


432
433
434
435
# File 'lib/programr/aiml_elements.rb', line 432

def initialize environment
  @environment = environment
  super()
end