Class: FrameNet::SemanticType

Inherits:
Object
  • Object
show all
Defined in:
lib/frame_net/semantic_type.rb

Overview

A semantic fact about an element in FrameNet.

References:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, name) ⇒ SemanticType

Create a new SemanticType for the specified id and name.



24
25
26
27
# File 'lib/frame_net/semantic_type.rb', line 24

def initialize( id, name )
	@id = Integer( id )
	@name = name.to_sym
end

Instance Attribute Details

#idObject

The SmeanticType’s ID in FrameNet



36
37
38
# File 'lib/frame_net/semantic_type.rb', line 36

def id
  @id
end

#nameObject

The SemanticType’s name in FrameNet



40
41
42
# File 'lib/frame_net/semantic_type.rb', line 40

def name
  @name
end

Class Method Details

.from_node(node) ⇒ Object

Construct a SemanticType from the given node (a LibXML::XML::Node for a semType element)



18
19
20
# File 'lib/frame_net/semantic_type.rb', line 18

def self::from_node( node )
	return new( node['ID'], node['name'] )
end