Skip to content

Commit

Permalink
added information about redis mode
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Mar 1, 2012
1 parent d91caed commit 0600d2a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion 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:
Expand Down
45 changes: 38 additions & 7 deletions README.md
Expand Up @@ -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
------------
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0600d2a

Please sign in to comment.