Definition

class
Superclass
Object

A marked-up English language definition from various FrameNet elements

Attributes

content[RW]

The raw (unescaped) content of the definition.

Public Class Methods

anchor
from_frame_data( document )

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
anchor
from_node( node )

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
anchor
new() { |self| ... }

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

anchor
stripped_content()

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