Pienteger.QuranLib
7.0.1
dotnet add package Pienteger.QuranLib --version 7.0.1
NuGet\Install-Package Pienteger.QuranLib -Version 7.0.1
<PackageReference Include="Pienteger.QuranLib" Version="7.0.1" />
paket add Pienteger.QuranLib --version 7.0.1
#r "nuget: Pienteger.QuranLib, 7.0.1"
// Install Pienteger.QuranLib as a Cake Addin #addin nuget:?package=Pienteger.QuranLib&version=7.0.1 // Install Pienteger.QuranLib as a Cake Tool #tool nuget:?package=Pienteger.QuranLib&version=7.0.1
Quran Lib
A portable Quran library that gives read-only access to the entire Holy Quran.
Available Versions
- .NET 7
- .NET 6
- .NET Framework 4.5
Installation
In the NuGet package manager console type -
Install-Package Pienteger.QuranLib
Or paste this code directly in the .csproj file.
<PackageReference Include="Pienteger.QuranLib" Version="7.0.1" />
Usage
using Pienteger.QuranLib;
QuranInstance quran = new QuranInstance();
quran.LoadChapters(1, 5);
Chapter? chapter = quran.GetChapter(1);
string randomAyah = chapter.Verses.ToList()[random.Next(0, chapter.TotalVerse)].Text;
API Documentation
Script Type
Two script types are available:
ScriptType.Clean
- The script is a clean script that does not contain any Harkat or Tashkeel.ScriptType.WithTashkil
- The script is a script that contains Harkat and Tashkeel.
ScriptType.Clean
is set to default. If you want to use ScriptType.WithTashkil
, you can set it in the constructor.
Constructor Parameters
QuranInstance
constructor has four parameters:
scriptType
- The script type. (Default is set toScriptType.Clean
)autoLoad
- Iftrue
, the library will automatically load the chapters. (Default is set tofalse
)start
andend
- The start and end chapter numbers. (Default is set to1
and114
. IfautoLoad
istrue
, the library will load chapters within this range.)
You can load chapters manually by calling LoadChapters
method. Without loading chapters, the library will not be able to work properly. If the chapter is not loaded, the library will load it automatically when you call GetChapter
method.
Methods
Method | Description |
---|---|
LoadChapters(byte start = 1, byte end = 114) |
Loads chapters within the specified range. |
GetChapterNames(byte start = 1, byte end = 114) |
Returns a list of chapter names. |
GetBismillah() |
Returns Bismillahir Rahmanir Rahim in selected script |
GetInTheNameOfAllah() |
Returns Bismillahir Rahmanir Rahim in selected script |
GetChapter(ChapterName chapterName) |
Returns a Chapter object. |
GetChapter(byte chapterNumber) |
Returns a Chapter object. |
GetChapters(ChapterName[] chapterNames) |
Returns an ImmutableList<Chapter> object. |
GetChapters(byte[] chapterNumbers) |
Returns an ImmutableList<Chapter> object. |
GetChapters() |
Returns an ImmutableList<Chapter> object. |
GetVerse(byte chapter, ushort verseNumber) |
Returns a Verse object. |
GetVerse(ChapterName chapter, ushort verseNumber) |
Returns a Verse object. |
GetVerses(ChapterName chapter) |
Returns an ImmutableList<Verse> object. |
GetVerses(ushort chapterNumber) |
Returns an ImmutableList<Verse> object. |
GetVerses(byte chapter, ushort startVerse, ushort endVerse) |
Returns an ImmutableList<Verse> object. |
GetVerses(ChapterName chapter, ushort startVerse, ushort endVerse) |
Returns an ImmutableList<Verse> object. |
All the text, and properties are read-only.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Now verse count can be retrieved from a surah without loading the surah.