User talk:WindBOT/Filters

From Team Fortress Wiki
< User talk:WindBOT
Revision as of 15:13, 17 November 2012 by Robin0van0der0vliet (talk | contribs) ("tradeable" > "tradable": new section)
Jump to: navigation, search

Uber and Über

Time out here, you'll have to make sure it doesn't affect things like external links. Same goes for images unless you make it so that it moves them to the proper namespace at the same time. -- Vi3trice (talk) 15:08, 6 August 2010 (UTC)

It is all taken care of. :3 the wordFilter function wraps the regex inside more lookaround checks to see if it's not within a link. — Wind 15:22, 6 August 2010 (UTC)
To be more precise, the page's content is first filtered out of templates and links; then, filters are applied to this "clean" text, and then the templates and links are put back in. — Wind 15:25, 6 August 2010 (UTC)

Regex

I was good at regex once:

Find:                                                             Replace:

\[http://en.wikipedia.org/wiki/:*([^][<>"\s]+) ([^]]+)\]          [[:$1|$2]]
\b(?<!-)crit(ical)?(s)?\b                                         Crit$1$2
\bcritical hit(s?)\b                                              Critical hit$1
\bmini[ -]?crit(ical)?(s)?\b                                      Mini-crit$1$2
\b[Ss]entry([ _])[Gg]un\b                                         Sentry$1Gun

All case sensitive. I have a bunch more, as far as I know they all work perfectly. -- Pilk (talk) 22:28, 7 August 2010 (UTC)

Nice! I believe Wind said we could add things ourselves, so you should whack them in yourself. -- Smashman... (ts) 22:33, 7 August 2010 (UTC)
It's really not that simple, running those would destroy things like file names that are still lowercase. That's why there's this wordFilter function to do it more cleanly and hopefully without recurring to a possibly too aggressive regex. As for wikipedia links, I am currently working on filtering links the same way words are filtered, so while the wikipedia case could be done with a regex, I'd rather wait until Seb26 replies to my message asking what cases should be handled exactly. — Wind 22:34, 7 August 2010 (UTC)
You can't make it ignore links/images/nowiki? -- Pilk (talk) 22:37, 7 August 2010 (UTC)
Of course, I'm just saying that running those regexes directly on pages would be harmful. The critical hits/sentry gun cases should be taken care of now, though~ — Wind 22:39, 7 August 2010 (UTC)

Adding Maps filter

Gravelpit to Gravel Pit, Doublecross to Double Cross, Badwater to Badwater Basin, etc., excluding filenames? (in addition to capitalization of map names) -- Nineaxis Duck Gib.png 05:33, 10 August 2010 (UTC)

The bot is changing Gravel Pit to Gravelpit, rather than the reverse. I would fix it, but I have nfi how to do it without fucking things up, so. seb26 (talk) 11:39, 12 August 2010 (UTC)
Yeah, the official names are Gravel Pit, Double Cross and Badwater Basin. Use these please. -- Smashman... (ts) 12:42, 12 August 2010 (UTC)
Fix'd — Wind 18:00, 19 August 2010 (UTC)

Mini-Crit

Smashman's given me the go-ahead for changing Mini-crit to Mini-Crit. Be sure to change the filters, I'm commenting out the one that would revert any edits I make to mini-crit. --Firestorm 16:33, 12 August 2010 (UTC)

Fix'd — Wind 18:00, 19 August 2010 (UTC)

Sentry Gun

Disable the sentry filter due to this diff. -- Pilk (talk) 14:59, 19 August 2010 (UTC)

Fix'd — Wind 18:00, 19 August 2010 (UTC)

Item infobox filters

If anyone is willing to watch over the diffs then just revert my edit. I disabled the filters because I didn't want to leave the bot running them overnight if it wasn't being checked on. seb26 [talk] 09:58, 14 November 2010 (UTC)

Screenshots Images Category - Blacklisted?

I wonder why is the bot removing categories from files categorized in the "Category:Screenshot_images" category. There's nothing wrong about it, as I believe. :S ~Sonic 02:16, 26 March 2011 (UTC)

Where did it do that? — Wind 02:20, 26 March 2011 (UTC)

Korean-specific word replacement request

Hi!

Recently, our members of STS decided to change classname Soldier in Korean from 솔져 to 솔저. So, it is necessary to replace every single word "솔져"(except quotation marks) with "솔저" in zhis wiki!

I wrote a chunk of code, referring other existing codes on Filters page; please review the following code and apply if it is correct:

addSafeFilter(
    dumbReplace(
        u'솔져', # from
        u'솔저' # to
    ), language='ko'
 )

Thanks! — Cyrus Hackford (T / C) // 02:43, 27 October 2011 (PDT)

Have the changes been pushed to the game yet? If they're in STS, it's best to wait before doing such a massive replace. Also, there is a better solution: Replace them all by {{Class name|Soldier}}, which will show an auto-translated version of the class name "Soldier" as defined in {{dictionary/classes}}. Then, any edit to {{dictionary/classes}} will propagate to all pages in one shot~ — Wind 10:42, 27 October 2011 (PDT)
Yeap, the change is now in effect in-game. Of course using that Dictionary wrapper is the best solution, but there are many "un-wrapped" texts out there. :( — Cyrus Hackford (T / C) // 11:34, 27 October 2011 (PDT)
Well alright then, but I think it'd be better to use wordFilter instead of dumbReplace, as dumbReplace is a really, really dumb replace. For example, dumbReplace('hell', 'heaven') applied to the sentence Oh hello there would give Oh heaveno there. However, wordFilter only replaces words when they are whole words, so that hell in hello wouldn't be replaced. Would that work for Korean though? Are all words always separated with regular spaces or latin-like punctuation signs, such that wordFilter would identify them as such? — Wind 11:42, 27 October 2011 (PDT)
Unfortunately, no. Korean grammar forces any nominative postpositions to be attached to prior nominative noun; so 솔져의, 솔져가, 솔져에게, 솔져는, 솔져를, and so on should all be changed as well. Therefore, dumbReplace is the very function we need to use. Thanks for your hearty help! — Cyrus Hackford (T / C) // 11:58, 27 October 2011 (PDT)
Very well then, it's been added. Keep in mind that the bot doesn't actively crawl the wiki, it just runs over pages that get recently edited. If you want to force it to look at certain pages or categories of pages to speed up the process, you can add them hereWind
Your gracious help will eventually crank up the general Korean wiki-readers' convenience in any way! Thank you again! — Cyrus Hackford (T / C) // 12:11, 27 October 2011 (PDT)
Why, welcome :3 It's not every day that I get a request with already-provided code, as most people don't bother reading the documentation. By the way, next time ask me on IRC, it makes this kind of conversation much easier than with awkward wikicode. You should join it any time anyway, is a good place. Thanks~ — Wind 12:14, 27 October 2011 (PDT)

Misc items

Hey, can you please add this filters to the German (de) wiki?

Diverser Gegenstand, diverser Gegenstand, sonstiger Gegenstand -> Sonstiger Gegenstand
Diverse Gegenstände, diverse Gegenstände, sonstige Gegenstände -> Sonstige Gegenstände

Thank you. --Picard talk 07:13, 10 December 2011 (PST)

Done, I hope those accents vs. lack of accents and uppercase vs lowercase were what they were supposed to be — Wind 10:56, 10 December 2011 (PST)

More Dutch filters

Could "officiëel" and "officieël" both be converted to "officieel" on the Dutch pages, because that is the correct spelling and it is sometimes wrong spelled. — Robin0van0der0vliet (talk | contributions) - 08:31, 7 October 2012 (PDT)

Pictogram tick.png DoneWind 12:55, 7 October 2012 (PDT)
I forgot about converting "officiele" to "officiële" (an attributive adjective), which does need an diaeresis.
addSafeFilter( # Requested by Robin0van0der0vliet
    wordFilter(u'officieel', u'offici[eë][eë]l', keepcapitalization=True),
    wordFilter(u'officiële', u'offic[iï]ele', keepcapitalization=True),
    language='nl'
)
Pictogram tick.png DoneWind 12:07, 4 November 2012 (PST)
And could you maybe add redirects for the Botkiller weapons, I mean redirecting "Diamond Botkiller Scattergun/nl" to "Scattergun/nl" etc, now only the English, Russian and Chinese version has this and this is too much work to do manual. — Robin0van0der0vliet (talk | contributions) - 12:01, 4 November 2012 (PST)
No, that's a one-off thing that would be best suited for a script if it had to be done. But does it have to be done at all? I'm not sure if those redirects are worth creating — Wind 12:07, 4 November 2012 (PST)
You added an filter double now. ;)
And I saw some broken links to those Botkillers, first the botkiller table had those broken links too, but that is already updated. — Robin0van0der0vliet (talk | contributions) - 12:15, 4 November 2012 (PST)

"tradeable" > "tradable"

Could this filter be added to the Common misspellings filter beneath "Natascha", since this filter only need to be applied to English pages?

wordFilter('tradable', 'tradeable', keepcapitalization=True)

Thanks! — Robin0van0der0vliet (talk | contributions) - 07:13, 17 November 2012 (PST)