Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for How I built a rhymes dictionary ?
camarm
camarm

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'
Enter fullscreen modeExit fullscreen mode

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:

DescriptionScreenshot
Searching a word in the rimes dictionaryRimes dictionary
Browsing rimesBrowsing
Setsyllabes filterFilter

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)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

I'm @camarm, a French Developer fond of Linux, server infrastructures and development 🇫🇷💻🐧💾👨‍💻.
  • Location
    Doubs, France
  • Work
    Hostler, sysadmin and developper at Labse Software.
  • Joined

More fromcamarm

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp