Class: TimingTagger
Overview
Copyright 2015 The MITRE Corporation
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Instance Method Summary collapse
-
#initialize ⇒ TimingTagger
constructor
A new instance of TimingTagger.
Methods inherited from Tagger
#normalize, #parse_main, #parse_text
Constructor Details
#initialize ⇒ TimingTagger
Returns a new instance of TimingTagger.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/taggers/timing_tagger.rb', line 18 def initialize @name = 'timing' durat1 = /(?x)(?:\d+|one|two|three|four|five|six|seven|eight|nine| ten|fifteen|twenty|thirty|sixty|half\s+an|one\s+half)\s+ (?:min(?:utes?)?|hours?)/i instruct1 = /(?x)(?:(?:(?:(?:immediately|just|right|#{durat1})\s+)? (?:after|at|before|prior\s+to)\s+ (?:breakfast|dinner|food|lunch| (?:(?:first|each|every|q\.?)\s+)? meals?|milk|supper|eating|bedtime|going\s+to\s+bed| retiring))|\ba\.?c\.?\b|\bp\.?c\.?\b)/i instruct2 = /(?x)(?:(?:(?:with|at|in)\s+(?:breakfast|dinner|food| lunch|(?:(?:first|each|every)\s+)?meals?|milk|supper| water|OJ|orange\s+juice)))/i instruct3 = /(?:on\s+)?(?:an\s+)?empty\s+stomach/i @default_search = @default_precondition = /(#{instruct1}|#{instruct2}|#{instruct3})/i @content_group = 1 end |