Class: LLT::Morphologizer::LookupStatement

Inherits:
Object
  • Object
show all
Defined in:
lib/llt/morphologizer/lookup_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ LookupStatement

Returns a new instance of LookupStatement.



7
8
9
10
# File 'lib/llt/morphologizer/lookup_statement.rb', line 7

def initialize(*args)
  @stem, @table, @column, @itypes, @components = args
  safety_clones
end

Instance Attribute Details

#componentsObject (readonly) Also known as: options

Returns the value of attribute components.



4
5
6
# File 'lib/llt/morphologizer/lookup_statement.rb', line 4

def components
  @components
end

Instance Method Details

#stem_typeObject



12
13
14
# File 'lib/llt/morphologizer/lookup_statement.rb', line 12

def stem_type
  @column
end

#to_queryObject



20
21
22
23
24
25
26
27
# File 'lib/llt/morphologizer/lookup_statement.rb', line 20

def to_query
  {
    type: @table,
    stem: @stem,
    stem_type: @column,
    restrictions: build_restrictions
  }
end

#to_sObject



29
30
31
# File 'lib/llt/morphologizer/lookup_statement.rb', line 29

def to_s
  "Looking up #{@stem.light_green} as #{@table}, #{@column} #{"with #{components_to_s}" if @components.any? } (classes: #{@itypes * ", "})"
end

#typeObject



16
17
18
# File 'lib/llt/morphologizer/lookup_statement.rb', line 16

def type
  @table
end