Skip to content

Conversation

@lasconic
Copy link
Collaborator

@lasconic lasconic commented Oct 7, 2025

Fixes #2534
Also fix the handling of reverse_variants at the end of render.

BoboTiG added a commit that referenced this pull request Oct 9, 2025
Closes #2534.
Supersedes #2549.

Co-authored-by: Nicolas Froment <[email protected]>
@BoboTiG
Copy link
Member

BoboTiG commented Oct 9, 2025

Thanks, I applied part of the patch only.

About the reverse variant issue, I cannot see it. Is macOS behavior different than Linux about proxy objects? For example, this word properly shows reverse variants:

python -m wikidict ro --get-word="paronim" --raw

Output:

paronim /pa.ro'nim/ ''

 Substantiv
  1. 'cuvânt asemănător cu altul din punctul de vedere al formei, dar deosebit de acesta ca sens (și ca origine).'
  2. 'cuvânt care se aseamănă parțial cu altul din punctul de vedere al formei, dar se deosebește ca sens de acesta.'


'Din franceză <i>paronyme</i>, latină <i>paronymon</i>, originar format din greacă παρα + <b>ονομα</b> -onym'

[reverse variants] paronime, paronimele, paronimelor, paronimul, paronimului

@lasconic
Copy link
Collaborator Author

lasconic commented Oct 9, 2025

Coud you run the test.py from here : https://gist.github.com/lasconic/ba131c27f03d22165bc3687af2a62945
The output on mac is also in the gist. Can you post the output on Linux ? (you use Linux right ?)

@BoboTiG
Copy link
Member

BoboTiG commented Oct 10, 2025

you use Linux right ?

Yes.

@lasconic
Copy link
Collaborator Author

Thanks, I applied part of the patch only.

About the reverse variant issue, I cannot see it. Is macOS behavior different than Linux about proxy objects? For example, this word properly shows reverse variants:

python -m wikidict ro --get-word="paronim" --raw

That's ok on MacOS too. render() is not called by --get-word.

In render() the reverse_variants are set as "normal" variant for other words. I believe it doesn't work, even on Linux.
I put my simple test case in a github project and ran it on windows, linux and mac, and I have the same behavior on the 3 OSes : It doesn't work

See https://github.com/lasconic/test-python

@BoboTiG
Copy link
Member

BoboTiG commented Oct 10, 2025

(I posted the Linux output on the gist.)

OK I get it, thanks for the test script and the catch! :)

@BoboTiG
Copy link
Member

BoboTiG commented Oct 10, 2025

I'll push a fix slightly different, bcause I would like to keep the optimization bypassingthe call to dict().

@BoboTiG BoboTiG closed this in bb591ef Oct 10, 2025
@BoboTiG
Copy link
Member

BoboTiG commented Oct 10, 2025

Thanks for the eagle-eyed spotting of this one!

BoboTiG added a commit that referenced this pull request Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the "redirect" key for more reverse variants

2 participants