|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectopennlp.maxent.DomainToModelMap
public class DomainToModelMap
A class which stores a mapping from ModelDomain objects to MaxentModels. This permits an application to replace an old model for a domain with a newly trained one in a thread-safe manner. By calling the getModel() method, the application can create new instances of classes which use the relevant models.
Constructor Summary | |
---|---|
DomainToModelMap()
|
Method Summary | |
---|---|
MaxentModel |
getModel(ModelDomain domain)
Get the model mapped to by the given ModelDomain key. |
java.util.Set |
keySet()
A set view of the ModelDomain keys contained in this map. |
void |
removeDomain(ModelDomain domain)
Removes the mapping for this ModelDomain key from this map if present. |
void |
setModelForDomain(ModelDomain domain,
MaxentModel model)
Sets the model for the given domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomainToModelMap()
Method Detail |
---|
public void setModelForDomain(ModelDomain domain, MaxentModel model)
domain
- The ModelDomain object which keys to the model.model
- The MaxentModel trained for the domain.public MaxentModel getModel(ModelDomain domain)
domain
- The ModelDomain object which keys to the desired model.
public void removeDomain(ModelDomain domain)
domain
- The ModelDomain key whose mapping is to be removed from
the map.public java.util.Set keySet()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |