<commit_before>*rope* is a pure Ruby implementation of the "Rope data structure":http://en.wikipedia.org/wiki/Rope_%28computer_science%29.

For many applications, the *Rope* class can be a drop-in replacement for *String* that is optimized for certain use cases.

Using a *Rope* instance over a *String* may be desirable in applications that manipulate large amounts of text.

*rope* currently offers:
* Fast string concatenation and substring operations involving large strings
* Immutability, which is desirable for functional programming techniques or multithreaded applications

Planned features for *rope*:
* Ability to view a function producing characters as a Rope (including I/O operations).  For instance, a piece of a Rope may be a 100MB file, but is only read when that section of the string is examined.  Concatenating to the end of that Rope does not involve reading the entire file.

Disadvantages of *rope*:
* Single character replacements are expensive
* Iterating character-by-character is slightly more expensive than in a String (TODO: how much? .. haven't implemented iterators yet)

h1. Installation

*rope* is hosted on "rubygems":http://www.rubygems.org/

<pre>
gem install rope
</pre>

... or in your Gemfile

<pre>
gem 'rope'
</pre>

*rope* is tested against MRI 1.8.7 and 1.9.2.

h1. Usage

h2. Creating a Rope

<pre>
rope = "123456789".to_rope # Rope::Rope.new("123456789") also works

puts rope # "123456789"
</pre>

h2. Concatenation

A *Rope* instance can be concatenated with another *Rope* or *String* instance.

<pre>
rope = "12345"
string = "6789"

rope += string
puts rope # "123456789"
</pre>

h2. Slices/Substrings

A *Rope* instance offers efficient substring operations.  The *slice* and *[]* methods are synonymous with their "String counterparts (Ruby API documentation)":http://ruby-doc.org/core-1.9/classes/String.html#M000293

<pre>
rope = "123456789".to_rope

puts rope.slice(3, 4) # 4567
# TODO: More examples when they are implemented
</pre><commit_msg>Add missing period<commit_after>*rope* is a pure Ruby implementation of the "Rope data structure":http://en.wikipedia.org/wiki/Rope_%28computer_science%29.

For many applications, the *Rope* class can be a drop-in replacement for *String* that is optimized for certain use cases.

Using a *Rope* instance over a *String* may be desirable in applications that manipulate large amounts of text.

*rope* currently offers:
* Fast string concatenation and substring operations involving large strings
* Immutability, which is desirable for functional programming techniques or multithreaded applications

Planned features for *rope*:
* Ability to view a function producing characters as a Rope (including I/O operations).  For instance, a piece of a Rope may be a 100MB file, but is only read when that section of the string is examined.  Concatenating to the end of that Rope does not involve reading the entire file.

Disadvantages of *rope*:
* Single character replacements are expensive
* Iterating character-by-character is slightly more expensive than in a String (TODO: how much? .. haven't implemented iterators yet)

h1. Installation

*rope* is hosted on "rubygems":http://www.rubygems.org/

<pre>
gem install rope
</pre>

... or in your Gemfile

<pre>
gem 'rope'
</pre>

*rope* is tested against MRI 1.8.7 and 1.9.2.

h1. Usage

h2. Creating a Rope

<pre>
rope = "123456789".to_rope # Rope::Rope.new("123456789") also works

puts rope # "123456789"
</pre>

h2. Concatenation

A *Rope* instance can be concatenated with another *Rope* or *String* instance.

<pre>
rope = "12345"
string = "6789"

rope += string
puts rope # "123456789"
</pre>

h2. Slices/Substrings

A *Rope* instance offers efficient substring operations.  The *slice* and *[]* methods are synonymous with their "String counterparts (Ruby API documentation)":http://ruby-doc.org/core-1.9/classes/String.html#M000293.

<pre>
rope = "123456789".to_rope

puts rope.slice(3, 4) # 4567
# TODO: More examples when they are implemented
</pre>
{'fraction_non_alphanumeric': 0.09311033449825262, 'fraction_numerical': 0.042935596605092365, 'mean_word_length': 4.549861495844875, 'pattern_counts': {'":': 6, '<': 23, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2678715', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1222, 'n_words': 517}