This library provides a set of Kotlin functions for working with Hebrew numerals (Gematria) and Talmudic page references (Daf Gemara). It's designed to be easy to use and integrate into your projects, offering convenient extensions for String and Int types.
- Convert Hebrew strings to their numerical Gematria value
- Convert integers to Hebrew numeral representations (Gematria)
- Convert Daf Gemara (Talmudic page) numbers to their string representations
- Multiplatform support: can be used on JVM, JS, and Native platforms
- Exportable as both a native library and a JavaScript library
- Available on Maven Central
You can import the library directly from Maven Central.
Add the following to your build.gradle.kts
:
repositories {
mavenCentral()
}
dependencies {
implementation("io.github.kdroidfilter:hebrewnumerals:0.2.4")
}
val hebrewYear = "תשפִד"
val gematriaValue = hebrewYear.toGematria()
println(gematriaValue) // Outputs: 784
val dafNumber = 5
val dafGemara = dafNumber.toDafGemara()
println(dafGemara) // Outputs: "ד."
val dafNumber2 = 6
val dafGemara2 = dafNumber2.toDafGemara()
println(dafGemara2) // Outputs: "ד:"
val year = 5784
val hebrewYear = year.toHebrewNumeral()
println(hebrewYear) // Outputs: "ה'תשפ"ד"
// Without Geresh symbols
val hebrewYearNoSymbols = year.toHebrewNumeral(includeGeresh = false)
println(hebrewYearNoSymbols) // Outputs: "התשפד"
val dafNumber = 5
val englishDaf = dafNumber.toEnglishDafGemara()
println(englishDaf) // Outputs: "4a"
val dafNumber2 = 6
val englishDaf2 = dafNumber2.toEnglishDafGemara()
println(englishDaf2) // Outputs: "4b"
This library is built with Kotlin Multiplatform, allowing it to be used across different platforms:
- JVM: For use in Java and Android applications
- JS: For use in web applications and Node.js environments
- Native: For use in iOS, desktop, and other native applications
Converts a Hebrew string to its corresponding numerical value (Gematria).
Converts an integer representing a Daf Gemara (Talmudic page) to its corresponding string representation.
Converts an integer to its corresponding Hebrew numeral representation (Gematria).
Converts an integer representing a Daf Gemara to its English representation with "a" (Aleph) and "b" (Bet).
The library can be easily exported for use in various environments:
- As a native library: Can be compiled and used in C, Objective-C, and Swift projects
- As a JavaScript library: Can be used directly in web applications or Node.js projects