Discussion utilisateur:Raoli
Ajouter un sujetBienvenue
[modifier]Wikiquote est un projet libre de collecte de citations réalisé actuellement dans plus de 80 langues différentes de par le monde. Pour vous aider à tout moment, chaque page du site possède à gauche un lien vers l'aide de Wikiquote.
N'hésitez pas à consulter les premières indications pour modifier et rédiger des pages dans Wikiquote avec la syntaxe appropriée. Un guide est à votre disposition.
| |
Sur une page de discussion, n'oubliez pas de signer vos messages, en tapant ~~~~ . Mais faites aussi attention à ne pas insérer votre signature dans des articles de citations, leurs auteurs sont connus par le biais de l'historique.
| |
Si vous le souhaitez, vous pouvez vous présenter sur le forum des nouveaux arrivants, qui est aussi un bon endroit pour poser des questions. Et pourquoi ne pas créer votre page utilisateur ? Vous pouvez y indiquer quelles langues vous parlez, d'où vous venez, quels sont vos centres d'intérêt…
|
Hello,
You can find the code on Utilisateur:RimBot/count-quotes.py. As you can see on any article on fr.wikiquote, we use the {{citation}} template to enclose quotes. This makes the article a bit harder to edit, but we can change the quote formatting with a simple template modification.
count-quotes.py parses the articles (see the workon() method), looking for the quote template ({{citation}} in fr.wikiquote). Every quote is then parsed (known formatting templates are stripped etc., see parse_templates()), stripped of any non-alphanumeric characters and stored in a dictionary (globalvar.quotes), the key being a hashed version of the stripped quote. When all articles have been parsed, it removes duplicates (using the hashes, see generate_output()) and generate the output (either the number of quotes, the number of pages with at least one quote, or a full fledged statistics page).
I wrote this code quite a long time ago, and a good cleanup would be necessary. But it still works anyway, so if you want to use it, feel free. Unfortunately my server has been down for a few days due to networking operator problems, but I can add other wikis to RimBot when it's back on.
Feel free to ask any further question if you have trouble understanding the code. Manuel Menal (discussion) 4 avril 2012 à 22:00 (CEST)
- Counting quotes would be easy with the layout you describe. You would need to just change the existing code and replace the part where it looks for {{citation}} with a lookup for '*', and edit the quote parsing function to remove the textes enclosed by {{NDR}} and ().
- The thing is, I've had a look at different it.wq articles, and it seems to me that many articles do not really follow this layout. it:Philip Levine has two-line quotes with the first line beginning with a '*' and the second line beginning with a ':'. it:Marino Freschi has incipits, which are quotes (AIUI), but do not begin with a '*'. it: Seabury Quinn has quotes which do not begin with a '*'.
- You'd also need to remove the text in the Bibliografia sections (which also begin with '*' but aren't quotes) and in the Alti progetti or Note sections. One would have to list all these sections names to exclude them.
- So: in theory, it's quite simple. But it might be a lot more difficult than it seems, because as you do not use a quote template, identifying quotes can be a bit hard. Manuel Menal (discussion) 5 avril 2012 à 17:06 (CEST)
Merci
[modifier]Bonjour, et merci pour ta vigilance. Grazie per la tua vigilanza. Lykos (discussion) 20 janvier 2016 à 10:52 (CET)