https://bugzilla.wikimedia.org/show_bug.cgi?id=24409

           Summary: A brand new conversion core for Language Converter
           Product: MediaWiki
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: Normal
         Component: Language converter
        AssignedTo: [email protected]
        ReportedBy: [email protected]


Created an attachment (id=7571)
 --> (https://bugzilla.wikimedia.org/attachment.cgi?id=7571)
a initial patch

I have reprogramed the core algorithm of Language Converter just now. The
conversion core used an algorithm named "forwards maximum match algorithm"
which was implemented in PHP by a function strtr(). The original strtr (in the
C source, it's php_strtr_array) is slow because it simply finds out maxlen and
minlen of all keys, then test the text to be converted from top to bottom, from
long to short without any distinction.

I improved this algorithm. Fisrt I create a "quick table" to store the first
char of a key and all possible length of the key. The quick table can be
cached. Then I can simply check the quick table with the first char of the
remain text, and just need to test all possible length of such first char. As a
result, the performance improved.

Here I submit a initial patch for further testing.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to