Class: Word
- Inherits:
-
Object
- Object
- Word
- Defined in:
- lib/word.rb
Class Method Summary collapse
- .detransliterations_for(word, include_softeners, is_detranslit = true) ⇒ Object
-
.output_words(part_options) ⇒ Object
transform 2d-options-array two an array of cyrillic words.
- .transliterations_for(word) ⇒ Object
Class Method Details
.detransliterations_for(word, include_softeners, is_detranslit = true) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/word.rb', line 7 def self.detransliterations_for(word, include_softeners, is_detranslit=true) last_part = build_word_part_structure word, is_detranslit first_part = add_link_to_succ_to_each_word_part(last_part) input_structure = word_input_structure(first_part) = [] #this will be filled with lists of possible cyrillic output (2d-array then) part = first_part until part.nil? do << part.(include_softeners) part = part.succ end {:input_structure => input_structure, :options => } end |
.output_words(part_options) ⇒ Object
transform 2d-options-array two an array of cyrillic words.
25 26 27 28 29 |
# File 'lib/word.rb', line 25 def self.output_words .map!{|a| a.size==0 ? nil : a} #delete empty option arrays .compact! get_part_combinations '', , [] end |
.transliterations_for(word) ⇒ Object
20 21 22 |
# File 'lib/word.rb', line 20 def self.transliterations_for(word) self.detransliterations_for(word, true, false) end |