diff options
author | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2007-10-15 19:27:16 +0100 |
commit | e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 (patch) | |
tree | 6ffe3ae1b2453578a032ce053934a31f980645e9 /lib/sisu/v0/concordance.rb | |
parent | regex matching of images, (and rearrangement of conditionals) (diff) |
mostly the arrangement of conditionals
Diffstat (limited to 'lib/sisu/v0/concordance.rb')
-rw-r--r-- | lib/sisu/v0/concordance.rb | 12 |
1 files changed, 9 insertions, 3 deletions
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 |