<commit_before>= Similus

Similus is a Ruby library that allows to find similar objects and recommendations using generated activity.
Examples of usage:

* Find similar articles based on what other users also viewed.
* Recommend articles to users based on their activity.

== Authors

{<NAME>}[http://github.com/horaci] <<EMAIL>>

== Quick overview

* Setup
* Store activity
* Show similar objects
* Show recommended objects

== Setup

Before using Similus, you need to setup the redis configuration. In rails this can be done inside a preinitializer in the config/preinitializers folder.

  Similus.config do |config|
    config.backend = :redis
    config.redis_server = "localhost:6379"
    config.redis_db = 8
  end

=== Store activity

Locate where you want to store activity. For example, in Ruby on Rails, inside the show method of the ArticlesController class:

  class ArticlesController < ApplicationController
    def show
      @article = Article.find(params[:id])
      Similus.add_activity(current_user, :show, @article)
    end
  end

=== Show similar objects

Once there is some activity stored by users, you can query for similar objects:

  class ArticlesController < ApplicationController
    def show
      @article = Article.find(params[:id])
      @similar_articles = Similus.similar_to(@article)
    end
  end

=== Show recommended objects

Even better than just showing similar articles, show recommended articles for the user's previous activity when there is a logged in user:

class HomeController < ApplicationController
  def index
    @recommended_articles = Similus.recommended_for(current_user)
  end
end

== Configuring and installing Similus

As of current version, Similus only supports redis backend.

Install Redis 2.0 from [http://code.google.com/p/redis/] and start the server.

Install the Similus gem:

  gem install similus

== License

Copyright (c) 2010 <NAME>

See LICENSES for details.<commit_msg>readme indentation fix<commit_after>= Similus

Similus is a Ruby library that allows to find similar objects and recommendations using generated activity.
Examples of usage:

* Find similar articles based on what other users also viewed.
* Recommend articles to users based on their activity.

== Authors

{<NAME>}[http://github.com/horaci] <<EMAIL>>

== Quick overview

* Setup
* Store activity
* Show similar objects
* Show recommended objects

== Setup

Before using Similus, you need to setup the redis configuration. In rails this can be done inside a preinitializer in the config/preinitializers folder.

  Similus.config do |config|
    config.backend = :redis
    config.redis_server = "localhost:6379"
    config.redis_db = 8
  end

=== Store activity

Locate where you want to store activity. For example, in Ruby on Rails, inside the show method of the ArticlesController class:

  class ArticlesController < ApplicationController
    def show
      @article = Article.find(params[:id])
      Similus.add_activity(current_user, :show, @article)
    end
  end

=== Show similar objects

Once there is some activity stored by users, you can query for similar objects:

  class ArticlesController < ApplicationController
    def show
      @article = Article.find(params[:id])
      @similar_articles = Similus.similar_to(@article)
    end
  end

=== Show recommended objects

Even better than just showing similar articles, show recommended articles for the user's previous activity when there is a logged in user:

  class HomeController < ApplicationController
    def index
      @recommended_articles = Similus.recommended_for(current_user)
    end
  end

== Configuring and installing Similus

As of current version, Similus only supports redis backend.

Install Redis 2.0 from [http://code.google.com/p/redis/] and start the server.

Install the Similus gem:

  gem install similus

== License

Copyright (c) 2010 <NAME>

See LICENSES for details.
{'fraction_non_alphanumeric': 0.06709346991037132, 'fraction_numerical': 0.005633802816901409, 'mean_word_length': 4.105882352941176, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '284572', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1024, 'n_words': 445}