Class: Rambling::Trie::Readers::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/rambling/trie/readers/reader.rb

Overview

Base class for all readers.

Direct Known Subclasses

PlainText

Instance Method Summary collapse

Instance Method Details

#each_word(filepath) {|String| ... } ⇒ self

This method is abstract.

Subclass and override #each_word to fit to a particular file format.

Yields each word read from given file.

Parameters:

  • filepath (String)

    the full path of the file to load the words from.

Yields:

  • (String)

    Each line read from the file.

Returns:

  • (self)

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/rambling/trie/readers/reader.rb', line 13

def each_word filepath
  raise NotImplementedError
end