Class: Dandelionapi::EntityExtraction

Inherits:
Base
  • Object
show all
Defined in:
lib/dandelionapi/entity_extraction.rb

Constant Summary collapse

ENDPOINT =
"/datatxt/nex/v1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countryObject

Returns the value of attribute country.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def country
  @country
end

#custom_spotsObject

Returns the value of attribute custom_spots.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def custom_spots
  @custom_spots
end

#extra_typesObject

Returns the value of attribute extra_types.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def extra_types
  @extra_types
end

#htmlObject

Returns the value of attribute html.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def html
  @html
end

#html_fragmentObject

Returns the value of attribute html_fragment.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def html_fragment
  @html_fragment
end

#includeObject

Returns the value of attribute include.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def include
  @include
end

#langObject

Returns the value of attribute lang.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def lang
  @lang
end

#min_confidenceObject

Returns the value of attribute min_confidence.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def min_confidence
  @min_confidence
end

#min_lengthObject

Returns the value of attribute min_length.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def min_length
  @min_length
end

#social_hashtagObject

Returns the value of attribute social_hashtag.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def social_hashtag
  @social_hashtag
end

#social_mentionObject

Returns the value of attribute social_mention.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def social_mention
  @social_mention
end

#textObject

Returns the value of attribute text.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def text
  @text
end

#urlObject

Returns the value of attribute url.



13
14
15
# File 'lib/dandelionapi/entity_extraction.rb', line 13

def url
  @url
end

Instance Method Details

#analyze(options) ⇒ Object

Raises:



18
19
20
21
22
23
24
# File 'lib/dandelionapi/entity_extraction.rb', line 18

def analyze(options)

  raise MissingParameters.new("Please provide one of the following parameters: text, url, html or html_fragment") if ([:text, :url, :html, :html_fragment] & options.keys).empty?

  params = options
  call(ENDPOINT, params)
end