Smab.DictionaryOfWords
1.0.7
dotnet add package Smab.DictionaryOfWords --version 1.0.7
NuGet\Install-Package Smab.DictionaryOfWords -Version 1.0.7
<PackageReference Include="Smab.DictionaryOfWords" Version="1.0.7" />
paket add Smab.DictionaryOfWords --version 1.0.7
#r "nuget: Smab.DictionaryOfWords, 1.0.7"
// 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:
With a file of words, 1 word per line.
string filename = "path to file"; DictionaryOfWords dictionary = new(filename);
With a collection of strings
IEnumerable<string> words = ["a", "list", "of", "words"]; DictionaryOfWords dictionary = new(words);
Words can be manually added using
AddWord()
. This returns a 'true' if the word was successfully added to the dictionary, otherwisefalse
.DictionaryOfWords dictionary = new(); bool success = dictionary.AddWord("this"); if (dictionary.AddWord("is")) { _ = dictionary.AddWord("a"); _ = dictionary.AddWord("word"); }
Multiple words can be manually added using
AddWords()
. This returns the number of new words added to the dictionaryDictionaryOfWords 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:
- HasWords
Returns True if the dictionary has more than 1 word.
bool hasWords = dictionary.HasWords;
- 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 | Versions 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. |
-
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.