RubyGems | Homepage | Source Code | Bug Tracker
<img src=“https://img.shields.io/gem/v/tokenizer.svg” alt=“Gem Version” /> <img src=“https://img.shields.io/travis/arbox/tokenizer.svg” alt=“Build Status” /> <img src=“https://img.shields.io/codeclimate/github/arbox/tokenizer.svg” alt=“Code Climate” /> <img src=“https://img.shields.io/gemnasium/arbox/tokenizer.svg” alt=“Dependency Status” />
A simple multilingual tokenizer – a linguistic tool intended to split a written text into tokens for NLP tasks. This tool provides a CLI and a library for linguistic tokenization which is an anavoidable step for many HLT (Human Language Technology) tasks in the preprocessing phase for further syntactic, semantic and other higher level processing goals.
Tokenization task involves Sentence Segmentation, Word Segmentation and Boundary Disambiguation for the both tasks.
Use it for tokenization of German, English and Dutch texts.
to be …
Tokenizer
is provided as a .gem package. Simply install it via RubyGems.
To install tokenizer
issue the following command:
$ gem install tokenizer
If you want to do a system wide installation, do this as root (possibly using sudo
).
Alternatively use your Gemfile for dependency management.
You can use Tokenizer
in two ways.
-
As a command line tool:
$ echo 'Hi, ich gehe in die Schule!. | tokenize
-
As a library for embedded tokenization:
> require 'tokenizer' > de_tokenizer = Tokenizer::WhitespaceTokenizer.new > de_tokenizer.tokenize('Ich gehe in die Schule!') > => ["Ich", "gehe", "in", "die", "Schule", "!"]
-
Customizable PRE and POST list
> require 'tokenizer' > de_tokenizer = Tokenizer::WhitespaceTokenizer.new(:de, { post: Tokenizer::Tokenizer::POST + ['|'] }) > de_tokenizer.tokenize('Ich gehe|in die Schule!') > => ["Ich", "gehe", "|in", "die", "Schule", "!"]
See documentation in the Tokenizer::WhitespaceTokenizer class for details on particular methods.
If you have question, bug reports or any suggestions, please drop me an email :) Any help is deeply appreciated!
For details on future plan and working progress see CHANGELOG.rdoc.
This library is work in process! Though the interface is mostly complete, you might face some not implemented features.
Please contact me with your suggestions, bug reports and feature requests.
Tokenizer
is a copyrighted software by Andrei Beliankou, 2011-
You may use, redistribute and change it under the terms provided in the LICENSE.rdoc file.