Class: StoryKey::Lexicon
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#entries ⇒ Object
2 3 4 5 6 |
# File 'lib/story_key/lexicon.rb', line 2 def entries @entries ||= StoryKey::GRAMMAR.values.flatten.uniq.index_with do |part_of_speech| import_entries(part_of_speech).sort_by(&:token) end end |
#prepositions ⇒ Object
8 9 10 |
# File 'lib/story_key/lexicon.rb', line 8 def prepositions @prepositions ||= entries.values.flatten.filter_map(&:preposition).uniq.sort end |
#sha ⇒ Object
12 13 14 |
# File 'lib/story_key/lexicon.rb', line 12 def sha @sha ||= Digest::SHA256.hexdigest(entries.to_s).first(StoryKey::LEXICON_SHA_SIZE) end |