Skip to content

DiscoPYF/CedictParser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CedictParser

A C# .Net Standard 2.0 library for parsing the CC-CEDICT format.

Install

Install the NuGet package.

.Net CLI

dotnet add package CedictParser

Package Manager:

Install-Package CedictParser

Package Reference:

<PackageReference Include="CedictParser" Version="1.0.0" />

Usage

Create an instance of the CedictParser class with a filepath or a StreamReader.

using (var parser = new CedictParser(filepath))
{
}
using (var reader = new StreamReader(filepath, Encoding.UTF8))
{
    var parser = new CedictParser(reader);
}

CedictParser contains synchronous and asynchronous methods to read one or all entries.

Read one entry:

// sync
CedictEntry entry = parser.Read();

// async
CedictEntry entry = await parser.ReadAsync();

Read all remaining entries:

// sync
IList<CedictEntry> entries = parser.ReadToEnd();

// async
IList<CedictEntry> entries = await parser.ReadToEndAsync();

About

A C# library for parsing the CC-CEDICT format.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages