Skip to content

Commit

Permalink
update dependencies
Browse files Browse the repository at this point in the history
add travis and coveralls
  • Loading branch information
inukshuk committed Feb 7, 2014
1 parent 370f407 commit e633f90
Show file tree
Hide file tree
Showing 10 changed files with 106 additions and 33 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
service_name: travis-ci
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
./doc/
./doc
lib/anystyle/parser/support/dict.kch
lib/anystyle/parser/support/dict.dbm
Gemfile.lock
*.rbc
*.swp
/.bundle
/coverage
4 changes: 4 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SimpleCov.start do
add_filter 'spec/'
add_filter 'features/'
end
13 changes: 13 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
language: ruby
bundler_args: --without debug extra redis kyoto
script: bundle exec rake test_with_coveralls
rvm:
- 2.1.0
- 2.0.0
- 1.9.3
- rbx
notifications:
email:
- sylvester@keil.or.at
on_success: change
on_failure: always
40 changes: 28 additions & 12 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
source 'https://rubygems.org'
gemspec

group :development do
gem 'debugger', :platforms => [:mri_19]
gem 'simplecov'
gem 'yard'
group :development, :test do
gem 'rake'
gem 'cucumber'
gem 'rspec'
gem 'simplecov', '~>0.8', :require => false
gem 'rubinius-coverage', :platform => :rbx
gem 'coveralls', :require => false
end

group :test do
gem 'rake'
gem 'racc', '~>1.4'

gem 'cucumber'
gem 'rspec'
gem 'ZenTest'
group :debug do
gem 'debugger', '~>1.6', :require => false, :platform => :mri
gem 'rubinius-compiler', '~>2.0', :require => false, :platform => :rbx
gem 'rubinius-debugger', '~>2.0', :require => false, :platform => :rbx
end

group :profile do
Expand All @@ -22,6 +22,22 @@ group :profile do
end

group :extra do
gem 'autotest-fsevent', :require => false
gem 'yard'
gem 'ZenTest'
end

group :redis do
gem 'redis'
gem 'hiredis'
end

group :kyoto do
gem 'kyotocabinet-ruby', :require => 'kyotocabinet'
gem 'autotest-fsevent', :require => false
end

platform :rbx do
gem 'rubysl', '~>2.0'
gem 'json', '~>1.8'
gem 'racc'
end
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Anystyle-Parser
===============

