aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/concordance.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-09-13 23:27:28 -0400
committerRalph Amissah <ralph@amissah.com>2008-09-13 23:27:28 -0400
commitdbde53fbcfb79fd01762d97fac929af2a4cfc26a (patch)
treec98a4c884198aab848443f5b57f5e996f2d55bdd /lib/sisu/v0/concordance.rb
parentdal_idx: capitalize first letter of index lev1 for sort; provide letter a-z n... (diff)
dal_idx, and concordance, letter list for navigation
Diffstat (limited to 'lib/sisu/v0/concordance.rb')
-rw-r--r--lib/sisu/v0/concordance.rb25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb
index fad91d14..dd4411ac 100644
--- a/lib/sisu/v0/concordance.rb
+++ b/lib/sisu/v0/concordance.rb
@@ -207,11 +207,11 @@ WOK
def songsheet
begin
mkdir_p(@path) unless FileTest.directory?(@path)
- @file_index_all=File.open("#@path/#{@md.fn[:concordance]}",'w')
+ @file_concordance=File.open("#@path/#{@md.fn[:concordance]}",'w')
map_para
rescue; SiSU_Errors::Info_error.new($!,$@,@md.cmd,@md.fns).error
ensure
- @file_index_all.close
+ @file_concordance.close
end
end
protected
@@ -315,20 +315,33 @@ WOK
end
scr='<font size="1" color="#777777" face=times new roman><img border="0" height="15" width="15" src="../_sisu/image/b_doc.png" alt="Full Text">&nbsp;scroll:&nbsp;</font><font size="1" color="#222222" face=times new roman>doc#&nbsp;</font> '
seg=''
- @file_index_all << SiSU_Concordance::Source::Doc_title.new(@particulars).create
+ @file_concordance << SiSU_Concordance::Source::Doc_title.new(@particulars).create
+ alph=%W[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z]
+ @file_concordance << '<p>'
+ alph.each {|x| @file_concordance << %{<a href="##{x}">#{x}</a>,&nbsp;}}
+ @file_concordance << '</p>'
+ letter=alph.shift
+ @file_concordance << %{\n<hr />\n<p class="book_index_lev1"><a name="A">A</a></p>}
for word in @freq.keys.sort! {|a,b| a.downcase<=>b.downcase}
+ f=/^(\S)/.match(word)[1]
+ if letter < f.upcase
+ while letter < f.upcase
+ letter=alph.shift
+ @file_concordance << %{\n<hr />\n<p class="book_index_lev1"><a name="#{letter}">#{letter}</a></p>}
+ end
+ end
keyword=SiSU_Concordance::Source::Word.new(word,@freq[word]).html
if keyword !~ @rxp_excluded0
if @word_map[word][0] =~ /\d+/
wm=[]
- @file_index_all << %{#{keyword}#{seg}#{@word_map[word].uniq.compact.join}}
+ @file_concordance << %{#{keyword}#{seg}#{@word_map[word].uniq.compact.join}}
end
- @file_index_all << '</p>'
+ @file_concordance << '</p>'
end
# special cases endnotes and header levels 1 - 3
end
credits=@vz.credits_sisu
- @file_index_all << %{</div><div class="content">#{credits}<div></body>\n</html>} # footer
+ @file_concordance << %{</div><div class="content">#{credits}<div></body>\n</html>} # footer
tell=SiSU_Screen::Ansi.new(@md.cmd,@md.fns,"#{@env.path.output_tell}/#{@md.fn[:concordance]}")
tell.flow if @md.cmd =~/[MV]/
end