Skip to content

Commit 71e17be

Browse files
committed
removed unused FST test
renamed uppercase misspelled file name readded REST action _langdetect
1 parent 6ff3a41 commit 71e17be

File tree

5 files changed

+11
-338
lines changed

5 files changed

+11
-338
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
def xbibGroup = 'org.xbib.elasticsearch.plugin'
3-
def xbibVersion = '2.2.0.1'
3+
def xbibVersion = '2.2.0.2'
44

55
group = xbibGroup
66
version = xbibVersion

pom.xml

Lines changed: 0 additions & 334 deletions
This file was deleted.

src/main/java/org/xbib/elasticsearch/plugin/bundle/BundlePlugin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.elasticsearch.index.analysis.AnalysisModule;
3030
import org.elasticsearch.indices.IndicesModule;
3131
import org.elasticsearch.plugins.Plugin;
32+
import org.elasticsearch.rest.RestModule;
3233
import org.xbib.elasticsearch.index.analysis.baseform.BaseformAnalysisBinderProcessor;
3334
import org.xbib.elasticsearch.index.analysis.concat.ConcatAnalysisBinderProcessor;
3435
import org.xbib.elasticsearch.index.analysis.decompound.DecompoundAnalysisBinderProcessor;
@@ -53,6 +54,7 @@
5354
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapperTypeParser;
5455
import org.xbib.elasticsearch.module.langdetect.LangdetectService;
5556
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberService;
57+
import org.xbib.elasticsearch.rest.action.langdetect.RestLangdetectAction;
5658

5759
import java.util.ArrayList;
5860
import java.util.Collection;
@@ -181,4 +183,10 @@ public void onModule(IndicesModule indicesModule) {
181183
}
182184
}
183185

186+
public void onModule(RestModule module) {
187+
if ("node".equals(settings.get("client.type")) && settings.getAsBoolean("plugins.langdetect.enabled", true)) {
188+
module.addRestAction(RestLangdetectAction.class);
189+
}
190+
}
191+
184192
}

src/test/java/org/xbib/elasticsearch/index/analysis/decompound/fst/CreateFST.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@
2121

2222
public class CreateFST {
2323

24-
@Test
2524
public void createMorphy() throws IOException {
26-
final HashSet<BytesRef> words = new HashSet<BytesRef>();
25+
final HashSet<BytesRef> words = new HashSet<>();
2726
String[] inputs = new String[]{
2827
"morphy.txt.gz",
2928
"morphy-unknown.txt.gz"
@@ -32,7 +31,7 @@ public void createMorphy() throws IOException {
3231
BufferedReader reader = new BufferedReader(new InputStreamReader(
3332
new GZIPInputStream(getClass().getResourceAsStream(input)), "UTF-8"));
3433
Pattern pattern = Pattern.compile("\\s+");
35-
String line = null;
34+
String line;
3635
String last = null;
3736
StringBuilder buffer = new StringBuilder();
3837
while ((line = reader.readLine()) != null) {

0 commit comments

Comments
 (0)