Skip to content
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

[FR] Add support for the 'ar-cf' template #643

Closed
BoboTiG opened this issue Jan 23, 2021 · 13 comments · Fixed by #1738
Closed

[FR] Add support for the 'ar-cf' template #643

BoboTiG opened this issue Jan 23, 2021 · 13 comments · Fixed by #1738
Assignees

Comments

@BoboTiG
Copy link
Owner

BoboTiG commented Jan 23, 2021

@lasconic
Copy link
Collaborator

this is a hard one... We need to replicate https://fr.wiktionary.org/wiki/Module:arabe#L-474 arabe.appliquer like we did for arabiser.

@BoboTiG
Copy link
Owner Author

BoboTiG commented Jan 24, 2021

Yes. We can just postpone its handling until more words will be using it.

@BoboTiG
Copy link
Owner Author

BoboTiG commented Apr 29, 2021

Another one: https://fr.wiktionary.org/wiki/alm%C3%A9e

@lasconic
Copy link
Collaborator

ar-terme: https://fr.wiktionary.org/wiki/qasida

@BoboTiG
Copy link
Owner Author

BoboTiG commented Jun 22, 2021

ar-terme: https://fr.wiktionary.org/wiki/Muad-Dib

@BoboTiG
Copy link
Owner Author

BoboTiG commented Oct 22, 2022

Here are all words using that template:

 !! Missing 'ar-cf' template support for word 'cafir'
 !! Missing 'ar-cf' template support for word 'Coran'
 !! Missing 'ar-cf' template support for word 'casbah'
 !! Missing 'ar-cf' template support for word 'azulejo'
 !! Missing 'ar-cf' template support for word 'Ali'
 !! Missing 'ar-cf' template support for word 'Omar'
 !! Missing 'ar-cf' template support for word 'assorath'
 !! Missing 'ar-cf' template support for word 'alcade'
 !! Missing 'ar-cf' template support for word 'Imran'
 !! Missing 'ar-cf' template support for word 'Zahra'
 !! Missing 'ar-cf' template support for word 'adhan'
 !! Missing 'ar-cf' template support for word 'Ryad'
 !! Missing 'ar-cf' template support for word 'Mourad'
 !! Missing 'ar-cf' template support for word 'cabas'
 !! Missing 'ar-cf' template support for word 'Majlis'
 !! Missing 'ar-cf' template support for word 'djihad'
 !! Missing 'ar-cf' template support for word 'nadir'
 !! Missing 'ar-cf' template support for word 'génie'
 !! Missing 'ar-cf' template support for word 'ihram'
 !! Missing 'ar-cf' template support for word 'sura'
 !! Missing 'ar-cf' template support for word 'schème'

@BoboTiG BoboTiG self-assigned this Oct 29, 2022
@BoboTiG
Copy link
Owner Author

BoboTiG commented Oct 29, 2022

So, I converted appliquer() to Python. And finally, I just saw we also need to fetch https://fr.wiktionary.org/wiki/Cat%C3%A9gorie:Mod%C3%A8les_de_racine_en_arabe_du_Wiktionnaire.

Work is still ongoing ⏲️

@BoboTiG
Copy link
Owner Author

BoboTiG commented Oct 29, 2022

#1414 needs way more work than I expected.

As stated in the documentation:

Le modèle :
 1. transcrit le paramètre en arabe et fait un lien sur la page correspondante ;
 2. donne la translittération, avec lien sur la convention de translittération ;
 3. donne la définition courte du terme (modèle de schème passé en paramètre du modèle de racine).

For now, the PR only tackles the last point (3).

For (1) and (2), we also need to support https://fr.wiktionary.org/wiki/Mod%C3%A8le:ar-abiser I guess? It seems we cannot rely on the current arabiser() fonction: results are not good (maybe it is my implementation that is incorrect too, though).

It will be for later, I'll pause the work for a moment. @lasconic if you want to move on, you can use the PR as a team effort. In any cases, I'll find some time to make progress the next week, hopefully.

@lasconic
Copy link
Collaborator

@lasconic
Copy link
Collaborator

I took a deep look into the issue and #1414

1/ Lua a string are 1-indexed ... while python script are 0-indexed.
2/ The script is not enough, we need all the senses for the couple racine/scheme and probably the "forme".

I have 3 working correctly now. It's not given by appliquer.
Appliquer is supposed to give 2 and a call to arabiser with the result of appliquer should give 1..

Quite a bit of work and testing. I already spent some time on it. I will look further this week.

@lasconic
Copy link
Collaborator

With this PR, all the words from #643 (comment) are OK with check-word except for "schème" which uses other non supported templates (ar-racine/nom and ar-sch)

@lasconic
Copy link
Collaborator

The two big learning points about porting lua to python

  • 1-indexed vs 0-indexed strings
  • End of slices : sub(scheme, 1, position -1) --> scheme[:position]

@lasconic
Copy link
Collaborator

lasconic commented Feb 2, 2023

With this PR, all the words from #643 (comment) are OK with check-word except for "schème" which uses other non supported templates (ar-racine/nom and ar-sch)

schème is now OK with #1742 and the support of ar-racine/nom and ar-sch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants