Package opennlp.tools.entitylinker
Class EntityLinkerFactory
- java.lang.Object
-
- opennlp.tools.entitylinker.EntityLinkerFactory
-
public class EntityLinkerFactory extends Object
Generates aEntityLinker
instances via aproperties
file configuration.In the properties file, the linker implementation must be provided using
"linker"
as the properties key, and the full class name as value.
-
-
Constructor Summary
Constructors Constructor Description EntityLinkerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EntityLinker<?>
getLinker(String entityType, EntityLinkerProperties properties)
Retrieves aEntityLinker
instance matching theproperties
configuration.static EntityLinker<?>
getLinker(EntityLinkerProperties properties)
Retrieves aEntityLinker
instance matching theproperties
configuration.
-
-
-
Method Detail
-
getLinker
public static EntityLinker<?> getLinker(String entityType, EntityLinkerProperties properties) throws IOException
Retrieves aEntityLinker
instance matching theproperties
configuration.- Parameters:
entityType
- The type of entity being linked to. This value is used to retrieve the implementation of theEntityLinker
from theEntityLinker
properties file. Must not benull
.properties
- An object that extendsEntityLinkerProperties
. This object will be passed into theEntityLinker.init(EntityLinkerProperties)
method, so it is an appropriate place to put additional resources. Must not benull
.- Returns:
- The
EntityLinker
instance for theproperties
configuration. - Throws:
IOException
- Thrown if IO errors occurred.IllegalArgumentException
- Thrown if parameters were invalid.
-
getLinker
public static EntityLinker<?> getLinker(EntityLinkerProperties properties) throws IOException
Retrieves aEntityLinker
instance matching theproperties
configuration.- Parameters:
properties
- An object that extendsEntityLinkerProperties
. This object will be passed into theEntityLinker.init(EntityLinkerProperties)
method, so it is an appropriate place to put additional resources. Must not benull
.- Returns:
- The
EntityLinker
instance for theproperties
configuration. - Throws:
IOException
- Thrown if IO errors occurred.IllegalArgumentException
- Thrown if parameters were invalid.
-
-