mirror of
https://github.com/MarginaliaSearch/MarginaliaSearch.git
synced 2025-02-24 13:19:02 +00:00

Look, this will make the git history look funny, but trimming unnecessary depth from the source tree is a very necessary sanity-preserving measure when dealing with a super-modularized codebase like this one. While it makes the project configuration a bit less conventional, it will save you several clicks every time you jump between modules. Which you'll do a lot, because it's *modul*ar. The src/main/java convention makes a lot of sense for a non-modular project though. This ain't that.
31 lines
968 B
Java
31 lines
968 B
Java
package nu.marginalia.converting;
|
|
|
|
import com.google.gson.Gson;
|
|
import com.google.inject.AbstractModule;
|
|
import com.google.inject.name.Names;
|
|
import nu.marginalia.LanguageModels;
|
|
import nu.marginalia.WmsaHome;
|
|
import nu.marginalia.model.gson.GsonFactory;
|
|
|
|
public class ConverterModule extends AbstractModule {
|
|
|
|
public ConverterModule() {
|
|
}
|
|
|
|
public void configure() {
|
|
bind(Gson.class).toInstance(createGson());
|
|
|
|
bind(Double.class).annotatedWith(Names.named("min-document-quality")).toInstance(-15.);
|
|
bind(Integer.class).annotatedWith(Names.named("min-document-length")).toInstance(250);
|
|
bind(Integer.class).annotatedWith(Names.named("max-title-length")).toInstance(128);
|
|
bind(Integer.class).annotatedWith(Names.named("max-summary-length")).toInstance(255);
|
|
|
|
bind(LanguageModels.class).toInstance(WmsaHome.getLanguageModels());
|
|
}
|
|
|
|
private Gson createGson() {
|
|
return GsonFactory.get();
|
|
}
|
|
|
|
}
|