Class NameFinderCensus90NameStream
java.lang.Object
opennlp.tools.formats.NameFinderCensus90NameStream
- All Implemented Interfaces:
AutoCloseable, opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>
@Internal
public class NameFinderCensus90NameStream
extends Object
implements opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>
This class helps to read the US Census data from the files to build a
StringList for each dictionary entry in the name-finder dictionary.
The entries in the source file are as follows:
SMITH 1.006 1.006 1
- The first field is the name (in ALL CAPS).
- The next field is a frequency in percent.
- The next is a cumulative frequency in percent.
- The last is a ranking.
Note: Do not use this class, internal use only!
-
Constructor Summary
ConstructorsConstructorDescriptionNameFinderCensus90NameStream(opennlp.tools.util.InputStreamFactory in, Charset encoding) NameFinderCensus90NameStream(opennlp.tools.util.ObjectStream<String> lineStream) Initializes aNameFinderCensus90NameStreamviaopennlp.tools.util.ObjectStream<String>. -
Method Summary
-
Constructor Details
-
NameFinderCensus90NameStream
Initializes aNameFinderCensus90NameStreamviaopennlp.tools.util.ObjectStream<String>.- Parameters:
lineStream- Anopennlp.tools.util.ObjectStream<String>that represents the input file to be attached to this class.
-
NameFinderCensus90NameStream
public NameFinderCensus90NameStream(opennlp.tools.util.InputStreamFactory in, Charset encoding) throws IOException Initializes aNameFinderCensus90NameStreamvia anInputStreamFactoryand aCharset. Opens an associated stream object with the specified encoding specified.- Parameters:
in- TheInputStreamFactoryfor the input file.encoding- theCharsetto apply to the input stream.- Throws:
IOException- Thrown if IO errors occurred.
-
-
Method Details
-
read
- Specified by:
readin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>- Throws:
IOException
-
reset
- Specified by:
resetin interfaceopennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>- Throws:
IOExceptionUnsupportedOperationException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceopennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>- Throws:
IOException
-