Class: NTKSemantics
Overview
Semantics for NTK Generated SITAC
Instance Attribute Summary
Attributes inherited from Semantics
Instance Method Summary collapse
-
#initialize ⇒ NTKSemantics
constructor
A new instance of NTKSemantics.
Methods inherited from Semantics
Constructor Details
#initialize ⇒ NTKSemantics
Returns a new instance of NTKSemantics.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/semantics.rb', line 29 def initialize super @regexes = { body: %r{<figures>((.|\n)*)</figures>}, figure: %r{<figure .*?>((.|\n)*?)</figure>}, figType: %r{<figureType>(.*)</figureType>}, figName: %r{<name>(.*)</name>}, figHoriz: %r{<horizontal>(.*)</horizontal>}, figVert: %r{<vertical>(.*)</vertical>}, figPoints: %r{<points>((.|\n)*)</points>}, figPoint: %r{<point>((.|\n)*?)</point>}, ptLatitude: %r{<latitude>(.*)</latitude>}, ptLongitude: %r{<longitude>(.*)</longitude>}, bullseye: %r{<bullseye>(.*)</bullseye>}, bullsRings: %r{<numberOfRings>(.*)</numberOfRings>}, bullsDist: %r{<distanceBetweenRing>(.*)</distanceBetweenRing>} } @sems = {} @regexes.each do |key, value| @sems[key] = value.to_s.scan(/<(.*)>/).first.first.to_sym end end |