-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow query param to strip Bismillah from first ayahs #17
Comments
I had to do it manually:
|
@Rabubaker My solution to this is to get the range of Baslmalih by getting the first index of "ٱلرَّحِيمِ" then replacing this range with an empty string: (This code is in Kotlin, but I think you can find something similar for what are you programming in) const val Fatiha = "Al-Faatiha"
const val Tawba = "At-Tawba"
fun getEndIndexOfBasmalih(): Int {
//Works only for quran-uthmani
val string = "ٱلرَّحِيمِ"
return ayaText.indexOf(string, 0) + string.length
}
fun getTextWithoutBasmalih(numberInSurah :Int): String {
return if (numberInSurah == 1
&& surah!!.englishName != MushafConstants.Fatiha
&& surah!!.englishName != MushafConstants.Tawba)
ayaText.substring(getEndIndexOfBasmalih(), ayaText.length)
else ayaText
} |
Thanks a lot for pointing out to this.. it was indeed helpful. I am programming in ES6/Angular. I will certainly do something similar. JazakAllah Kahir.. |
Most Welcome |
@vipafattal @Rabubaker this will only work with quran-uthmani - not with quran-simple - incase anyone is using that. |
Yes I'm using it with quran-uthmani if someone is not using generic Quran version, they can replace val string = "ٱلرَّحِيمِ" with same version of end Basmalih in quran-simple, otherwise, I would suggest splitting first Aya by whitespace I think this will work fine in all quran version: fun getEndIndexOfBasmalih(): Int {
val split = ayaText.split(' ')
return ayaText.indexOf(split[3], 0) + split[3].length
} |
Thanks @vipafattal I will try and prioritise this to deal with it on the API side. |
Any update on this? @meezaan |
Al Salaamu Alaykum @RabeeAbuBaker. It's number 5 on the backlog - https://github.com/orgs/islamic-network/projects/5 - so not yet, I'm afraid. But soon, God willing! |
I use .replace() method. Those unicode is part of Bismillah. Hope helps.
|
No description provided.
The text was updated successfully, but these errors were encountered: