aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v4/concordance.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-08-08 00:26:51 -0400
committerRalph Amissah <ralph@amissah.com>2013-08-08 00:26:51 -0400
commit6f88dbf16ce50d3ab246b79e16222447cb3ddfc6 (patch)
treea5b35b294f9278ce2c20179f8ceb0e8c65877640 /lib/sisu/v4/concordance.rb
parentdebian/changelog (4.1.9-1) (diff)
parentv4: merge v5 lib (5.0.10) (diff)
Merge tag 'sisu_4.1.10' into debian/sid
SiSU 4.1.10
Diffstat (limited to 'lib/sisu/v4/concordance.rb')
-rw-r--r--lib/sisu/v4/concordance.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/sisu/v4/concordance.rb b/lib/sisu/v4/concordance.rb
index cba5ae99..567b36e0 100644
--- a/lib/sisu/v4/concordance.rb
+++ b/lib/sisu/v4/concordance.rb
@@ -239,15 +239,14 @@ WOK
%{<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}\##{wordlocation}">#{wordlocation}</a>; }
end
def location_seg(wordlocation,show) ##fix
- @word_location_seg=wordlocation.gsub(/(.+?)\#(\d+)/,"\\1#{@md.lang_code_insert}#{Sfx[:html]}#\\2") unless wordlocation.nil?
- case wordlocation
- when @rxp_t1
- %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, }
- when @rxp_t2
- %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, }
- when @rxp_t3
- %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, }
- else %{<a href="#{@word_location_seg}">#{show}</a>, }
+ unless wordlocation.nil?
+ wl=wordlocation.gsub(/(.+?)\#(\d+)/,"\\1#{@md.lang_code_insert}#{Sfx[:html]}#\\2")
+ case wordlocation
+ when /#{@rxp_t1}|@rxp_t2}|#{@rxp_t3}/
+ %{[<a href="doc#{@md.lang_code_insert}#{Sfx[:html]}##{show}">H</a>]#{show}, }
+ when /(.+?)\#(\d+)/
+ %{<a href="#{wl}">#{show}</a>, }
+ end
end
end
def map_para
@@ -316,10 +315,11 @@ WOK
end
@freq[word] +=1
@word_map[word] ||= []
- if line !~@rxp_lv1 \
- and line !~@rxp_lv2 \
- and line !~@rxp_lv3 #fix @rxp_lv # Mx[:lv_o]
- @word_map[word] << location_seg("#{@seg}\##{ocn}",ocn)
+ if line !~ /#{@rxp_lv1}|#{@rxp_lv2}|#{@rxp_lv3}/
+ loc_=%{#{location_seg("#{@seg}\##{ocn}",ocn).to_s}}
+ unless loc_.empty?
+ @word_map[word] << loc_
+ end
else
@word_map[word] << case line
when @rxp_lv1; location_seg('T1',ocn) #fix @rxp_lv # Mx[:lv_o]