ngrams_parser 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +3 -1
- data/README.md +7 -1
- data/Rakefile +3 -3
- data/lib/ngrams_parser/version.rb +1 -1
- data/ngrams_parser.gemspec +9 -9
- data/spec/ngrams_parser/ngram_spec.rb +2 -2
- data/spec/ngrams_parser/ngrams_spec.rb +2 -2
- data/spec/ngrams_parser/string_spec.rb +3 -3
- data/spec/spec_helper.rb +2 -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: 333bac9861f67ff93ef439bb3d4cfd6e650726d2
|
4
|
+
data.tar.gz: 9c59e4950f5934800b164086ab3ddddfccb38980
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 913a140a49a661de1ba0816a211b896d47fed06736649d8f82b06225ccad00c82806eba328092c8f382cf649fac389ff74e9327a7a5d8d678038137017e007a1
|
7
|
+
data.tar.gz: 9b1e80fc1a0b38b26b2a76b3ac4ea44a098e81b1906cfa9f52ce9240a581fcfaa44effdeea4160c45edd2e239051bbcae9e6838b240fdf03f1b9e5b91302c729
|
data/.rubocop.yml
ADDED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -5,9 +5,11 @@ gemspec
|
|
5
5
|
|
6
6
|
group :development, :test do
|
7
7
|
gem 'coveralls', require: false
|
8
|
-
gem '
|
8
|
+
gem 'codeclimate-test-reporter', require: false
|
9
|
+
gem 'rspec', '~> 3.0.0.beta1'
|
9
10
|
gem 'reek'
|
10
11
|
gem 'guard'
|
11
12
|
gem 'guard-bundler'
|
12
13
|
gem 'guard-rspec'
|
14
|
+
gem 'rb-readline', '~> 0.5.0', require: false
|
13
15
|
end
|
data/README.md
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
# NgramsParser
|
1
|
+
# NgramsParser
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/ngrams_parser.png)](http://badge.fury.io/rb/ngrams_parser)
|
3
|
+
[![Build Status](https://travis-ci.org/fractalsoft/ngrams_parser.png)](https://travis-ci.org/fractalsoft/ngrams_parser)
|
4
|
+
[![Dependency Status](https://gemnasium.com/fractalsoft/ngrams_parser.png)](https://gemnasium.com/fractalsoft/ngrams_parser)
|
5
|
+
[![Coverage Status](https://coveralls.io/repos/fractalsoft/ngrams_parser/badge.png)](https://coveralls.io/r/fractalsoft/ngrams_parser)
|
6
|
+
[![Code Climate](https://codeclimate.com/repos/5284c251c7f3a33dc601754f/badges/1003ccd7b66d8d8cae42/gpa.png)](https://codeclimate.com/repos/5284c251c7f3a33dc601754f/feed)
|
7
|
+
[![Stories in Ready](https://badge.waffle.io/fractalsoft/ngrams_parser.png)](http://waffle.io/fractalsoft/ngrams_parser)
|
2
8
|
[![endorse](https://api.coderwall.com/torrocus/endorsecount.png)](https://coderwall.com/torrocus)
|
3
9
|
|
4
10
|
N-gram is a contiguous sequence of n items from a given sequence of text or speech. The items are letters, but can be phonemes, syllables, words or base pairs according to the application. The n-grams typically are collected from a text or speech corpus.
|
data/Rakefile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
|
-
require
|
1
|
+
require 'bundler/gem_tasks'
|
2
2
|
require 'rspec/core/rake_task'
|
3
3
|
|
4
4
|
desc 'Default: run specs.'
|
5
5
|
task default: :spec
|
6
6
|
|
7
|
-
desc
|
7
|
+
desc 'Run specs'
|
8
8
|
RSpec::Core::RakeTask.new do |t|
|
9
|
-
t.rspec_opts =
|
9
|
+
t.rspec_opts = '--tag fast'
|
10
10
|
end
|
data/ngrams_parser.gemspec
CHANGED
@@ -4,21 +4,21 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'ngrams_parser/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'ngrams_parser'
|
8
8
|
spec.version = NgramsParser::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Aleksander Malaszkiewicz']
|
10
|
+
spec.email = ['info@fractalsoft.org']
|
11
11
|
spec.summary = %q{Split text into ngrams}
|
12
|
-
spec.homepage =
|
13
|
-
spec.license =
|
12
|
+
spec.homepage = 'https://github.com/fractalsoft/ngrams_parser'
|
13
|
+
spec.license = 'MIT'
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
16
16
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
17
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
-
spec.require_paths = [
|
18
|
+
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_development_dependency
|
21
|
-
spec.add_development_dependency
|
20
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
21
|
+
spec.add_development_dependency 'rake'
|
22
22
|
|
23
|
-
spec.add_dependency
|
23
|
+
spec.add_dependency 'lexical_units'
|
24
24
|
end
|
@@ -20,11 +20,11 @@ describe NgramsParser do
|
|
20
20
|
text, bigrams, trigrams = hash.values
|
21
21
|
|
22
22
|
it "split word '#{text}' into bigrams: #{bigrams}" do
|
23
|
-
subject.ngram(text, 2).
|
23
|
+
expect(subject.ngram(text, 2)).to eq(bigrams)
|
24
24
|
end
|
25
25
|
|
26
26
|
it "split word '#{text}' into trigrams: #{trigrams}" do
|
27
|
-
subject.ngram(text, 3).
|
27
|
+
expect(subject.ngram(text, 3)).to eq(trigrams)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -126,11 +126,11 @@ describe NgramsParser do
|
|
126
126
|
text, bigrams, trigrams = hash.values
|
127
127
|
|
128
128
|
it "split text '#{text}' into bigrams" do
|
129
|
-
subject.ngrams(text, 2).
|
129
|
+
expect(subject.ngrams(text, 2)).to eq(bigrams)
|
130
130
|
end
|
131
131
|
|
132
132
|
it "split text '#{text}' into trigrams" do
|
133
|
-
subject.ngrams(text, 3).
|
133
|
+
expect(subject.ngrams(text, 3)).to eq(trigrams)
|
134
134
|
end
|
135
135
|
end
|
136
136
|
end
|
@@ -23,9 +23,9 @@ describe NgramsParser::String do
|
|
23
23
|
'ipsu', 'psum', 'sum ', 'um ', 'm '
|
24
24
|
]
|
25
25
|
|
26
|
-
string.ngrams(2).
|
27
|
-
string.ngrams(3).
|
28
|
-
string.ngrams(4).
|
26
|
+
expect(string.ngrams(2)).to eq(bigrams)
|
27
|
+
expect(string.ngrams(3)).to eq(trigrams)
|
28
|
+
expect(string.ngrams(4)).to eq(quadgrams)
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'ngrams_parser'
|
2
2
|
require 'coveralls'
|
3
3
|
Coveralls.wear!
|
4
|
+
require 'codeclimate-test-reporter'
|
5
|
+
CodeClimate::TestReporter.start
|
4
6
|
|
5
7
|
RSpec.configure do |config|
|
6
|
-
config.treat_symbols_as_metadata_keys_with_true_values = true
|
7
8
|
config.run_all_when_everything_filtered = true
|
8
9
|
config.filter_run :focus
|
9
10
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ngrams_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksander Malaszkiewicz
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -61,6 +61,7 @@ extra_rdoc_files: []
|
|
61
61
|
files:
|
62
62
|
- .gitignore
|
63
63
|
- .rspec
|
64
|
+
- .rubocop.yml
|
64
65
|
- .ruby-gemset
|
65
66
|
- .ruby-version
|
66
67
|
- .travis.yml
|
@@ -100,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
100
101
|
version: '0'
|
101
102
|
requirements: []
|
102
103
|
rubyforge_project:
|
103
|
-
rubygems_version: 2.0.
|
104
|
+
rubygems_version: 2.0.7
|
104
105
|
signing_key:
|
105
106
|
specification_version: 4
|
106
107
|
summary: Split text into ngrams
|