Class: NLP::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/tagger/token.rb

Direct Known Subclasses

Emoticon, Word

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(orth, tags) ⇒ Token

Returns a new instance of Token.



7
8
9
10
# File 'lib/tagger/token.rb', line 7

def initialize(orth,tags)
  @orth = orth
  @tags = tags
end

Instance Attribute Details

#orthObject (readonly)

Returns the value of attribute orth.



4
5
6
# File 'lib/tagger/token.rb', line 4

def orth
  @orth
end

#tagsObject (readonly)

Returns the value of attribute tags.



5
6
7
# File 'lib/tagger/token.rb', line 5

def tags
  @tags
end

Instance Method Details

#agl?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/tagger/token.rb', line 40

def agl?
  @tags.include?("agl")
end

#float?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/tagger/token.rb', line 32

def float?
  @tags.include?("tnum:frac")
end

#integer?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/tagger/token.rb', line 28

def integer?
  @tags.include?("tnum:integer")
end

#interp?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/tagger/token.rb', line 16

def interp?
  @tags.eql? "interp"
end

#number?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/tagger/token.rb', line 24

def number?
  @tags.include?("tnum")
end

#qublic?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/tagger/token.rb', line 36

def qublic?
  @tags.include?("qub")
end

#symbol?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/tagger/token.rb', line 12

def symbol?
  @tags.eql? "tsym"
end

#word?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/tagger/token.rb', line 20

def word?
  not interp? and not number? and not agl?
end