[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-09-13 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/incubator-hivemall/pull/110


---


[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-08-28 Thread takuti
Github user takuti commented on a diff in the pull request:

https://github.com/apache/incubator-hivemall/pull/110#discussion_r135462565
  
--- Diff: core/src/main/java/hivemall/utils/lang/StringUtils.java ---
@@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder 
buf) {
 
 public static String concat(@Nonnull final List list, @Nonnull 
final String sep) {
--- End diff --

done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-08-28 Thread takuti
Github user takuti commented on a diff in the pull request:

https://github.com/apache/incubator-hivemall/pull/110#discussion_r135459734
  
--- Diff: core/src/main/java/hivemall/utils/lang/StringUtils.java ---
@@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder 
buf) {
 
 public static String concat(@Nonnull final List list, @Nonnull 
final String sep) {
--- End diff --

okay, so I keep the update here


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-08-28 Thread myui
Github user myui commented on a diff in the pull request:

https://github.com/apache/incubator-hivemall/pull/110#discussion_r135458769
  
--- Diff: core/src/main/java/hivemall/utils/lang/StringUtils.java ---
@@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder 
buf) {
 
 public static String concat(@Nonnull final List list, @Nonnull 
final String sep) {
--- End diff --

former is expected. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-08-27 Thread takuti
Github user takuti commented on a diff in the pull request:

https://github.com/apache/incubator-hivemall/pull/110#discussion_r135446415
  
--- Diff: core/src/main/java/hivemall/utils/lang/StringUtils.java ---
@@ -172,12 +172,17 @@ public static void clear(@Nonnull final StringBuilder 
buf) {
 
 public static String concat(@Nonnull final List list, @Nonnull 
final String sep) {
--- End diff --

@myui I guess you originally assumed this method behaves in a similar way 
to [what `org.apache.commons.lang3.StringUtils.join` 
does](https://github.com/apache/commons-lang/blob/1571050a196198f336ae487ee3b6df629d3ee9da/src/main/java/org/apache/commons/lang3/StringUtils.java#L4106-L4150).
 However, the original code appends a separator even at the end of result 
string as:

- expected: `concat(["a", "b", "c"], "-")` => `a-b-c`
- actual: `concat(["a", "b", "c"], "-")` => `a-b-c-`

So, I fixed the method in 796d388c36c520858b6e61deb34100cb9201e5fa. Is this 
okay? If my assumption was incorrect, I revert the modification and introduce 
alternative method `StringUtils.join()`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hivemall pull request #110: [HIVEMALL-142] Implement SingularizeUD...

2017-08-27 Thread takuti
GitHub user takuti opened a pull request:

https://github.com/apache/incubator-hivemall/pull/110

[HIVEMALL-142] Implement SingularizeUDF

## What changes were proposed in this pull request?

Implement `singularize(string word)` to obtain singular form of `word`.

The implementation referred the following third-party code:

- 
https://github.com/sundrio/sundrio/blob/95c2b11f7b842bdaa04f61e8e338aea60fb38f70/codegen/src/main/java/io/sundr/codegen/functions/Singularize.java
- 
https://github.com/clips/pattern/blob/3eef00481a4555331cf9a099308910d977f6fc22/pattern/text/en/inflect.py#L445-L623

## What type of PR is it?

Feature

## What is the Jira issue?

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

## How was this patch tested?

unit test & manual test on EMR

## How to use this feature?

as documented

## Checklist

- [x] Did you apply source code formatter, i.e., `mvn formatter:format`, 
for your commit?


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/takuti/incubator-hivemall singularize

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hivemall/pull/110.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #110


commit 796d388c36c520858b6e61deb34100cb9201e5fa
Author: Takuya Kitazawa 
Date:   2017-08-28T05:41:43Z

Fix StringUtils.concat() to remove tail unnecessary separator

commit b14ca0975ddc65f0b208ae16734e8f77fb0c126d
Author: Takuya Kitazawa 
Date:   2017-08-28T05:43:51Z

Implement SingularizeUDF




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---