Class: Iora::Models::Reinterpretation

Inherits:
Element
  • Object
show all
Defined in:
lib/iora/models/reinterpretation.rb

Overview

The Reinterpretation class represents a element, an element used by the Wolfram Alpha API to indicate when a query that it could not understand was replaced by a new query that seems close to the original.

For example, the nonsensical query "blue mustang moon" might be replaced by the similar query "mustang moon," the name of a 2002 book by Terri Farley.

Instance Attribute Summary

Attributes inherited from Element

#element

Instance Method Summary collapse

Methods inherited from Element

#initialize, #to_xml

Methods included from Associations::HasOne

#has_one

Methods included from Associations::Helpers

#parse_element, #tag_for

Methods included from Associations::HasMany

#has_many

Methods included from Associations::HasAttribute

#has_attribute

Constructor Details

This class inherits a constructor from Iora::Models::Element

Instance Method Details

#levelString

Returns a description ("low", "medium", or "high") indicating how similar the new query is to the original query.

Returns:

  • (String)

    a description ("low", "medium", or "high") indicating how similar the new query is to the original query


33
# File 'lib/iora/models/reinterpretation.rb', line 33

has_attribute :level

#queryString

Returns the new query.

Returns:

  • (String)

    the new query


23
# File 'lib/iora/models/reinterpretation.rb', line 23

has_attribute :query, tag: 'new'

#scoreFloat

Returns a value from 0 to 1 indicating how similar the new query is to the original query.

Returns:

  • (Float)

    a value from 0 to 1 indicating how similar the new query is to the original query


28
# File 'lib/iora/models/reinterpretation.rb', line 28

has_attribute :score, Float

#textString

Returns a sentence you might display to the user before showing the new query. This is almost always "Using closest Wolfram|Alpha interpretation:".

Returns:

  • (String)

    a sentence you might display to the user before showing the new query. This is almost always "Using closest Wolfram|Alpha interpretation:"


19
# File 'lib/iora/models/reinterpretation.rb', line 19

has_attribute :text