mesh-medical-subject-headings 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +1 -1
- data/lib/MESH/heading.rb +6 -12
- data/lib/MESH/version.rb +2 -2
- data/test/mesh_core_test.rb +9 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9536958aba4f9e6c5d022f6180f5f3af98fee4b4
|
4
|
+
data.tar.gz: 7d14f05245143439b2b0f28629ceb805afb83141
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 08ca55381c6a598544df5ed90cc1187d4fd021d184ed40cca1c0953f0a8d06e6114debf6e6a47bfecc872d879d67ba3f6a4e428fc0c60b4ea34a8d9c9fee3a03
|
7
|
+
data.tar.gz: 0a1cd8123ef2680ac7dd6fb4b027ff0ba4fcd41bac2be3fbef161a8ace226d14196eaeee9ea73ccd9c9dcdca139a59ab4e2bb5b8cb5b4f18eedcfa05392a6ee9
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/MESH/heading.rb
CHANGED
@@ -10,33 +10,27 @@ module MESH
|
|
10
10
|
end
|
11
11
|
|
12
12
|
def original_heading(locale = default_locale)
|
13
|
-
|
13
|
+
@original_heading[locale]
|
14
14
|
end
|
15
15
|
|
16
16
|
def natural_language_name(locale = default_locale)
|
17
|
-
|
17
|
+
@natural_language_name[locale]
|
18
18
|
end
|
19
19
|
|
20
20
|
def summary(locale = default_locale)
|
21
|
-
|
21
|
+
@summary[locale]
|
22
22
|
end
|
23
23
|
|
24
24
|
def linkify_summary
|
25
25
|
return if summary.nil?
|
26
|
-
@linkified_summary = summary.
|
27
|
-
@linkified_summary.scan(/[A-Z]+[A-Z,\s]+[A-Z]+/).each do |text|
|
26
|
+
@linkified_summary = summary.gsub(/[A-Z]+[A-Z,\s]+[A-Z]+/).each do |text|
|
28
27
|
heading = @tree.find_by_entry(text)
|
29
|
-
|
30
|
-
replacement_text = yield text, heading
|
31
|
-
@linkified_summary.sub!(text, replacement_text)
|
32
|
-
end
|
28
|
+
heading ? yield(text, heading) : text
|
33
29
|
end
|
34
|
-
@linkified_summary
|
35
30
|
end
|
36
31
|
|
37
32
|
def entries(locale = default_locale)
|
38
33
|
@entries[locale] ||= []
|
39
|
-
return @entries[locale]
|
40
34
|
end
|
41
35
|
|
42
36
|
|
@@ -88,7 +82,7 @@ module MESH
|
|
88
82
|
end
|
89
83
|
|
90
84
|
def to_s
|
91
|
-
|
85
|
+
"#{unique_id}, #{original_heading}, [#{tree_numbers.join(',')}]"
|
92
86
|
end
|
93
87
|
|
94
88
|
def inspect
|
data/lib/MESH/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Mesh
|
2
|
-
VERSION = "2.0.
|
3
|
-
end
|
2
|
+
VERSION = "2.0.5"
|
3
|
+
end
|
data/test/mesh_core_test.rb
CHANGED
@@ -144,7 +144,8 @@ module MESH
|
|
144
144
|
|
145
145
|
def test_linkify_summary
|
146
146
|
mh = @mesh_tree.find('D001471')
|
147
|
-
|
147
|
+
original_summary = 'A condition with damage to the lining of the lower ESOPHAGUS resulting from chronic acid reflux (ESOPHAGITIS, REFLUX). Through the process of metaplasia, the squamous cells are replaced by a columnar epithelium with cells resembling those of the INTESTINE or the salmon-pink mucosa of the STOMACH. Barrett\'s columnar epithelium is a marker for severe reflux and precursor to ADENOCARCINOMA of the esophagus.'
|
148
|
+
assert_equal original_summary, mh.summary
|
148
149
|
|
149
150
|
found = {
|
150
151
|
'ESOPHAGUS' => false,
|
@@ -154,15 +155,15 @@ module MESH
|
|
154
155
|
'ADENOCARCINOMA' => false
|
155
156
|
}
|
156
157
|
|
157
|
-
#
|
158
|
+
#start = Time.now
|
158
159
|
linkified_summary = mh.linkify_summary do |text, heading|
|
159
160
|
found[text] = true unless heading.nil?
|
160
161
|
"<foo>#{text.downcase}</foo>"
|
161
162
|
end
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
163
|
+
#finish = Time.now
|
164
|
+
#puts start
|
165
|
+
#puts finish
|
166
|
+
#puts finish - start
|
166
167
|
|
167
168
|
assert_equal 5, found.length
|
168
169
|
assert found['ESOPHAGUS']
|
@@ -171,6 +172,7 @@ module MESH
|
|
171
172
|
assert found['STOMACH']
|
172
173
|
assert found['ADENOCARCINOMA']
|
173
174
|
|
175
|
+
assert_equal original_summary, mh.summary
|
174
176
|
assert_equal 'A condition with damage to the lining of the lower <foo>esophagus</foo> resulting from chronic acid reflux (<foo>esophagitis, reflux</foo>). Through the process of metaplasia, the squamous cells are replaced by a columnar epithelium with cells resembling those of the <foo>intestine</foo> or the salmon-pink mucosa of the <foo>stomach</foo>. Barrett\'s columnar epithelium is a marker for severe reflux and precursor to <foo>adenocarcinoma</foo> of the esophagus.', linkified_summary
|
175
177
|
|
176
178
|
end
|
@@ -738,4 +740,4 @@ ALL there is no increased sensitivity to treatment, but there is increased risk
|
|
738
740
|
'
|
739
741
|
end
|
740
742
|
end
|
741
|
-
end
|
743
|
+
end
|