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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 78e6a2b607a8690b2fe171665e35272efd31b2ac
4
- data.tar.gz: 4517bb06cc8e1f8b0be5fc47bca4bfeda0fcfd49
3
+ metadata.gz: b025f7cd93d2bf279fcf0ab8feef9d7c454ff1e1
4
+ data.tar.gz: 1deb1edc7c104c21d419f638f5795ecdab20fcf3
5
5
  SHA512:
6
- metadata.gz: dd24765af042566249e0c8d3153aee640c626b8f838fdda03c7b6598ad30bd0935df47ad1d1c6658ccf0e4fd598a94052c99dee127becb2f9c59b3e8dafe1cf0
7
- data.tar.gz: 9eca1a25e8837732827a282d3d532db35113620372a0bde41b64669cb3fd696cc4c149267e19a5cfe58df7367b2932942554ea88cfd26826c73db926ad6ca89d
6
+ metadata.gz: a191c636f175107809e9e20d15f476d2c55361096b4c95e2e7a01a44a66416117a80b5f14c97138911e815ecc30d008052b1e8c15b850667a34b00b20da2d1d2
7
+ data.tar.gz: d6e62830b96b6ced210fa75fdcdb6846fb66190a9415f1cdb6bd5a3c8cb91cfb03d94c40a36534f875979d22c25e9f29f42ca7ceadfb1839a803868288060617
data/.travis.yml CHANGED
@@ -1,6 +1,7 @@
1
- branches:
2
- only:
3
- - master
4
1
  rvm:
5
2
  - 2.0.0
6
3
  - jruby-19mode
4
+ - rbx-19mode
5
+ matrix:
6
+ allow_failures:
7
+ - rvm: rbx-19mode
data/bin/greeb CHANGED
@@ -19,6 +19,7 @@ end
19
19
 
20
20
  Greeb::Parser.urls(text).each(&extract)
21
21
  Greeb::Parser.emails(text).each(&extract)
22
+ Greeb::Parser.abbrevs(text).each(&extract)
22
23
 
23
24
  tokens.each do |entity|
24
25
  puts text[entity.from...entity.to] unless entity.type == :separ
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}\.)+/i
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
@@ -5,5 +5,5 @@
5
5
  module Greeb
6
6
  # Version of Greeb.
7
7
  #
8
- VERSION = '0.2.0.rc2'
8
+ VERSION = '0.2.0.rc3'
9
9
  end
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: http://вася.рф/. ' \
9
- 'And my e-mail is example@example.com! Also it is available by ' \
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(48, 63, :url),
19
- Entity.new(132, 147, :url)]
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(82, 101, :email)]
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(155, 163, :abbrev)]
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.rc2
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-22 00:00:00.000000000 Z
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.3
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: