Smab.DictionaryOfWords 1.0.7

dotnet add package Smab.DictionaryOfWords --version 1.0.7                
NuGet\Install-Package Smab.DictionaryOfWords -Version 1.0.7                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Smab.DictionaryOfWords" Version="1.0.7" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Smab.DictionaryOfWords --version 1.0.7                
#r "nuget: Smab.DictionaryOfWords, 1.0.7"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Smab.DictionaryOfWords as a Cake Addin
#addin nuget:?package=Smab.DictionaryOfWords&version=1.0.7

// Install Smab.DictionaryOfWords as a Cake Tool
#tool nuget:?package=Smab.DictionaryOfWords&version=1.0.7                

Smab.DictionaryOfWords

A .NET 8.0 library used to check the spelling of words.

Documentation

Initialisation

4 ways to initialise the dictionary:

  1. With a file of words, 1 word per line.

     string filename = "path to file";
     DictionaryOfWords dictionary = new(filename);
    
  2. With a collection of strings

     IEnumerable<string> words = ["a", "list", "of", "words"];
     DictionaryOfWords dictionary = new(words);
    
  3. Words can be manually added using AddWord(). This returns a 'true' if the word was successfully added to the dictionary, otherwise false.

     DictionaryOfWords dictionary = new();
     bool success = dictionary.AddWord("this");
     if (dictionary.AddWord("is"))
     {
     	_ = dictionary.AddWord("a");
     	_ = dictionary.AddWord("word");
     }
    
  4. Multiple words can be manually added using AddWords(). This returns the number of new words added to the dictionary

     DictionaryOfWords dictionary = new();
     IEnumerable<string> words = ["a", "list", "of", "words"];
     int wordsAdded = dictionary.AddWords(words);
    

Status

Once a dictionary has been created there are 2 ways that can be used to check if the words have loaded correctly:

  1. HasWords Returns True if the dictionary has more than 1 word.
     bool hasWords = dictionary.HasWords;
    
  2. Count Returns the number of words loaded into the dictionary.
     int count = dictionary.Count;
    

Check Spelling

Words can be checked using the IsWord() method. Returns true if the word exists in the dictionary, otherwise false.

bool isWord = dictionary.IsWord("word");
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Smab.DictionaryOfWords:

Package Downloads
Smab.DiceAndTiles

Library to handle dice and tiles for use in games

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.7 206 2/19/2024
1.0.6 123 2/18/2024
1.0.5 115 2/18/2024
1.0.4 162 2/18/2024
1.0.3 129 2/18/2024
1.0.2 119 2/17/2024
1.0.1 126 2/17/2024
1.0.0 126 2/16/2024