Class: Datasets::AFINN
Defined Under Namespace
Classes: Record
Instance Attribute Summary
Attributes inherited from Dataset
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize ⇒ AFINN
constructor
A new instance of AFINN.
Methods inherited from Dataset
Constructor Details
#initialize ⇒ AFINN
Returns a new instance of AFINN.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/datasets/afinn.rb', line 9 def initialize super() @metadata.id = "afinn" @metadata.name = "AFINN" @metadata.url = "http://www2.imm.dtu.dk/pubdb/pubs/6010-full.html" @metadata.licenses = ["ODbL-1.0"] @metadata.description = lambda do extract_file("AFINN/AFINN-README.txt") do |input| readme = input.read readme.force_encoding("UTF-8") readme. gsub(/^AFINN-96:.*?\n\n/m, ""). gsub(/^In Python.*$/m, ""). strip end end end |