org.carrot2.text.linguistic
Class LexicalDataLoaderDescriptor.AttributeBuilder

java.lang.Object
  extended by org.carrot2.text.linguistic.LexicalDataLoaderDescriptor.AttributeBuilder
Enclosing class:
LexicalDataLoaderDescriptor

public static class LexicalDataLoaderDescriptor.AttributeBuilder
extends Object

Attribute map builder for the LexicalDataLoader component. You can use this builder as a type-safe alternative to populating the attribute map using attribute keys.


Field Summary
 Map<String,Object> map
          The attribute map populated by this builder.
 
Constructor Summary
protected LexicalDataLoaderDescriptor.AttributeBuilder(Map<String,Object> map)
          Creates a builder backed by the provided map.
 
Method Summary
 LexicalDataLoaderDescriptor.AttributeBuilder reloadResources(boolean value)
          Reloads cached stop words and stop labels on every processing request.
 LexicalDataLoaderDescriptor.AttributeBuilder resourceLookup(Class<? extends ResourceLookup> clazz)
          Lexical resource lookup facade.
 LexicalDataLoaderDescriptor.AttributeBuilder resourceLookup(ResourceLookup value)
          Lexical resource lookup facade.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

public final Map<String,Object> map
The attribute map populated by this builder.

Constructor Detail

LexicalDataLoaderDescriptor.AttributeBuilder

protected LexicalDataLoaderDescriptor.AttributeBuilder(Map<String,Object> map)
Creates a builder backed by the provided map.

Method Detail

reloadResources

public LexicalDataLoaderDescriptor.AttributeBuilder reloadResources(boolean value)
Reloads cached stop words and stop labels on every processing request. For best performance, lexical resource reloading should be disabled in production.

This flag is reset to false after successful resource reload to prevent multiple resource reloads during the same processing cycle.

See Also:
LexicalDataLoader.reloadResources

resourceLookup

public LexicalDataLoaderDescriptor.AttributeBuilder resourceLookup(ResourceLookup value)
Lexical resource lookup facade. By default, resources are sought in the current thread's context class loader. An override of this attribute is possible both at the initialization time and at processing time.

See Also:
LexicalDataLoader.resourceLookup

resourceLookup

public LexicalDataLoaderDescriptor.AttributeBuilder resourceLookup(Class<? extends ResourceLookup> clazz)
Lexical resource lookup facade. By default, resources are sought in the current thread's context class loader. An override of this attribute is possible both at the initialization time and at processing time.

See Also:
LexicalDataLoader.resourceLookup


Copyright (c) Dawid Weiss, Stanislaw Osinski