Module: Morphy

Extended by:
Morphy
Included in:
Morphy
Defined in:
lib/word.rb,
lib/morphy.rb

Defined Under Namespace

Classes: Morphy, Word

Instance Method Summary collapse

Instance Method Details

#grammemesObject



50
51
52
53
54
55
56
# File 'lib/morphy.rb', line 50

def grammemes
  @@grammemes ||=
    File
    .open("#{path}/grammemes.txt", 'r')
    .read
    .split("\n").map { |g| g.split(',') }
end

#newObject



30
31
32
# File 'lib/morphy.rb', line 30

def new
  Morphy.new
end

#paradigmsObject



38
39
40
# File 'lib/morphy.rb', line 38

def paradigms
  @@paradigms ||= Marshal.load(File.read("#{path}/paradigms.dat"))
end

#pathObject



34
35
36
# File 'lib/morphy.rb', line 34

def path
  File.dirname(__FILE__) + '/dictionary'
end

#prefixesObject



42
43
44
# File 'lib/morphy.rb', line 42

def prefixes
  @@prefixes ||= File.open("#{path}/prefixes.txt", 'r').read.split("\n")
end

#suffixesObject



46
47
48
# File 'lib/morphy.rb', line 46

def suffixes
  @@suffixes ||= File.open("#{path}/suffixes.txt", 'r').read.split("\n")
end