Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit c14057a

Browse files
committed
Upgrade to c2 4.0.3.
1 parent 7a31986 commit c14057a

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ group = 'org.carrot2'
66
buildscript {
77
ext {
88
version_es = '7.7.1'
9-
version_c2 = 'org.carrot2:carrot2-core:4.0.2'
9+
version_c2 = 'org.carrot2:carrot2-core:4.0.3'
1010
}
1111

1212
repositories {

src/main/java/org/carrot2/elasticsearch/ClusteringContext.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ protected void doStart() throws ElasticsearchException {
8787
LanguageComponentsLoader loader = LanguageComponents.loader();
8888

8989
if (!resourceLocations.isEmpty()) {
90-
logger.info("Clustering algorithm resources first looked up relative to: {}",
91-
resourceLocations);
90+
logger.info(
91+
"Clustering algorithm resources first looked up relative to: {}", resourceLocations);
9292
loader.withResourceLookup(
9393
(provider) ->
9494
new ChainedResourceLookup(
@@ -109,11 +109,25 @@ protected void doStart() throws ElasticsearchException {
109109
(PrivilegedExceptionAction<Void>)
110110
() -> {
111111
languages = new LinkedHashMap<>();
112-
LoadedLanguages loadedLanguages = loader.load();
112+
LoadedLanguages loadedLanguages = loader.load(languageComponentProviders);
113113
for (String lang : loadedLanguages.languages()) {
114114
languages.put(lang, loadedLanguages.language(lang));
115115
}
116116

117+
// Debug info about loaded languages.
118+
if (logger.isDebugEnabled()) {
119+
for (String lang : loadedLanguages.languages()) {
120+
logger.debug(
121+
"Loaded language '"
122+
+ lang
123+
+ "' with components: "
124+
+ "\n - "
125+
+ loadedLanguages.language(lang).components().stream()
126+
.map(c -> c.getSimpleName())
127+
.collect(Collectors.joining("\n - ")));
128+
}
129+
}
130+
117131
// Remove algorithms for which there are no languages that are supported.
118132
algorithmProviders
119133
.entrySet()
@@ -145,9 +159,7 @@ protected void doStart() throws ElasticsearchException {
145159
}
146160
}
147161

148-
/**
149-
* @return Return a list of available algorithm component identifiers.
150-
*/
162+
/** @return Return a list of available algorithm component identifiers. */
151163
public LinkedHashMap<String, ClusteringAlgorithmProvider> getAlgorithms() {
152164
return algorithmProviders;
153165
}

0 commit comments

Comments
 (0)