simple_inline_text_annotation 1.1.1 → 2.0.0

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
  SHA256:
3
- metadata.gz: 061a83e8872ec5b3b011d150d55666121873d2868bcccc038dfd6b62ccbd4403
4
- data.tar.gz: 68305fb2bac8f52a78da2dcee8c5e126370a5787cfdc3bd8e3feb730f874c443
3
+ metadata.gz: 8d8d14f48a850c835dbf62083dcda9ea3f2588e7f2544cacf3125e54481fca37
4
+ data.tar.gz: 50ebe7c23e5d841697f455586c9ed031d7df4d0da8e625630872948506145b2b
5
5
  SHA512:
6
- metadata.gz: 2c82b34b2e6647847113e2b31927193af85f09d9ec285f6a510d4438d0425f7f8c3e3978c5269f4c75ceff3db0efe5f70304b78b0a33107198d59514e4920bd3
7
- data.tar.gz: 2df5b80be4335a6106738846f07716770c1852b77e694c9157997d2987497462b7c5ff8f70b4d862f92c1e4f16cb11e9bcd0d2b513f6bbb1a55fa9e2a1e163cc
6
+ metadata.gz: 99e205823a643812b22d835d9b9eae0041e320430b07175ab95a8b87cfb6287d37c749b18eac48beada081c39bb89a3aa16179cbb930e1ef4b426ce5b4ed0334
7
+ data.tar.gz: ccd90e14e4b0247428bc271e1663c995126f7361c60c59dfa6a2805fe3d255ef82b73f02ca19ed4beefe0486f3075697a96e389a7577b454d29bdbf19bbe6488
data/.rubocop.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  AllCops:
2
2
  TargetRubyVersion: 3.1
3
+ NewCops: enable
3
4
 
4
5
  Style/StringLiterals:
5
6
  EnforcedStyle: double_quotes
@@ -13,3 +14,6 @@ Style/Documentation:
13
14
  Metrics/BlockLength:
14
15
  Exclude:
15
16
  - 'spec/**/*'
17
+
18
+ Gemspec/RequireMFA:
19
+ Enabled: false
@@ -15,11 +15,11 @@ class SimpleInlineTextAnnotation
15
15
  end
16
16
 
17
17
  def span
18
- { begin: @begin_pos, end: @end_pos }
18
+ { "begin" => @begin_pos, "end" => @end_pos }
19
19
  end
20
20
 
21
21
  def to_h
22
- { id: @id, span: span, obj: @obj }.compact
22
+ { "id" => @id, "span" => span, "obj" => @obj }.compact
23
23
  end
24
24
 
25
25
  def nested_within?(other)
@@ -20,12 +20,12 @@ class SimpleInlineTextAnnotation
20
20
  # to_config returns a Array of hashes of each entity type.
21
21
  # Example:
22
22
  # [
23
- # {id: "https://example.com/Person", label: "Person"},
24
- # {id: "https://example.com/Organization", label: "Organization"}
23
+ # {"id" => "https://example.com/Person", "label" => "Person"},
24
+ # {"id" => "https://example.com/Organization", "label" => "Organization"}
25
25
  # ]
26
26
  def to_config
27
27
  entity_types.map do |label, id|
28
- { id: id, label: label }
28
+ { "id" => id, "label" => label }
29
29
  end
30
30
  end
31
31
 
@@ -3,7 +3,7 @@
3
3
  class SimpleInlineTextAnnotation
4
4
  class GeneratorError < StandardError
5
5
  def initialize(msg = nil)
6
- super(msg)
6
+ super
7
7
  end
8
8
  end
9
9
  end
@@ -89,7 +89,7 @@ class SimpleInlineTextAnnotation
89
89
  subj, label, pred, obj2 = annotations
90
90
  obj = get_obj_for(label)
91
91
  @denotations << Denotation.new(begin_pos, end_pos, obj, subj)
92
- @relations << { pred: pred, subj: subj, obj: obj2 }
92
+ @relations << { "pred" => pred, "subj" => subj, "obj" => obj2 }
93
93
  end
94
94
  end
95
95
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class SimpleInlineTextAnnotation
4
- VERSION = "1.1.1"
4
+ VERSION = "2.0.0"
5
5
  end
@@ -38,10 +38,10 @@ class SimpleInlineTextAnnotation
38
38
 
39
39
  def to_h
40
40
  {
41
- text: format_text(@text),
42
- denotations: @denotations.map(&:to_h),
43
- relations: @relations.empty? ? nil : @relations,
44
- config: config
41
+ "text" => format_text(@text),
42
+ "denotations" => @denotations.map(&:to_h),
43
+ "relations" => @relations.empty? ? nil : @relations,
44
+ "config" => config
45
45
  }.compact
46
46
  end
47
47
 
@@ -68,6 +68,6 @@ class SimpleInlineTextAnnotation
68
68
  def config
69
69
  return nil unless @entity_type_collection.any?
70
70
 
71
- { "entity types": @entity_type_collection.to_config }
71
+ { "entity types" => @entity_type_collection.to_config }
72
72
  end
73
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_inline_text_annotation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - xaiBUh29wX
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-05-27 00:00:00.000000000 Z
11
+ date: 2025-07-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem provides inline text annotation functionality, extracted from
14
14
  PubAnnotation, with support for denotations, entity types, and nested spans.