<commit_before># Rack::LocaleRootRedirect

`Rack::LocaleRootRedirect` redirects requests to `"/"` based on the `Accept-Language` HTTP header.

## Installation

Add this line to your application’s Gemfile:

```ruby
gem 'rack-locale-root-redirect'
```

And then execute:

```shell
$ bundle
```

## Usage

With Sinatra:

```ruby
# Gemfile
gem "sinatra"
gem "rack-accept", :require => "rack/accept"
gem "rack-locale-root-redirect", :require => "rack/locale-root-redirect"

# config.ru
require 'bundler'
Bundler.require

class MyApp < Sinatra::Base
  use Rack::Accept
  use Rack::LocaleRootRedirect, :fr => "/fr", :en => "/en"

  get("/fr") { "Français!" }
  get("/en") { "English!" }
end

run MyApp
```

Then, test it:

```shell
$ rackup &

$ curl -sI "http://0.0.0.0:9292" -H "Accept-Language: fr;q=1, en;q=0.8" | grep Location
Location: /fr

$ curl -sI "http://0.0.0.0:9292" -H "Accept-Language: fr;q=0.4, en;q=0.8" | grep Location
Location: /en
```<commit_msg>Improve usage section in README again<commit_after># Rack::LocaleRootRedirect

`Rack::LocaleRootRedirect` redirects requests to `"/"` based on the `Accept-Language` HTTP header.

## Installation

Add this line to your application’s Gemfile:

```ruby
gem 'rack-locale-root-redirect'
```

And then execute:

```shell
$ bundle
```

## Usage

With Sinatra:

```ruby
# Gemfile
gem "sinatra"
gem "rack-accept", :require => "rack/accept"
gem "rack-locale-root-redirect", :require => "rack/locale-root-redirect"

# config.ru
require 'bundler'
Bundler.require

class MyApp < Sinatra::Base
  use Rack::Accept
  use Rack::LocaleRootRedirect, :fr => "/fr", :en => "/en"

  get("/fr") { "Français!" }
  get("/en") { "English!" }
end

run MyApp
```

Then, test it:

```shell
$ rackup &

$ curl -sI "http://0.0.0.0:9292" -H "Accept-Language: fr;q=1, en;q=0.8" | grep "301\|Location"
HTTP/1.1 301 Moved Permanently
Location: /fr

$ curl -sI "http://0.0.0.0:9292" -H "Accept-Language: fr;q=0.4, en;q=0.8" | grep "301\|Location"
HTTP/1.1 301 Moved Permanently
Location: /en
```
{'fraction_non_alphanumeric': 0.18929633300297324, 'fraction_numerical': 0.030723488602576808, 'mean_word_length': 4.2578125, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, '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': '3033589', 'n_tokens_mistral': 829, 'n_tokens_neox': 769, 'n_words': 197}