textrazor 1.0.0 → 1.0.1
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 +8 -0
- data/README.md +4 -0
- data/lib/textrazor/client.rb +1 -1
- data/lib/textrazor/entity.rb +1 -1
- data/lib/textrazor/request.rb +1 -0
- data/lib/textrazor/version.rb +1 -1
- data/spec/lib/textrazor/client_spec.rb +4 -3
- data/spec/lib/textrazor/entity_spec.rb +5 -1
- 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: a5dd726ebc5946e424815cfad69070296b759d2e
|
4
|
+
data.tar.gz: fda4507e8aa64b77073789d97526fa661aa63c13
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa872f1ddd89bb8b2273997a068fb026f90504cb610f6a319b32207964041d2b59052648fc77f6538f1263d08c9e07806686e80de30416cc2c099ca01bc97962
|
7
|
+
data.tar.gz: d3e63881541061cc0a3042e683d2f14cf7780f07563d852737e644ee3a4d99bb515d962c7492f6786df634ffa778e09800f96731327e6b6eeebd0f1ab5cf2671
|
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
This is a gem wrapper for TextRazor REST API reference.
|
4
4
|
|
5
|
+
## Code status
|
6
|
+
|
7
|
+
[](https://travis-ci.org/andhapp/textrazor)
|
8
|
+
|
5
9
|
## Installation
|
6
10
|
|
7
11
|
Add this line to your application's Gemfile:
|
data/lib/textrazor/client.rb
CHANGED
@@ -16,7 +16,7 @@ module TextRazor
|
|
16
16
|
VALID_CLEANUP_MODE_VALUES = [DEFAULT_CLEANUP_MODE, 'stripTags', 'cleanHTML']
|
17
17
|
|
18
18
|
REQUEST_OPTIONS = [:extractors, :rules, :cleanup_mode, :cleanup_return_cleaned, :cleanup_return_raw,
|
19
|
-
:language, :filter_dbpedia_types, :filter_freebase_types, :allow_overlap,
|
19
|
+
:language, :dictionaries, :filter_dbpedia_types, :filter_freebase_types, :allow_overlap,
|
20
20
|
:enrichment_queries]
|
21
21
|
|
22
22
|
attr_reader :response, :api_key, :request_options
|
data/lib/textrazor/entity.rb
CHANGED
@@ -6,7 +6,7 @@ module TextRazor
|
|
6
6
|
|
7
7
|
attr_reader :id, :type, :matching_tokens, :entity_id, :freebase_types, :confidence_score,
|
8
8
|
:wiki_link, :matched_text, :freebase_id, :relevance_score, :entity_english_id,
|
9
|
-
:starting_pos, :ending_pos
|
9
|
+
:starting_pos, :ending_pos, :data
|
10
10
|
|
11
11
|
def initialize(params = {})
|
12
12
|
@type = []
|
data/lib/textrazor/request.rb
CHANGED
@@ -13,6 +13,7 @@ module TextRazor
|
|
13
13
|
cleanup_return_cleaned: 'cleanup.returnCleaned',
|
14
14
|
cleanup_return_raw: 'cleanup.returnRaw',
|
15
15
|
language: 'languageOverride',
|
16
|
+
dictionaries: 'entities.dictionaries',
|
16
17
|
filter_dbpedia_types: 'entities.filterDbpediaTypes',
|
17
18
|
filter_freebase_types: 'entities.filterFreebaseTypes',
|
18
19
|
allow_overlap: 'entities.allowOverlap',
|
data/lib/textrazor/version.rb
CHANGED
@@ -25,7 +25,8 @@ module TextRazor
|
|
25
25
|
extractors: %w(entities topics words), cleanup_mode: 'raw',
|
26
26
|
cleanup_return_cleaned: true, cleanup_return_raw: true,
|
27
27
|
filter_dbpedia_types: %w(type1), language: 'fre',
|
28
|
-
filter_freebase_types: %w(type2), allow_overlap: false
|
28
|
+
filter_freebase_types: %w(type2), allow_overlap: false,
|
29
|
+
dictionaries: %w(test)
|
29
30
|
})
|
30
31
|
end
|
31
32
|
|
@@ -56,7 +57,7 @@ module TextRazor
|
|
56
57
|
to eq({extractors: %w(entities topics words), cleanup_mode: 'raw', language: 'fre',
|
57
58
|
cleanup_return_cleaned: true, cleanup_return_raw: true,
|
58
59
|
filter_dbpedia_types: %w(type1), filter_freebase_types: %w(type2),
|
59
|
-
allow_overlap: false})
|
60
|
+
allow_overlap: false, dictionaries: %w(test)})
|
60
61
|
end
|
61
62
|
|
62
63
|
end
|
@@ -124,7 +125,7 @@ module TextRazor
|
|
124
125
|
with('text', {api_key: 'api_key', extractors: %w(entities topics words), cleanup_mode: 'raw',
|
125
126
|
cleanup_return_cleaned: true, cleanup_return_raw: true, language: 'fre',
|
126
127
|
filter_dbpedia_types: %w(type1), filter_freebase_types: %w(type2),
|
127
|
-
allow_overlap: false}).
|
128
|
+
allow_overlap: false, dictionaries: %w(test)}).
|
128
129
|
and_return(request)
|
129
130
|
|
130
131
|
expect(Response).to receive(:new).with(request)
|
@@ -25,7 +25,10 @@ module TextRazor
|
|
25
25
|
"relevanceScore" => 0.311479,
|
26
26
|
"entityEnglishId" => "Foreign minister",
|
27
27
|
"startingPos" => 3,
|
28
|
-
"endingPos" => 20
|
28
|
+
"endingPos" => 20,
|
29
|
+
"data" => {
|
30
|
+
"type" => ['person', 'company']
|
31
|
+
}
|
29
32
|
}
|
30
33
|
end
|
31
34
|
|
@@ -43,6 +46,7 @@ module TextRazor
|
|
43
46
|
expect(entity.entity_english_id).to eq("Foreign minister")
|
44
47
|
expect(entity.starting_pos).to eq(3)
|
45
48
|
expect(entity.ending_pos).to eq(20)
|
49
|
+
expect(entity.data['type']).to match_array(['person', 'company'])
|
46
50
|
end
|
47
51
|
end
|
48
52
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: textrazor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anuj Dutta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -105,6 +105,7 @@ files:
|
|
105
105
|
- ".rspec"
|
106
106
|
- ".ruby-gemset"
|
107
107
|
- ".ruby-version"
|
108
|
+
- ".travis.yml"
|
108
109
|
- Gemfile
|
109
110
|
- LICENSE.txt
|
110
111
|
- README.md
|
@@ -162,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
163
|
version: '0'
|
163
164
|
requirements: []
|
164
165
|
rubyforge_project:
|
165
|
-
rubygems_version: 2.
|
166
|
+
rubygems_version: 2.2.5
|
166
167
|
signing_key:
|
167
168
|
specification_version: 4
|
168
169
|
summary: An api wrapper for text razor in ruby
|