ruby_ngrams 0.0.5 → 0.0.6

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.
Files changed (2) hide show
  1. data/bin/ruby_ngrams +8 -23
  2. metadata +4 -4
data/bin/ruby_ngrams CHANGED
@@ -6,29 +6,14 @@ require 'ruby_ngrams'
6
6
  class App
7
7
  include RubyCLI
8
8
 
9
- def define_command_options() @options = {:regex => //, :n => 2} end
10
-
11
- # Redefining the RubyCLI define_option_parser method
12
- # Need to tell the OptionParser how to handle this command specific options.
13
- def define_option_parser
14
- #configure an OptionParser
15
- OptionParser.new do |opts|
16
- opts.banner = "Usage: #{__FILE__} [OPTIONS]... [FILE]..."
17
- opts.separator ""
18
- opts.separator "Specific options:"
19
- opts.on('-h', '--help', 'displays help information') do
20
- @default_options[:help] = true
21
- output_help
22
- end
23
- opts.on('-V','--verbose','Run verbosely') do
24
- @default_options[:verbose] = true
25
- end
26
- opts.on('-n', '--n NUM', Integer, 'set length n for n-grams') do |n|
27
- @options[:n] = n
28
- end
29
- opts.on('-r', '--regex "REGEX"', Regexp, 'set regex to split string into tokens') do |r|
30
- @options[:regex] = r
31
- end
9
+ def initialize_command_options() @options = {:regex => //, :n => 2} end
10
+
11
+ def define_command_option_parsing
12
+ @opt_parser.on('-n', '--n NUM', Integer, 'set length n for n-grams') do |n|
13
+ @options[:n] = n
14
+ end
15
+ @opt_parser.on('-r', '--regex "REGEX"', Regexp, 'set regex to split string into tokens') do |r|
16
+ @options[:regex] = r
32
17
  end
33
18
  end
34
19
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 5
9
- version: 0.0.5
8
+ - 6
9
+ version: 0.0.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Martin Velez
@@ -27,9 +27,9 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  segments:
29
29
  - 0
30
- - 1
30
+ - 2
31
31
  - 0
32
- version: 0.1.0
32
+ version: 0.2.0
33
33
  type: :runtime
34
34
  version_requirements: *id001
35
35
  description: A simple extension of the Ruby core string class to parse a string into n-grams