Class: Lda::DirectoryCorpus
- Defined in:
- lib/lda-ruby/corpus/directory_corpus.rb
Instance Attribute Summary collapse
-
#extension ⇒ Object
readonly
Returns the value of attribute extension.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Corpus
#documents, #num_docs, #num_terms, #stopwords, #vocabulary
Instance Method Summary collapse
-
#initialize(path, extension = nil) ⇒ DirectoryCorpus
constructor
load documents from a directory.
Methods inherited from Corpus
Constructor Details
#initialize(path, extension = nil) ⇒ DirectoryCorpus
load documents from a directory
6 7 8 9 10 11 12 13 |
# File 'lib/lda-ruby/corpus/directory_corpus.rb', line 6 def initialize(path, extension = nil) super() @path = path.dup.freeze @extension = extension ? extension.dup.freeze : nil load_from_directory end |
Instance Attribute Details
#extension ⇒ Object (readonly)
Returns the value of attribute extension.
3 4 5 |
# File 'lib/lda-ruby/corpus/directory_corpus.rb', line 3 def extension @extension end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
3 4 5 |
# File 'lib/lda-ruby/corpus/directory_corpus.rb', line 3 def path @path end |