com.groupbyinc.flux.indices.analysis.HunspellService.class Maven / Gradle / Ivy
???? 4? 4com/groupbyinc/flux/indices/analysis/HunspellService 6com/groupbyinc/flux/common/component/AbstractComponent HunspellService.java 4com/groupbyinc/flux/common/settings/Setting$Property +com/groupbyinc/flux/common/settings/Setting Property 4com/groupbyinc/flux/common/settings/Settings$Builder ,com/groupbyinc/flux/common/settings/Settings
Builder %java/lang/invoke/MethodHandles$Lookup java/lang/invoke/MethodHandles Lookup HUNSPELL_LAZY_LOAD -Lcom/groupbyinc/flux/common/settings/Setting; BLcom/groupbyinc/flux/common/settings/Setting; HUNSPELL_IGNORE_CASE HUNSPELL_DICTIONARY_OPTIONS ]Lcom/groupbyinc/flux/common/settings/Setting; dictionaries (Ljava/util/concurrent/ConcurrentHashMap; ?Ljava/util/concurrent/ConcurrentHashMap; knownDictionaries Ljava/util/Map; jLjava/util/Map; defaultIgnoreCase Z hunspellDir Ljava/nio/file/Path; loadingFunction Ljava/util/function/Function; xLjava/util/function/Function; e(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/env/Environment;Ljava/util/Map;)V java/io/IOException * 1(Lcom/groupbyinc/flux/common/settings/Settings;)V ( ,
- &java/util/concurrent/ConcurrentHashMap / ()V ( 1
0 2 4 java/util/Collections 6 unmodifiableMap (Ljava/util/Map;)Ljava/util/Map; 8 9
7 : < resolveHunspellDirectory ;(Lcom/groupbyinc/flux/env/Environment;)Ljava/nio/file/Path; > ?
@ # $ B D get B(Lcom/groupbyinc/flux/common/settings/Settings;)Ljava/lang/Object; F G
H java/lang/Boolean J booleanValue ()Z L M
K N ! " P "java/lang/invoke/LambdaMetafactory R metafactory ?(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite; T U
S V W &(Ljava/lang/Object;)Ljava/lang/Object; Y lambda$new$0 ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/env/Environment;Ljava/lang/String;)Lcom/groupbyinc/flux/common/apache/lucene/analysis/hunspell/Dictionary; [ \
] ^ [(Ljava/lang/String;)Lcom/groupbyinc/flux/common/apache/lucene/analysis/hunspell/Dictionary; ` apply ?(Lcom/groupbyinc/flux/indices/analysis/HunspellService;Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/env/Environment;)Ljava/util/function/Function; b c d % & f h scanAndLoadDictionaries j 1
k #com/groupbyinc/flux/env/Environment m
java/util/Map o this 6Lcom/groupbyinc/flux/indices/analysis/HunspellService; settings .Lcom/groupbyinc/flux/common/settings/Settings; env %Lcom/groupbyinc/flux/env/Environment;
getDictionary F Y p x Ecom/groupbyinc/flux/common/apache/lucene/analysis/hunspell/Dictionary z computeIfAbsent C(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object; | }
0 ~ locale Ljava/lang/String;
dictionary GLcom/groupbyinc/flux/common/apache/lucene/analysis/hunspell/Dictionary;
configFile ()Ljava/nio/file/Path; ? ?
n ? hunspell ? java/nio/file/Path ? resolve ((Ljava/lang/String;)Ljava/nio/file/Path; ? ? ? ? java/lang/Exception ? java/lang/Throwable ? java/nio/file/LinkOption ? java/nio/file/Files ? isDirectory 2(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z ? ?
? ? newDirectoryStream 5(Ljava/nio/file/Path;)Ljava/nio/file/DirectoryStream; ? ?
? ? java/nio/file/DirectoryStream ? iterator ()Ljava/util/Iterator; ? ? ? ? java/util/Iterator ? hasNext ? M ? ? next ()Ljava/lang/Object; ? ? ? ? *(Ljava/nio/file/Path;)Ljava/nio/file/Path; ? ? ? ? *.dic ? G(Ljava/nio/file/Path;Ljava/lang/String;)Ljava/nio/file/DirectoryStream; ? ?
? ? getFileName ? ? ? ? toString ()Ljava/lang/String; ? ? ? ? w `
? logger !Lorg/apache/logging/log4j/Logger; ? ? ? ? lambda$scanAndLoadDictionaries$1 ((Ljava/nio/file/Path;)Ljava/lang/Object; ? ?
? ? >(Ljava/nio/file/Path;)Lorg/apache/logging/log4j/util/Supplier; F ? ? org/apache/logging/log4j/Logger ? error @(Lorg/apache/logging/log4j/util/Supplier;Ljava/lang/Throwable;)V ? ? ? ? close ? 1 ? ?
addSuppressed (Ljava/lang/Throwable;)V ? ?
? ? e Ljava/lang/Exception; inner 5Ljava/nio/file/DirectoryStream; Ljava/nio/file/DirectoryStream; file stream loadDictionary ?(Ljava/lang/String;Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/env/Environment;)Lcom/groupbyinc/flux/common/apache/lucene/analysis/hunspell/Dictionary; isDebugEnabled ? M ? ? #Loading hunspell dictionary [{}]... ? debug '(Ljava/lang/String;Ljava/lang/Object;)V ? ? ? ? -com/groupbyinc/flux/common/io/FileSystemUtils ? isAccessibleDirectory 8(Ljava/nio/file/Path;Lorg/apache/logging/log4j/Logger;)Z ? ?
? ? *com/groupbyinc/flux/ElasticsearchException ? java/util/Locale ? ROOT Ljava/util/Locale; ? ? ? ? 'Could not find hunspell dictionary [%s] ? java/lang/Object ? java/lang/String ? format K(Ljava/util/Locale;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
? ((Ljava/lang/String;[Ljava/lang/Object;)V (
? java/lang/StringBuilder
2 append -(Ljava/lang/String;)Ljava/lang/StringBuilder;
.
? getByPrefix B(Ljava/lang/String;)Lcom/groupbyinc/flux/common/settings/Settings;
loadDictionarySettings r(Ljava/nio/file/Path;Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/common/settings/Settings;
ignore_case valueOf (Z)Ljava/lang/Boolean;
K getAsBoolean :(Ljava/lang/String;Ljava/lang/Boolean;)Ljava/lang/Boolean;!"
# *.aff% files =(Ljava/nio/file/Path;Ljava/lang/String;)[Ljava/nio/file/Path;'(
?) /Missing affix file for hunspell dictionary [%s]+ [Ljava/nio/file/Path;- 7Too many affix files exist for hunspell dictionary [%s]/ java/util/ArrayList1 (I)V (3
24 java/io/InputStream6 java/util/List8 java/nio/file/OpenOption: newInputStream F(Ljava/nio/file/Path;[Ljava/nio/file/OpenOption;)Ljava/io/InputStream;<=
?> add (Ljava/lang/Object;)Z@A9B @com/groupbyinc/flux/common/apache/lucene/store/SimpleFSDirectoryD tmpFileF ?
nG (Ljava/nio/file/Path;)V (I
EJ u(Lcom/groupbyinc/flux/common/apache/lucene/store/Directory;Ljava/lang/String;Ljava/io/InputStream;Ljava/util/List;Z)V (L
{M 8com/groupbyinc/flux/common/apache/lucene/store/DirectoryO
P ? java/io/CloseableR 5com/groupbyinc/flux/common/apache/lucene/util/IOUtilsT ([Ljava/io/Closeable;)V ?V
UW (Ljava/lang/Iterable;)V ?Y
UZ lambda$loadDictionary$2 &(Ljava/lang/String;)Ljava/lang/Object;\]
^_ <(Ljava/lang/String;)Lorg/apache/logging/log4j/util/Supplier; Fa b i I tmp :Lcom/groupbyinc/flux/common/apache/lucene/store/Directory; nodeSettings dicDir dictSettings
ignoreCase
affixFiles affixStream Ljava/io/InputStream; dicFiles
dicStreams 'Ljava/util/List; Ljava/util/List; settings.ymls existsu ?
?v builder 8()Lcom/groupbyinc/flux/common/settings/Settings$Builder;xy
z loadFromPath L(Ljava/nio/file/Path;)Lcom/groupbyinc/flux/common/settings/Settings$Builder;|}
~ put f(Lcom/groupbyinc/flux/common/settings/Settings;)Lcom/groupbyinc/flux/common/settings/Settings$Builder;??
? build 0()Lcom/groupbyinc/flux/common/settings/Settings;??
?
settings.json? dir defaults 5org/apache/logging/log4j/message/ParameterizedMessage? 'Could not load hunspell dictionary [{}]? ( ?
?? %exception while loading dictionary {}? ? ?
? java/lang/IllegalStateException? /failed to load hunspell dictionary for locale: ? *(Ljava/lang/String;Ljava/lang/Throwable;)V (?
?? )indices.analysis.hunspell.dictionary.lazy? FALSE Ljava/lang/Boolean;?? K? NodeScope 6Lcom/groupbyinc/flux/common/settings/Setting$Property;?? ? boolSetting y(Ljava/lang/String;Z[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? 0indices.analysis.hunspell.dictionary.ignore_case? %indices.analysis.hunspell.dictionary.? groupSetting x(Ljava/lang/String;[Lcom/groupbyinc/flux/common/settings/Setting$Property;)Lcom/groupbyinc/flux/common/settings/Setting;??
? Signature Code LocalVariableTable LocalVariableTypeTable LineNumberTable
StackMapTable
Exceptions ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/env/Environment;Ljava/util/Map;)V BootstrapMethods
SourceFile InnerClasses ! ? ? ? ? ? ! " # $ % &