Skip to content

Commit

Permalink
Merge pull request #7 from stscoundrel/feature/readme-usage-examples
Browse files Browse the repository at this point in the history
Readme: add usage examples
  • Loading branch information
stscoundrel authored Apr 24, 2022
2 parents 4d34cc3 + 86a4ca4 commit 700afdc
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,40 @@ Old Norwegian/Norse Dictionary for C#. The dictionary consists of 40 000+ Old No

Based on "Dictionary of the Old Norwegian Language".

### Install

```
dotnet add package OldNorwegianDictionary
```

### Usage


```csharp
using OldNorwegianDictionary;

// Get all dictionary entries.
var dictionary = new Dictionary();
var result = dictionary.GetEntries();
Console.WriteLine(dictionar.Count); // 42 021 entries.
// Individual entry contains headword, definition and part of speech.
DictionaryEntry entry = result[42000];
Console.WriteLine(entry.Headword); // þyrnir
Console.WriteLine(entry.PartOfSpeech); // m
Console.WriteLine(entry.Definition); // þyrnir, m. Tjørn, Tornebusk. [...] etc.
// Entries contain couple of helper methods.
DictionaryEntry entry2 = result[0];

// Part of speech does not exist in all entries.
Console.WriteLine(entry2.HasPartOfSpeech()); // false
// ToString is overwritten for generic presentation.
Console.WriteLine(entry2.ToString()); // [HEADWORD] - [DEFINITION]
```

### About "Dictionary of the Old Norwegian Language"

_"Ordbog over det gamle norske Sprog"_ dictionary was published in late 1800s by Johan Fritzner. Its is the largest Old Norse to Norwegian dictionary, containing over 40 000 word definitions. While the original dictionary is called dictionary of "old norwegian", it is practically a dictionary of western Old Norse. Technically "Old Norwegian" would be a later stage in the language.

0 comments on commit 700afdc

Please sign in to comment.