def process_synonyms(rec, taxon)
      accepted_id = taxon[0]
      parent_id = taxon[2]
      rank = taxon[-1]
      return unless %w[species subspecies].include? rank
      synonyms = rec[:synonyms].gsub(/\.$/, "").
                 gsub(%r{<[/ibsup]+>}, "").gsub(/[\s]+/, " ").split(";")
      synonyms = synonyms.map(&:strip)
      synonyms.map do |s|
        next if s =~ /<u>/
        s = rec[:genus] + " " + s if s =~ /^[a-z]/
        @count += 1
        id = @count
        if real_name?(s)
          @core << [id, nil, parent_id, accepted_id, s, "synonym", rank]
        else
          puts "Rejected: #{s}"
        end
      end
    end
def process_synonyms(rec, taxon)
      accepted_id = taxon[0]
      parent_id = taxon[2]
      rank = taxon[-1]
      return unless %w[species subspecies].include? rank
      synonyms = rec[:synonyms].gsub(/\.$/, "").
                 gsub(%r{<[/ibsup]+>}, "").gsub(/[\s]+/, " ").split(";")
      synonyms = synonyms.map(&:strip)
      synonyms.map do |s|
        next if s =~ /<u>/
        s = rec[:genus] + " " + s if s =~ /^[a-z]/
        @count += 1
        id = @count
        if real_name?(s)
          @core << [id, nil, parent_id, accepted_id, s, "synonym", rank]
        else
          puts "Rejected: #{s}"
        end
      end
    end
rubocop:disable Metrics/AbcSize