module Tnql grammar Age rule age space age:(fuzzy_age / exact_age) end rule exact_age [0-9] 1..3 end rule fuzzy_age 'between' space start:exact_age space 'and' space finish:exact_age end rule with_age_at_diagnosis were_keyword aged_keyword age end rule with_death_date died_keyword fuzzy_date end rule with_birth_date were_keyword born_keyword fuzzy_date end rule age_group space group:(ctya / paediatric / teenage / young_adult) word_break end rule ctya 'ctya' end rule paediatric 'paediatric' end rule teenage 'teenage' end rule young_adult 'young' space 'adult' end rule aged_keyword space 'aged' word_break end rule died_keyword space 'died' word_break end rule were_keyword space 'were' word_break end rule born_keyword space 'born' word_break end end end