Wordtree
This is the WordTree ruby gem for text analysis.
Installation
$ gem install wordtree
Usage
require 'wordtree'
library = WordTree::Library.new("/tmp/library")
librarian = WordTree::Librarian.new(library)
Download a book from Archive.org to your "library":
book_ids = librarian.archive_org_get(
'latewarbetween_00hunt',
'firstbooknapole00gruagoog')
Find a book in your on-disk "library":
book = librarian.find('firstbooknapole00gruagoog')
book.metadata
book.content
Modify and save a book to your "library":
book.year = 2014
librarian.save(book)
Clean the text:
book.clean_content
# returns the book without punctuation
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request