diff --git a/LICENSE b/LICENSE index f8655b8..bab06da 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2011 Sylvester Keil. All rights reserved. +Copyright 2011-2012 Sylvester Keil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index caba570..0507699 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,14 @@ 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 is designed -for raw speed (it uses [wapiti](https://github.com/inukshuk/wapiti-ruby) based +[FreeCite](http://freecite.library.brown.edu/); Anystyle-Parser uses machine +learning algorithms and is designed +for raw speed (it [wapiti](https://github.com/inukshuk/wapiti-ruby) based conditional random fields and [Kyoto Cabinet](http://fallabs.com/kyotocabinet/) -as a key-value store), flexibility (it is easy to train the model with -data that is relevant to your parsing needs), and compatibility (Anystyle-Parser -exports to Ruby Hashes, BibTeX, or the CiteProc JSON format). +or [Redis](http://redis.io) as a key-value store), flexibility (it is easy to +train the model with data that is relevant to your parsing needs), and +compatibility (Anystyle-Parser exports to Ruby Hashes, BibTeX, or the +CSL/CiteProc JSON format). Installation ------------ @@ -31,7 +33,36 @@ note that you will need write permissions in the directory where the file is to be created. You can change the Dictionary's default path in the Dictionary's options: - Anystyle::Parser::Dictionary.instance.options[:path] + Anystyle::Parser::Dictionary.instance.options[:cabinet] + +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 + +To see which data store modes are available in you current environment, +check the output of `Dictionary.modes`: + + > Anystyle::Parser::Dictionary.modes + => [:kyoto, :redis, :hash] + +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: + + Anystyle::Parser::Dictionary.instance.options[:mode] = :redis + Anystyle::Parser::Dictionary.instance.options[:host] = 'localhost' + +When the data store is opened using redis-mode and the data store is empty, +the feature dictionary will be imported automatically. If you want to import +the data explicitly you can use `Dictionary#create` after setting the +required options. Usage @@ -152,7 +183,7 @@ and open a pull request on GitHub. License ------- -Copyright 2011 Sylvester Keil. All rights reserved. +Copyright 2011-2012 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