Method: VORuby::UCD#translate

Defined in:
lib/voruby/ucd/ucd.rb

#translate(ucd) ⇒ Object

Translate an old-style UCD1 into it’s newer UCD1+ form. Returns nil if the UCD is untranslatable.

ucd.translate('POS_EQ_RA_MAIN') # => 'pos.eq.ra;meta.main'


49
50
51
52
53
54
# File 'lib/voruby/ucd/ucd.rb', line 49

def translate(ucd)
  raise "UCD resolver at #{self.end_point} is not currently available" if self.check_availability and !self.available?
  
  ucd_plus = @resolver.translate(ucd).strip
  ucd_plus.match('Could not translate') ? nil : ucd_plus
end