class HebrewWord

The user-facing transliterator class

Public Class Methods

new(string) click to toggle source

Initializer Expects a Unicode Hebrew word (i.e. “עַקֵדָה”)

# File lib/hebrewword.rb, line 25
def initialize string
  @hebword = string
end

Public Instance Methods

inspect() click to toggle source

Returns a `String` of format: `hebrew_text`: Permutations: `x` single | `y` short | `z` long

# File lib/hebrewword.rb, line 41
def inspect
  "#{@hebword}: Permutations: #{transliterate(:single).length} single | #{transliterate(:short).length} short | #{transliterate(:long).length} long"
end
phonemes() click to toggle source
# File lib/hebrewword.rb, line 45
def phonemes
  Phonemizer.new(@hebword).phonemes
end
raw() click to toggle source

Get the raw Hebrew text of the word (Included NIKUD)

# File lib/hebrewword.rb, line 30
def raw
  @hebword
end
t(list_name = nil) click to toggle source

Alias for transliterate

# File lib/hebrewword.rb, line 57
def t list_name = nil
  transliterate list_name
end
to_s() click to toggle source

Alias of `raw`

# File lib/hebrewword.rb, line 35
def to_s
  raw
end
transliterate(list_name = nil) click to toggle source

Return an `Array` of all possible transliterations of the word As defined in the optional `list_name` argument. options: [:long, :short, :single] Default is `:short`

# File lib/hebrewword.rb, line 52
def transliterate list_name = nil
  Transliterator.new(@hebword, list_name).transliterate
end