Module: Morphy
Defined Under Namespace
Instance Method Summary collapse
- #grammemes ⇒ Object
- #new ⇒ Object
- #paradigms ⇒ Object
- #path ⇒ Object
- #prefixes ⇒ Object
- #suffixes ⇒ Object
Instance Method Details
#grammemes ⇒ Object
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 |
#new ⇒ Object
30 31 32 |
# File 'lib/morphy.rb', line 30 def new Morphy.new end |
#paradigms ⇒ Object
38 39 40 |
# File 'lib/morphy.rb', line 38 def paradigms @@paradigms ||= Marshal.load(File.read("#{path}/paradigms.dat")) end |
#path ⇒ Object
34 35 36 |
# File 'lib/morphy.rb', line 34 def path File.dirname(__FILE__) + '/dictionary' end |
#prefixes ⇒ Object
42 43 44 |
# File 'lib/morphy.rb', line 42 def prefixes @@prefixes ||= File.open("#{path}/prefixes.txt", 'r').read.split("\n") end |
#suffixes ⇒ Object
46 47 48 |
# File 'lib/morphy.rb', line 46 def suffixes @@suffixes ||= File.open("#{path}/suffixes.txt", 'r').read.split("\n") end |