simple_bioc 0.0.15 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 673195f463d46bbf691b695b22a4c8d70c89ef5d
4
- data.tar.gz: 4e6f8f9b391ac41f01b26f7066953487f379d446
3
+ metadata.gz: feecd4ce8d52cafa27b5bc62c3da638352198bf4
4
+ data.tar.gz: 647f59cbc0be3c0aebccf06a07c1dfd6778c92b7
5
5
  SHA512:
6
- metadata.gz: d58fc6f850327e05d65e1e1087b685b30d1854dc98df8011f65c76291e383e1604c44784cf04ac422b283ee4411ebe7af32b86f6a513d0cc7431570fac74b421
7
- data.tar.gz: c150d68d3233d6f6a12815e39a8c00c3bee62305704b31b5b75e6635065279119dc44578091762ad7b7764abb496f24a2b1cb1c8c5e520dd0b9f033e26c77132
6
+ metadata.gz: bc7182bb97f4bc65e8c235e7b59106ae584275a6a1836be8a6740c370260daa4be2b450dac2c7419d6533e95aef5247a5017a4c8a3f217753f76631ff184e3fd
7
+ data.tar.gz: ac121fdc97a23a85456681fdf6e532d6eae6cf6fe17788822d4a3f7ce1e97b1b9febcfdcc2499152ab9da0cddd190e3f895aefa51661f656b0718499d0238663
@@ -111,6 +111,7 @@ module BioCReader
111
111
  def read_location(xml, location, options = {})
112
112
  location.offset = xml["offset"]
113
113
  location.length = xml["length"]
114
+ location.original_offset = xml["original_offset"]
114
115
  true
115
116
  end
116
117
 
@@ -88,7 +88,11 @@ module BioCWriter
88
88
  end
89
89
 
90
90
  def write_location(xml, location)
91
- xml.location(:offset => location.offset, :length => location.length)
91
+ if location.original_offset.nil? || location.original_offset == location.offset
92
+ xml.location(:offset => location.offset, :length => location.length)
93
+ else
94
+ xml.location(:offset => location.offset, :length => location.length, :original_offset => location.original_offset)
95
+ end
92
96
  end
93
97
 
94
98
  def write_node(xml, node)
@@ -6,7 +6,7 @@ module SimpleBioC
6
6
  obj.annotations.each do |a|
7
7
  positions = find_all_locations(obj, a.text)
8
8
  a.locations.each do |l|
9
- l.original_offset = l.offset.to_i
9
+ l.original_offset = l.offset.to_i if l.original_offset.nil?
10
10
  l.offset = choose_offset_candidate(l.offset, positions)
11
11
  end
12
12
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleBioC
2
- VERSION = "0.0.15"
2
+ VERSION = "0.0.16"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_bioc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dongseop Kwon