def each_property
      IO.readlines(path).each do |l|
        begin
          stripped = l.strip.encode("UTF-8")
          if stripped.match(/^\-\-\s+sem\.attribute\./)
            stripped.sub!(/^\-\-\s+sem\.attribute\./, '')
            name, value = stripped.split(/\=/, 2).map(&:strip)
            yield name, value
          end
        rescue Encoding::InvalidByteSequenceError
          # Ignore - attributes must be in ascii
        end
      end
    rescue Encoding::InvalidByteSequenceError
      # Ignore - file must be in ascii in order to parse attributes
    end
def each_property
      IO.readlines(path).each do |l|
        begin
          stripped = l.strip.encode("UTF-8")
          if stripped.match(/^\-\-\s+sem\.attribute\./)
            stripped.sub!(/^\-\-\s+sem\.attribute\./, '')
            name, value = stripped.split(/\=/, 2).map(&:strip)
            yield name, value
          end
        rescue Encoding::InvalidByteSequenceError
          # Ignore - attributes must be in ascii
        end
      end
    rescue Encoding::InvalidByteSequenceError
      # Ignore - file must be in ascii in order to parse attributes
    end
Parse properties from the comments. Looks for this pattern:

 -- sem.attribute.name = value

 and yields each matching row with |name, value|