embulk-filter-kuromoji 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07b131529ec5429a9ab8a4514984c100d1b195f2
4
- data.tar.gz: c92805464a90f040fc31b32d5f46a50f3f5940bf
3
+ metadata.gz: 4b4dca9e4715f6af3d568ca4013519d4f5351470
4
+ data.tar.gz: 9acf950dff08f825309b721eb63fefc031977b99
5
5
  SHA512:
6
- metadata.gz: b5ef435b141559d5c59cb92a3a0a3dc6d07d27fc1b728dc09644c4d444ee1fc1fd634d9a0022aa608dc58b3da195e85730d6db5982222ce0824b7d3dd9dc9388
7
- data.tar.gz: 9f8a9087e4beaf82c2d114ac2fd9ba44166f66b1fe56b1ce0c8e7e638afa253797b1d9e24076e1cd3dad0500648bebe6f6180ca04374a2451144b06e74240cd9
6
+ metadata.gz: d5b3f8dda0b8ccc31be015bb839925640fdc109c9fe6de98ced99e9008d2df27dfa8c686148b55d7be0694ad19cf1110db11a3227a5941b69e19c5af9b693d17
7
+ data.tar.gz: 2eb8b106940f6716b782ef1e5b2960d96d425b475c33d652a797620a40caef87d4157d916cb99d47e1b134766e35212a54a90a201aa8415f3fcb630fe19160e8
data/build.gradle CHANGED
@@ -14,7 +14,7 @@ configurations {
14
14
  provided
15
15
  }
16
16
 
17
- version = "0.1.1"
17
+ version = "0.2.0"
18
18
 
19
19
  sourceCompatibility = 1.7
20
20
  targetCompatibility = 1.7
@@ -69,8 +69,14 @@ public class KuromojiFilterPlugin implements FilterPlugin
69
69
 
70
70
  for (String key: task.getKeyNames()) {
71
71
  for (Map<String, String> setting : task.getSettings()) {
72
- Column outputColumn = new Column(i++, key + MoreObjects.firstNonNull(setting.get("suffix"), ""), Types.STRING);
73
- builder.add(outputColumn);
72
+ String keyName = key + MoreObjects.firstNonNull(setting.get("suffix"), "");
73
+ if (task.getKeepInput()) {
74
+ if (setting.get("suffix") != null) {
75
+ builder.add(new Column(i++, keyName, Types.STRING));
76
+ }
77
+ } else {
78
+ builder.add(new Column(i++, keyName, Types.STRING));
79
+ }
74
80
  }
75
81
  }
76
82
 
@@ -101,26 +107,24 @@ public class KuromojiFilterPlugin implements FilterPlugin
101
107
 
102
108
  return new PageOutput() {
103
109
  private PageReader reader = new PageReader(inputSchema);
110
+ private PageBuilder builder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, output);
104
111
 
105
112
  @Override
106
113
  public void finish() {
107
- output.finish();
114
+ builder.finish();
108
115
  }
109
116
 
110
117
  @Override
111
118
  public void close() {
112
- output.close();
119
+ builder.close();
113
120
  }
114
121
 
115
122
  @Override
116
123
  public void add(Page page) {
117
124
  reader.setPage(page);
118
- try (final PageBuilder builder = new PageBuilder(Exec.getBufferAllocator(), outputSchema, output)) {
119
- while (reader.nextRecord()) {
120
- setValue(builder);
121
- builder.addRecord();
122
- }
123
- builder.finish();
125
+ while (reader.nextRecord()) {
126
+ setValue(builder);
127
+ builder.addRecord();
124
128
  }
125
129
  }
126
130
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: embulk-filter-kuromoji
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - toyama0919
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-30 00:00:00.000000000 Z
11
+ date: 2015-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -56,7 +56,7 @@ files:
56
56
  - lib/embulk/filter/kuromoji.rb
57
57
  - src/main/java/org/embulk/filter/kuromoji/KuromojiFilterPlugin.java
58
58
  - src/test/java/org/embulk/filter/kuromoji/TestKuromojiFilterPlugin.java
59
- - classpath/embulk-filter-kuromoji-0.1.1.jar
59
+ - classpath/embulk-filter-kuromoji-0.2.0.jar
60
60
  - classpath/kuromoji-0.7.7.jar
61
61
  homepage: https://github.com/toyama0919/embulk-filter-kuromoji
62
62
  licenses: