A marked-up English language definition from various FrameNet elements
The raw (unescaped) content of the definition.
Load a definition from a frame XML document
(a LibXML::XML::Document parsed from
frame XML)
# File lib/frame_net/definition.rb, line 23
def self::from_frame_data( document )
node = document.find_first( '//fn:definition' ) or return nil
return self.from_node( node )
end
Construct a Definition from the given
node
(a LibXML::XML::Node for a definition
element)
# File lib/frame_net/definition.rb, line 14
def self::from_node( node )
return new do |definition|
definition.content = node.content
end
end
Create a new Definition for the specified
raw_content
.
# File lib/frame_net/definition.rb, line 30
def initialize
@content = nil
yield( self ) if block_given?
end
Return the definition's content with the XML stripped.
# File lib/frame_net/definition.rb, line 46
def stripped_content
return self.content.gsub( /<.*?>/, '' ).tr( "\n\t ", ' ' ).strip
end