afch-rewrite icon indicating copy to clipboard operation
afch-rewrite copied to clipboard

Integrate Novem Linguae's DraftCleaner script

Open enterprisey opened this issue 3 years ago • 3 comments

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

enterprisey avatar Jan 12 '22 08:01 enterprisey

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?

NovemLinguae avatar Jan 12 '22 09:01 NovemLinguae

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?

enterprisey avatar Jan 15 '22 00:01 enterprisey

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.

NovemLinguae avatar Jan 15 '22 02:01 NovemLinguae