• Stars
    star
    36
  • Rank 710,386 (Top 15 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 14 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Parse numbers in natural language from strings (ex forty two).

Numerizer

<img src=“https://github.com/jduff/numerizer/actions/workflows/test.yaml/badge.svg?branch=master” alt=“Build Status” />

Numerizer is a gem to help with parsing numbers in natural language from strings (ex forty two). It was extracted from the awesome Chronic gem github.com/mojombo/chronic.

Installation

$ gem install numerizer

Usage

>> require 'numerizer'
=> true
>> Numerizer.numerize('forty two')
=> "42"
>> Numerizer.numerize('two and a half')
=> "2.5"
>> Numerizer.numerize('three quarters')
=> "3/4"
>> Numerizer.numerize('two and three eighths')
=> "2.375"

Contributors

Tom Preston-Werner, John Duff