Class: NLP::Token
- Inherits:
-
Object
- Object
- NLP::Token
- Defined in:
- lib/tagger/token.rb
Instance Attribute Summary collapse
-
#orth ⇒ Object
readonly
Returns the value of attribute orth.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
- #agl? ⇒ Boolean
- #float? ⇒ Boolean
-
#initialize(orth, tags) ⇒ Token
constructor
A new instance of Token.
- #integer? ⇒ Boolean
- #interp? ⇒ Boolean
- #number? ⇒ Boolean
- #qublic? ⇒ Boolean
- #symbol? ⇒ Boolean
- #word? ⇒ Boolean
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,) @orth = orth @tags = end |
Instance Attribute Details
#orth ⇒ Object (readonly)
Returns the value of attribute orth.
4 5 6 |
# File 'lib/tagger/token.rb', line 4 def orth @orth end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
5 6 7 |
# File 'lib/tagger/token.rb', line 5 def @tags end |
Instance Method Details
#agl? ⇒ Boolean
40 41 42 |
# File 'lib/tagger/token.rb', line 40 def agl? @tags.include?("agl") end |
#float? ⇒ Boolean
32 33 34 |
# File 'lib/tagger/token.rb', line 32 def float? @tags.include?("tnum:frac") end |
#integer? ⇒ Boolean
28 29 30 |
# File 'lib/tagger/token.rb', line 28 def integer? @tags.include?("tnum:integer") end |
#interp? ⇒ Boolean
16 17 18 |
# File 'lib/tagger/token.rb', line 16 def interp? @tags.eql? "interp" end |
#number? ⇒ Boolean
24 25 26 |
# File 'lib/tagger/token.rb', line 24 def number? @tags.include?("tnum") end |
#qublic? ⇒ Boolean
36 37 38 |
# File 'lib/tagger/token.rb', line 36 def qublic? @tags.include?("qub") end |
#symbol? ⇒ Boolean
12 13 14 |
# File 'lib/tagger/token.rb', line 12 def symbol? @tags.eql? "tsym" end |
#word? ⇒ Boolean
20 21 22 |
# File 'lib/tagger/token.rb', line 20 def word? not interp? and not number? and not agl? end |