aboutsummaryrefslogtreecommitdiffstats
path: root/container-core/src/main/java/com/yahoo/language/provider/DefaultLinguisticsProvider.java
blob: 8f08e33a777afc8088d96ab5155399c09663434d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.language.provider;

import com.google.inject.Inject;
import com.yahoo.language.opennlp.OpenNlpLinguistics;
import com.yahoo.container.di.componentgraph.Provider;
import com.yahoo.language.Linguistics;

/**
 * Provides the default linguistics implementation if no linguistics component has been explicitly configured
 * (dependency injection will fallback to providers if no components of the requested type is found).
 *
 * @author bratseth
 */
public class DefaultLinguisticsProvider implements Provider<Linguistics> {

    private final Linguistics linguistics;

    @SuppressWarnings("deprecation")
    @Inject
    public DefaultLinguisticsProvider() { linguistics = new OpenNlpLinguistics(); }

    @Override
    public Linguistics get() { return linguistics; }

    @Override
    public void deconstruct() {}

}