Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
duydo committed Aug 23, 2016
2 parents d06fc09 + 0edaa29 commit 8eea312
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Vietnamese Analysis Plugin for Elasticsearch

Vietnamese Analysis plugin integrates Vietnamese language analysis into Elasticsearch.

In order to install the plugin, simply run:
In order to install the plugin, choose a version in [releases](https://github.com/duydo/elasticsearch-analysis-vietnamese/releases) page then run:

```sh
bin/plugin --url https://dl.dropboxusercontent.com/u/1598491/elasticsearch-analysis-vietnamese-0.2.2.zip --install analysis-vietnamese
bin/plugin install link-to-binary-version
```

Or to build from source, you need to build it with Maven:
Expand All @@ -20,7 +20,13 @@ bin/plugin install file:target/releases/elasticsearch-analysis-vietnamese-0.2.2.

|Vietnamese Analysis Plugin|Elasticsearch|
|---|---|
| master|2.2.0|
| master|2.3.5|
| 2.3.5|2.3.5|
| 2.3.4|2.3.4|
| 2.3.3|2.3.3|
| 2.3.2|2.3.2|
| 2.3.1|2.3.1|
| 2.3.0|2.3.0|
| 0.2.2|2.2.0|
| 0.2.1.1|2.1.1|
| 0.2.1|2.1.0|
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch-analysis-vietnamese</artifactId>
<version>0.2.3.5</version>
<version>2.3.5</version>
<packaging>jar</packaging>
<name>elasticsearch-analysis-vietnamese</name>
<url>https://github.com/duydo/elasticsearch-analysis-vietnamese/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ public final boolean incrementToken() throws IOException {
while (taggedWords.hasNext()) {
final TaggedWord word = taggedWords.next();
if (accept(word)) {
final char[] chars = word.getText().trim().toCharArray();
termAtt.copyBuffer(chars, 0, chars.length);
typeAtt.setType(word.getRule().getName());
posIncrAtt.setPositionIncrement(skippedPositions + 1);
offsetAtt.setOffset(correctOffset(offset), offset = correctOffset(offset + termAtt.length()));
typeAtt.setType(word.getRule().getName());
final int length = word.getText().length();
termAtt.copyBuffer(word.getText().toCharArray(), 0, length);
offsetAtt.setOffset(correctOffset(offset), offset = correctOffset(offset + length));
offset++;
return true;
}
++skippedPositions;
skippedPositions++;
}
return false;
}
Expand All @@ -128,7 +128,8 @@ private final boolean accept(TaggedWord word) {
@Override
public final void end() throws IOException {
super.end();
offsetAtt.setOffset(offset, offset);
final int finalOffset = correctOffset(offset);
offsetAtt.setOffset(finalOffset, finalOffset);
posIncrAtt.setPositionIncrement(posIncrAtt.getPositionIncrement() + skippedPositions);
}

Expand Down

0 comments on commit 8eea312

Please sign in to comment.