tag_along 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/1 +1 -0
- data/CHANGELOG +2 -0
- data/README.md +5 -5
- data/lib/tag_along/offsets.rb +1 -0
- data/lib/tag_along/version.rb +1 -1
- data/spec/files/t +55 -0
- data/spec/files/t_offsets.json +1 -0
- data/spec/tag_along_spec.rb +8 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 819101f784c7940739f98d2ea7a46af410e0206d
|
4
|
+
data.tar.gz: ec970bdddf053d5522ac3effa00f890fe7fad57b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c54655a5e5863266cdaeb2b77eff09e99521d3d7461f6ac5cf15e642b0c783b5ca911dd380253bd7cb8837b318f9c7f4c750bd3dfd940614f0e82349729c8885
|
7
|
+
data.tar.gz: 20b14b77bf0d519153887117ed6b2e1c4a5a80db4f8a04d31ea58536a775dbecf958497e90a6231a6e72ee84a5b82faeaae0aa47cc076d935998ae9fa9b298fd
|
data/CHANGELOG
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ start and end offsets. This gem places arbitrary
|
|
14
14
|
markup tags surrounding the fragments.
|
15
15
|
|
16
16
|
Gem works with UTF-8 and ASCII7 texts. It is quite fast and allows to tag
|
17
|
-
4MB of text in one second on 2.7GHz processor.
|
17
|
+
4MB of text in about one second on 2.7GHz processor.
|
18
18
|
|
19
19
|
Installation
|
20
20
|
------------
|
@@ -34,7 +34,7 @@ Or install it yourself as:
|
|
34
34
|
Usage
|
35
35
|
-----
|
36
36
|
|
37
|
-
For example you want to tag days of week from a text:
|
37
|
+
For example you want to tag days of a week from a text:
|
38
38
|
|
39
39
|
text = "There's Sunday and there's Monday"
|
40
40
|
|
@@ -55,7 +55,7 @@ Notice that you can retag the text as many times as you want.
|
|
55
55
|
|
56
56
|
### Dynamic tags
|
57
57
|
|
58
|
-
Sometimes
|
58
|
+
Sometimes tags contain changeable component. To add dynamic data to tags:
|
59
59
|
|
60
60
|
#one substitution in opening tag:
|
61
61
|
offsets = [[8, 13, 'sunday'], [27, 32, 'monday']
|
@@ -108,7 +108,7 @@ In all cases you can instantiate TagAlong with resulting offsets:
|
|
108
108
|
tg = TagAlong.new(text, offsets)
|
109
109
|
tg.tag('|hi|', '|bye|')
|
110
110
|
|
111
|
-
Examples of dynamic
|
111
|
+
Examples of offsets with dynamic data:
|
112
112
|
|
113
113
|
# Array of arrays
|
114
114
|
my_ary = [[8, 13, ['sunday', 'http://en.wikipedia.org/wiki/Sunday']],
|
@@ -154,7 +154,7 @@ In all cases you can instantiate TagAlong with resulting offsets:
|
|
154
154
|
tg = TagAlong.new(text, offsets)
|
155
155
|
tg.tag("<my_tag value=\"%s\", href=\"%s\">", '</my_tag>')
|
156
156
|
|
157
|
-
Example of dynamic information
|
157
|
+
Example of dynamic information for a closing tag:
|
158
158
|
|
159
159
|
# Array of hashes
|
160
160
|
my_hash = [
|
data/lib/tag_along/offsets.rb
CHANGED
data/lib/tag_along/version.rb
CHANGED
data/spec/files/t
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
1959
|
2
|
+
Newman H. H. Spawmin behavior and sexual dimorphism of Pundulus
|
3
|
+
9 5 QS
|
4
|
+
heteroclitus and allied fish. Biol. Bull. 12, 1907.
|
5
|
+
IV. CIRGULATORY SYSTEM
|
6
|
+
P. B. Functional reactions in the embryonic heart accom~
|
7
|
+
panying the ingrowth and development of the vagus
|
8
|
+
innervation. Jour. Exp. Zool. 58, 1951.
|
9
|
+
Brinley, P. J. A Physiological study of the innervation of the
|
10
|
+
heart of fish embryos. Physiol. Zool. 5, 1952.
|
11
|
+
Reagan, F, P. Experimental studies in the origin of the vascular
|
12
|
+
endothelium and of Am. Jour, Anat.
|
13
|
+
21, 1917.
|
14
|
+
Shearer, E. M. Studies on the embryology of the circulation in
|
15
|
+
fishes, 1. and ll. Am. Jour. Anat. 46, 1950.
|
16
|
+
Stockard, C. R. An experimental analysis of the origin of blood
|
17
|
+
and vascular endothelium Mem. Wist. Inst. Anat.
|
18
|
+
Biol. No. 7, 1915. also Am. Jour, Anat. 18, 1915.
|
19
|
+
V. GERM CELLS
|
20
|
+
Goodrich, H. B., et al. Germ cells and sex differentiation in
|
21
|
+
Lebistes reticulatus. Biol. Bull. 67, 1954.
|
22
|
+
Mann, H. W. The history of the germ cells of Cottus Baerdii. Gerard
|
23
|
+
Jour. Morph. Physiol. 45, 1927.
|
24
|
+
okkelberg, Peter The early history of the germ cells in the brook
|
25
|
+
lamprey, Entosphenus wilderi (Gage) up to and in~
|
26
|
+
cluding the period of sex differentiation. Jour.
|
27
|
+
Morph. 55, 1921. (This paper has a complete bib-
|
28
|
+
liography of work on germ cells in other groups.)
|
29
|
+
Tichards, A. and Thompson, James I., Migration with primary sex
|
30
|
+
cells of Fundulus hetercclitus Biol. Bull. 40, 1921.
|
31
|
+
Wolf, L. E. The history of the germ cells in the viviparous
|
32
|
+
1 teleost PPlatypoecilus maculatus. Jour. Morph. and
|
33
|
+
Physiol. 52, 1951.
|
34
|
+
1 VI. EXPERIMENTAL WORK.
|
35
|
+
Amberson, W. R, and F. B. The respiratory metabolism
|
36
|
+
of Fundulus heteroclitus during embryonic develop-
|
37
|
+
mental Jour. Cell. and Comp. Physiol. 2, 1955.
|
38
|
+
P. B. The embryonic origin of function in the pronephros
|
39
|
+
through differentiation and paren~chyma-vascular
|
40
|
+
association. Amer. Jour. Anat. 51, 1952.
|
41
|
+
Batallion, Nouveaux essais de Parthenogenere experimentale chez les
|
42
|
+
vertibres infesienes Arch. Ent. Mech. 18, 1904.
|
43
|
+
Clapp, C. M. The relation of the axis of the embryo to the first
|
44
|
+
cleavage plane. Biol Lect. M. B. L. 1898.
|
45
|
+
Filatow, D. Entwicklungsmechanishhe Untersuchungen an Embryonen
|
46
|
+
von Acipenser guldenstadtti and Acipenbryonen von
|
47
|
+
Acipenser guldenstadtii und Acipenser stellatus.
|
48
|
+
Arch. Ent. Mech. 122, 1950.
|
49
|
+
HinriChS,.M. A. and Genther 1. T. Ultraviolet radiation and the
|
50
|
+
production of twins and double monsters. Physiol.
|
51
|
+
iZool. 4, 1951.
|
52
|
+
Headley, L. 0n the localization of developmental potencies in
|
53
|
+
embryo of Fundulus heteroclitus Jour. Exp. Zool.
|
54
|
+
52, 1928.
|
55
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
[{"pos_start":866,"pos_end":885,"url":"http://eol.org/pages/11081658"},{"pos_start":955,"pos_end":960,"url":"http://eol.org/pages/204556"},{"pos_start":1347,"pos_end":1354,"url":"http://eol.org/pages/207614"},{"pos_start":1604,"pos_end":1624,"url":"http://eol.org/pages/1157172"},{"pos_start":2137,"pos_end":2145,"url":"http://eol.org/pages/15048"},{"pos_start":2211,"pos_end":2229,"url":"http://eol.org/pages/206889"},{"pos_start":2462,"pos_end":2482,"url":"http://eol.org/pages/1157172"},{"pos_start":1085,"pos_end":1103,"url":null},{"pos_start":2183,"pos_end":2205,"url":null}]
|
data/spec/tag_along_spec.rb
CHANGED
@@ -54,4 +54,12 @@ describe TagAlong do
|
|
54
54
|
should raise_error
|
55
55
|
end
|
56
56
|
|
57
|
+
it 'should take offsets in any order' do
|
58
|
+
text = 'There\'s Sunday and there\'s Monday'
|
59
|
+
offsets = [[27,32], [8,13]]
|
60
|
+
tg = TagAlong.new(text, offsets)
|
61
|
+
tg.tag('<em>', '</em>').should ==
|
62
|
+
%q{There's <em>Sunday</em> and there's <em>Monday</em>}
|
63
|
+
end
|
64
|
+
|
57
65
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tag_along
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Mozzherin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
Tags a text with arbitrary tags
|
@@ -22,6 +22,7 @@ files:
|
|
22
22
|
- .gitignore
|
23
23
|
- .ruby-version
|
24
24
|
- .travis.yml
|
25
|
+
- '1'
|
25
26
|
- CHANGELOG
|
26
27
|
- Gemfile
|
27
28
|
- LICENSE.txt
|
@@ -31,6 +32,8 @@ files:
|
|
31
32
|
- lib/tag_along/offsets.rb
|
32
33
|
- lib/tag_along/version.rb
|
33
34
|
- spec/files/spec_data.json
|
35
|
+
- spec/files/t
|
36
|
+
- spec/files/t_offsets.json
|
34
37
|
- spec/spec_helper.rb
|
35
38
|
- spec/tag_along/offsets_spec.rb
|
36
39
|
- spec/tag_along_spec.rb
|
@@ -63,6 +66,8 @@ summary: A user who runs a search tool on a text would find multiple text fragm
|
|
63
66
|
and end offsets. This gem places arbitrary markup tags surrounding the fragments.
|
64
67
|
test_files:
|
65
68
|
- spec/files/spec_data.json
|
69
|
+
- spec/files/t
|
70
|
+
- spec/files/t_offsets.json
|
66
71
|
- spec/spec_helper.rb
|
67
72
|
- spec/tag_along/offsets_spec.rb
|
68
73
|
- spec/tag_along_spec.rb
|