QuickDict is an open-source .NET library for generating language dictionaries in a variety of digital dictionary formats.
QuickDict is published on NuGet Gallery: https://www.nuget.org/packages/QuickDict
Use this command in the NuGet Package Manager console to install QuickDict manually:
Install-Package QuickDict
Using QuickDict is as easy as:
- Create a
StarDictDictionary
orXdxfDictionary
instance - Set the dictionary's metadata (i.e. title, authors, languages, etc.)
- (Optional) Implement any of a dictionary's hooks with any custom processing code
- Add all of the dictionary's articles (i.e. term and definition pairs)
- (Optional) Add all of the dictionary's abbreviations (i.e. term and definition pairs)
- Save the dictionary to disk
Note: The library works best when using plain text in the articles and abbreviations.
/// Create XdxfDictionary instance
var dict = new XdxfDictionary();
// Set the dictionary's metadata
dict.Metadata.LongTitle = "My Fancy French to English Dictionary";
dict.Metadata.Description = "Sample Dictionary made by QuickDict";
dict.Metadata.ArticleKeyLangCode = "FRA";
dict.Metadata.ArticleValueLangCode = "ENG";
// (Optional) Implement any of a dictionary's hooks
dict.GetXdxfKeysFromArticle = a =>
{
// XDXF can support an article with multiple terms for the same defintions,
// so assuming my input data has articles with multiple terms divided by commas,
// I split them here by the comma into separate keys
return a.Key.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries).ToList();
};
dict.GetXdxfKeyOptionalTerms = () =>
{
// XDXF can support specifying parts of an article's terms which are "optional",
// and do not need to be matched when performing a search, so assuming my input data
// has these these gender terms "(masc)" and "(fem)" that aren't part of the actual word
// I can specify them here to be flagged as optional
return new HashSet<string>() { "(masc)", "(fem)" };
};
dict.GetXdxfValuesFromArticle = a =>
{
// XDXF can support an article with multiple defintions for the same terms,
// so assuming my input data has articles with multiple numbered definitions
// (i.e. 1. definition 2. other definition) I use the GetDefintions helper to
// split the single string into separate (unnumbered) definitions
return a.Value.GetDefinitions(false).ToList();
};
// Add all of the dictionary's articles
dict.AddArticle("bonjour", "1. interj. hello 2. dated. interj. good day");
dict.AddArticle("examinateur (masc), examinatrice (fem)", "n. examiner");
dict.AddArticle("horloge", "n. clock");
// (Optional) Add all of the dictionary's abbreviations
dict.AddAbbreviation("dated.", "interjection", AbbreviationType.Stylistic);
dict.AddAbbreviation("interj.", "interjection", AbbreviationType.Grammatical);
dict.AddAbbreviation("n.", "noun", AbbreviationType.Grammatical);
// Save the dictionary to disk
dict.Save("MyFancyFrenchToEnglishDictionary.xdxf");
This sample code will create a file named MyFancyFrenchToEnglishDictionary.xdxf
with the following contents:
<?xml version="1.0" encoding="utf-8"?>
<xdxf format="logical" revision="33" lang_from="FRA" lang_to="ENG">
<meta_info>
<full_title>My Fancy French to English Dictionary</full_title>
<description>Sample Dictionary made by QuickDict</description>
<abbreviations>
<abbr_def type="stl">
<abbr_k>dated.</abbr_k>
<abbr_v>interjection</abbr_v>
</abbr_def>
<abbr_def type="grm">
<abbr_k>interj.</abbr_k>
<abbr_v>interjection</abbr_v>
</abbr_def>
<abbr_def type="grm">
<abbr_k>n.</abbr_k>
<abbr_v>noun</abbr_v>
</abbr_def>
</abbreviations>
<creation_date>24-07-2025</creation_date>
</meta_info>
<lexicon>
<ar>
<k>bonjour</k>
<def>
<def>
<deftext>
<abbr>interj.</abbr> hello</deftext>
</def>
<def>
<deftext>
<abbr>dated.</abbr>
<abbr>interj.</abbr> good day</deftext>
</def>
</def>
</ar>
<ar>
<k>examinateur <opt>(masc)</opt></k>
<k>examinatrice <opt>(fem)</opt></k>
<def>
<deftext>
<abbr>n.</abbr> examiner</deftext>
</def>
</ar>
<ar>
<k>horloge</k>
<def>
<deftext>
<abbr>n.</abbr> clock</deftext>
</def>
</ar>
</lexicon>
</xdxf>
Building QuickDict requires:
- A PC with the .NET 8 SDK installed
- The QuickDict source
Then you should be able to run the following command to build QuickDict from within its source folder:
dotnet build ./src/QuickDict.sln
With the above setup, you should be able to run the following command to test QuickDict from within its source folder:
dotnet test ./src/QuickDict.sln
QuickDict is open-source under the MIT license.
Copyright (c) 2025 Jon Thysell.