Last modified: 2014-11-17 09:21:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T19999, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 17999 - New parser function for reversing order of characters
New parser function for reversing order of characters
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
ParserFunctions (Other open bugs)
unspecified
All All
: Lowest enhancement with 11 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-16 08:18 UTC by ABX
Modified: 2014-11-17 09:21 UTC (History)
10 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Parser function to implement string reversal (18.87 KB, patch)
2009-04-07 00:18 UTC, wclark
Details
Cleaner patch to implement string reversal parser function (18.53 KB, patch)
2009-04-07 00:25 UTC, wclark
Details
Clean patch (1.66 KB, patch)
2009-04-07 01:30 UTC, OverlordQ
Details

Description ABX 2009-03-16 08:18:31 UTC
Hi! I would like to have available (mainly for wiktionaries) function {{#reverse:SOME_TEXT}} which returns given text in reversed order of characters:

Examples:
{{#reverse:SOME_TEXT}} -> TXET_EMOS
{{#reverse:bugfix}} -> xifgub
{{#reverse:black dog}} -> god kcalb

Purpose:
I want to have indexes (categories) sorted according to characters placed at the end of page name (or at the end of any given text). I want to write [[Category:English words|{{PAGENAME}}]] for normal category as usually and [[Category:English words (a tergo)|{{#reverse:{{PAGENAME}}}}]].

Rationale:
Classic dictionaries have extra bonus called "index a tergo". That's index where terms are places according to the end of term. Words like "comeback", "hatchback", "playback" are next to each other. In such index North America, South America and Central America and all cities of the world named America are together. This is handy for ethymologists when they look for words with same postfix but also for users who do not remember begining of the term.

ABX
Comment 1 Piotr Kubowicz 2009-03-16 11:58:07 UTC
Would it be really useful? I would rather think of writing something like [[Special:SuffixIndex]], working like [[Special:PrefixIndex]].
Comment 2 ABX 2009-03-16 12:56:56 UTC
[[Special:PrefixIndex]] AFAIK doesn't allow browsing categories and browsing categories (ie. only one language) according to postfix is what makes value of such index for single language specialists. There is already field for postfix in [[Special:AllPages]] hovewer this also doesn't allow selection of single category.
Comment 3 Andrew Garrett 2009-03-16 12:58:53 UTC
(In reply to comment #1)
> Would it be really useful? I would rather think of writing something like
> [[Special:SuffixIndex]], working like [[Special:PrefixIndex]].
> 

That couldn't be done for performance reasons.
Comment 4 wclark 2009-04-07 00:18:23 UTC
Created attachment 5998 [details]
Parser function to implement string reversal
Comment 5 wclark 2009-04-07 00:19:38 UTC
Comment on attachment 5998 [details]
Parser function to implement string reversal

stupid eclipse... wtf is with the character encoding nonsense and .buildpath
Comment 6 wclark 2009-04-07 00:25:49 UTC
Created attachment 5999 [details]
Cleaner patch to implement string reversal parser function

This one will probably still contain character encoding nonsense but is missing the stupid eclipse .buildpath file
Comment 7 OverlordQ 2009-04-07 01:30:07 UTC
Created attachment 6000 [details]
Clean patch

Another thing to note is that strrev clobbers multibyte characters.

Hopefully this fixes both issues.
Comment 8 Andrew Garrett 2009-04-07 06:43:01 UTC
It should be noted that due to the potential for abuse, we're at least wary of (possibly flat-out opposed to) new parser functions with the intention of providing string manipulation abilities in wikitext.

I should warn you that it is possible (even likely) that this patch will sit waiting for review for another few years, until we figure out which direction we are going with respect to string manipulation in wikitext.
Comment 9 Dariusz Jażdżyk 2009-04-20 01:17:17 UTC
It's very easy to implementation. <bdo dir="rtl">SOME_TEXT</bdo> view: TXET_EMOS. Unfortunately, now tag <bdo> is blocked.
Comment 10 Chad H. 2009-04-20 01:28:58 UTC
Between adding a suffix index (which may or may not ever be feasible, but is certainly covered by other bugs), adding <bdo> (which might be covered under the expand allowed HTML list bug), I can't see a huge use case here. Partially because of the reasons I mentioned, and partially because of comment #8, I'm going ahead and being bold with a WONTFIX.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links