Class: EstraierPure::ResultDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/vendor/estraierpure.rb

Overview


++ Abstraction of document in result set.


Instance Method Summary collapse

Instance Method Details

#attr(name) ⇒ Object

Get the value of an attribute. The return value is the value of the attribute or ‘nil’ if it does not exist.



355
356
357
358
# File 'lib/vendor/estraierpure.rb', line 355

def attr(name)
  Utility::check_types({ name=>String }) if $DEBUG
  @attrs[name]
end

#attr_namesObject

Get a list of attribute names. The return value is a list object of attribute names.



350
351
352
# File 'lib/vendor/estraierpure.rb', line 350

def attr_names()
  @attrs.keys.sort
end

#keywordsObject

Get keywords. The return value is a string of serialized keywords of the result document object. There are tab separated values. Keywords and their scores come alternately.



370
371
372
# File 'lib/vendor/estraierpure.rb', line 370

def keywords()
  @keywords
end

#snippetObject

Get the snippet of a result document object. The return value is a string of the snippet of the result document object. There are tab separated values. Each line is a string to be shown. Though most lines have only one field, some lines have two fields. If the second field exists, the first field is to be shown with highlighted, and the second field means its normalized form.



364
365
366
# File 'lib/vendor/estraierpure.rb', line 364

def snippet()
  @snippet
end

#uriObject

Get the URI. The return value is the URI of the result document object.



345
346
347
# File 'lib/vendor/estraierpure.rb', line 345

def uri()
  @uri
end