Template talk:str sub

Definition from Wiktionary, the free dictionary
Jump to: navigation, search
TK archive icon.svg

The following discussion has been moved from Wiktionary:Requests for deletion.

This discussion is no longer live and is left here as an archive. Please do not modify this conversation, though feel free to discuss its conclusions.


Template:str find
Template:str index
Template:str left
Template:str ≥ len
Template:str sub

Ridiculously heavy templates imported from Wikipedia that attempt to manipulate strings by using padright tens of thousands of times. --Yair rand (talk) 22:08, 7 February 2011 (UTC)

I'd rather keep them, and use them for templates of categories. --Daniel. 22:18, 7 February 2011 (UTC)
As a side note, I would also be happy if alternatively mw:Extension:StringFunctions could be installed here. --Daniel. 22:20, 7 February 2011 (UTC)
The devs have made it pretty clear that none of the Wikimedia wikis are ever going to get string functions. --Yair rand (talk) 22:24, 7 February 2011 (UTC)
By my understanding, that's only partly true. The devs take issue with some specific aspects of that extension, but they're not opposed to the entire concept of string-functions. IINM, it's considered likely that a significant subset of its functions will eventually be incorporated into the ParserFunctions extension (which is installed here). —RuakhTALK 22:30, 7 February 2011 (UTC)
Delete {{str find}}, {{str index}}, and {{str sub}}. (I'd be fine with deleting the other two as well, but they actually aren't very expensive, so I don't terribly mind if we keep them.) —RuakhTALK 22:21, 7 February 2011 (UTC)
Incidentally, because of the way they're implemented, these templates are also quite limited: {{str find}} can only search the first 50 characters (which limit can be raised, but only by making the template commensurately more expensive), and {{str index}} and {{str sub}} only support a very limited character set (which set can be made less limited, but only by making the template commensurately more expensive). —RuakhTALK 23:47, 7 February 2011 (UTC)
Strong support of what Ruakh said. DAVilla 19:52, 22 February 2011 (UTC)
Template:str len

Keep. I've been using this extensively to add inflection tables. It removes the last letters of a word to produce a stem for inflection. For example, in the word hevonen, the following:

{{fi-decl-nainen|{{subst:padright:|{{subst:#expr:{{subst:str len|{{subst:PAGENAME}}}}-3}}|{{subst:PAGENAME}}}}}}

Produces: {{fi-decl-nainen|hevo}}

I had valuable help on this from Yair rand. ~ heyzeuss 22:15, 8 February 2011 (UTC)

Well, if we can guarantee any of these templates only be used substed, I wouldn't mind keeping it. I suppose using the subst: trick that ensures that, protecting the page, and adding notes to the talkpage and documentation indicating that the templates must remain nontranscludable will do.​—msh210 (talk) 22:22, 8 February 2011 (UTC)
I'd be O.K. with that as well. —RuakhTALK 23:12, 8 February 2011 (UTC)
Thank you kindly. That would have pulled the rug out from under me!   :)   ~ heyzeuss 06:12, 9 February 2011 (UTC)
Template:wide image/sandbox
BTW, also delete {{str len}} and delete or fix {{wide image/sandbox}}. —RuakhTALK 22:29, 7 February 2011 (UTC)
I've added those headers, above, now.​—msh210 (talk) 22:34, 7 February 2011 (UTC)
Delete str find, str index, str sub, and str len, per others' comments.​—msh210 (talk) 22:34, 7 February 2011 (UTC) ← This opinion has been qualified; see my comments, above, of 22:22, 8 February 2011 (UTC).​—msh210 (talk)
Keep Template:wide image/sandbox, but do not use in NS:0. It's a sandbox. Mglovesfun (talk) 23:07, 13 February 2011 (UTC)