Home > Grammatic

Grammatic

Grammatic is a project mainly written in Ruby, based on the MIT license.

Parse and recognize expressions

= GRAMMATIC. Parse and Recognize expressions for Budgeteer

Grammatic is a simple gem that recognize different types of grammatic for budgeteer and parse them. Each time that you call the method 'parse' you will get a hash with all parts of that string or you get an exception when the expression is not valid.

require 'grammatic'
Grammatic.parse("@savings super food 100 some groceries for tonight")
#=> { :account => "@savings", :tags => "super food", :amount => 100, :description => "some groceries for tonight" }

Grammatic.parse("invalid expression")
#=> Grammatic::InvalidExpression: The expression is not valid
Previous:server-watch