text_parser 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore ADDED
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
data/.travis.yml ADDED
@@ -0,0 +1,6 @@
1
+ rvm:
2
+ - ree
3
+ - 1.8.7
4
+ - 1.9.2
5
+ - 1.9.3
6
+ script: "rake test"
data/.yardoc/checksums ADDED
@@ -0,0 +1,2 @@
1
+ lib/text_parser.rb 0793388312f10f4689d5e7fbae71ac7f87c505a1
2
+ lib/text_parser/version.rb 4a0cc1b60789d942f386ea7de97154f2ed3590f3
Binary file
@@ -0,0 +1,2 @@
1
+ {" Object:
2
+ class
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in text_parser.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2012 Fred
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,68 @@
1
+ # TextParser
2
+
3
+ Using method parse in the String object you can parse any text.
4
+
5
+ ![Text Parser Build status](https://secure.travis-ci.org/fpaula/text_parser.png)
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ gem 'text_parser'
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install text_parser
20
+
21
+ ## Usage
22
+
23
+ "Simple, simple test".parse
24
+ # => [{:word => "simple", :hits => 2}, {:word => "test", :hits => 1}]
25
+
26
+ ---
27
+
28
+ my_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium consectetur."
29
+ my_text.parse(:dictionary => ["dolor", "consectetur"])
30
+ # => [{:word => "consectetur", :hits => 2}, {:word => "dolor", :hits => 1}]
31
+
32
+ ---
33
+
34
+ my_text.parse(:dictionary => ["dolor", "consectetur"], :order => :word, :order_direction => :desc)
35
+ # => [{:word => "dolor", :hits => 1}, {:word => "consectetur", :hits => 2}]
36
+
37
+ ---
38
+
39
+ "Lorem ipsum dolor sit amet".parse(:negative_dictionary => ["ipsum", "dolor", "sit"])
40
+ # => [{:word => "loren", :hits => 1}, {:word => "amet", :hits => 1}]
41
+
42
+ ---
43
+
44
+ "My test!".parse(:minimum_length => 3)
45
+ # => [{:word => "test", :hits => 1}]
46
+
47
+ ---
48
+
49
+ ### Arguments (Hash)
50
+
51
+ | Key | Type | Default value |
52
+ | ------------------------------- | ------ | ------------- |
53
+ | :dictionary | Array | nil |
54
+ | :order (:word, :hits) | Symbol | :word |
55
+ | :order_direction (:asc, :desc) | Symbol | :asc |
56
+ | :negative_dictionary | Array | nil |
57
+ | :minimum_length | int | nil |
58
+
59
+ Try it online at the [site example](http://textparser.heroku.com "Title").
60
+
61
+ ## Contributing
62
+
63
+ 1. Fork it
64
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
65
+ 3. Run the tests
66
+ 4. Commit your changes (`git commit -am 'Add some feature'`)
67
+ 5. Push to the branch (`git push origin my-new-feature`)
68
+ 6. Create new Pull Request
data/Rakefile CHANGED
@@ -1,5 +1,8 @@
1
+ require "bundler/gem_tasks"
1
2
  require "rake/testtask"
2
-
3
+
4
+ task :default => 'test'
5
+
3
6
  Rake::TestTask.new do |t|
4
7
  t.libs << "lib"
5
8
  t.test_files = Dir["test/**/*_test.rb"]
data/doc/_index.html CHANGED
@@ -68,9 +68,6 @@
68
68
  <div class="clear"></div>
69
69
  <h2>Namespace Listing A-Z</h2>
70
70
 
71
-
72
-
73
-
74
71
  <table>
75
72
  <tr>
76
73
  <td valign='top' width="33%">
@@ -0,0 +1,3 @@
1
+ module TextParser
2
+ VERSION = "0.1.9"
3
+ end
data/lib/text_parser.rb CHANGED
@@ -1,4 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
+ require "text_parser/version"
3
+
2
4
  module TextParser
3
5
  # Returns a parsed text with the words and its occurrences.
4
6
  # @param [Hash] [args]
@@ -30,4 +32,4 @@ end
30
32
  # Includes module TextParser in the String object
31
33
  class String
32
34
  include TextParser
33
- end
35
+ end
data/text_parser.gemspec CHANGED
@@ -1,10 +1,19 @@
1
- Gem::Specification.new do |s|
2
- s.name = "text_parser"
3
- s.version = "0.1.8"
4
- s.author = "Frederico de Paula"
5
- s.email = "fpaula@gmail.com"
6
- s.summary = "A easy way to parse a text."
7
- s.description = "Using method parse in the String object you can parse any text."
8
- s.files = Dir["{lib/**/*.rb,README.rdoc,test/**/*.rb,Rakefile,*.gemspec,doc/**/*}"]
9
- s.homepage = "http://textparser.heroku.com/"
10
- end
1
+ # -*- encoding: utf-8 -*-
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'text_parser/version'
5
+
6
+ Gem::Specification.new do |gem|
7
+ gem.name = "text_parser"
8
+ gem.version = TextParser::VERSION
9
+ gem.authors = ["Frederico de Paula"]
10
+ gem.email = ["fpaula@gmail.com"]
11
+ gem.description = %q{Includes a parse method on String object}
12
+ gem.summary = %q{Using method parse in the String object you can parse any text.}
13
+ gem.homepage = "http://textparser.heroku.com"
14
+
15
+ gem.files = `git ls-files`.split($/)
16
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
+ gem.require_paths = ["lib"]
19
+ end
metadata CHANGED
@@ -1,27 +1,45 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: text_parser
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.8
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 9
10
+ version: 0.1.9
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Frederico de Paula
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-12-20 00:00:00.000000000Z
17
+
18
+ date: 2012-10-23 00:00:00 Z
13
19
  dependencies: []
14
- description: Using method parse in the String object you can parse any text.
15
- email: fpaula@gmail.com
20
+
21
+ description: Includes a parse method on String object
22
+ email:
23
+ - fpaula@gmail.com
16
24
  executables: []
25
+
17
26
  extensions: []
27
+
18
28
  extra_rdoc_files: []
19
- files:
20
- - lib/text_parser.rb
21
- - README.rdoc
22
- - test/text_parser_test.rb
29
+
30
+ files:
31
+ - .gitignore
32
+ - .travis.yml
33
+ - .yardoc/checksums
34
+ - .yardoc/objects/root.dat
35
+ - .yardoc/proxy_types
36
+ - Gemfile
37
+ - LICENSE.txt
38
+ - README.md
23
39
  - Rakefile
24
- - text_parser.gemspec
40
+ - doc/String.html
41
+ - doc/TextParser.html
42
+ - doc/TextParser/Version.html
25
43
  - doc/_index.html
26
44
  - doc/class_list.html
27
45
  - doc/css/common.css
@@ -35,32 +53,43 @@ files:
35
53
  - doc/js/full_list.js
36
54
  - doc/js/jquery.js
37
55
  - doc/method_list.html
38
- - doc/String.html
39
- - doc/TextParser/Version.html
40
- - doc/TextParser.html
41
56
  - doc/top-level-namespace.html
42
- homepage: http://textparser.heroku.com/
57
+ - lib/text_parser.rb
58
+ - lib/text_parser/version.rb
59
+ - test/text_parser_test.rb
60
+ - text_parser.gemspec
61
+ homepage: http://textparser.heroku.com
43
62
  licenses: []
63
+
44
64
  post_install_message:
45
65
  rdoc_options: []
46
- require_paths:
66
+
67
+ require_paths:
47
68
  - lib
48
- required_ruby_version: !ruby/object:Gem::Requirement
69
+ required_ruby_version: !ruby/object:Gem::Requirement
49
70
  none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
- required_rubygems_version: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ hash: 3
75
+ segments:
76
+ - 0
77
+ version: "0"
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
79
  none: false
56
- requirements:
57
- - - ! '>='
58
- - !ruby/object:Gem::Version
59
- version: '0'
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
86
+ version: "0"
60
87
  requirements: []
88
+
61
89
  rubyforge_project:
62
- rubygems_version: 1.8.10
90
+ rubygems_version: 1.8.24
63
91
  signing_key:
64
92
  specification_version: 3
65
- summary: A easy way to parse a text.
66
- test_files: []
93
+ summary: Using method parse in the String object you can parse any text.
94
+ test_files:
95
+ - test/text_parser_test.rb
data/README.rdoc DELETED
@@ -1,33 +0,0 @@
1
- =Arguments (Hash)
2
- +---------------------------------+--------+---------------+
3
- | Key | Type | Default value |
4
- +---------------------------------+--------+---------------+
5
- | :dictionary | Array | nil |
6
- | :order (:word | :hits) | Symbol | :word |
7
- | :order_direction (:asc | :desc) | Symbol | :asc |
8
- | :negative_dictionary | Array | nil |
9
- +---------------------------------+--------+---------------+
10
-
11
-
12
- =Usage
13
-
14
- "Simple, simple test".parse
15
- # => [{:word => "simple", :hits => 2}, {:word => "test", :hits => 1}]
16
-
17
- ------------------------------------------------------------------------------------------------------------
18
-
19
- my_text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque pretium consectetur."
20
- my_text.parse(:dictionary => ["dolor", "consectetur"])
21
- # => [{:word => "consectetur", :hits => 2}, {:word => "dolor", :hits => 1}]
22
-
23
- ------------------------------------------------------------------------------------------------------------
24
-
25
- my_text.parse(:dictionary => ["dolor", "consectetur"], :order => :word, :order_direction => :desc)
26
- # => [{:word => "dolor", :hits => 1}, {:word => "consectetur", :hits => 2}]
27
-
28
- ------------------------------------------------------------------------------------------------------------
29
-
30
- "Lorem ipsum dolor sit amet".parse(:negative_dictionary => ["ipsum", "dolor", "sit"])
31
- # => [{:word => "loren", :hits => 1}, {:word => "amet", :hits => 1}]
32
-
33
-