class FrameNet::Definition
A marked-up English language definition from various FrameNet
elements
Attributes
content[RW]
The raw (unescaped) content of the definition.
Public Class Methods
from_frame_data( document )
click to toggle source
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
from_node( node )
click to toggle source
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
new() { |self| ... }
click to toggle source
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
Public Instance Methods
stripped_content()
click to toggle source
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