Class: WordNet::Pointer

Inherits:
Object
  • Object
show all
Defined in:
lib/wordnet/pointer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(symbol: raise, offset: raise, pos: raise, source: raise) ⇒ Pointer

Returns a new instance of Pointer.



5
6
7
8
# File 'lib/wordnet/pointer.rb', line 5

def initialize(symbol: raise, offset: raise, pos: raise, source: raise)
  @symbol, @offset, @pos, @source = symbol, offset, pos, source
  @target = source.slice!(2,2)
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



3
4
5
# File 'lib/wordnet/pointer.rb', line 3

def offset
  @offset
end

#posObject (readonly)

Returns the value of attribute pos.



3
4
5
# File 'lib/wordnet/pointer.rb', line 3

def pos
  @pos
end

#sourceObject (readonly)

Returns the value of attribute source.



3
4
5
# File 'lib/wordnet/pointer.rb', line 3

def source
  @source
end

#symbolObject (readonly)

Returns the value of attribute symbol.



3
4
5
# File 'lib/wordnet/pointer.rb', line 3

def symbol
  @symbol
end

#targetObject (readonly)

Returns the value of attribute target.



3
4
5
# File 'lib/wordnet/pointer.rb', line 3

def target
  @target
end

Instance Method Details

#is_semantic?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/wordnet/pointer.rb', line 10

def is_semantic?
  source == "00" && target == "00"
end