wikimedia-gadgets / afc-helper

A tool for reviewing Articles for Creation submissions on the English Wikipedia
https://en.wikipedia.org/wiki/Wikipedia:AFCH
GNU General Public License v3.0
37 stars 80 forks source link

Integrate Novem Linguae's DraftCleaner script #208

Open enterprisey opened 2 years ago

enterprisey commented 2 years ago

https://en.wikipedia.org/wiki/Wikipedia_talk:WikiProject_Articles_for_creation/Archive_48#Enhancement_request_for_AFCH_script

NovemLinguae commented 2 years ago

Related #200

I've made good progress on it since we last chatted. Roughly guessing, I'd say its false positive rate is down from 25% to 10%. I continue to add test cases as I find errors, and I've fixed the easy ones.

image

It's structured as two classes: DraftCleaner and StringFilter. It can be invoked easily with the following code:

let dc = new DraftCleaner();
wikicode = dc.cleanDraft(wikicode, namespaceNumber, titleWithNamespaceAndSpaces);

Any thoughts on specific implementation details? Should the AFCH user press a button to use it or should it run automatically?

enterprisey commented 2 years ago

LOL I missed the other issue, sorry about that.

Having it run automatically is a pretty interesting idea, worth having a WT:WPAFC discussion over. Maybe we could have a preference to do that. For myself, I'd support either a preference or always running it.

I haven't seen the code yet, so no comments on that front, but from a really, really quick scan it looks fine to me. Sometime after I clear out the open PRs, I'm going to push another update to the script; I think it would be nice to also get DraftCleaner in there as well, if that sounds like a reasonable timeframe?

NovemLinguae commented 2 years ago

Maybe it's best go with a preference, since there's always likely to be some bugs, and they could "bug" people. Sorry, that was a terrible pun :)

It should be quite easy to integrate. Just need to drop in 2 classes, then invoke. Just contact me when you're ready.