Module: Natsukantou

Defined in:
lib/natsukantou/deep_l.rb,
lib/natsukantou.rb,
lib/natsukantou/minhon.rb,
lib/natsukantou/version.rb,
lib/natsukantou/chat_gpt.rb,
lib/natsukantou/utility/env.rb,
lib/natsukantou/setup/registry.rb,
lib/natsukantou/utility/logger.rb,
lib/natsukantou/utility/parse_xml.rb,
lib/natsukantou/handle_ruby_markup.rb,
lib/natsukantou/setup/write_prompt.rb,
lib/natsukantou/setup/config_prompt.rb,
lib/natsukantou/substitude_glossary.rb,
lib/natsukantou/utility/utility_base.rb,
lib/natsukantou/utility/language_code.rb,
lib/natsukantou/setup/config_load_or_prompt.rb

Overview

Glossary isn’t supported in some language combinations (e.g. DeepL ja to zh). We can however substitude terms prior to translation and mark it as translated.

Support TSV format

Defined Under Namespace

Modules: Logger, ParseXml, Setup, UtilityBase Classes: ChatGpt, DeepL, Env, Error, HandleRubyMarkup, LanguageCode, Minhon, SubstitudeGlossary

Constant Summary collapse

VERSION =
"0.2.2"

Class Method Summary collapse

Class Method Details

.autoload_and_register(type, constant, path) ⇒ Object

While autoloading in Ruby, also keep it in the local registry, which can be used in setup prompt.



20
21
22
23
24
25
26
27
28
# File 'lib/natsukantou.rb', line 20

def self.autoload_and_register(type, constant, path)
  Setup::Registry.instance.register(
    type,
    constant,
    (File.expand_path "../#{path}.rb", __FILE__)
  )

  autoload(constant, path)
end

.loggerObject



42
43
44
# File 'lib/natsukantou.rb', line 42

def self.logger
  @logger ||= ::Logger.new($stdout)
end