File tree Expand file tree Collapse file tree 5 files changed +11
-338
lines changed
main/java/org/xbib/elasticsearch
test/java/org/xbib/elasticsearch/index/analysis/decompound/fst Expand file tree Collapse file tree 5 files changed +11
-338
lines changed Original file line number Diff line number Diff line change 11
22def xbibGroup = ' org.xbib.elasticsearch.plugin'
3- def xbibVersion = ' 2.2.0.1 '
3+ def xbibVersion = ' 2.2.0.2 '
44
55group = xbibGroup
66version = xbibVersion
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 2929import org .elasticsearch .index .analysis .AnalysisModule ;
3030import org .elasticsearch .indices .IndicesModule ;
3131import org .elasticsearch .plugins .Plugin ;
32+ import org .elasticsearch .rest .RestModule ;
3233import org .xbib .elasticsearch .index .analysis .baseform .BaseformAnalysisBinderProcessor ;
3334import org .xbib .elasticsearch .index .analysis .concat .ConcatAnalysisBinderProcessor ;
3435import org .xbib .elasticsearch .index .analysis .decompound .DecompoundAnalysisBinderProcessor ;
5354import org .xbib .elasticsearch .index .mapper .standardnumber .StandardnumberMapperTypeParser ;
5455import org .xbib .elasticsearch .module .langdetect .LangdetectService ;
5556import org .xbib .elasticsearch .index .mapper .standardnumber .StandardnumberService ;
57+ import org .xbib .elasticsearch .rest .action .langdetect .RestLangdetectAction ;
5658
5759import java .util .ArrayList ;
5860import 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}
Original file line number Diff line number Diff line change 2121
2222public 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 ) {
You can’t perform that action at this time.
0 commit comments