Module: Analects

Defined in:
lib/analects.rb,
lib/analects/source.rb,
lib/analects/library.rb,
lib/analects/version.rb,
lib/analects/encoding.rb,
lib/analects/models/zi.rb,
lib/analects/tokenizer.rb,
lib/analects/hsk_loader.rb,
lib/analects/rake_tasks.rb,
lib/generators/analects.rb,
lib/analects/cli/progress.rb,
lib/analects/cedict_loader.rb,
lib/analects/unihan_loader.rb,
lib/analects/chise_ids_loader.rb,
lib/analects/models/kangxi_radical.rb,
lib/generators/analects/cedict/cedict_generator.rb

Defined Under Namespace

Modules: CLI, Encoding, Generators, Models Classes: CedictLoader, ChiseIdsLoader, HskLoader, Library, RakeTasks, Source, Tokenizer, UnihanLoader

Constant Summary collapse

ROOT =
Pathname(__FILE__).dirname.parent
CEDICT_URL =
'http://www.mdbg.net/chindict/export/cedict/cedict_1_0_ts_utf-8_mdbg.txt.gz'
CHISE_IDS_URL =
'http://git.chise.org/git/chise/ids.git'
UNIHAN_URL =
'http://www.unicode.org/Public/UCD/latest/ucd/Unihan.zip'
HSK_URL =
'https://raw.githubusercontent.com/plexus/analects-data/master/hsk/hsk.csv'
TW_CURRICULUM_URL =
'https://raw.githubusercontent.com/plexus/analects-data/master/taiwan_school_curriculum.txt'
VERSION =
'0.4.2'

Class Method Summary collapse

Class Method Details

.cjk?(str) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
23
# File 'lib/analects.rb', line 19

def self.cjk?(str)
  str.codepoints.all? do |cp|
    Analects::Models::Zi.codepoint_ranges.any? {|range| range.include?(cp)}
  end
end

.init_rake_tasks(*args, &blk) ⇒ Object



14
15
16
17
# File 'lib/analects.rb', line 14

def self.init_rake_tasks(*args, &blk)
  require 'analects/rake_tasks'
  Analects::RakeTasks.new(*args, &blk)
end