Sha256: 4dda8c5b04948f9b2410470b4409312a52adf10dff30b96e393e2a6dcade3808

Contents?: true

Size: 1.18 KB

Versions: 8

Compression:

Stored size: 1.18 KB

Contents

module Tnql
  grammar Age
    rule age
      space age:(fuzzy_age / exact_age) <Nodes::AgeNode>
    end

    rule exact_age
      [0-9] 1..3 <Nodes::ExactAgeNode>
    end

    rule fuzzy_age
      'between' space start:exact_age space 'and' space finish:exact_age <Nodes::FuzzyAgeNode>
    end

    rule with_age_at_diagnosis
      were_keyword aged_keyword age <Nodes::AgeAtDiagnosisNode>
    end

    rule with_death_date
      died_keyword fuzzy_date <Nodes::DeathDateNode>
    end

    rule with_birth_date
      were_keyword born_keyword fuzzy_date <Nodes::BirthDateNode>
    end

    rule age_group
      space group:(ctya / paediatric / teenage / young_adult) word_break
    end

    rule ctya
      'ctya' <Nodes::CtyaNode>
    end

    rule paediatric
      'paediatric' <Nodes::PaediatricNode>
    end

    rule teenage
      'teenage' <Nodes::TeenageNode>
    end

    rule young_adult
      'young' space 'adult' <Nodes::YoungAdultNode>
    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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tnql-1.1.2 lib/tnql/grammars/age.treetop
tnql-1.1.1 lib/tnql/grammars/age.treetop
tnql-1.1.0 lib/tnql/grammars/age.treetop
tnql-1.0.4 lib/tnql/grammars/age.treetop
tnql-1.0.3 lib/tnql/grammars/age.treetop
tnql-1.0.2 lib/tnql/grammars/age.treetop
tnql-1.0.1 lib/tnql/grammars/age.treetop
tnql-1.0.0 lib/tnql/grammars/age.treetop