[HIVEMALL-248] UDF for Kuromoji stoptags

## What changes were proposed in this pull request?

In tokenize_ja, user need to provide stoptags that matched tokens removed from the token stream. So, stoptag is "exclusive" rule.

## What type of PR is it?

Feature

## What is the Jira issue?

https://issues.apache.org/jira/browse/HIVEMALL-248

## How was this patch tested?

unit tests, functional test on EMR

## How to use this feature?

```sql
select tokenize_ja("kuromojiを使った分かち書きのテストです。", "normal", array("kuromoji"), stoptags_exclude(array("名詞")));
```
> ["分かち書き","テスト"]

`stoptags_exclude(array<string> tags, [, const string lang='ja'])` is a useful UDF for getting [stoptags](https://github.com/apache/lucene-solr/blob/master/lucene/analysis/kuromoji/src/resources/org/apache/lucene/analysis/ja/stoptags.txt) excluding given part-of-speech tags as seen below:

```sql
select stoptags_exclude(array("名詞-固有名詞"));
```
> ["その他","その他-間投","フィラー","副詞","副詞-一般","副詞-助詞類接続","助動詞","助詞","助詞-並立助詞"
,"助詞-係助詞","助詞-副助詞","助詞-副助詞/並立助詞/終助詞","助詞-副詞化","助詞-接続助詞","助詞-格助詞
","助詞-格助詞-一般","助詞-格助詞-引用","助詞-格助詞-連語","助詞-特殊","助詞-終助詞","助詞-連体化","助
詞-間投助詞","動詞","動詞-接尾","動詞-自立","動詞-非自立","名詞","名詞-サ変接続","名詞-ナイ形容詞語幹",
"名詞-一般","名詞-代名詞","名詞-代名詞-一般","名詞-代名詞-縮約","名詞-副詞可能","名詞-動詞非自立的","名
詞-引用文字列","名詞-形容動詞語幹","名詞-接尾","名詞-接尾-サ変接続","名詞-接尾-一般","名詞-接尾-人名","
名詞-接尾-副詞可能","名詞-接尾-助動詞語幹","名詞-接尾-助数詞","名詞-接尾-地域","名詞-接尾-形容動詞語幹"
,"名詞-接尾-特殊","名詞-接続詞的","名詞-数","名詞-特殊","名詞-特殊-助動詞語幹","名詞-非自立","名詞-非自
立-一般","名詞-非自立-副詞可能","名詞-非自立-助動詞語幹","名詞-非自立-形容動詞語幹","形容詞","形容詞-接
尾","形容詞-自立","形容詞-非自立","感動詞","接続詞","接頭詞","接頭詞-動詞接続","接頭詞-名詞接続","接頭
詞-形容詞接続","接頭詞-数接","未知語","記号","記号-アルファベット","記号-一般","記号-句点","記号-括弧閉
","記号-括弧開","記号-空白","記号-読点","語断片","連体詞","非言語音"]

## Checklist

- [x] Did you apply source code formatter, i.e., `./bin/format_code.sh`, for your commit?
- [x] Did you run system tests on Hive (or Spark)?

Author: Makoto Yui <myui@apache.org>

Closes #189 from myui/HIVEMALL-248.
6 files changed
tree: 62996b58bd081dd038cbb0d7a570f23681886375
  1. .github/
  2. bin/
  3. conf/
  4. core/
  5. dist/
  6. docs/
  7. mixserv/
  8. nlp/
  9. resources/
  10. spark/
  11. src/
  12. tools/
  13. xgboost/
  14. .dockerignore
  15. .gitignore
  16. .rat-excludes
  17. .travis.yml
  18. DISCLAIMER
  19. KEYS
  20. LICENSE
  21. NOTICE
  22. pom.xml
  23. README.md
  24. VERSION
README.md

Apache Hivemall: Hive scalable machine learning library

Build Status Documentation Status License Coverage Status Twitter Follow

Apache Hivemall is a scalable machine learning library that runs on Apache Hive, Apache Spark, and Apache Pig. Hivemall is designed to be scalable to the number of training instances as well as the number of training features.

Usage

Hivemall

Find more examples on our user guide and find a brief introduction to Hivemall in this slide.

Support

Support is through user@hivemall.incubator.apache.org, not by a direct e-mail.

Contributing

If you are planning to contribute to this repository, we first request you to create an issue at our JIRA page even if the topic is not related to source code itself (e.g., documentation, new idea and proposal).

All Hivemall functions are defined under resources/ddl. In order to update the definition files, the following script helps inserting function name and class path of your new UDF:

$ ./bin/update_ddls.sh

Moreover, don't forget to update function list in the document as well:

$ ./bin/update_func_md.sh

Note that, before creating a pull request including Java code, please make sure your code follows our coding conventions by applying formatter:

$ ./bin/format_code.sh