mexico 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTU2MmVjZDQ1ZGUyZjIyZTU2YWZjNzY5YzVmZGNhYmUzOTM0ZjE3Yw==
4
+ MzA1YTcwYjg0ZjIyZGE2MWMwN2ViMGRkMmVkOGU0OGU4Y2EwNjE2Zg==
5
5
  data.tar.gz: !binary |-
6
- Zjc3NDE2NWUzMTM0ZTIwMzJiZDQ5ODQwMDQ0YWJiMDY5MDUzMzNiMQ==
6
+ NzllMzRjMWNkMzIxN2M2YjE2ODAwZmRkYTQ2NWY2MzMyMjkyMzVkYw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODNiZmI3N2JjMzY0ZjQ2YWQ3NGFiNTgwNTA1YzJiY2IxZDZkOTU4MGEzOWI1
10
- MTllMjdjZTdiNGMzMGVmNTg4YWZjYmY4NGI2NTNlNDQ1NjRmNmI3YTcyNTMw
11
- MWQ5ZDNjMzRkOWIwNmVjZWZkMWUzYTA4N2YyYWMzMDk0OGUzMzA=
9
+ ZGY3ZGJkYTM3OWM1Mjk2NzQyZGVhYTdlOGMyYjg0MmVmOTE1ZDVhNDdjOGUy
10
+ MjIyZDVkN2I5N2FkZDNhYWM4MzYzYjU3Yzc4M2U0M2IyMWIyYzJmYzM0MzQ3
11
+ ODk0YmFkMzBkNjc2OTc4YjE2NDNkYzdkYjdiYTM3NTM1MWI1Zjg=
12
12
  data.tar.gz: !binary |-
13
- ZjRhODUzODVjMWY4YjlhMzNhZmRmYmZjYzU0ZTU4Nzc5NzNmZWU2ZTlkOThh
14
- MzBkODNkZDU4M2RlNDNhNWI1YjUzNTdlMjMyZDc2MWJiZmZlYTZhNDQzOTg3
15
- ZDk5NTUxNmQ4YmY4ZDRiMGUwYTIxYjZjYjliN2Q4NWU4M2FmZGM=
13
+ MDgyNDcxNjkzMjM5MzE4YzcxMjlmN2IzMWQ3MTkzNTFlYjRjMTIwYzA0MjRl
14
+ ZDM5NGFmMDQxNTRlMzFiY2ZmNGQ2OTE2NjRiOTgwYjNiZTk5NWIwZDE2OWM0
15
+ OTE4Nzk0Nzk4ZDY3MGVhMzNkNzEwNDY3ODgyODkwZjc3NTE2MDg=
data/Gemfile CHANGED
@@ -10,10 +10,10 @@ gem 'roxml'
10
10
  gem 'builder'
11
11
  gem 'colorize'
12
12
 
13
- gem 'rdf', '~> 1.0.7'
14
- gem 'rdf-turtle', '~> 1.0.8'
13
+ gem 'rdf', '~> 1.1'
14
+ gem 'rdf-turtle', '~> 1.1'
15
15
  # gem 'rdf-ntriples'
16
- gem 'rdf-rdfxml'
16
+ gem 'rdf-rdfxml', '~> 1.1'
17
17
  #gem 'poseidon', :require => true, :path => '~/code/poseidon'
18
18
  gem 'poseidon', '~> 1.1.1', :require => true, :git => 'git://github.com/sfb673/poseidon.git'
19
19
 
data/README.md CHANGED
@@ -10,6 +10,13 @@ Its central organising unit is the **Corpus** class which allows researchers to
10
10
 
11
11
  ## Last Changes
12
12
 
