Class: StartsWithLetter
- Inherits:
-
Natural::Fragment
- Object
- Tree::TreeNode
- Natural::Fragment
- StartsWithLetter
- Defined in:
- lib/natural/fragments/example.rb
Overview
e.g. start with the letter t
Instance Attribute Summary
Attributes inherited from Natural::Fragment
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Natural::Fragment
#all_filters, #clone, #data, #id_range, #ids, #ids=, #initialize, #pretty_to_s, recurse_alternatives, #to_s
Constructor Details
This class inherits a constructor from Natural::Fragment
Class Method Details
.find(options) ⇒ Object
32 33 34 |
# File 'lib/natural/fragments/example.rb', line 32 def self.find() super .merge(:looking_for => {:and => ['start with the letter', {:or => ('a'..'z').to_a}]}) end |
Instance Method Details
#filter ⇒ Object
35 36 37 |
# File 'lib/natural/fragments/example.rb', line 35 def filter "select {|a| a[0].downcase == '#{self.children.last.to_s.downcase}'}" end |