From e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:27:16 +0100 Subject: mostly the arrangement of conditionals --- lib/sisu/v0/concordance.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/sisu/v0/concordance.rb') diff --git a/lib/sisu/v0/concordance.rb b/lib/sisu/v0/concordance.rb index d60ffc2f..08b25195 100644 --- a/lib/sisu/v0/concordance.rb +++ b/lib/sisu/v0/concordance.rb @@ -241,7 +241,8 @@ WOK end if line =~@rxp_to; toy=line[@rxp_to,1] end - if toy =~/\d+/ and toy !~/^0$/ + if toy =~/\d+/ \ + and toy !~/^0$/ for word in line.scan(@rgx_scanlist) #%take in word or other match word=nil if word =~@rxp_excluded0 #watch word=nil if word =~@rxp_excluded1 #watch @@ -260,12 +261,17 @@ WOK word.gsub!(/^(\d+\.?)+$/, '') word=nil if word =~/^\s*$/ #watch if word - word.capitalize! unless word =~/[A-Z][A-Z]/ or word =~/\w+\s\w+/ + unless word =~/[A-Z][A-Z]/ \ + or word =~/\w+\s\w+/ + word.capitalize! + end #word.downcase! if word =~lesser #word.capitalize! if word =~greater @freq[word] +=1 @word_map[word] ||= [] - if line !~@rxp_lv1 and line !~@rxp_lv2 and line !~@rxp_lv3 + if line !~@rxp_lv1 \ + and line !~@rxp_lv2 \ + and line !~@rxp_lv3 @word_map[word] << location_seg("#@seg\##{toy}",toy) else @word_map[word] << case line -- cgit v1.2.3