lib/bio/db/fasta/defline.rb in bio-1.4.3.0001 vs lib/bio/db/fasta/defline.rb in bio-1.5.0

- old
+ new

@@ -4,11 +4,10 @@ # Copyright:: Copyright (C) 2001, 2002 # GOTO Naohisa <ngoto@gen-info.osaka-u.ac.jp>, # Toshiaki Katayama <k@bioruby.org> # License:: The Ruby License # -# $Id: defline.rb,v 1.1.2.1 2008/06/20 13:22:32 ngoto Exp $ # # == Description # # Bio::FastaDefline is a parser class for definition line (defline) # of the FASTA format. @@ -290,11 +289,10 @@ # this method destroys ary data = [] while token = ary.shift if labels = self.class::NSIDs[token] then di = [ token ] - idtype = token labels.each do |x| token = ary.shift break unless token if self.class::NSIDs[token] then ary.unshift(token) @@ -389,10 +387,10 @@ ] # Shows words used in the defline. Returns an Array. def words(case_sensitive = nil, kill_regexp = self.class::KillRegexpArray, kwhash = self.class::KillWordsHash) - a = descriptions.join(' ').split(/[\.\,\;\:\(\)\[\]\{\}\<\>\"\'\`\~\/\|\?\!\&\@\#\s\x00-\x1f\x7f]+/) + a = descriptions.join(' ').split(/[\.\,\;\:\(\)\[\]\{\}\<\>\"\'\`\~\/\|\?\!\&\@\# \x00-\x1f\x7f]+/) a.collect! do |x| x.sub!(/\A[\$\*\-\+]+/, '') x.sub!(/[\$\*\-\=]+\z/, '') if x.size <= 1 then nil