https://github.com/public-law/law_string
String utils in support of legal publishing
https://github.com/public-law/law_string
ruby
Last synced: 8 months ago
JSON representation
String utils in support of legal publishing
- Host: GitHub
- URL: https://github.com/public-law/law_string
- Owner: public-law
- License: mit
- Created: 2018-04-04T03:48:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T15:36:43.000Z (almost 3 years ago)
- Last Synced: 2024-05-01T09:53:04.095Z (about 2 years ago)
- Topics: ruby
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
LawString
=========
A few string util functions which support the [Public.Law](https://www.public.law) apps. Optimized for reduced object instantiation
at the expense of readability.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'law_string'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install law_string
## Usage
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](https://github.com/public-law/law_string/blob/master/spec/law_string_spec.rb) for details.