Module: Rabbit::Parser::RD::Ext::Anthy
Constant Summary
Constants included from GetText
Instance Method Summary collapse
Methods included from GetText
N_, _, bindtextdomain, locale=
Instance Method Details
#anthy_hiragana_to_kanji(label, source, content, visitor) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/rabbit/parser/rd/ext/anthy.rb', line 11 def anthy_hiragana_to_kanji(label, source, content, visitor) unless Parser::Ext::Anthy.available? visitor.logger.warn(_("Anthy isn't available")) return nil end src, prop = parse_source(source) converted_src = Parser::Ext::Anthy.hiragana_to_kanji(src) tree = ::RD::RDTree.new("=begin\n#{converted_src}\n=end\n") elems = tree.root.children.collect do |child| child.accept(visitor) end Container.new(elems) end |