• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Exclude HTML tags and some UNICODE Characters while searching in SQLite

I am working with Arabic Language saved in UNICODE Format in SQLite. I want to implement a search. But there's a problem.

Let's say the text is



<html>
<head>
<style>
@font-face {
font-family: "Al_Mushaf";
src: url('fonts/al_mushaf.ttf');
}
@font-face {
font-family: "Jameel Noori Nastaleeq";
src: url('fonts/jameel_noori.ttf');
}
</style>
</head>

<body>
<h3 style='font-family:"Al_Mushaf"'>
صحابہ کرام کا انبیائے کرام کی سنّت پر عمل
میٹھے میٹھے اسلامی بھائیو!صدائے مدینہ لگانا انبیائے کِرام عَلَیْہِمُ السَّلَام کی اس قَدْر پیاری سنّت ہے کہ صحابۂ کِرام عَلَیْہِمُ الرِّضْوَان نے بھی اسے خُوب اپنایا اور وہ بھی حضرت سَیِّدُنا داؤد عَلَیْہِ السَّلَام کی طرح اپنے گھر والوں کو جگایا کرتے جیسا کہ حضرت سَیِّدُنا عبد اللہ بن عُمَر رَضِیَاللّٰہُ تَعَالٰی عَنْہُما فرماتے ہیں کہ میرے والِدِ مُحْتَرَم اَمِیرُ الْمُوْمِنِین حضرت سَیِّدُنا عُمَر فَارُوقِ اَعْظَم رَضِیَاللّٰہُ تَعَالٰی عَنْہ رات میں جس قَدْر ربّ تعالیٰ چاہتا،نَماز پڑھتے رہتے،یہاں تک کہ جب رات کا آخری وَقْت ہوتا تو اپنے گھر والوں کو بھی نَماز کے لیے جگا دیتے اور ان سے فرماتے: اَلصَّلٰوة یعنی نماز۔ پھر یہ آیت مُبارَکہ تِلاوَت فرماتے:
وَاۡمُرْ اَہۡلَکَ بِالصَّلٰوۃِ وَ اصْطَبِرْ عَلَیۡہَا ؕ لَا نَسْـَٔلُکَ رِزْقًا ؕ نَحْنُ نَرْزُقُکَ ؕ وَالْعٰقِبَۃُ لِلتَّقْوٰی (پ۱۶،طٰهٰ:۱۳۲)
</h3>
</body>

</html>

And it is stored in SQLite Database. Now I want to search html, it will return the result and if I search مبارکہ it won't return a result because in actual text, it is مُبارَکہ (with these extra UNICODE).

I want to ignore all HTML tags and these extra UNICODE Characters while searching so that htmlshouldn't return a result while مبارکہ should return a result.

What I found so far;

  1. Make extra column and put stripped text into it and then search (I can't do it because there are thousands of books and they will take a lot of memory)

  2. UDF Like SQL (I couldn't find any suitable example/tutorial to implement it)

  3. Using REGEXP (I couldn't figure it out yet how to do this, I just know that I've to implement it myself)

  4. SQL query using LIKE and GLOB operators and wildcard characters.
I'm stuck for two days and couldn't find a working solution. Option#4 is desirable but any working solution will do the charm.

Meanwhile, I've to keep application memory efficient and optimized searching.

Any help is highly appreciated.
 
Back
Top Bottom