Last modified: 2013-03-12 08:50:36 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 T37457, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35457 - Allow callbacks also to make more complex replacements
Allow callbacks also to make more complex replacements
Status: RESOLVED WONTFIX
Product: MediaWiki extensions
Classification: Unclassified
Narayam (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-24 17:58 UTC by Junaid
Modified: 2013-03-12 08:50 UTC (History)
7 users (show)

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


Attachments

Description Junaid 2012-03-24 17:58:04 UTC
Currently Narayam allow only string as the third item in a rule for replacement. If callback functions are also allowed it will be possible to do more complex replacements.
Comment 1 Siebrand Mazeland 2012-03-24 18:30:55 UTC
What's a feature without a use case? Please provide a reason why.
Comment 2 Junaid 2012-03-24 18:54:40 UTC
Submitted the change code changes for this feature:
https://gerrit.wikimedia.org/r/3694

Waiting for review and merge.

(In reply to comment #1)
> What's a feature without a use case? Please provide a reason why.

One use case: people want to convert/create Unicode character from its code number.
For example, by typing '\u0D05\' it should be converted to 'അ'. Please see the code change for Malayalam transliteration in the commit, that function implements it.

Also callbacks can be used to combine several rules those share some behavior.

While writing the rules for some languages, I had met with rules that would have more tuned if this feature used. So this feature was in my mind from almost beginning of Narayam but just now only it got implemented.
Comment 3 Santhosh Thottingal 2012-03-25 04:22:19 UTC
(In reply to comment #2)
> Submitted the change code changes for this feature:
> https://gerrit.wikimedia.org/r/3694
> 
> Waiting for review and merge.
> 
> (In reply to comment #1)
> > What's a feature without a use case? Please provide a reason why.
> 
> One use case: people want to convert/create Unicode character from its code
> number.
> For example, by typing '\u0D05\' it should be converted to 'അ'. Please see the
> code change for Malayalam transliteration in the commit, that function
> implements it.

hexcode based inputting does not seem to be a valid usecase here. It is very advanced and it is for people know the hexcode of characters.

['\\\\u([0-9a-fA-F]{4})\\\\', '', narayam_ml_unicode_char_convert], // use callback
Here the conversion is nothing specific to Malayalam, because we allow any 4 character length hexcodes. Moreover the length 4 rule is unnecessary.

All operating systems allow direct unicode inputting. See http://en.wikipedia.org/wiki/Unicode_input#Hexadecimal_code_input. In Gnome, I can type using hexadecimal characters by control+shift+ u + <hexcode>.

> Also callbacks can be used to combine several rules those share some behavior.

I agree here.  Do you have any patters where this can be used?
Comment 4 Junaid 2012-03-25 08:56:33 UTC
(In reply to comment #3)
> hexcode based inputting does not seem to be a valid usecase here. It is very
> advanced and it is for people know the hexcode of characters.

It is not a necessary to have there.

> > Also callbacks can be used to combine several rules those share some behavior.
> 
> I agree here.  Do you have any patters where this can be used?

That I have to examine over the existing rulesets.

Anyway the callback feature is a must have in Narayam. Its implementation, programming logic, method signature can be tuned.
Comment 5 Amir E. Aharoni 2012-07-28 05:06:34 UTC
I am trying to revive this feature, at least for bugs like Bug 31904 and Bug 32029.
Comment 6 Andre Klapper 2013-02-13 12:36:04 UTC
Junaid: Are you still working on this? If not, please reset this bug report's ASSIGNED status and/or the assignee person. Thanks!
Comment 7 Junaid 2013-02-13 15:45:34 UTC
No, I am not. OK, I am resetting assignee to default.
Comment 8 Santhosh Thottingal 2013-03-12 08:50:36 UTC
Not planning to add this feature to Narayam. Already added to jquery.ime

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


Navigation
Links