Tabnine Logo
org.wikibrain.conf
Code IndexAdd Tabnine to your IDE (free)

How to use org.wikibrain.conf

Best Java code snippets using org.wikibrain.conf (Showing top 20 results out of 315)

origin: org.wikibrainapi/wikibrain-utils

/**
 * @see #get(Class, String, java.util.Map)
 * @param klass
 * @param name
 * @param <T>
 * @return
 * @throws ConfigurationException
 */
public <T> T get(Class<T> klass, String name) throws ConfigurationException {
  return get(klass, name, null);
}
origin: shilad/wikibrain

  @Override
  public void close() throws IOException {
    configurator.close();
  }
}
origin: org.wikibrainapi/wikibrain-utils

/**
 * Constructs a new configuration object with the specified configuration.
 * @param conf
 */
public Configurator(Configuration conf) throws ConfigurationException {
  this.conf = conf;
  registerProviders();
}
origin: shilad/wikibrain

/**
 * Returns a default set of LuceneOptions.
 *
 * @return a default set of LuceneOptions
 */
public static LuceneOptions getDefaultOptions() {
  try {
    return new Configurator(new Configuration()).get(LuceneOptions.class, "plaintext");
  } catch (ConfigurationException e) {
    throw new RuntimeException(e);
  }
}
origin: shilad/wikibrain

public SRBuilder(Env env, String metricName, Language language) throws ConfigurationException {
  this.env = env;
  this.language = language;
  this.config = env.getConfiguration();
  this.srDir = new File(config.get().getString("sr.metric.path"));
  datasetNames = config.get().getStringList("sr.dataset.defaultsets");
  // Properly resolve the default metric name.
  this.metricName = env.getConfigurator().resolveComponentName(SRMetric.class, metricName);
  if (!srDir.isDirectory()) {
    srDir.mkdirs();
  }
}
origin: org.wikibrainapi/wikibrain-spatial

  /**
   * Hack: Better to ask the configurator for this!
   * @param conf
   * @return
   */
  public static SpatialDataFolder get(Configuration conf) {
    return new SpatialDataFolder(conf.getFile("spatial.dir"));
  }
}
origin: org.wikibrainapi/wikibrain-utils

/**
 * Constructs an instance of the specified class with the passed
 * in config. This bypasses the cache and the configuration object.
 *
 *
 * @param klass The class being created.
 * @param name  An arbitrary name for the object. Can be null.
 * @param conf The configuration for the object.
 * @param runtimeParams
 * @return The object
 */
public <T> T construct(Class<T> klass, String name, Config conf, Map<String, String> runtimeParams) throws ConfigurationException {
  return constructInternal(klass, name, conf, runtimeParams).getRight();
}
origin: org.wikibrainapi/wikibrain-utils

/**
 * Get a specific named instance of the component with the specified class.
 * This method can only be used when there is exactly one instance of the component.
 *
 * @param klass The generic interface or superclass, not the specific implementation.
 * @return The requested component.
 */
public <T> T get(Class<T> klass) throws ConfigurationException {
  return get(klass, null);
}
origin: shilad/wikibrain

  /**
   * Hack: Better to ask the configurator for this!
   * @param conf
   * @return
   */
  public static SpatialDataFolder get(Configuration conf) {
    return new SpatialDataFolder(conf.getFile("spatial.dir"));
  }
}
origin: shilad/wikibrain

/**
 * Constructs a new configuration object with the specified configuration.
 * @param conf
 */
public Configurator(Configuration conf) throws ConfigurationException {
  this.conf = conf;
  registerProviders();
}
origin: shilad/wikibrain

/**
 * Get a specific named instance of the component with the specified class.
 * This method can only be used when there is exactly one instance of the component.
 *
 * @param klass The generic interface or superclass, not the specific implementation.
 * @return The requested component.
 */
public <T> T get(Class<T> klass) throws ConfigurationException {
  return get(klass, null);
}
origin: shilad/wikibrain

/**
 * @see #get(Class, String, java.util.Map)
 * @param klass
 * @param name
 * @param <T>
 * @return
 * @throws ConfigurationException
 */
public <T> T get(Class<T> klass, String name) throws ConfigurationException {
  return get(klass, name, null);
}
origin: shilad/wikibrain

public LanguageSet getLanguages() {
  try {
    return configurator.get(LanguageSet.class);
  } catch (ConfigurationException e) {
    throw new RuntimeException(e);
  }
}
origin: shilad/wikibrain

  public WebEntityParser(Env env) throws ConfigurationException {
//        this.conceptDao = env.getConfigurator().get(UniversalPageDao.class);
    this.pageDao = env.getConfigurator().get(LocalPageDao.class);
  }

origin: shilad/wikibrain

public ContainsPointScorer(Env env, Config conf) throws ConfigurationException {
  super(env, conf);
  wikidataDao = env.getConfigurator().get(WikidataDao.class);
}
origin: org.wikibrainapi/wikibrain-spatial

public ContainsPointScorer(Env env, Config conf) throws ConfigurationException {
  super(env, conf);
  wikidataDao = env.getConfigurator().get(WikidataDao.class);
}
origin: org.wikibrainapi/wikibrain-loader

public LoadedStats(Env env) throws ConfigurationException {
  this.env = env;
  this.dao = env.getConfigurator().get(MetaInfoDao.class);
}
origin: shilad/wikibrain

public LoadedStats(Env env) throws ConfigurationException {
  this.env = env;
  this.dao = env.getConfigurator().get(MetaInfoDao.class);
}
origin: org.wikibrainapi/wikibrain-spatial

public SpatialDataLoader(Env env) throws ConfigurationException, WikiBrainException {
  this.env = env;
  this.langs = env.getLanguages();
  this.spatialDao = env.getConfigurator().get(SpatialDataDao.class);
  this.metaDao = env.getConfigurator().get(MetaInfoDao.class);
  this.wdDao = env.getConfigurator().get(WikidataDao.class);
}
origin: shilad/wikibrain

public SpatialDataLoader(Env env) throws ConfigurationException, WikiBrainException {
  this.env = env;
  this.langs = env.getLanguages();
  this.spatialDao = env.getConfigurator().get(SpatialDataDao.class);
  this.metaDao = env.getConfigurator().get(MetaInfoDao.class);
  this.wdDao = env.getConfigurator().get(WikidataDao.class);
}
org.wikibrain.conf

Most used classes

  • Configurator
    Binds together providers for a collection of components. A component is uniquely identified by two e
  • Configuration
    A generic configuration file. The class is a lightweight wrapper around the typesafe config project
  • ConfigurationException
  • DefaultOptionBuilder
    DefaultOptionBuilder is a non-static version of OptionBuilder that truly follows the builder pattern
  • Configurator$ProviderSet
    A collection of providers for a particular type of component (e.g. LocalPageDao).
  • ProviderFilter
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now