
Posted on • Originally published atremede.camarm.fr
How I built a rhymes dictionary ?
Hi and welcome to this new article !
I've been working hard on my mobile dictionary Remède this last month (I released the1.2.0-beta
version a week ago).
I've added many things but today I will focus on a special functionality.
I've added arhymes dictionary which is completely running on your phone (or any browser) without an internet connection !
1. - Find data to build a rhymes database
I've searched for open source projects which had already built a rhymes database so I can re-use their database and adapt it for Remède.
After some searches, I discovered thatOpen Lexicon, a project which provides various open database about words, has enough data to build a rhymes dictionary.
I found theDrime project, which usesOpen Lexicon database to generate its own rhymes database. With their documentation, I built my own base and added these rows in a new table of the Remède database.
2. - How it works ?
If you don't know Remède (you can check it out onGithub and leave a star), it uses aSqlite database which is downloaded locally.
Now that I have enough fields about words, how can I build an efficient dictionary ?
First, let's explain how this dictionary is working.
A tablerime
contains rows (one row is equal to one word) with the fieldsphon_end
,word_end
(and more fields likefeminine
orelide
for particular rhymes...).
So for example, to get the rimes of the wordbonjour
, phoneme\b$ZuR\
, we will filter all the words whose phoneme finishes withuR
.
The requests will look like
SELECTwordFROMrimeWHEREphon_endLIKE'%uR'
And you understood the main concept ! Now we can add fields to filter and get more specific results, like in the application.
3. Final look
Yes we have a dictionary but not anyone can use it ! You must know Sql to browse it...
I tried to have the simplest and most understandable interface. For the interface, I use Ionic 7 with Vue 3.
I integrate this functionality as following in Remède:
Description | Screenshot |
---|---|
Searching a word in the rimes dictionary | ![]() |
Browsing rimes | ![]() |
Setsyllabes filter | ![]() |
What's next ?
For the moment, some functionalities are missing and the experience is not perfect... I want to add the possibility to choose the "nature" of the wanted rhymes (verb, noun...) and to enhance word finding experience.
Thank you for reading,
Don't hesitate to try Remède (https://remede.camarm.fr, and let me a message about your experience if you want !)
Have nice code !
Top comments(0)
For further actions, you may consider blocking this person and/orreporting abuse