Class: Chihiro::Token
- Inherits:
-
Object
- Object
- Chihiro::Token
- Defined in:
- lib/chihiro/token.rb
Constant Summary collapse
- @@attributes =
[:start, :end, :add_info, :basic_string, :cform, :cost, :pos, :pronunciation, :reading, :surface, :term_info, :length]
Instance Method Summary collapse
-
#initialize(java_token) ⇒ Token
constructor
A new instance of Token.
-
#inspect ⇒ Object
def initialize(java_token).
Constructor Details
#initialize(java_token) ⇒ Token
Returns a new instance of Token.
16 17 18 19 20 |
# File 'lib/chihiro/token.rb', line 16 def initialize(java_token) @@attributes.each do |symbol| eval("@#{symbol} = java_token.send(symbol)") end # @@attributes.each do |symbol| end |
Instance Method Details
#inspect ⇒ Object
def initialize(java_token)
22 23 24 |
# File 'lib/chihiro/token.rb', line 22 def inspect '#<%s:0x%s @surface=\'%s\'>' % [self.class.name, self.hash.to_s(16), self.surface] end |