Class: Vicary::Conformance::Gate

Inherits:
Struct
  • Object
show all
Defined in:
lib/vicary/conformance.rb

Overview

bars_by_corpus overrides bar per corpus id. Only over_fire_prose carries one: it is the sole gate whose bar describes the prose rather than the detector, and ASAP-AES's 0.61 against PERSUADE's 8.15 is what one corpus naming real entities and another naming @PERSON tokens costs. bar remains the fallback, and is the tighter of the two.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#barObject

Returns the value of attribute bar

Returns:

  • (Object)

    the current value of bar



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def bar
  @bar
end

#bars_by_corpusObject

Returns the value of attribute bars_by_corpus

Returns:

  • (Object)

    the current value of bars_by_corpus



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def bars_by_corpus
  @bars_by_corpus
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def id
  @id
end

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def label
  @label
end

#opObject

Returns the value of attribute op

Returns:

  • (Object)

    the current value of op



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def op
  @op
end

#requiresObject

Returns the value of attribute requires

Returns:

  • (Object)

    the current value of requires



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def requires
  @requires
end

#unitObject

Returns the value of attribute unit

Returns:

  • (Object)

    the current value of unit



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def unit
  @unit
end

#whyObject

Returns the value of attribute why

Returns:

  • (Object)

    the current value of why



41
42
43
# File 'lib/vicary/conformance.rb', line 41

def why
  @why
end

Instance Method Details

#bar_for(corpus_id) ⇒ Object

The bar this gate holds corpus_id to — its override, else its default.



44
45
46
47
48
# File 'lib/vicary/conformance.rb', line 44

def bar_for(corpus_id)
  return bar if corpus_id.nil?

  (bars_by_corpus || {}).fetch(corpus_id, bar)
end