Class NameFinderCensus90NameStream

Namespace
NOpenNLP.Tools.Formats
Assembly
NOpenNLP.Tools.dll

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!
public class NameFinderCensus90NameStream : ObjectStreamBase<StringList?>, IObjectStream<StringList?>, IDisposable
Inheritance
NameFinderCensus90NameStream
Implements
Inherited Members

Constructors

NameFinderCensus90NameStream(IInputStreamFactory, Encoding)

This constructor takes an IInputStreamFactory and an Encoding and opens an associated stream object with the specified encoding specified.

public NameFinderCensus90NameStream(IInputStreamFactory @in, Encoding encoding)

Parameters

in IInputStreamFactory

an IInputStreamFactory for the input file.

encoding Encoding

the Encoding to apply to the input stream.

Exceptions

IOException

if there is an error during reading

NameFinderCensus90NameStream(IObjectStream<string?>)

This constructor takes an IObjectStream<T> and initializes the class to handle the stream.

public NameFinderCensus90NameStream(IObjectStream<string?> lineStream)

Parameters

lineStream IObjectStream<string>

an IObjectStream<string> that represents the input file to be attached to this class.

Methods

Dispose(bool)

Releases the resources from this object stream.

protected override void Dispose(bool disposing)

Parameters

disposing bool

Read()

Returns the next object. Calling this method repeatedly until it returns null will return each object from the underlying source exactly once.

public override StringList? Read()

Returns

StringList

the next object or null to signal that the stream is exhausted

Exceptions

IOException

if there is an error during reading

IOException

if there is an error during reading

Reset()

Repositions the stream at the beginning and the previously seen object sequence will be repeated exactly. This method can be used to re-read the stream if multiple passes over the objects are required.

The implementation of this method is optional.

public override void Reset()

Exceptions

IOException

if there is an error during resetting the stream

NotSupportedException

if reset is not supported on this stream

IOException

if there is an error during resetting the stream