Difference between revisions of "User talk:WindBOT/Filters"

From Team Fortress Wiki
Jump to: navigation, search
m (Korean-specific word replacement request)
Line 74: Line 74:
 
:::::: Your gracious help will eventually crank up the general Korean wiki-readers' convenience in any way! Thank you again! {{User:Cyrus H./sig}} 12:11, 27 October 2011 (PDT)
 
:::::: Your gracious help will eventually crank up the general Korean wiki-readers' convenience in any way! Thank you again! {{User:Cyrus H./sig}} 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~ — [[User:WindPower|<span style="font-weight:bold;">Wind</span>]] 12:14, 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~ — [[User:WindPower|<span style="font-weight:bold;">Wind</span>]] 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. --[[User:Picard|Picard]] <sup>[[User talk:Picard|talk]]</sup> 07:13, 10 December 2011 (PST)

Revision as of 15:13, 10 December 2011

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)