A few string util functions which support the Public.Law apps. Optimized for reduced object instantiation at the expense of readability.
Add this line to your application's Gemfile:
gem 'law_string'
And then execute:
$ bundle
Or install it yourself as:
$ gem install law_string
Provides;
#add_typograpy
e.g., changing ASCII quotes to true UTF-8 double quotes.#add_html_typograhy
improvements which require HTML.#initialism?
to detect, e.g., "ATM". Very rudimentary.#initials?
to detect, e.g., "A.S.C.A.P."#titleize
enhanced for English-language legal texts, coded to reduce memory allocations.
See the tests for details.