Anystyle-Parser is a very fast and smart parser for academic references. It
is inspired by [ParsCit](http://aye.comp.nus.edu.sg/parsCit/) and
[FreeCite](http://freecite.library.brown.edu/); Anystyle-Parser uses machine
Expand All @@ -18,15 +17,15 @@ Installation
$ [sudo] gem install anystyle-parser

During the statistical analysis of reference strings, Anystyle-Parser relies
on a large feature dictionary; by default, Anystyle-Parser creates a
on a large feature dictionary; by default, Anystyle-Parser creates a
[Kyoto Cabinet](http://fallabs.com/kyotocabinet/) file-based hash database
from the dictionary file that ships with the parser. If Kyoto Cabinet is
not installed on your system, Anystyle-Parser uses a simple Ruby Hash as a
fall-back; this Hash has to be re-created every time you load the parser
and takes up a lot of memory in your Ruby process; it is therefore strongly
recommended to install Kyoto Cabinet and the `kyotocabinet-ruby` gem.

$ [sudo] gem install kyotocabinet-ruby
$ [sudo] gem install kyotocabinet-ruby

The database file will be created the first time you access the dictionary;
note that you will need write permissions in the directory where the file
Expand All @@ -39,8 +38,8 @@ Starting with version 0.1.0, Anystyle-Parser also supports
[Redis](http://redis.io); to use Redis as the data store you need to install
the `redis` gem (and, optionally, the `hiredis` gem).

$ [sudo] gem install hiredis
$ [sudo] gem install redis
$ [sudo] gem install hiredis
$ [sudo] gem install redis

To see which data store modes are available in you current environment,
check the output of `Dictionary.modes`:
Expand All @@ -52,7 +51,7 @@ To select one of the available modes, use the dictionary instance options:

> Anystyle::Parser::Dictionary.instance.options[:mode]
=> :kyoto

To use [Redis](http://redis.io) you also need to set the host or unix socket
where your redis server is available. For example:

Expand Down Expand Up @@ -113,7 +112,7 @@ The following irb sessions illustrates some parser goodness:
year = {1997}
}
=> nil

### Unhappy with the results?

Citation references come in many forms, so, inevitably, you will find data
Expand Down Expand Up @@ -159,7 +158,7 @@ data again:
=> [{:author=>"John Lafferty and Andrew McCallum and Fernando Pereira", :title=>"Conditional random fields: probabilistic models for segmenting and labeling sequence data", :booktitle=>"Proceedings of the International Conference on Machine Learning", :pages=>"282--289", :publisher=>"Morgan Kaufmann", :location=>"San Francisco, CA", :year=>2001, :type=>:inproceedings}]

If you want to make Anystyle-Parser smarter, please consider sending us your
tagged references (see below).
tagged references (see below).

Contributing
------------
Expand All @@ -182,8 +181,7 @@ and open a pull request on GitHub.

License
-------

Copyright 2011-2012 Sylvester Keil. All rights reserved.
Copyright 2011-2014 Sylvester Keil. All rights reserved.

Some of the code in Anystyle-Parser's post processing (normalizing) routines
was originally based on the source code of FreeCite and
Expand Down
17 changes: 14 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'bundler'
begin
Bundler.setup(:default, :development, :debug, :test, :extra, :profile)
Bundler.setup
rescue Bundler::BundlerError => e
$stderr.puts e.message
$stderr.puts "Run `bundle install` to install missing gems"
Expand All @@ -23,6 +23,13 @@ task :release => [:build] do
system "gem push anystyle-parser-#{Anystyle::Parser::VERSION}.gem"
end

task :check_warnings do
$VERBOSE = true
require 'anystyle/parser'

puts Anystyle::Parser::VERSION
end

require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec) do |spec|
Expand All @@ -32,6 +39,10 @@ end
require 'cucumber/rake/task'
Cucumber::Rake::Task.new(:features)

require 'coveralls/rake/task'
Coveralls::RakeTask.new
task :test_with_coveralls => [:spec, 'coveralls:push']

task :default => :spec

begin
Expand All @@ -41,13 +52,13 @@ rescue LoadError
# ignore
end

desc 'Run an IRB session with CSL loaded'
desc 'Run an IRB session with Anystyle-Parser loaded'
task :console, [:script] do |t, args|
ARGV.clear

require 'irb'
require 'anystyle/parser'

IRB.conf[:SCRIPT] = args.script
IRB.start
end
Expand Down
12 changes: 7 additions & 5 deletions anystyle-parser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ Gem::Specification.new do |s|
s.summary = 'Parser for academic references.'
s.description = 'A sophisticated parser for academic references based on machine learning algorithms using conditional random fields.'
s.license = 'FreeBSD'

s.add_runtime_dependency('bibtex-ruby', '~>2.0')

s.required_ruby_version = '>= 1.9.3'

s.add_runtime_dependency('bibtex-ruby', '~>3.0')
s.add_runtime_dependency('wapiti', '~>0.0')
s.add_runtime_dependency('namae', '~>0.7.1')
s.add_runtime_dependency('namae', '~>0.8')

s.files = `git ls-files`.split("\n") - Dir['resources/**/*']
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
Expand All @@ -26,7 +28,7 @@ Gem::Specification.new do |s|

s.rdoc_options = %w{--line-numbers --inline-source --title "Anystyle\ Parser" --main README.md}
s.extra_rdoc_files = %w{README.md LICENSE}

end

# vim: syntax=ruby
# vim: syntax=ruby
18 changes: 18 additions & 0 deletions features/support/env.rb
Original file line number Diff line number Diff line change
@@ -1 +1,19 @@
begin
require 'simplecov'
require 'coveralls' if ENV['CI']
rescue LoadError
# ignore
end

begin
case
when defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
require 'rubinius/debugger'
else
require 'debugger'
end
rescue LoadError
# ignore
end

require 'anystyle/parser'
11 changes: 9 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
begin
require 'simplecov'
require 'coveralls' if ENV['CI']
rescue LoadError
# ignore
end

begin
require 'debugger'
case
when defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx'
require 'rubinius/debugger'
else
require 'debugger'
end
rescue LoadError
# ignore
end

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))

require 'rspec'
require 'anystyle/parser'

Expand All @@ -20,5 +27,5 @@
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

RSpec.configure do |config|

end

0 comments on commit e633f90

Please sign in to comment.