Example usage for opennlp.tools.namefind DefaultNameContextGenerator DefaultNameContextGenerator

List of usage examples for opennlp.tools.namefind DefaultNameContextGenerator DefaultNameContextGenerator

Introduction

In this page you can find the example usage for opennlp.tools.namefind DefaultNameContextGenerator DefaultNameContextGenerator.

Prototype

public DefaultNameContextGenerator(AdaptiveFeatureGenerator... featureGenerators) 

Source Link

Document

Creates a name context generator with the specified cache size.

Usage

From source file:com.civis.utils.opennlp.models.address.AddressFinderMe.java

public AddressFinderMe(TokenNameFinderModel model) {
    super(model.getNameFinderModel());
    additionalContextFeatureGenerator = new AdditionalContextFeatureGenerator();
    AdaptiveFeatureGenerator featureGenerator = createDefaultFeatureGenerator();
    contextGenerator = new DefaultNameContextGenerator(featureGenerator);
    SequenceValidator<String> sequenceValidator = new AddressFinderSequenceValidator();
    beam = new BeamSearch<>(DEFAULT_BEAM_SIZE, contextGenerator, nameFinderModel, sequenceValidator,
            DEFAULT_BEAM_SIZE);//from   w  w  w . java2 s .co m
    this.csvAddressDataList = CSVAddressReader.read();
    this.countries = CountryReader.read();
}