iqvoc_inflectionals 2.5.0 → 2.8.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 +4 -4
- data/.travis.yml +9 -5
- data/Gemfile +2 -3
- data/Gemfile.lock +218 -167
- data/app/assets/stylesheets/manifest.css.scss +1 -0
- data/app/models/concerns/inflectionable.rb +16 -24
- data/app/models/inflectional/base.rb +26 -29
- data/app/views/partials/inflectional/_base.html.erb +10 -1
- data/app/views/partials/inflectional/_edit_base.html.erb +8 -4
- data/bin/bundle +3 -0
- data/bin/rails +2 -8
- data/bin/rake +3 -6
- data/bin/setup +29 -0
- data/db/migrate/20150108155020_add_fk_constraints_iqvoc_inflectionals.rb +5 -0
- data/db/migrate/20160127131143_add_inflectional_attributes_to_label.rb +6 -0
- data/db/migrate/20160331092532_change_inflectional_value_collation.rb +13 -0
- data/iqvoc_inflectionals.gemspec +2 -2
- data/lib/iqvoc/inflectionals/version.rb +1 -1
- data/test/unit/import_test.rb +1 -2
- data/test/unit/inflectional_generation_test.rb +94 -0
- data/test/unit/inflectional_test.rb +2 -6
- metadata +14 -9
- data/config/initializers/origin_filters.rb +0 -3
- data/lib/iqvoc/inflectionals/base_form_sanitizer.rb +0 -13
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b28bd25f25c0382a44c31ed385058ee53394cddc
|
|
4
|
+
data.tar.gz: 3e19663335b8390017deef4fe12c71ec2f87f133
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5cef71544e61fabacd3067605bcbcededfdfdd100e4ec43456936020cfab8be85b9245c73765e02ef27b8113123f99abe863e1a4e5f9499d34197d630de95cd
|
|
7
|
+
data.tar.gz: eba135aaa0ae49e62ccf15e5676d26a67cde32a8122c64d5ec52d8313f3d9606c048180878d0e49a952edf352828bc902b1db2e7b7d5731b201c630281e18b3e
|
data/.travis.yml
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
language: ruby
|
|
2
2
|
cache: bundler
|
|
3
|
-
bundler_args:
|
|
3
|
+
bundler_args: "--without production --retry 3"
|
|
4
4
|
rvm:
|
|
5
|
-
- 1.9.3
|
|
5
|
+
# - 1.9.3
|
|
6
6
|
- 2.0
|
|
7
|
-
- 2.
|
|
8
|
-
-
|
|
7
|
+
- 2.2
|
|
8
|
+
- ruby-head
|
|
9
|
+
# - jruby-19mode
|
|
10
|
+
# - jruby-head
|
|
9
11
|
env:
|
|
10
12
|
- DB=sqlite
|
|
11
13
|
- DB=mysql
|
|
12
|
-
before_install:
|
|
14
|
+
before_install:
|
|
15
|
+
- cp config/database.yml.$DB config/database.yml
|
|
16
|
+
- gem update bundler
|
|
13
17
|
before_script:
|
|
14
18
|
- bundle exec rake db:drop RAILS_ENV=test
|
|
15
19
|
- bundle exec rake db:create RAILS_ENV=test
|
data/Gemfile
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
source 'https://rubygems.org'
|
|
2
2
|
|
|
3
|
-
gem 'iqvoc', '~> 4.
|
|
4
|
-
gem 'iqvoc_skosxl', '~> 2.
|
|
3
|
+
gem 'iqvoc', '~> 4.10.0', :github => 'innoq/iqvoc', branch: 'master'
|
|
4
|
+
gem 'iqvoc_skosxl', '~> 2.8.0', :github => 'innoq/iqvoc_skosxl', branch: 'master'
|
|
5
5
|
|
|
6
6
|
group :development, :test do
|
|
7
|
-
gem 'spring'
|
|
8
7
|
gem 'pry-rails'
|
|
9
8
|
|
|
10
9
|
platforms :ruby do
|
data/Gemfile.lock
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
GIT
|
|
2
2
|
remote: git://github.com/innoq/iqvoc.git
|
|
3
|
-
revision:
|
|
3
|
+
revision: 872456feda103f7f3df4e771ab1ba608a985cac6
|
|
4
|
+
branch: master
|
|
4
5
|
specs:
|
|
5
|
-
iqvoc (4.
|
|
6
|
-
apipie-rails
|
|
6
|
+
iqvoc (4.10.0)
|
|
7
|
+
apipie-rails (~> 0.3.5)
|
|
7
8
|
authlogic (~> 3.4.2)
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
autoprefixer-rails (~> 5.1.8)
|
|
10
|
+
bootstrap-sass (~> 3.3.1.0)
|
|
11
|
+
bootstrap_form (~> 2.2.0)
|
|
10
12
|
bundler
|
|
11
13
|
cancancan
|
|
12
14
|
carrierwave
|
|
13
15
|
database_cleaner
|
|
14
16
|
delayed_job_active_record (~> 4.0.1)
|
|
15
|
-
faraday
|
|
17
|
+
faraday (= 0.9.0)
|
|
16
18
|
faraday_middleware
|
|
17
|
-
font-awesome-rails
|
|
19
|
+
font-awesome-rails (~> 4.2.0)
|
|
18
20
|
iq_rdf (>= 0.1.15)
|
|
19
21
|
iq_triplestorage
|
|
20
22
|
json
|
|
@@ -23,262 +25,309 @@ GIT
|
|
|
23
25
|
linkeddata
|
|
24
26
|
maruku
|
|
25
27
|
nokogiri
|
|
26
|
-
rails (~> 4.
|
|
28
|
+
rails (~> 4.2.0)
|
|
27
29
|
rails_autolink
|
|
28
|
-
sass-rails (~>
|
|
30
|
+
sass-rails (~> 5.0.0)
|
|
29
31
|
uglifier (>= 1.3.0)
|
|
30
32
|
|
|
31
33
|
GIT
|
|
32
34
|
remote: git://github.com/innoq/iqvoc_skosxl.git
|
|
33
|
-
revision:
|
|
35
|
+
revision: 76b2f925be425d8236379d7487023a7053629ad2
|
|
36
|
+
branch: master
|
|
34
37
|
specs:
|
|
35
|
-
iqvoc_skosxl (2.
|
|
36
|
-
iqvoc (~> 4.
|
|
38
|
+
iqvoc_skosxl (2.8.0)
|
|
39
|
+
iqvoc (~> 4.10.0)
|
|
37
40
|
|
|
38
41
|
GEM
|
|
39
42
|
remote: https://rubygems.org/
|
|
40
43
|
specs:
|
|
41
|
-
actionmailer (4.1
|
|
42
|
-
actionpack (= 4.1
|
|
43
|
-
actionview (= 4.1
|
|
44
|
+
actionmailer (4.2.1)
|
|
45
|
+
actionpack (= 4.2.1)
|
|
46
|
+
actionview (= 4.2.1)
|
|
47
|
+
activejob (= 4.2.1)
|
|
44
48
|
mail (~> 2.5, >= 2.5.4)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
50
|
+
actionpack (4.2.1)
|
|
51
|
+
actionview (= 4.2.1)
|
|
52
|
+
activesupport (= 4.2.1)
|
|
53
|
+
rack (~> 1.6)
|
|
49
54
|
rack-test (~> 0.6.2)
|
|
50
|
-
|
|
51
|
-
|
|
55
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
56
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
57
|
+
actionview (4.2.1)
|
|
58
|
+
activesupport (= 4.2.1)
|
|
52
59
|
builder (~> 3.1)
|
|
53
60
|
erubis (~> 2.7.0)
|
|
54
|
-
|
|
55
|
-
|
|
61
|
+
rails-dom-testing (~> 1.0, >= 1.0.5)
|
|
62
|
+
rails-html-sanitizer (~> 1.0, >= 1.0.1)
|
|
63
|
+
activejob (4.2.1)
|
|
64
|
+
activesupport (= 4.2.1)
|
|
65
|
+
globalid (>= 0.3.0)
|
|
66
|
+
activemodel (4.2.1)
|
|
67
|
+
activesupport (= 4.2.1)
|
|
56
68
|
builder (~> 3.1)
|
|
57
|
-
activerecord (4.1
|
|
58
|
-
activemodel (= 4.1
|
|
59
|
-
activesupport (= 4.1
|
|
60
|
-
arel (~>
|
|
61
|
-
activerecord-jdbc-adapter (1.3.
|
|
69
|
+
activerecord (4.2.1)
|
|
70
|
+
activemodel (= 4.2.1)
|
|
71
|
+
activesupport (= 4.2.1)
|
|
72
|
+
arel (~> 6.0)
|
|
73
|
+
activerecord-jdbc-adapter (1.3.14)
|
|
62
74
|
activerecord (>= 2.2)
|
|
63
|
-
activerecord-jdbcmysql-adapter (1.3.
|
|
64
|
-
activerecord-jdbc-adapter (~> 1.3.
|
|
75
|
+
activerecord-jdbcmysql-adapter (1.3.14)
|
|
76
|
+
activerecord-jdbc-adapter (~> 1.3.14)
|
|
65
77
|
jdbc-mysql (>= 5.1.22)
|
|
66
|
-
activerecord-jdbcsqlite3-adapter (1.3.
|
|
67
|
-
activerecord-jdbc-adapter (~> 1.3.
|
|
68
|
-
jdbc-sqlite3 (
|
|
69
|
-
activesupport (4.1
|
|
70
|
-
i18n (~> 0.
|
|
78
|
+
activerecord-jdbcsqlite3-adapter (1.3.14)
|
|
79
|
+
activerecord-jdbc-adapter (~> 1.3.14)
|
|
80
|
+
jdbc-sqlite3 (>= 3.7.2, < 3.9)
|
|
81
|
+
activesupport (4.2.1)
|
|
82
|
+
i18n (~> 0.7)
|
|
71
83
|
json (~> 1.7, >= 1.7.7)
|
|
72
84
|
minitest (~> 5.1)
|
|
73
|
-
thread_safe (~> 0.
|
|
85
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
|
74
86
|
tzinfo (~> 1.1)
|
|
75
|
-
|
|
87
|
+
addressable (2.4.0)
|
|
88
|
+
apipie-rails (0.3.5)
|
|
76
89
|
json
|
|
77
|
-
arel (
|
|
78
|
-
authlogic (3.4.
|
|
90
|
+
arel (6.0.0)
|
|
91
|
+
authlogic (3.4.6)
|
|
79
92
|
activerecord (>= 3.2)
|
|
80
93
|
activesupport (>= 3.2)
|
|
81
94
|
request_store (~> 1.0)
|
|
82
|
-
scrypt (
|
|
83
|
-
|
|
95
|
+
scrypt (>= 1.2, < 3.0)
|
|
96
|
+
autoprefixer-rails (5.1.11)
|
|
97
|
+
execjs
|
|
98
|
+
json
|
|
99
|
+
bcp47 (0.3.3)
|
|
100
|
+
i18n
|
|
101
|
+
bootstrap-sass (3.3.1.0)
|
|
84
102
|
sass (~> 3.2)
|
|
85
|
-
bootstrap_form (2.
|
|
103
|
+
bootstrap_form (2.2.0)
|
|
86
104
|
builder (3.2.2)
|
|
87
|
-
cancancan (1.
|
|
105
|
+
cancancan (1.13.1)
|
|
88
106
|
carrierwave (0.10.0)
|
|
89
107
|
activemodel (>= 3.2.0)
|
|
90
108
|
activesupport (>= 3.2.0)
|
|
91
109
|
json (>= 1.7)
|
|
92
110
|
mime-types (>= 1.16)
|
|
93
111
|
coderay (1.1.0)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
112
|
+
concurrent-ruby (1.0.0)
|
|
113
|
+
database_cleaner (1.5.1)
|
|
114
|
+
delayed_job (4.0.6)
|
|
115
|
+
activesupport (>= 3.0, < 5.0)
|
|
116
|
+
delayed_job_active_record (4.0.3)
|
|
117
|
+
activerecord (>= 3.0, < 5.0)
|
|
99
118
|
delayed_job (>= 3.0, < 4.1)
|
|
100
|
-
ebnf (0.
|
|
101
|
-
haml (~> 4.0)
|
|
119
|
+
ebnf (1.0.0)
|
|
102
120
|
rdf (~> 1.1)
|
|
103
121
|
sxp (~> 0.1, >= 0.1.3)
|
|
104
|
-
equivalent-xml (0.
|
|
122
|
+
equivalent-xml (0.6.0)
|
|
105
123
|
nokogiri (>= 1.4.3)
|
|
106
124
|
erubis (2.7.0)
|
|
107
|
-
execjs (2.
|
|
125
|
+
execjs (2.6.0)
|
|
108
126
|
faraday (0.9.0)
|
|
109
127
|
multipart-post (>= 1.2, < 3)
|
|
110
|
-
faraday_middleware (0.
|
|
128
|
+
faraday_middleware (0.10.0)
|
|
111
129
|
faraday (>= 0.7.4, < 0.10)
|
|
112
|
-
ffi (1.9.
|
|
113
|
-
ffi (1.9.
|
|
130
|
+
ffi (1.9.8)
|
|
131
|
+
ffi (1.9.8-java)
|
|
114
132
|
ffi-compiler (0.1.3)
|
|
115
133
|
ffi (>= 1.0.0)
|
|
116
134
|
rake
|
|
117
135
|
font-awesome-rails (4.2.0.0)
|
|
118
136
|
railties (>= 3.2, < 5.0)
|
|
119
|
-
|
|
137
|
+
globalid (0.3.6)
|
|
138
|
+
activesupport (>= 4.1.0)
|
|
139
|
+
haml (4.0.7)
|
|
120
140
|
tilt
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
i18n (0.6.11)
|
|
141
|
+
htmlentities (4.3.4)
|
|
142
|
+
i18n (0.7.0)
|
|
124
143
|
iq_rdf (0.1.15)
|
|
125
144
|
activesupport
|
|
126
145
|
builder
|
|
127
146
|
bundler
|
|
128
147
|
iq_triplestorage (0.2.2)
|
|
129
|
-
jdbc-mysql (5.1.
|
|
130
|
-
jdbc-sqlite3 (3.7
|
|
131
|
-
json (1.8.
|
|
132
|
-
json (1.8.
|
|
133
|
-
json-ld (1.
|
|
134
|
-
|
|
135
|
-
|
|
148
|
+
jdbc-mysql (5.1.33)
|
|
149
|
+
jdbc-sqlite3 (3.8.7)
|
|
150
|
+
json (1.8.2)
|
|
151
|
+
json (1.8.2-java)
|
|
152
|
+
json-ld (1.99.0)
|
|
153
|
+
multi_json (~> 1.11)
|
|
154
|
+
rdf (~> 1.99)
|
|
155
|
+
kaminari (0.16.3)
|
|
136
156
|
actionpack (>= 3.0.0)
|
|
137
157
|
activesupport (>= 3.0.0)
|
|
138
158
|
kaminari-bootstrap (3.0.1)
|
|
139
159
|
kaminari (>= 0.13.0)
|
|
140
160
|
rails
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
rdf
|
|
147
|
-
rdf-
|
|
148
|
-
rdf-
|
|
149
|
-
rdf-
|
|
150
|
-
rdf-
|
|
151
|
-
rdf-
|
|
152
|
-
rdf-
|
|
153
|
-
rdf-
|
|
154
|
-
rdf-
|
|
155
|
-
rdf-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
161
|
+
link_header (0.0.8)
|
|
162
|
+
linkeddata (1.99.0)
|
|
163
|
+
equivalent-xml (~> 0.6)
|
|
164
|
+
json-ld (~> 1.99)
|
|
165
|
+
nokogiri (~> 1.6)
|
|
166
|
+
rdf (~> 1.99)
|
|
167
|
+
rdf-aggregate-repo (~> 1.99)
|
|
168
|
+
rdf-isomorphic (~> 1.99)
|
|
169
|
+
rdf-json (~> 1.1, >= 1.1.2)
|
|
170
|
+
rdf-microdata (~> 2.0, >= 2.0.2)
|
|
171
|
+
rdf-n3 (~> 1.99)
|
|
172
|
+
rdf-rdfa (~> 1.99)
|
|
173
|
+
rdf-rdfxml (~> 1.1, >= 1.1.5)
|
|
174
|
+
rdf-reasoner (~> 0.3)
|
|
175
|
+
rdf-tabular (~> 0.3)
|
|
176
|
+
rdf-trig (~> 1.99, >= 1.99.0.1)
|
|
177
|
+
rdf-trix (~> 1.99)
|
|
178
|
+
rdf-turtle (~> 1.99)
|
|
179
|
+
rdf-vocab (~> 0.8, >= 0.8.6)
|
|
180
|
+
rdf-xsd (~> 1.1, >= 1.1.5)
|
|
181
|
+
sparql (~> 1.99)
|
|
182
|
+
sparql-client (~> 1.99)
|
|
183
|
+
loofah (2.0.3)
|
|
184
|
+
nokogiri (>= 1.5.9)
|
|
185
|
+
mail (2.6.3)
|
|
159
186
|
mime-types (>= 1.16, < 3)
|
|
160
187
|
maruku (0.7.2)
|
|
161
188
|
method_source (0.8.2)
|
|
162
|
-
mime-types (2.
|
|
163
|
-
mini_portile (0.6.
|
|
164
|
-
minitest (5.
|
|
165
|
-
multi_json (1.
|
|
189
|
+
mime-types (2.99.1)
|
|
190
|
+
mini_portile (0.6.2)
|
|
191
|
+
minitest (5.6.1)
|
|
192
|
+
multi_json (1.11.2)
|
|
166
193
|
multipart-post (2.0.0)
|
|
167
|
-
mysql2 (0.3.
|
|
194
|
+
mysql2 (0.3.17)
|
|
168
195
|
net-http-persistent (2.9.4)
|
|
169
|
-
nokogiri (1.6.
|
|
170
|
-
mini_portile (
|
|
171
|
-
|
|
172
|
-
pry (0.10.0)
|
|
196
|
+
nokogiri (1.6.6.2)
|
|
197
|
+
mini_portile (~> 0.6.0)
|
|
198
|
+
pry (0.10.1)
|
|
173
199
|
coderay (~> 1.1.0)
|
|
174
200
|
method_source (~> 0.8.1)
|
|
175
201
|
slop (~> 3.4)
|
|
176
|
-
pry (0.10.
|
|
202
|
+
pry (0.10.1-java)
|
|
177
203
|
coderay (~> 1.1.0)
|
|
178
204
|
method_source (~> 0.8.1)
|
|
179
205
|
slop (~> 3.4)
|
|
180
206
|
spoon (~> 0.0)
|
|
181
|
-
pry-rails (0.3.
|
|
207
|
+
pry-rails (0.3.3)
|
|
182
208
|
pry (>= 0.9.10)
|
|
183
|
-
rack (1.
|
|
184
|
-
rack-test (0.6.
|
|
209
|
+
rack (1.6.4)
|
|
210
|
+
rack-test (0.6.3)
|
|
185
211
|
rack (>= 1.0)
|
|
186
|
-
rails (4.1
|
|
187
|
-
actionmailer (= 4.1
|
|
188
|
-
actionpack (= 4.1
|
|
189
|
-
actionview (= 4.1
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
212
|
+
rails (4.2.1)
|
|
213
|
+
actionmailer (= 4.2.1)
|
|
214
|
+
actionpack (= 4.2.1)
|
|
215
|
+
actionview (= 4.2.1)
|
|
216
|
+
activejob (= 4.2.1)
|
|
217
|
+
activemodel (= 4.2.1)
|
|
218
|
+
activerecord (= 4.2.1)
|
|
219
|
+
activesupport (= 4.2.1)
|
|
193
220
|
bundler (>= 1.3.0, < 2.0)
|
|
194
|
-
railties (= 4.1
|
|
195
|
-
sprockets-rails
|
|
221
|
+
railties (= 4.2.1)
|
|
222
|
+
sprockets-rails
|
|
223
|
+
rails-deprecated_sanitizer (1.0.3)
|
|
224
|
+
activesupport (>= 4.2.0.alpha)
|
|
225
|
+
rails-dom-testing (1.0.7)
|
|
226
|
+
activesupport (>= 4.2.0.beta, < 5.0)
|
|
227
|
+
nokogiri (~> 1.6.0)
|
|
228
|
+
rails-deprecated_sanitizer (>= 1.0.1)
|
|
229
|
+
rails-html-sanitizer (1.0.3)
|
|
230
|
+
loofah (~> 2.0)
|
|
196
231
|
rails_autolink (1.1.6)
|
|
197
232
|
rails (> 3.1)
|
|
198
|
-
railties (4.1
|
|
199
|
-
actionpack (= 4.1
|
|
200
|
-
activesupport (= 4.1
|
|
233
|
+
railties (4.2.1)
|
|
234
|
+
actionpack (= 4.2.1)
|
|
235
|
+
activesupport (= 4.2.1)
|
|
201
236
|
rake (>= 0.8.7)
|
|
202
237
|
thor (>= 0.18.1, < 2.0)
|
|
203
|
-
rake (
|
|
204
|
-
rdf (1.1
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
238
|
+
rake (11.1.2)
|
|
239
|
+
rdf (1.99.1)
|
|
240
|
+
link_header (~> 0.0, >= 0.0.8)
|
|
241
|
+
rdf-aggregate-repo (1.99.0)
|
|
242
|
+
rdf (~> 1.99)
|
|
243
|
+
rdf-isomorphic (1.99.0)
|
|
244
|
+
rdf (~> 1.99)
|
|
245
|
+
rdf-json (1.99.0)
|
|
246
|
+
rdf (~> 1.99)
|
|
247
|
+
rdf-microdata (2.0.2)
|
|
212
248
|
htmlentities (~> 4.3)
|
|
213
249
|
nokogiri (~> 1.6)
|
|
214
250
|
rdf (~> 1.1)
|
|
215
251
|
rdf-xsd (~> 1.1)
|
|
216
|
-
rdf-n3 (1.
|
|
217
|
-
rdf (~> 1.
|
|
218
|
-
rdf-rdfa (1.
|
|
252
|
+
rdf-n3 (1.99.0)
|
|
253
|
+
rdf (~> 1.99)
|
|
254
|
+
rdf-rdfa (1.99.0)
|
|
219
255
|
haml (~> 4.0)
|
|
220
256
|
htmlentities (~> 4.3)
|
|
221
|
-
rdf (~> 1.
|
|
257
|
+
rdf (~> 1.99)
|
|
258
|
+
rdf-aggregate-repo (~> 1.1)
|
|
222
259
|
rdf-xsd (~> 1.1)
|
|
223
|
-
rdf-rdfxml (1.
|
|
260
|
+
rdf-rdfxml (1.99.0)
|
|
224
261
|
htmlentities (~> 4.3)
|
|
225
|
-
rdf (~> 1.
|
|
226
|
-
rdf-rdfa (~> 1.
|
|
262
|
+
rdf (~> 1.99)
|
|
263
|
+
rdf-rdfa (~> 1.99)
|
|
264
|
+
rdf-xsd (~> 1.99)
|
|
265
|
+
rdf-reasoner (0.3.0)
|
|
266
|
+
rdf (~> 1.1, >= 1.1.4.2)
|
|
267
|
+
rdf-turtle (~> 1.1)
|
|
268
|
+
rdf-vocab (~> 0.8)
|
|
227
269
|
rdf-xsd (~> 1.1)
|
|
228
|
-
rdf-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
rdf (
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
270
|
+
rdf-tabular (0.3.0)
|
|
271
|
+
addressable (~> 2.3)
|
|
272
|
+
bcp47 (~> 0.3, >= 0.3.3)
|
|
273
|
+
json-ld (~> 1.1)
|
|
274
|
+
rdf (~> 1.1, >= 1.1.7)
|
|
275
|
+
rdf-vocab (~> 0.8)
|
|
276
|
+
rdf-xsd (~> 1.1)
|
|
277
|
+
rdf-trig (1.99.0.1)
|
|
278
|
+
ebnf (~> 1.0)
|
|
279
|
+
rdf (~> 1.99)
|
|
280
|
+
rdf-turtle (~> 1.99)
|
|
281
|
+
rdf-trix (1.99.0)
|
|
238
282
|
rdf (~> 1.1)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
283
|
+
rdf-turtle (1.99.0)
|
|
284
|
+
ebnf (~> 1.0)
|
|
285
|
+
rdf (~> 1.99)
|
|
286
|
+
rdf-vocab (0.8.7.1)
|
|
287
|
+
rdf (~> 1.1, >= 1.1.10)
|
|
288
|
+
rdf-xsd (1.99.0)
|
|
289
|
+
rdf (~> 1.99)
|
|
290
|
+
request_store (1.3.1)
|
|
291
|
+
sass (3.4.21)
|
|
292
|
+
sass-rails (5.0.4)
|
|
242
293
|
railties (>= 4.0.0, < 5.0)
|
|
243
|
-
sass (~> 3.
|
|
244
|
-
sprockets (
|
|
245
|
-
sprockets-rails (
|
|
246
|
-
|
|
294
|
+
sass (~> 3.1)
|
|
295
|
+
sprockets (>= 2.8, < 4.0)
|
|
296
|
+
sprockets-rails (>= 2.0, < 4.0)
|
|
297
|
+
tilt (>= 1.1, < 3)
|
|
298
|
+
scrypt (2.0.2)
|
|
247
299
|
ffi-compiler (>= 0.0.2)
|
|
248
300
|
rake
|
|
249
|
-
slop (3.
|
|
250
|
-
sparql (1.
|
|
251
|
-
builder (~> 3.
|
|
252
|
-
ebnf (~>
|
|
253
|
-
rdf (~> 1.
|
|
254
|
-
rdf-aggregate-repo (~> 1.
|
|
301
|
+
slop (3.6.0)
|
|
302
|
+
sparql (1.99.0)
|
|
303
|
+
builder (~> 3.2)
|
|
304
|
+
ebnf (~> 1.0)
|
|
305
|
+
rdf (~> 1.99)
|
|
306
|
+
rdf-aggregate-repo (~> 1.99)
|
|
255
307
|
rdf-xsd (~> 1.1)
|
|
256
308
|
sparql-client (~> 1.1)
|
|
257
309
|
sxp (~> 0.1)
|
|
258
|
-
sparql-client (1.
|
|
310
|
+
sparql-client (1.99.0)
|
|
259
311
|
net-http-persistent (~> 2.9)
|
|
260
312
|
rdf (~> 1.1)
|
|
261
313
|
spoon (0.0.4)
|
|
262
314
|
ffi
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
activesupport (>= 3.0)
|
|
272
|
-
sprockets (>= 2.8, < 4.0)
|
|
273
|
-
sqlite3 (1.3.9)
|
|
315
|
+
sprockets (3.5.2)
|
|
316
|
+
concurrent-ruby (~> 1.0)
|
|
317
|
+
rack (> 1, < 3)
|
|
318
|
+
sprockets-rails (3.0.1)
|
|
319
|
+
actionpack (>= 4.0)
|
|
320
|
+
activesupport (>= 4.0)
|
|
321
|
+
sprockets (>= 3.0.0)
|
|
322
|
+
sqlite3 (1.3.10)
|
|
274
323
|
sxp (0.1.5)
|
|
275
324
|
thor (0.19.1)
|
|
276
|
-
thread_safe (0.3.
|
|
277
|
-
thread_safe (0.3.
|
|
278
|
-
tilt (
|
|
325
|
+
thread_safe (0.3.5)
|
|
326
|
+
thread_safe (0.3.5-java)
|
|
327
|
+
tilt (2.0.2)
|
|
279
328
|
tzinfo (1.2.2)
|
|
280
329
|
thread_safe (~> 0.1)
|
|
281
|
-
uglifier (2.
|
|
330
|
+
uglifier (2.7.2)
|
|
282
331
|
execjs (>= 0.3.0)
|
|
283
332
|
json (>= 1.8.0)
|
|
284
333
|
|
|
@@ -289,9 +338,11 @@ PLATFORMS
|
|
|
289
338
|
DEPENDENCIES
|
|
290
339
|
activerecord-jdbcmysql-adapter
|
|
291
340
|
activerecord-jdbcsqlite3-adapter
|
|
292
|
-
iqvoc (~> 4.
|
|
293
|
-
iqvoc_skosxl (~> 2.
|
|
341
|
+
iqvoc (~> 4.10.0)!
|
|
342
|
+
iqvoc_skosxl (~> 2.8.0)!
|
|
294
343
|
mysql2
|
|
295
344
|
pry-rails
|
|
296
|
-
spring
|
|
297
345
|
sqlite3
|
|
346
|
+
|
|
347
|
+
BUNDLED WITH
|
|
348
|
+
1.12.4
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
1
2
|
module Inflectionable
|
|
2
3
|
extend ActiveSupport::Concern
|
|
3
4
|
|
|
@@ -7,45 +8,36 @@ module Inflectionable
|
|
|
7
8
|
after_save :create_default_inflectional
|
|
8
9
|
|
|
9
10
|
has_many :inflectionals,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
:class_name => "Inflectional::Base",
|
|
12
|
+
:foreign_key => "label_id",
|
|
13
|
+
:dependent => :destroy
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
def endings
|
|
16
17
|
Inflectional::Base.for_language_and_code(language, inflectional_code)
|
|
17
18
|
end
|
|
18
19
|
|
|
20
|
+
def candidates
|
|
21
|
+
Inflectional::Base.candidates_for(base_form, language, inflectional_code)
|
|
22
|
+
end
|
|
23
|
+
|
|
19
24
|
def generate_inflectionals!
|
|
20
25
|
return send(Inflectional::Base.name.to_relation_name) if base_form.blank?
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
unless base_form.blank?
|
|
27
|
-
new_base_form = converted_literal_form[0..(base_form.length-1)]
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
Rails.logger.debug "converted_literal_form => #{converted_literal_form} (#{converted_literal_form.size}) |
|
|
31
|
-
base_form => #{base_form} (#{base_form.size}) |
|
|
32
|
-
new_base_form => #{new_base_form} |
|
|
33
|
-
value => #{value} (#{value.size}) |
|
|
34
|
-
diff => #{diff}"
|
|
35
|
-
|
|
36
|
-
endings.each do |ending|
|
|
37
|
-
value = ending == "." ? new_base_form : (new_base_form + ending.downcase)
|
|
38
|
-
send(Inflectional::Base.name.to_relation_name).create!(:value => value)
|
|
27
|
+
candidates.each do |candidate|
|
|
28
|
+
if candidate && inflectionals.where(value: candidate).none?
|
|
29
|
+
send(Inflectional::Base.name.to_relation_name).create!(value: candidate)
|
|
30
|
+
end
|
|
39
31
|
end
|
|
40
32
|
|
|
41
|
-
self.base_form = new_base_form
|
|
42
|
-
save(:
|
|
33
|
+
# self.base_form = new_base_form
|
|
34
|
+
save(validate: false)
|
|
43
35
|
|
|
44
36
|
inflectionals
|
|
45
37
|
end
|
|
46
38
|
|
|
47
39
|
def inflectionals_attributes=(str)
|
|
48
|
-
@inflectionals_attributes = str.split("\r\n")
|
|
40
|
+
@inflectionals_attributes = str.split("\r\n").uniq
|
|
49
41
|
end
|
|
50
42
|
|
|
51
43
|
def overwrite_inflectionals!
|
|
@@ -53,7 +45,7 @@ module Inflectionable
|
|
|
53
45
|
transaction do
|
|
54
46
|
inflectionals.delete_all
|
|
55
47
|
inflectionals_attributes.each do |value|
|
|
56
|
-
inflectionals.create!(:
|
|
48
|
+
inflectionals.create!(value: value)
|
|
57
49
|
end
|
|
58
50
|
end
|
|
59
51
|
end
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
2
|
|
|
3
3
|
require 'digest/md5'
|
|
4
|
-
require 'iqvoc/rdfapi'
|
|
5
4
|
|
|
6
5
|
class Inflectional::Base < ActiveRecord::Base
|
|
7
6
|
|
|
@@ -16,12 +15,15 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
16
15
|
|
|
17
16
|
belongs_to :label, :class_name => Iqvoc::XLLabel.base_class_name
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
def value=(str)
|
|
19
|
+
write_attribute(:value, str)
|
|
20
|
+
|
|
21
|
+
value_hash = self.class.normalize(str)
|
|
22
|
+
write_attribute(:normal_hash, value_hash)
|
|
21
23
|
end
|
|
22
24
|
|
|
23
25
|
def self.build_from_rdf(subject, predicate, object)
|
|
24
|
-
unless object =~
|
|
26
|
+
unless object =~ RDFAPI::LITERAL_REGEXP
|
|
25
27
|
raise InvalidStringLiteralError, "#{self.name}#build_from_rdf: Object (#{object}) must be a string literal"
|
|
26
28
|
end
|
|
27
29
|
|
|
@@ -85,28 +87,6 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
85
87
|
:"CA" => [".", "E", "EN", "ES", "S"],
|
|
86
88
|
:"CB" => [".", "EN", "ES"],
|
|
87
89
|
:"CC" => [".", "E", "EN", "ES"],
|
|
88
|
-
:"AD" => [".", "N", "ST", "T"],
|
|
89
|
-
:"AE" => [".", "N", "T"],
|
|
90
|
-
:"AX" => ["E", "N", "ST", "T", "TE", "TEN", "TET"],
|
|
91
|
-
:"AY" => ["E", "EN", "EST", "ET", "ST", "T", "TE", "TEN", "TET"],
|
|
92
|
-
:"AZ" => ["E", "N", "ST", "T", "TE", "TEN", "TET"],
|
|
93
|
-
:"B0" => [".", "EN", "EST", "ET", "ST", "T"],
|
|
94
|
-
:"B5" => ["T", "ST", "TEN", "TE", "TET"],
|
|
95
|
-
:"BA" => [".", "EN", "EST", "ET", "T"],
|
|
96
|
-
:"BB" => [".", "E", "EN", "EST", "ET", "ST"],
|
|
97
|
-
:"BC" => [".", "EN", "EST", "ET", "ST"],
|
|
98
|
-
:"BD" => [".", "EN", "EST", "ET"],
|
|
99
|
-
:"BF" => ["E", "EN", "EST", "ET"],
|
|
100
|
-
:"C0" => [".", "ST", "T"],
|
|
101
|
-
:"C1" => [".", "E", "ST", "T"],
|
|
102
|
-
:"C3" => ["ST", "T"],
|
|
103
|
-
:"C4" => [".", "ST"],
|
|
104
|
-
:"C7" => [".", "D", "DE", "DEM", "DEN", "DER", "DES"],
|
|
105
|
-
:"C8" => [".", "T", "TE", "TEN", "TET"],
|
|
106
|
-
:"C9" => [".", "D", "DE", "DEM", "DEN", "DER", "DES", "S"],
|
|
107
|
-
:"CA" => [".", "E", "EN", "ES", "S"],
|
|
108
|
-
:"CB" => [".", "EN", "ES"],
|
|
109
|
-
:"CC" => [".", "E", "EN", "ES"],
|
|
110
90
|
:"CD" => [".", "SE", "SEN"],
|
|
111
91
|
:"CE" => [".", "E", "ER", "ERN", "ES", "S"],
|
|
112
92
|
:"CF" => [".", "EN", "S"],
|
|
@@ -166,7 +146,6 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
166
146
|
:"NI" => ["IS", "ES", "ISES"],
|
|
167
147
|
:"NL" => ["EX", "ICES"],
|
|
168
148
|
:"NQ" => [".", "TA", "S"],
|
|
169
|
-
:"PP" => [".", "."],
|
|
170
149
|
:"T0" => [".", "E"],
|
|
171
150
|
:"TA" => [".", "E", "S"],
|
|
172
151
|
:"TF" => [".", "E", "EN"],
|
|
@@ -237,7 +216,6 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
237
216
|
:"NH" => ["IS", "ES"],
|
|
238
217
|
:"NM" => ["EX", "ICES", "EXES"],
|
|
239
218
|
:"NO" => ["X", "CES", "XES"],
|
|
240
|
-
:"PP" => [".", "."],
|
|
241
219
|
:"R0" => ["R", "ST"],
|
|
242
220
|
:"R1" => [".", "R", "ST"],
|
|
243
221
|
:"R2" => [".", "R", "ST", "LY"],
|
|
@@ -249,6 +227,7 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
249
227
|
:"R8" => ["E", "ER", "EST", "LY"],
|
|
250
228
|
:"R9" => ["LE", "LY"],
|
|
251
229
|
:"RA" => ["Y", "ILY"],
|
|
230
|
+
:"U2" => ["A", "AS", "ATA"],
|
|
252
231
|
:"V0" => [".", "S", "D"],
|
|
253
232
|
:"V1" => [".", "S", "ED"],
|
|
254
233
|
:"V2" => [".", "ED"],
|
|
@@ -298,6 +277,16 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
298
277
|
MAPPINGS
|
|
299
278
|
end
|
|
300
279
|
|
|
280
|
+
def self.candidates_for(base_form, language, inflectional_code)
|
|
281
|
+
return [] if language.blank? || inflectional_code.blank? || base_form.blank?
|
|
282
|
+
|
|
283
|
+
endings = for_language_and_code(language, inflectional_code)
|
|
284
|
+
|
|
285
|
+
endings.map do |ending|
|
|
286
|
+
ending == '.' ? base_form : (base_form + ending.downcase)
|
|
287
|
+
end
|
|
288
|
+
end
|
|
289
|
+
|
|
301
290
|
def self.forces_multi_query?
|
|
302
291
|
true
|
|
303
292
|
end
|
|
@@ -306,7 +295,7 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
306
295
|
query_str = build_query_string(params)
|
|
307
296
|
|
|
308
297
|
scope = by_query_value(query_str).includes(:label)
|
|
309
|
-
scope = scope.references(:labels).merge(
|
|
298
|
+
scope = scope.references(:labels).merge(Iqvoc::XLLabel.base_class.by_language(params[:languages].to_a).published.order("LOWER(#{Label::Base.table_name}.value)"))
|
|
310
299
|
scope.map { |result| SearchResult.new(result) }
|
|
311
300
|
end
|
|
312
301
|
|
|
@@ -358,4 +347,12 @@ class Inflectional::Base < ActiveRecord::Base
|
|
|
358
347
|
Digest::MD5.hexdigest(str.to_s.mb_chars.downcase)
|
|
359
348
|
end
|
|
360
349
|
|
|
350
|
+
def ==(other)
|
|
351
|
+
self.normal_hash == other.try(:normal_hash)
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
def eql?(other)
|
|
355
|
+
self == other
|
|
356
|
+
end
|
|
357
|
+
|
|
361
358
|
end
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
<div class="relation panel">
|
|
2
2
|
<h2><%= t("txt.views.labels.inflectionals") %></h2>
|
|
3
3
|
<% labels_inflectionals_values = label.send(klass.name.to_relation_name).map(&:value) %>
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
<% if labels_inflectionals_values.any? %>
|
|
6
|
+
<ul>
|
|
7
|
+
<% labels_inflectionals_values.each do |inf| %>
|
|
8
|
+
<li><%= inf %></li>
|
|
9
|
+
<% end %>
|
|
10
|
+
</ul>
|
|
11
|
+
<% end %>
|
|
12
|
+
|
|
5
13
|
<%
|
|
6
14
|
all_inflectionals = Inflectional::Base.where(:value => labels_inflectionals_values).all
|
|
7
15
|
# subtract initial and current version from the inflectionals collection
|
|
8
16
|
inflectionals_labels = Iqvoc::XLLabel.base_class.find(all_inflectionals.map(&:label_id)-[label.published_version_id, label.id].compact)
|
|
9
17
|
%>
|
|
18
|
+
|
|
10
19
|
<% if inflectionals_labels.present? %>
|
|
11
20
|
<p><%= t("txt.views.labels.inflectionals_used_in") %></p>
|
|
12
21
|
<ul>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<%= f.text_area :inflectionals_attributes,
|
|
2
|
-
:
|
|
3
|
-
:
|
|
4
|
-
:
|
|
5
|
-
:
|
|
2
|
+
label: t("txt.views.labels.inflectionals"),
|
|
3
|
+
value: label.send(klass.name.to_relation_name).map(&:value).join("\n"),
|
|
4
|
+
rows: 10,
|
|
5
|
+
cols: 80,
|
|
6
|
+
data: {
|
|
7
|
+
generated_inflectionals: label.candidates.to_json
|
|
8
|
+
}
|
|
9
|
+
%>
|
data/bin/bundle
ADDED
data/bin/rails
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env ruby
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
rescue LoadError
|
|
5
|
-
end
|
|
6
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
7
|
-
|
|
8
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
9
|
-
require File.expand_path('../../config/boot', __FILE__)
|
|
2
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
3
|
+
require_relative '../config/boot'
|
|
10
4
|
require 'rails/commands'
|
data/bin/rake
CHANGED
data/bin/setup
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
require 'pathname'
|
|
3
|
+
|
|
4
|
+
# path to your application root.
|
|
5
|
+
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
|
|
6
|
+
|
|
7
|
+
Dir.chdir APP_ROOT do
|
|
8
|
+
# This script is a starting point to setup your application.
|
|
9
|
+
# Add necessary setup steps to this file:
|
|
10
|
+
|
|
11
|
+
puts "== Installing dependencies =="
|
|
12
|
+
system "gem install bundler --conservative"
|
|
13
|
+
system "bundle check || bundle install"
|
|
14
|
+
|
|
15
|
+
# puts "\n== Copying sample files =="
|
|
16
|
+
# unless File.exist?("config/database.yml")
|
|
17
|
+
# system "cp config/database.yml.sample config/database.yml"
|
|
18
|
+
# end
|
|
19
|
+
|
|
20
|
+
puts "\n== Preparing database =="
|
|
21
|
+
system "bin/rake db:setup"
|
|
22
|
+
|
|
23
|
+
puts "\n== Removing old logs and tempfiles =="
|
|
24
|
+
system "rm -f log/*"
|
|
25
|
+
system "rm -rf tmp/cache"
|
|
26
|
+
|
|
27
|
+
puts "\n== Restarting application server =="
|
|
28
|
+
system "touch tmp/restart.txt"
|
|
29
|
+
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
class AddInflectionalAttributesToLabel < ActiveRecord::Migration
|
|
2
|
+
def change
|
|
3
|
+
add_column :labels, :base_form, :string unless column_exists?(:labels, :base_form)
|
|
4
|
+
add_column :labels, :inflectional_code, :string unless column_exists?(:labels, :inflectional_code)
|
|
5
|
+
end
|
|
6
|
+
end
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class ChangeInflectionalValueCollation < ActiveRecord::Migration
|
|
2
|
+
def up
|
|
3
|
+
if ActiveRecord::Base.connection.adapter_name == 'Mysql2'
|
|
4
|
+
execute("ALTER TABLE inflectionals MODIFY value varchar(4000) CHARACTER SET utf8 COLLATE utf8_bin;")
|
|
5
|
+
end
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def down
|
|
9
|
+
if ActiveRecord::Base.connection.adapter_name == 'Mysql2'
|
|
10
|
+
execute("ALTER TABLE inflectionals MODIFY value varchar(4000) CHARACTER SET utf8 COLLATE utf8_general_ci;")
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
data/iqvoc_inflectionals.gemspec
CHANGED
|
@@ -15,8 +15,8 @@ Gem::Specification.new do |s|
|
|
|
15
15
|
|
|
16
16
|
s.rubyforge_project = "iqvoc_inflectionals"
|
|
17
17
|
|
|
18
|
-
s.add_dependency "iqvoc", ">= 4.5.0", "~> 4.
|
|
19
|
-
s.add_dependency "iqvoc_skosxl", "~> 2.
|
|
18
|
+
s.add_dependency "iqvoc", ">= 4.5.0", "~> 4.10"
|
|
19
|
+
s.add_dependency "iqvoc_skosxl", "~> 2.8.0"
|
|
20
20
|
|
|
21
21
|
s.files = `git ls-files`.split("\n")
|
|
22
22
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/test/unit/import_test.rb
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
# encoding: UTF-8
|
|
2
2
|
|
|
3
3
|
require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')
|
|
4
|
-
require "iqvoc/skos_importer"
|
|
5
4
|
|
|
6
5
|
class ImportTest < ActiveSupport::TestCase
|
|
7
6
|
TEST_DATA = File.open(File.expand_path("../../fixtures/hobbies.nt", __FILE__))
|
|
8
7
|
|
|
9
8
|
setup do
|
|
10
|
-
@importer =
|
|
9
|
+
@importer = SkosImporter.new(TEST_DATA, "http://hobbies.com/")
|
|
11
10
|
end
|
|
12
11
|
|
|
13
12
|
test "import inflectionals" do
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# encoding: UTF-8
|
|
2
|
+
|
|
3
|
+
require File.join(File.expand_path(File.dirname(__FILE__)), '../test_helper')
|
|
4
|
+
|
|
5
|
+
class InflectionalGenerationTest < ActiveSupport::TestCase
|
|
6
|
+
|
|
7
|
+
test "inflectional candidates generation (without instantiating)" do
|
|
8
|
+
# german example
|
|
9
|
+
generated_candidates = Inflectional::Base.candidates_for('Baum', 'de', 'D5')
|
|
10
|
+
expected_candidates = %w(Baum Baume Baumes Baums)
|
|
11
|
+
assert_equal expected_candidates.size, generated_candidates.size
|
|
12
|
+
expected_candidates.each { |inf| assert generated_candidates.include?(inf), "inflectional '#{inf}' expected" }
|
|
13
|
+
|
|
14
|
+
# english example
|
|
15
|
+
generated_candidates = Inflectional::Base.candidates_for('tree', 'en', 'D7')
|
|
16
|
+
expected_candidates = %w(tree trees)
|
|
17
|
+
assert_equal expected_candidates.size, generated_candidates.size
|
|
18
|
+
expected_candidates.each { |inf| assert generated_candidates.include?(inf), "inflectional '#{inf}' expected" }
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
test "simple inflectional generation" do
|
|
22
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
|
23
|
+
value: 'Eisenbahnfahrzeug',
|
|
24
|
+
language: 'de',
|
|
25
|
+
base_form: 'Eisenbahnfahrzeug',
|
|
26
|
+
inflectional_code: 'CA')
|
|
27
|
+
|
|
28
|
+
label.generate_inflectionals!
|
|
29
|
+
|
|
30
|
+
generated_inflectionals = label.inflectionals.reload.map(&:value)
|
|
31
|
+
expected_inflectionals = %w(Eisenbahnfahrzeug Eisenbahnfahrzeuge Eisenbahnfahrzeugen Eisenbahnfahrzeuges Eisenbahnfahrzeugs)
|
|
32
|
+
|
|
33
|
+
assert_equal expected_inflectionals.size, generated_inflectionals.size
|
|
34
|
+
expected_inflectionals.each { |inf| assert generated_inflectionals.include?(inf), "inflectional '#{inf}' expected" }
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
test "inflectional generation with german ß" do
|
|
38
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
|
39
|
+
value: 'Außenwirtschaftsbeziehung',
|
|
40
|
+
language: 'de',
|
|
41
|
+
base_form: 'Außenwirtschaftsbeziehung',
|
|
42
|
+
inflectional_code: 'D0')
|
|
43
|
+
|
|
44
|
+
label.generate_inflectionals!
|
|
45
|
+
|
|
46
|
+
generated_inflectionals = label.inflectionals.reload.map(&:value)
|
|
47
|
+
expected_inflectionals = %w(Außenwirtschaftsbeziehung Außenwirtschaftsbeziehungen)
|
|
48
|
+
assert_equal expected_inflectionals.size, generated_inflectionals.size
|
|
49
|
+
expected_inflectionals.each { |inf| assert generated_inflectionals.include?(inf), "inflectional '#{inf}' expected" }
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
test "inflectional generation with umlaut" do
|
|
53
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
|
54
|
+
value: 'Marschgewässer',
|
|
55
|
+
language: 'de',
|
|
56
|
+
base_form: 'Marschgewässer',
|
|
57
|
+
inflectional_code: 'D9')
|
|
58
|
+
|
|
59
|
+
label.generate_inflectionals!
|
|
60
|
+
|
|
61
|
+
generated_inflectionals = label.inflectionals.reload.map(&:value)
|
|
62
|
+
expected_inflectionals = %w(Marschgewässer Marschgewässern Marschgewässers)
|
|
63
|
+
assert_equal expected_inflectionals.size, generated_inflectionals.size
|
|
64
|
+
expected_inflectionals.each { |inf| assert generated_inflectionals.include?(inf), "inflectional '#{inf}' expected" }
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
test "inflectional generation with hyphen" do
|
|
68
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
|
69
|
+
value: 'Eisen- und Stahlindustrie',
|
|
70
|
+
language: 'de',
|
|
71
|
+
base_form: 'Eisen- und Stahlindustrie',
|
|
72
|
+
inflectional_code: 'FF')
|
|
73
|
+
|
|
74
|
+
label.generate_inflectionals!
|
|
75
|
+
|
|
76
|
+
generated_inflectionals = label.inflectionals.reload.map(&:value)
|
|
77
|
+
expected_inflectionals = ['Eisen- und Stahlindustrie']
|
|
78
|
+
assert_equal expected_inflectionals.size, generated_inflectionals.size
|
|
79
|
+
expected_inflectionals.each { |inf| assert generated_inflectionals.include?(inf), "inflectional '#{inf}' expected" }
|
|
80
|
+
|
|
81
|
+
label = Iqvoc::XLLabel.base_class.create!(
|
|
82
|
+
value: 'Agrar-Umweltindikator',
|
|
83
|
+
language: 'de',
|
|
84
|
+
base_form: 'Agrar-Umweltindikator',
|
|
85
|
+
inflectional_code: 'D7')
|
|
86
|
+
|
|
87
|
+
label.generate_inflectionals!
|
|
88
|
+
|
|
89
|
+
generated_inflectionals = label.inflectionals.reload.map(&:value)
|
|
90
|
+
expected_inflectionals = ['Agrar-Umweltindikator', 'Agrar-Umweltindikators']
|
|
91
|
+
assert_equal expected_inflectionals.size, generated_inflectionals.size
|
|
92
|
+
expected_inflectionals.each { |inf| assert generated_inflectionals.include?(inf), "inflectional '#{inf}' expected" }
|
|
93
|
+
end
|
|
94
|
+
end
|
|
@@ -10,7 +10,7 @@ class InflectionalTest < ActiveSupport::TestCase
|
|
|
10
10
|
|
|
11
11
|
test "instance creation" do
|
|
12
12
|
label = Label::SKOSXL::Base.create!(:value => "foo",
|
|
13
|
-
:origin =>
|
|
13
|
+
:origin => Origin.new("foo").to_s)
|
|
14
14
|
label.inflectionals.create!(:value => "bar")
|
|
15
15
|
|
|
16
16
|
assert_equal 2, Inflectional::Base.count
|
|
@@ -20,14 +20,10 @@ class InflectionalTest < ActiveSupport::TestCase
|
|
|
20
20
|
test "hashing of values within the label callback" do
|
|
21
21
|
@words.each do |word|
|
|
22
22
|
Label::SKOSXL::Base.create!(:value => word,
|
|
23
|
-
:origin =>
|
|
23
|
+
:origin => Origin.new(word).to_s)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
assert_equal @words.count, Inflectional::Base.count
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
test "base form sanitizer extension for origin generator" do
|
|
30
|
-
assert_equal "commaslashdotbracketbracket", Iqvoc::Origin.new("comma,slash/dot.bracket[bracket]").sanitize_base_form.to_s
|
|
31
|
-
end
|
|
32
|
-
|
|
33
29
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iqvoc_inflectionals
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Robert Glaser
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2016-05-19 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: iqvoc
|
|
@@ -21,7 +21,7 @@ dependencies:
|
|
|
21
21
|
version: 4.5.0
|
|
22
22
|
- - "~>"
|
|
23
23
|
- !ruby/object:Gem::Version
|
|
24
|
-
version: '4.
|
|
24
|
+
version: '4.10'
|
|
25
25
|
type: :runtime
|
|
26
26
|
prerelease: false
|
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -31,21 +31,21 @@ dependencies:
|
|
|
31
31
|
version: 4.5.0
|
|
32
32
|
- - "~>"
|
|
33
33
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '4.
|
|
34
|
+
version: '4.10'
|
|
35
35
|
- !ruby/object:Gem::Dependency
|
|
36
36
|
name: iqvoc_skosxl
|
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
|
38
38
|
requirements:
|
|
39
39
|
- - "~>"
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
|
-
version: 2.
|
|
41
|
+
version: 2.8.0
|
|
42
42
|
type: :runtime
|
|
43
43
|
prerelease: false
|
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
|
45
45
|
requirements:
|
|
46
46
|
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: 2.
|
|
48
|
+
version: 2.8.0
|
|
49
49
|
description: ''
|
|
50
50
|
email:
|
|
51
51
|
- robert.glaser@innoq.com
|
|
@@ -65,8 +65,10 @@ files:
|
|
|
65
65
|
- app/views/partials/inflectional/_base.html.erb
|
|
66
66
|
- app/views/partials/inflectional/_edit_base.html.erb
|
|
67
67
|
- app/views/partials/inflectional/_search_result.html.erb
|
|
68
|
+
- bin/bundle
|
|
68
69
|
- bin/rails
|
|
69
70
|
- bin/rake
|
|
71
|
+
- bin/setup
|
|
70
72
|
- bin/spring
|
|
71
73
|
- config.ru
|
|
72
74
|
- config/application.rb
|
|
@@ -80,7 +82,6 @@ files:
|
|
|
80
82
|
- config/environments/production.rb
|
|
81
83
|
- config/environments/test.rb
|
|
82
84
|
- config/initializers/iqvoc.rb
|
|
83
|
-
- config/initializers/origin_filters.rb
|
|
84
85
|
- config/initializers/session_store.rb
|
|
85
86
|
- config/locales/activerecord.de.yml
|
|
86
87
|
- config/locales/activerecord.en.yml
|
|
@@ -89,10 +90,12 @@ files:
|
|
|
89
90
|
- config/routes.rb
|
|
90
91
|
- config/secrets.yml
|
|
91
92
|
- db/migrate/20120109143704_create_inflectionals.rb
|
|
93
|
+
- db/migrate/20150108155020_add_fk_constraints_iqvoc_inflectionals.rb
|
|
94
|
+
- db/migrate/20160127131143_add_inflectional_attributes_to_label.rb
|
|
95
|
+
- db/migrate/20160331092532_change_inflectional_value_collation.rb
|
|
92
96
|
- db/seeds.rb
|
|
93
97
|
- iqvoc_inflectionals.gemspec
|
|
94
98
|
- lib/engine_tasks/db.rake
|
|
95
|
-
- lib/iqvoc/inflectionals/base_form_sanitizer.rb
|
|
96
99
|
- lib/iqvoc/inflectionals/version.rb
|
|
97
100
|
- lib/iqvoc_inflectionals.rb
|
|
98
101
|
- lib/tasks/inflectionals.rake
|
|
@@ -101,6 +104,7 @@ files:
|
|
|
101
104
|
- test/fixtures/hobbies.nt
|
|
102
105
|
- test/test_helper.rb
|
|
103
106
|
- test/unit/import_test.rb
|
|
107
|
+
- test/unit/inflectional_generation_test.rb
|
|
104
108
|
- test/unit/inflectional_test.rb
|
|
105
109
|
homepage: ''
|
|
106
110
|
licenses: []
|
|
@@ -121,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
121
125
|
version: '0'
|
|
122
126
|
requirements: []
|
|
123
127
|
rubyforge_project: iqvoc_inflectionals
|
|
124
|
-
rubygems_version: 2.4.
|
|
128
|
+
rubygems_version: 2.4.5.1
|
|
125
129
|
signing_key:
|
|
126
130
|
specification_version: 4
|
|
127
131
|
summary: ''
|
|
@@ -129,4 +133,5 @@ test_files:
|
|
|
129
133
|
- test/fixtures/hobbies.nt
|
|
130
134
|
- test/test_helper.rb
|
|
131
135
|
- test/unit/import_test.rb
|
|
136
|
+
- test/unit/inflectional_generation_test.rb
|
|
132
137
|
- test/unit/inflectional_test.rb
|