Class DictionaryEntryPersistor

Namespace
NOpenNLP.Tools.Dictionary.Serializer
Assembly
NOpenNLP.Tools.dll

This class is used by for reading and writing dictionaries of all kinds.

public static class DictionaryEntryPersistor
Inheritance
DictionaryEntryPersistor
Inherited Members

Methods

Create(Stream, EntryInserter)

Creates Entrys from the given Stream and forwards these Entrys to the EntryInserter.

After creation is finished the provided Stream is closed.

public static bool Create(Stream @in, EntryInserter inserter)

Parameters

in Stream

stream to read entries from

inserter EntryInserter

inserter to forward entries to

Returns

bool

isCaseSensitive attribute for Dictionary

Exceptions

IOException
InvalidFormatException

Serialize(Stream, IEnumerable<Entry>)

Serializes the given entries to the given Stream.

After the serialization is finished the provided Stream remains open.

[Obsolete("Use Serialize(Stream, IEnumerable<Entry>, bool) instead.")]
public static void Serialize(Stream @out, IEnumerable<Entry> entries)

Parameters

out Stream

stream to serialize to

entries IEnumerable<Entry>

entries to serialize

Remarks

Exceptions

IOException

If an I/O error occurs

Serialize(Stream, IEnumerable<Entry>, bool)

Serializes the given entries to the given Stream.

After the serialization is finished the provided Stream remains open.

public static void Serialize(Stream @out, IEnumerable<Entry> entries, bool casesensitive)

Parameters

out Stream

stream to serialize to

entries IEnumerable<Entry>

entries to serialize

casesensitive bool

indicates if the written dictionary should be case sensitive or case insensitive.

Remarks

NOpenNLP: It is more common in .NET to pass IEnumerable<T> than IEnumerator<T>, and this has the benefit of not making the caller clean up the enumerator. This was Iterator>Entry< upstream.

Exceptions

IOException

If an I/O error occurs