class MedAttrib

Public Instance Methods

parse(text) click to toggle source
# File lib/medattrib.rb, line 57
  def parse (text)

#    text = REXML::Text.new(text, true, nil, false).to_s # escape special characters
    taggersExceptDoseAmount = [StrengthTagger.new,
                StrengthUnitTagger.new,
                DoseFormTagger.new,
                DoseAmountListTagger.new,
                RouteTagger.new,
                IndicationTagger.new,
                FrequencyTagger.new,
                TimingTagger.new,
                SubstitutionTagger.new,
                RefillTagger.new,
                DurationTagger.new,
                DispenseQuantityTagger.new]
               
    tags = []
    taggersExceptDoseAmount.each {|tagger| tags += tagger.parse_main text}
    as = Standoff::AnnotatedString.new(:signal => text, :tags => tags)
    DoseAmountTagger.new.parse_annotated_string as
    
    partial_xml = as.to_s
    as

  end