45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# File 'lib/review/latexbuilder.rb', line 45
def setup_index
@index_db = {}
@index_mecab = nil
return true unless @book.config['pdfmaker']['makeindex']
if @book.config['pdfmaker']['makeindex_dic']
@index_db = load_idxdb(@book.config['pdfmaker']['makeindex_dic'])
end
return true unless @book.config['pdfmaker']['makeindex_mecab']
begin
begin
require 'MeCab'
rescue LoadError
require 'mecab'
end
require 'nkf'
@index_mecab = MeCab::Tagger.new(@book.config['pdfmaker']['makeindex_mecab_opts'])
rescue LoadError
warn 'not found MeCab', location: location
end
end
|