Class: SiSU_XHTML_EPUB2_Concordance::Source
- Inherits:
-
Object
- Object
- SiSU_XHTML_EPUB2_Concordance::Source
- Defined in:
- lib/sisu/xhtml_epub2_concordance.rb
Defined Under Namespace
Classes: DocTitle, Word, Words
Instance Method Summary collapse
-
#initialize(opt) ⇒ Source
constructor
A new instance of Source.
- #read ⇒ Object
Constructor Details
#initialize(opt) ⇒ Source
Returns a new instance of Source.
64 65 66 67 |
# File 'lib/sisu/xhtml_epub2_concordance.rb', line 64 def initialize(opt) @opt=opt @particulars=SiSU_Particulars::CombinedSingleton.instance.get_all(opt) end |
Instance Method Details
#read ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/sisu/xhtml_epub2_concordance.rb', line 68 def read begin @env,@md=@particulars.env,@particulars.md wordmax=@env.concord_max unless @md.wc_words.nil? if @md.wc_words < wordmax SiSU_XHTML_EPUB2_Concordance::Source::Words.new(@particulars).songsheet else SiSU_Screen::Ansi.new( @md.opt.act[:color_state][:set], "*WARN* concordance skipped, large document has over #{wordmax} words (#{@md.wc_words})" ).warn unless @md.opt.act[:quiet][:set]==:on end else SiSU_Screen::Ansi.new( @md.opt.act[:color_state][:set], "*WARN* wc (word count) is off, concordance will be processed for all files including those over the max set size of: #{wordmax} words" ).warn unless @md.opt.act[:quiet][:set]==:on SiSU_XHTML_EPUB2_Concordance::Source::Words.new(@particulars).songsheet end rescue SiSU_Errors::Rescued.new($!,$@,@md.opt.selections.str,@md.fns).location do __LINE__.to_s + ':' + __FILE__ end ensure end end |