VnTagger
Installation
Add this line to your application's Gemfile:
gem 'vn_tagger'
And then execute:
$ bundle
Or install it yourself as:
$ gem install vn_tagger
Usage Example
text = 'Mourinho là huấn luyện viên của Chelsea'
document = VnTagger::Tagger.tag(text)
document.to_xml # => "<?xml version=\"1.0\"?>\n<doc>\n\t<s>\n\t\t<w pos=\"Np\">Mourinho</w>\n\t\t<w pos=\"V\">là</w>\n\t\t<w pos=\"N\">huấn luyện viên</w>\n\t\t<w pos=\"E\">của</w>\n\t\t<w pos=\"Np\">Chelsea</w>\n\t\t<w pos=\".\">.</w>\n\t</s>\n</doc>\n"
document.class # => Nokogiri::Xml::Document
keys = document.xpath("//w")
keys.first.attr('pos') # => 'Np'
keys.first.child.text #=> 'Mourinho'
Contributing
- Fork it ( https://github.com/hieuk09/vn_tagger/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request