Skip to content

Instantly share code, notes, and snippets.

@mattb
Created April 3, 2013 22:24
Show Gist options
  • Save mattb/5306006 to your computer and use it in GitHub Desktop.
Save mattb/5306006 to your computer and use it in GitHub Desktop.
notice how it gets all the fiddly grammar with tenses and plural agreements correct.
# a jruby DSL for the Simple Natural Language Generator library - https://code.google.com/p/simplenlg/
realise clause {
subject 'two cats', :plural => true
verb 'live with'
object 'Matt', 'Ariel'
complement preposition_phrase {
complement 'San Francisco'
preposition 'in'
}
tense :future
}
=> "Two cats will live with Matt and Ariel in San Francisco."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment