wyndow/fuzzywuzzy

Difference with python library

Opened this issue · 2 comments

Hi,

great library but I notice difference compared to the python library. I also use it in nodjs and the result there are same as the python library but this is not the case in PHP.
This is the example result using python library

choices = ["ACOB751", "ACAB5861"]
process.extract("ACO8751", choices, scorer=fuzz.partial_ratio)
[('ACOB751', 86), ('ACAB5861', 53)]

And same example in PHP

$choices = ["ACOB751", "ACAB5861"];
$this->fuzzProcess->extract(
    $choices,
    "ACO8751",
    null,
    [$this->fuzz, 'partialRatio']
);
Collection {#1081
    -elements: array:2 [
        0 => array:2 [
            0 => "ACOB751"
            1 => 42
        ]
        1 => array:2 [
            0 => "ACAB5861"
            1 => 30
        ]
    ]
}

Any advice? Thanks.

Find out that tokenSortRatio give slightly closer values but still not same.

Same issue here. Did you managed to find a solution? The tokenSortRatio algorithm doesn't work for me.