Class: AnyStyle::Feature::Dictionary

Inherits:
AnyStyle::Feature show all
Defined in:
lib/anystyle/feature/dictionary.rb

Instance Attribute Summary collapse

Attributes inherited from AnyStyle::Feature

#precision

Instance Method Summary collapse

Methods inherited from AnyStyle::Feature

#next, #prev, #ratio

Methods included from StringUtils

canonize, count, display_chars, display_width, indent, nnum, page_break?, scrub, strip_html, transliterate

Constructor Details

#initialize(dictionary:, **opts) ⇒ Dictionary

Returns a new instance of Dictionary.


6
7
8
9
# File 'lib/anystyle/feature/dictionary.rb', line 6

def initialize(dictionary:, **opts)
  super(**opts)
  @dictionary = dictionary
end

Instance Attribute Details

#dictionaryObject (readonly)

Returns the value of attribute dictionary


4
5
6
# File 'lib/anystyle/feature/dictionary.rb', line 4

def dictionary
  @dictionary
end

Instance Method Details

#observe(token, alpha:, **opts) ⇒ Object


11
12
13
# File 'lib/anystyle/feature/dictionary.rb', line 11

def observe(token, alpha:, **opts)
  dictionary.tags(alpha.downcase)
end