Class: VnTagger::Tagger
- Inherits:
-
Object
- Object
- VnTagger::Tagger
- Defined in:
- lib/vn_tagger/tagger.rb
Constant Summary collapse
- ROOT_PATH =
File.('../../..', __FILE__)
- COMMAND =
'java -jar vn.hus.nlp.tagger-4.2.0.jar'- INPUT =
File.join(ROOT_PATH, 'input.txt')
- OUTPUT =
File.join(ROOT_PATH, 'output.xml')
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text) ⇒ Tagger
constructor
A new instance of Tagger.
- #result ⇒ Object
- #tag ⇒ Object
- #xml_result ⇒ Object
Constructor Details
#initialize(text) ⇒ Tagger
Returns a new instance of Tagger.
11 12 13 |
# File 'lib/vn_tagger/tagger.rb', line 11 def initialize(text) @text = normalize(text) end |
Class Method Details
.tag(text) ⇒ Object
37 38 39 40 41 |
# File 'lib/vn_tagger/tagger.rb', line 37 def self.tag(text) tagger = new(text) tagger.tag tagger.result end |
Instance Method Details
#result ⇒ Object
33 34 35 |
# File 'lib/vn_tagger/tagger.rb', line 33 def result @result ||= Document.new(xml_result) end |