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
inStreamstream to read entries from
inserterEntryInserterinserter to forward entries to
Returns
- bool
isCaseSensitive attribute for Dictionary
Exceptions
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
outStreamstream to serialize to
entriesIEnumerable<Entry>entries to serialize
Remarks
Deprecated: Use Serialize(Stream, IEnumerable<Entry>, bool) instead.
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
outStreamstream to serialize to
entriesIEnumerable<Entry>entries to serialize
casesensitiveboolindicates 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