Bug #60314 [NEW]: Metaphone returns fewer phonemes than defined

From: Date: Wed, 16 Nov 2011 20:52:15 +0000
Subject: Bug #60314 [NEW]: Metaphone returns fewer phonemes than defined
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-165271@lists.php.net to get a copy of this message
From:             
Operating system: Windows XP SP3
PHP version:      5.3.8
Package:          Unknown/Other Function
Bug Type:         Bug
Bug description:Metaphone returns fewer phonemes than defined

Description:
------------
Under certain conditions, the metaphone function returns fewer phonemes
than the $phonemes parameter specifies.  This is an edge-case occurrence
when dealing with an X near the end of the specified phoneme count.

For the test script, the following phoneme transformations take place:
A -> A
X -> KS
C -> K

Test script:
---------------
<?php

var_dump('axccc', 2);  // Should produce AKS
var_dump('axccc', 3);  // Should produce AKSK as "X->KS" is one phoneme
var_dump('axccc', 0);  // Should produce AKSKKK

?>

Expected result:
----------------
string(3) "AKS"
string(4) "AKSK"
string(6) "AKSKKK"

Actual result:
--------------
string(3) "AKS"
string(3) "AKS"
string(6) "AKSKKK"

-- 
Edit bug report at https://bugs.php.net/bug.php?id=60314&edit=1
-- 
Try a snapshot (PHP 5.4):            https://bugs.php.net/fix.php?id=60314&r=trysnapshot54
Try a snapshot (PHP 5.3):            https://bugs.php.net/fix.php?id=60314&r=trysnapshot53
Try a snapshot (trunk):              https://bugs.php.net/fix.php?id=60314&r=trysnapshottrunk
Fixed in SVN:                        https://bugs.php.net/fix.php?id=60314&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60314&r=needdocs
Fixed in release:                    https://bugs.php.net/fix.php?id=60314&r=alreadyfixed
Need backtrace:                      https://bugs.php.net/fix.php?id=60314&r=needtrace
Need Reproduce Script:               https://bugs.php.net/fix.php?id=60314&r=needscript
Try newer version:                   https://bugs.php.net/fix.php?id=60314&r=oldversion
Not developer issue:                 https://bugs.php.net/fix.php?id=60314&r=support
Expected behavior:                   https://bugs.php.net/fix.php?id=60314&r=notwrong
Not enough info:                     https://bugs.php.net/fix.php?id=60314&r=notenoughinfo
Submitted twice:                     https://bugs.php.net/fix.php?id=60314&r=submittedtwice
register_globals:                    https://bugs.php.net/fix.php?id=60314&r=globals
PHP 4 support discontinued:          https://bugs.php.net/fix.php?id=60314&r=php4
Daylight Savings:                    https://bugs.php.net/fix.php?id=60314&r=dst
IIS Stability:                       https://bugs.php.net/fix.php?id=60314&r=isapi
Install GNU Sed:                     https://bugs.php.net/fix.php?id=60314&r=gnused
Floating point limitations:          https://bugs.php.net/fix.php?id=60314&r=float
No Zend Extensions:                  https://bugs.php.net/fix.php?id=60314&r=nozend
MySQL Configuration Error:           https://bugs.php.net/fix.php?id=60314&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#165271) next »