Class: Lda::TextCorpus

Inherits:
Corpus
  • Object
show all
Defined in:
lib/lda-ruby/corpus/text_corpus.rb

Instance Attribute Summary collapse

Attributes inherited from Corpus

#documents, #num_docs, #num_terms, #stopwords, #vocabulary

Instance Method Summary collapse

Methods inherited from Corpus

#add_document, #remove_word

Constructor Details

#initialize(filename) ⇒ TextCorpus

Load text documents from YAML file if filename is given.



6
7
8
9
10
11
# File 'lib/lda-ruby/corpus/text_corpus.rb', line 6

def initialize(filename)
  super()

  @filename = filename
  load_from_file
end

Instance Attribute Details

#filenameObject (readonly)

Returns the value of attribute filename.



3
4
5
# File 'lib/lda-ruby/corpus/text_corpus.rb', line 3

def filename
  @filename
end