aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3dv/dal_idx.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3dv/dal_idx.rb')
-rw-r--r--lib/sisu/v3dv/dal_idx.rb23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/sisu/v3dv/dal_idx.rb b/lib/sisu/v3dv/dal_idx.rb
index 8ba2f2b5..5f4a38e0 100644
--- a/lib/sisu/v3dv/dal_idx.rb
+++ b/lib/sisu/v3dv/dal_idx.rb
@@ -101,21 +101,20 @@ module SiSU_DAL_BookIndex
g=idx_list.scan(/[^;]+/)
idxl=[]
g.each do |i|
- i.strip!
+ i=i.strip
idxl << { rough_idx: i, ocn: ocn, seg: seg }
end
idxl
else { rough_idx: idx_list, ocn: ocn, seg: seg }
end
end
- idx_lst.flatten!
- idx_lst
+ idx_lst=idx_lst.flatten
end
def construct_book_index(idx_array)
the_idx={}
idx_array.each do |idx|
idx_lst=idx[:rough_idx].scan(/[^|:]+/)
- idx_lst[0].strip!
+ idx_lst[0]=idx_lst[0].strip
if idx_lst[0] =~/.+?\+\d+/
use,plus=/(.+?)\+(\d+)/.match(idx_lst[0])[1,2]
else use=idx_lst[0]
@@ -123,7 +122,7 @@ module SiSU_DAL_BookIndex
use=use[0].chr.capitalize + use[1,use.length]
the_idx[use]={} unless the_idx[use] and defined? the_idx[use]
idx_lst.each do |i|
- i.strip!
+ i=i.strip
i,r=/(.+?)\+(\d+)/.match(i)[1,2] if i =~/.+?\+\d+/
x=if idx_lst.length==1 or idx_lst[0].gsub(/\+\d+/,'')==i
the_idx[use]['term_node_lev1']=[] unless the_idx[use]['term_node_lev1'] and defined? the_idx[use]['term_node_lev1']
@@ -151,12 +150,12 @@ module SiSU_DAL_BookIndex
the_idx
end
def clean_xml(str)
- str.gsub!(/&/,'&#038;')
- str.gsub!(/\(/,'&#040;')
- str.gsub!(/\)/,'&#041;')
- str.gsub!(/\*/,'&#042;')
- str.gsub!(/\+/,'&#043;')
- str.gsub!(/,/,'&#044;')
+ str=str.gsub(/&/,'&#038;').
+ gsub(/\(/,'&#040;').
+ gsub(/\)/,'&#041;').
+ gsub(/\*/,'&#042;').
+ gsub(/\+/,'&#043;').
+ gsub(/,/,'&#044;')
str
end
def index(the_idx)
@@ -347,7 +346,7 @@ module SiSU_DAL_BookIndex
def clean_index(data) #check on use of dob
tuned_file=[]
data.each do |para|
- para.gsub!(/\n*#{@rgx_idx}/m,'')
+ para=para.gsub(/\n*#{@rgx_idx}/m,'')
tuned_file << para
end
tuned_file