Class: NLP::Token
- Inherits:
-
Object
- Object
- NLP::Token
- Defined in:
- lib/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
- #float? ⇒ Boolean
-
#initialize(orth, tags) ⇒ Token
constructor
A new instance of Token.
- #integer? ⇒ Boolean
- #interp? ⇒ Boolean
- #number? ⇒ Boolean
- #word? ⇒ Boolean
Constructor Details
#initialize(orth, tags) ⇒ Token
Returns a new instance of Token.
8 9 10 11 |
# File 'lib/token.rb', line 8 def initialize(orth,) @orth = orth @tags = end |
Instance Attribute Details
#orth ⇒ Object (readonly)
Returns the value of attribute orth.
4 5 6 |
# File 'lib/token.rb', line 4 def orth @orth end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
5 6 7 |
# File 'lib/token.rb', line 5 def @tags end |
Instance Method Details
#float? ⇒ Boolean
29 30 31 |
# File 'lib/token.rb', line 29 def float? @tags.include?("tnum:frac") end |
#integer? ⇒ Boolean
25 26 27 |
# File 'lib/token.rb', line 25 def integer? @tags.include?("tnum:integer") end |
#interp? ⇒ Boolean
13 14 15 |
# File 'lib/token.rb', line 13 def interp? @tags.eql? "interp" end |
#number? ⇒ Boolean
21 22 23 |
# File 'lib/token.rb', line 21 def number? @tags.include?("tnum") end |
#word? ⇒ Boolean
17 18 19 |
# File 'lib/token.rb', line 17 def word? not interp? and not number? end |