Method: Ariel::Learner#example_is_unsuitable?

Defined in:
lib/ariel/learner.rb

#example_is_unsuitable?(tokenstream) ⇒ Boolean

When learning list iteration rules, some examples may be unsuitable. For instance if there is a list item at the start of an example with no tokens before it, a skip_to(nil) start rule would be generated that wouldn’t make sense for exhaustive rules. The example should be caught by the corresponding end rule. This should only be run after tokenstream’s have been prepared (reversed based on whether a :forward or :back rule is being searched for). Only returns a valid conclusion if the examples are intended to be used for exhaustive rule learning

Returns:

  • (Boolean)


251
252
253
254
255
256
257
# File 'lib/ariel/learner.rb', line 251

def example_is_unsuitable?(tokenstream)
  if tokenstream.label_index==0
    return true
  else
    return false
  end
end