Module: Pismo

Defined in:
lib/pismo.rb,
lib/pismo/document.rb,
lib/pismo/external_attributes.rb,
lib/pismo/internal_attributes.rb

Defined Under Namespace

Modules: ExternalAttributes, InternalAttributes Classes: Document, NFunctions

Class Method Summary collapse

Class Method Details

.[](url) ⇒ Object

Load a URL, as with Pismo, and caches the Pismo document (mostly useful for debugging use)



21
22
23
24
# File 'lib/pismo.rb', line 21

def self.[](url)
  @docs ||= {}
  @docs[url] ||= Pismo::Document.new(open(url))
end

.document(handle, url = nil) ⇒ Object

Sugar methods to make creating document objects nicer



15
16
17
# File 'lib/pismo.rb', line 15

def self.document(handle, url = nil)
  Document.new(handle, url)
end

.stopwordsObject

Return stopword list



28
29
30
# File 'lib/pismo.rb', line 28

def self.stopwords
  @stopwords ||= File.read(File.dirname(__FILE__) + '/pismo/stopwords.txt').split rescue []
end