felipe Tue Jun 30 11:46:20 2009 UTC
Added files: (Branch: PHP_5_3)
/php-src/ext/standard/tests/strings bug48709.phpt
Modified files:
/php-src/ext/standard metaphone.c
Log:
- MFH: Fixed bug #48709 (metaphone and 'wh')
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/metaphone.c?r1=1.28.2.1.2.4.2.5&r2=1.28.2.1.2.4.2.6&diff_format=u
Index: php-src/ext/standard/metaphone.c
diff -u php-src/ext/standard/metaphone.c:1.28.2.1.2.4.2.5
php-src/ext/standard/metaphone.c:1.28.2.1.2.4.2.6
--- php-src/ext/standard/metaphone.c:1.28.2.1.2.4.2.5 Wed Feb 18 22:34:06 2009
+++ php-src/ext/standard/metaphone.c Tue Jun 30 11:46:20 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: metaphone.c,v 1.28.2.1.2.4.2.5 2009/02/18 22:34:06 felipe Exp $ */
+/* $Id: metaphone.c,v 1.28.2.1.2.4.2.6 2009/06/30 11:46:20 felipe Exp $ */
/*
Based on CPANs "Text-Metaphone-1.96" by Michael G Schwern
<[email protected]>
@@ -225,15 +225,14 @@
w_idx += 2;
}
break;
- /* WH becomes H,
+ /* WH becomes W,
WR becomes R
W if followed by a vowel */
case 'W':
- if (Next_Letter == 'H' ||
- Next_Letter == 'R') {
+ if (Next_Letter == 'R') {
Phonize(Next_Letter);
w_idx += 2;
- } else if (isvowel(Next_Letter)) {
+ } else if (Next_Letter == 'H' || isvowel(Next_Letter)) {
Phonize('W');
w_idx += 2;
}
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/bug48709.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/strings/bug48709.phpt
+++ php-src/ext/standard/tests/strings/bug48709.phpt
--TEST--
Bug #48709 (metaphone and 'wh')
--FILE--
<?php
/* Initial letter exceptions */
$exceptions = array(
'kn', // Drop first letter
'gn', // ditto
'pn', // ditto
'ae', // ditto
'wr', // ditto
'x', // s
'wh', // w
'wa' // w
);
foreach ($exceptions as $letter) {
printf("%s => %s\n", $letter, metaphone($letter));
}
?>
--EXPECT--
kn => N
gn => N
pn => N
ae => E
wr => R
x => S
wh => W
wa => W
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php