13
+ ## 0.0.12 (Hotfix)
14
+
15
+ Completed on April 10 2014.
16
+
17
+ + [**#269**](http://intranet.sfb673.org/issues/269): Fixes a constructor in LayerConnector that did not allow parameter-less initialization (as needed by ROXML).
18
+ + [**#270**](http://intranet.sfb673.org/issues/270): The chat game corpus interface now uses the current setter methods.
19
+
13
20
  ## 0.0.11
14
21
 
15
22
  Completed on March 24 2014.
data/Rakefile CHANGED
@@ -64,3 +64,9 @@ end
64
64
  task :undoc do |t|
65
65
  YARD::CLI::Stats.run('--list-undoc')
66
66
  end
67
+
68
+ desc "Open an irb session preloaded with this library"
69
+ task :console do
70
+ sh "irb -rubygems -I lib -r test.rb"
71
+ end
72
+
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.11
1
+ 0.0.12
@@ -0,0 +1,4 @@
1
+ ## Release notes for version 0.0.12 – Import fixes
2
+
3
+ + [**#269**](http://intranet.sfb673.org/issues/269): Fixes a constructor in LayerConnector that did not allow parameter-less initialization (as needed by ROXML).
4
+ + [**#270**](http://intranet.sfb673.org/issues/270): The chat game corpus interface now uses the current setter methods.
@@ -40,8 +40,8 @@ class Mexico::Fiesta::Interfaces::B6ChatGameInterface
40
40
  t = fiesta_document.add_standard_timeline('s')
41
41
  x = Scale.new(identifier: 'spatial_x', name: 'Spatial coordinate X', unit: 'pixel', document: f)
42
42
  y = Scale.new(identifier: 'spatial_y', name: 'Spatial coordinate Y', unit: 'pixel', document: f)
43
- fiesta_document.scales << x
44
- fiesta_document.scales << y
43
+ fiesta_document.add_scale x
44
+ fiesta_document.add_scale y
45
45
 
46
46
  lChats = Layer.new(identifier: 'chats', name: 'Chats', document: f)
47
47
  lMoves = Layer.new(identifier: 'moves', name: 'Moves', document: f)
@@ -56,11 +56,11 @@ class Mexico::Fiesta::Interfaces::B6ChatGameInterface
56
56
  # - sentences, with attributes
57
57
  # - their parsetrees, with attributes
58
58
 
59
- fiesta_document.layers << lChats
60
- fiesta_document.layers << lMoves
61
- fiesta_document.layers << lSents
62
- fiesta_document.layers << lParsT
63
- fiesta_document.layers << lParsP
59
+ fiesta_document.add_layer lChats
60
+ fiesta_document.add_layer lMoves
61
+ fiesta_document.add_layer lSents
62
+ fiesta_document.add_layer lParsT
63
+ fiesta_document.add_layer lParsP
64
64
 
65
65
  # B6 data is avaiable in XML documents, so we read
66
66
  # those into a Nokogiri object.
@@ -92,7 +92,7 @@ class Mexico::Fiesta::Interfaces::B6ChatGameInterface
92
92
  i.data = Data.new(item: i, document: f)
93
93
  # link layer
94
94
  i.layer_links << LayerLink.new(identifier: "move-#{el_counter}-layer", target_object: lMoves, document: f)
95
- fiesta_document.items << i
95
+ fiesta_document.add_item i
96
96
  end
97
97
 
98
98
  if tag_name == 'chat'
@@ -101,7 +101,7 @@ class Mexico::Fiesta::Interfaces::B6ChatGameInterface
101
101
  i.point_links << PointLink.new(identifier: "chat-#{el_counter}-t", point: time_val , target_object: t, document: f)
102
102
  i.data = Data.new(:string_value => action['message'], item: i, document: f)
103
103
  i.layer_links << LayerLink.new(identifier: "chat-#{el_counter}-layer", target_object: lChats, document: f)
104
- fiesta_document.items << i
104
+ fiesta_document.add_item i
105
105
  # todo: remember this chat item, the next annotations refer to it
106
106
 
107
107
  last_chat_elem = action
@@ -141,28 +141,24 @@ class Mexico::Fiesta::Interfaces::B6ChatGameInterface
141
141
  no: sentence['no']}),
142
142
  item: sent_item, document: f
143
143
  sidm = sent_item.data.map
144
- f.items << sent_item
144
+ f.add_item sent_item
145
145
 
146
146
  parsetree_elem = sentence.xpath('./parsetree').first
147
- pt_id = parsetree_elem['id']
148
- parsetree_item = Item.new identifier: pt_id , document: f
149
-
150
- parsetree_item.item_links << ItemLink.new(identifier: "#{pt_id}-to-sentence", target_object: sent_item, role: 'parent', document: f)
151
- parsetree_item.layer_links << LayerLink.new(identifier:"#{pt_id}-to-layer", target_object: lParsT, document: f )
152
-
153
- parsetree_item.data = Data.new map: Mexico::FileSystem::FiestaMap.new({
154
- tiefe: parsetree_elem['tiefe'],
155
- verzweigung: parsetree_elem['verzweigung'],
156
- hoeflichkeit: parsetree_elem['hoeflichkeit']}),
157
- item: parsetree_item, document: f
158
-
159
- # parsetree_item.data = Mexico::FileSystem::Data.new string_value: "Parsetree"
160
-
161
-
162
- f.items << parsetree_item
163
-
164
- convert_phrases f, parsetree_item, lParsP, parsetree_elem
165
-
147
+ if parsetree_elem.nil?
148
+ $stderr.puts "There is a parsetree missing in sentence #{s_id}"
149
+ else
150
+ pt_id = parsetree_elem['id']
151
+ parsetree_item = Item.new identifier: pt_id , document: f
152
+ parsetree_item.item_links << ItemLink.new(identifier: "#{pt_id}-to-sentence", target_object: sent_item, role: 'parent', document: f)
153
+ parsetree_item.layer_links << LayerLink.new(identifier:"#{pt_id}-to-layer", target_object: lParsT, document: f )
154
+ parsetree_item.data = Data.new map: Mexico::FileSystem::FiestaMap.new({
155
+ tiefe: parsetree_elem['tiefe'],
156
+ verzweigung: parsetree_elem['verzweigung'],
157
+ hoeflichkeit: parsetree_elem['hoeflichkeit']}),
158
+ item: parsetree_item, document: f
159
+ f.add_item parsetree_item
160
+ convert_phrases f, parsetree_item, lParsP, parsetree_elem
161
+ end
166
162
  end
167
163
  end
168
164
  end
@@ -163,6 +163,20 @@ class Mexico::FileSystem::FiestaDocument
163
163
  return nil
164
164
  end
165
165
 
166
+ def add_scale(args)
167
+ if args.is_a?(Hash)
168
+ new_layer = Mexico::FileSystem::Scale.new(args.merge({document: self}))
169
+ @scales_container << new_layer
170
+ return new_layer
171
+ end
172
+ if args.is_a?(Mexico::FileSystem::Scale)
173
+ @scales_container << args
174
+ return args
175
+ end
176
+ # @TODO catch error if parameter has wrong object type
177
+ return nil
178
+ end
179
+
166
180
  # This method attempts to link objects from other locations of the XML/object tree
167
181
  # into position inside this object, by following the xml ids given in the
168
182
  # appropriate fields of this class.
@@ -38,7 +38,7 @@ class Mexico::FileSystem::LayerConnector
38
38
  attr_accessor :document
39
39
 
40
40
 
41
- def initialize(new_source, new_target, args={})
41
+ def initialize(new_source=nil, new_target=nil, args={})
42
42
  self.source= new_source
43
43
  self.target= new_target
44
44
  args.each do |k,v|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mexico
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Menke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-24 00:00:00.000000000 Z
11
+ date: 2014-04-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -72,42 +72,42 @@ dependencies:
72
72
  requirements:
73
73
  - - ~>
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.7
75
+ version: '1.1'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ~>
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.7
82
+ version: '1.1'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rdf-turtle
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: 1.0.8
89
+ version: '1.1'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: 1.0.8
96
+ version: '1.1'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rdf-rdfxml
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '0'
103
+ version: '1.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '0'
110
+ version: '1.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: poseidon
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -249,6 +249,7 @@ files:
249
249
  - info/releasenotes/0.0.1.md
250
250
  - info/releasenotes/0.0.10.md
251
251
  - info/releasenotes/0.0.11.md
252
+ - info/releasenotes/0.0.12.md
252
253
  - info/releasenotes/0.0.2.md
253
254
  - info/releasenotes/0.0.3.md
254
255
  - info/releasenotes/0.0.4.md