|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug48711.patch (last revision 2011-02-26 17:48 UTC by jthijssen at noxlogic dot nl)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-06-29 04:06 UTC] brettz9 at yahoo dot com
[2009-07-26 19:36 UTC] jani@php.net
[2009-08-03 01:00 UTC] php-bugs at lists dot php dot net
[2011-02-26 19:54 UTC] jthijssen at noxlogic dot nl
[2011-02-26 20:18 UTC] pajoye@php.net
-Status: No Feedback
+Status: Feedback
-PHP Version: 6CVS-2009-06-29 (snap)
+PHP Version: 5.3
-Assigned To:
+Assigned To: pajoye
[2011-02-26 20:18 UTC] pajoye@php.net
[2011-02-26 20:24 UTC] jthijssen at noxlogic dot nl
[2011-05-06 09:03 UTC] brettz9 at yahoo dot com
[2013-02-18 00:33 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 07:00:01 2025 UTC |
Description: ------------ Below are a few bugs remaining in metaphone()--they are both useful and follow the original implementation. I haven't tested them (a newbie to C), but they seem to follow the precise pattern. 1) SCH: There seems to be no way for the 'traditional' argument in metaphone() to be triggered (it is called on line 44 with '1' which disables those items depending on it). Shouldn't it be set to '0' in the call on line 44 (or have the requirement removed entirely)? For example, line 314 is not working now for treating items like "ch" in "school" as "K". If there's no way to trigger the behavior (and the behavior should be standard), it seems to me best to remove the requirement. 2) CH: should check for first position 'C': if the next char is 'H' and then a vowel, it should produce 'K' To fix, in the switch beginning at 205 for initial character (e.g., could put before 219): case 'C': if (Next_Letter == 'H' && isvowel(After_Next_Letter)) { // 'character' Phonize('K'); w_idx += 2; } break; 3) GH: should be pronounced as 'K' if at the beginning (and if then followed by a vowel), not as 'F'; The case for initial 'G' on line 219 could be changed to: case 'G': if (Next_Letter == 'H' && isvowel(After_Next_Letter)) { // 'ghent' Phonize('K'); w_idx += 2; break; } else 4) GH: should be silent in the likes of 'knight'/'wright', not 'F' under the 2nd 'G' case (insert right after line 341): if (After_Next_Letter != '\0' && !isvowel(After_Next_Letter) { // 'gh' followed by consonant, as in 'knight' /* silent */ } else Thanks! Reproduce code: --------------- <?php echo metaphone('school'), '<br />'; echo metaphone('character'), '<br />'; echo metaphone('ghent'), '<br />'; echo metaphone('knight'), '<br />'; ?> Expected result: ---------------- SKL KRKTR KNT NT Actual result: -------------- SXL XRKTR FNT NFT