greeb 0.2.0.rc2 → 0.2.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/bin/greeb +1 -0
- data/lib/greeb/parser.rb +1 -1
- data/lib/greeb/version.rb +1 -1
- data/spec/parser_spec.rb +8 -7
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b025f7cd93d2bf279fcf0ab8feef9d7c454ff1e1
|
4
|
+
data.tar.gz: 1deb1edc7c104c21d419f638f5795ecdab20fcf3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a191c636f175107809e9e20d15f476d2c55361096b4c95e2e7a01a44a66416117a80b5f14c97138911e815ecc30d008052b1e8c15b850667a34b00b20da2d1d2
|
7
|
+
data.tar.gz: d6e62830b96b6ced210fa75fdcdb6846fb66190a9415f1cdb6bd5a3c8cb91cfb03d94c40a36534f875979d22c25e9f29f42ca7ceadfb1839a803868288060617
|
data/.travis.yml
CHANGED
data/bin/greeb
CHANGED
data/lib/greeb/parser.rb
CHANGED
@@ -14,7 +14,7 @@ module Greeb::Parser
|
|
14
14
|
EMAIL = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i
|
15
15
|
|
16
16
|
# Another horrible pattern. Now for abbreviations.
|
17
|
-
ABBREV = /\b(\p{L}\.)
|
17
|
+
ABBREV = /\b((-{0,1}\p{L}\.)*|(-{0,1}\p{L}\. )*)-{0,1}\p{L}\./i
|
18
18
|
|
19
19
|
# Recognize URLs in the input text. Actually, URL is obsolete standard
|
20
20
|
# and this code should be rewritten to use the URI concept.
|
data/lib/greeb/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -5,9 +5,9 @@ require_relative 'spec_helper'
|
|
5
5
|
module Greeb
|
6
6
|
describe Parser do
|
7
7
|
let(:text) do
|
8
|
-
'Hello there! My name is Vasya B. My website is
|
9
|
-
'And my e-mail is example@example.com! Also it is
|
10
|
-
'URL: http://vasya.ru. Also, G.L.H.F. everyone!'
|
8
|
+
'Hello there! My name is Vasya B. and I am к.ф.-м.н. My website is ' \
|
9
|
+
'http://вася.рф/. And my e-mail is example@example.com! Also it is ' \
|
10
|
+
'available by URL: http://vasya.ru. Also, G.L.H.F. everyone!'
|
11
11
|
end
|
12
12
|
|
13
13
|
describe 'URL' do
|
@@ -15,8 +15,8 @@ module Greeb
|
|
15
15
|
|
16
16
|
it 'recognizes URLs' do
|
17
17
|
subject.must_equal(
|
18
|
-
[Entity.new(
|
19
|
-
Entity.new(
|
18
|
+
[Entity.new(66, 81, :url),
|
19
|
+
Entity.new(150, 165, :url)]
|
20
20
|
)
|
21
21
|
end
|
22
22
|
end
|
@@ -26,7 +26,7 @@ module Greeb
|
|
26
26
|
|
27
27
|
it 'recognizes e-mails' do
|
28
28
|
subject.must_equal(
|
29
|
-
[Entity.new(
|
29
|
+
[Entity.new(100, 119, :email)]
|
30
30
|
)
|
31
31
|
end
|
32
32
|
end
|
@@ -37,7 +37,8 @@ module Greeb
|
|
37
37
|
it 'recognizes abbreviations' do
|
38
38
|
subject.must_equal(
|
39
39
|
[Entity.new(30, 32, :abbrev),
|
40
|
-
Entity.new(
|
40
|
+
Entity.new(42, 51, :abbrev),
|
41
|
+
Entity.new(173, 181, :abbrev)]
|
41
42
|
)
|
42
43
|
end
|
43
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greeb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.0.
|
4
|
+
version: 0.2.0.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Ustalov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-05-
|
11
|
+
date: 2013-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -88,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
88
88
|
version: 1.3.1
|
89
89
|
requirements: []
|
90
90
|
rubyforge_project: greeb
|
91
|
-
rubygems_version: 2.0.
|
91
|
+
rubygems_version: 2.0.0
|
92
92
|
signing_key:
|
93
93
|
specification_version: 4
|
94
94
|
summary: Greeb is a simple Unicode-aware regexp-based tokenizer.
|
@@ -99,3 +99,4 @@ test_files:
|
|
99
99
|
- spec/spec_helper.rb
|
100
100
|
- spec/support/invoker.rb
|
101
101
|
- spec/tokenizer_spec.rb
|
102
|
+
has_rdoc:
|