ivanvc-dictionary 0.0.0
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.
- data/.document +5 -0
- data/.gitignore +2 -0
- data/README.rdoc +13 -0
- data/Rakefile +45 -0
- data/VERSION +1 -0
- data/bin/anagram_extractor +10 -0
- data/extras/3k_english.txt +3000 -0
- data/extras/capitalized_english.txt +7 -0
- data/extras/english.txt +7 -0
- data/lib/dictionary/anagram_extractor.rb +98 -0
- data/lib/dictionary/error.rb +25 -0
- data/lib/dictionary.rb +26 -0
- data/spec/anagram_extactor_spec.rb +94 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +9 -0
- metadata +90 -0
    
        data/.document
    ADDED
    
    
    
        data/.gitignore
    ADDED
    
    
    
        data/README.rdoc
    ADDED
    
    
    
        data/Rakefile
    ADDED
    
    | @@ -0,0 +1,45 @@ | |
| 1 | 
            +
            require 'rubygems'
         | 
| 2 | 
            +
            require 'rake'
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            begin
         | 
| 5 | 
            +
              require 'jeweler'
         | 
| 6 | 
            +
              Jeweler::Tasks.new do |gem|
         | 
| 7 | 
            +
                gem.name = "ivanvc-dictionary"
         | 
| 8 | 
            +
                gem.summary = %q{Dictionary}
         | 
| 9 | 
            +
                gem.description = %q{Dictionary}
         | 
| 10 | 
            +
                gem.email = "iv@nvald.es"
         | 
| 11 | 
            +
                gem.homepage = "http://github.com/ivanvc/dictionary"
         | 
| 12 | 
            +
                gem.authors = ["Iván Valdés (@ivanvc)"]
         | 
| 13 | 
            +
                gem.add_development_dependency "rspec", ">= 1.2.9"
         | 
| 14 | 
            +
                # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
         | 
| 15 | 
            +
              end
         | 
| 16 | 
            +
              Jeweler::GemcutterTasks.new
         | 
| 17 | 
            +
            rescue LoadError
         | 
| 18 | 
            +
              puts "Jeweler (or a dependency) not available. Install it with: gem install jeweler"
         | 
| 19 | 
            +
            end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            require 'spec/rake/spectask'
         | 
| 22 | 
            +
            Spec::Rake::SpecTask.new(:spec) do |spec|
         | 
| 23 | 
            +
              spec.libs << 'lib' << 'spec'
         | 
| 24 | 
            +
              spec.spec_files = FileList['spec/**/*_spec.rb']
         | 
| 25 | 
            +
            end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            Spec::Rake::SpecTask.new(:rcov) do |spec|
         | 
| 28 | 
            +
              spec.libs << 'lib' << 'spec'
         | 
| 29 | 
            +
              spec.pattern = 'spec/**/*_spec.rb'
         | 
| 30 | 
            +
              spec.rcov = true
         | 
| 31 | 
            +
            end
         | 
| 32 | 
            +
             | 
| 33 | 
            +
            task :spec => :check_dependencies
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            task :default => :spec
         | 
| 36 | 
            +
             | 
| 37 | 
            +
            require 'rake/rdoctask'
         | 
| 38 | 
            +
            Rake::RDocTask.new do |rdoc|
         | 
| 39 | 
            +
              version = File.exist?('VERSION') ? File.read('VERSION') : ""
         | 
| 40 | 
            +
             | 
| 41 | 
            +
              rdoc.rdoc_dir = 'rdoc'
         | 
| 42 | 
            +
              rdoc.title = "dictionary #{version}"
         | 
| 43 | 
            +
              rdoc.rdoc_files.include('README*')
         | 
| 44 | 
            +
              rdoc.rdoc_files.include('lib/**/*.rb')
         | 
| 45 | 
            +
            end
         | 
    
        data/VERSION
    ADDED
    
    | @@ -0,0 +1 @@ | |
| 1 | 
            +
            0.0.0
         | 
| @@ -0,0 +1,10 @@ | |
| 1 | 
            +
            #!/usr/bin/env ruby
         | 
| 2 | 
            +
            $LOAD_PATH.unshift(File.dirname(__FILE__))
         | 
| 3 | 
            +
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
         | 
| 4 | 
            +
            require 'dictionary'
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            if ARGV.empty?
         | 
| 7 | 
            +
            	puts "Use anagram_extractor [source dictionary] [export dictionary location]"
         | 
| 8 | 
            +
            else
         | 
| 9 | 
            +
              puts Dictionary.extract_anagrams(ARGV[0], ARGV[1])
         | 
| 10 | 
            +
            end
         |