Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrs/documentally
A simple, tested TF-IDF library for Ruby.
https://github.com/hrs/documentally
Last synced: about 1 month ago
JSON representation
A simple, tested TF-IDF library for Ruby.
- Host: GitHub
- URL: https://github.com/hrs/documentally
- Owner: hrs
- Created: 2014-02-09T22:52:54.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-16T14:18:41.000Z (almost 11 years ago)
- Last Synced: 2024-11-30T22:17:13.669Z (about 2 months ago)
- Language: Ruby
- Size: 117 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Documentally
Documentally uses [TF-IDF](http://en.wikipedia.org/wiki/tf-idf) to allow you to easily search and compare text documents.
It's still under development, so the documentation is basically just the tests right now, but an example use would be:
```ruby
term_lists = [['doc_1', ['foo', 'foo', 'bar']],
['doc_2', ['bar', 'baz', 'baz']],
['doc_3', ['bar', 'baz', 'foo']]]corpus = Documentally::Corpus.new(term_lists)
query = Documentally::Document.new('query', ['baz'])
corpus.search(query) # => ['doc_2']
```## Installation
```sh
gem install documentally
```