-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Smarter link-with-namespace filter #1494
Comments
List of namespaces on french wiktionary: https://fr.wiktionary.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces Probably the same for other languages. Spanish : https://es.wiktionary.org/w/api.php?action=query&meta=siteinfo&siprop=namespaces So we could create a script to get the namespaces, and only filter known namespaces... |
With 1b09061 it will be easier to use locale-specific code then. |
Mmm ok, I would have pass the language code in clean to get the correct array of namespace. If I understand correctly, here we will need to write a "clean" function per language with the current clean being the default. Correct ? |
I didn't want to add the new argument to |
I have something more or less working but I'm scratching my head on these two (on top of [[Stó:lō]]) or course. Not sure how to handle this yet [[Fichier:Blason ville fr Petit-Bersac 24.svg|vignette|120px|'''Base''' d’or ''(sens héraldique)'']] |
Would you like to open a draft PR so that I can try too? |
There you go.
|
1/ You're right, we could move the file to |
OK I made progress, will propose a patch on the PR. |
1/ After more thinking, keeping namespaces in scripts would ease our work when adding new locales, and it will handle updates automatically. I would say we can keep it as-is. The only tiny detail is about using |
OK but then it's less easy to implement 2 categories of namespaces, the one with text and the one without. |
I believe it breaks
|
Can you share the word using it 🙏 ? |
Ok. I have a simple solution... It passes all the tests already in the code... I must miss something. |
Ok. Already found a problem ... https://fr.wiktionary.org/wiki/Daghestan uses the File namespace ... A solution could be to always add File and Category, the english namespaces in the pattern list. |
👍 |
Wikicode:
Output:
Expected:
The wikicode is stripped at
ebook-reader-dict/wikidict/utils.py
Line 391 in fdca309
Not sure what to do for now, just reporting the issue.
The text was updated successfully, but these errors were encountered: