Class: Words2DotDat

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

Class Method Summary collapse

Class Method Details

.stopwordsObject



12
13
14
15
16
17
# File 'lib/words2dotdat.rb', line 12

def stopwords()
  @stopwords ||= (File.read \
      File.join(File.dirname(__FILE__), '..', 'data', 
                'stopwords.txt')).strip.lines.map(&:chomp)

end

.wordsObject



19
20
21
22
# File 'lib/words2dotdat.rb', line 19

def words()
  filepath = File.join(File.dirname(__FILE__), '..', 'data', 'words2.dat')
  File.open(filepath){|f| Marshal.load(f)}
end