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.



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

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

Instance Attribute Details

#idObject

The SmeanticType’s ID in FrameNet



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

def id
  @id
end

#nameObject

The SemanticType’s name in FrameNet



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

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)



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

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