cknill / patl

Automatically exported from code.google.com/p/patl
0 stars 0 forks source link

levenshtein_distance bug on vector #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use std::vector<int> for uxn::patl::levenshtein_distance
2. vector1: add vector1.resize(9,2). lookup: vector2: 1. vector2.resize(9,2) 
and vector2.resize(32, 4).
3. lookup vector2 with distance = 10.

What is the expected output? What do you see instead?
expected: not found.
output: found with distance = 14757395258967641292. (looks like uninit)

What version of the product are you using? On what operating system?
version129

Please provide any additional information below.
Looks like uninit.
Also, If I use std::string, std::wstring. It's working properly.

Original issue reported on code.google.com by dxj19831...@gmail.com on 21 Feb 2012 at 2:51

GoogleCodeExporter commented 9 years ago
reason: inside levenshein_distance, partial_base.hpp, line 134, we check with 
terminator inside, which cause this problem, as it assume terminator to be "\0".

Original comment by dxj19831...@gmail.com on 21 Feb 2012 at 3:41

GoogleCodeExporter commented 9 years ago
if someone needs to walk around, apply this patch on 129.
Func:
make sure not to reply on terminator only. (Still compatible with old 
behaviors).

Original comment by dxj19831...@gmail.com on 21 Feb 2012 at 6:05

Attachments:

GoogleCodeExporter commented 9 years ago
ok. apply this patch after last one.

There is size problem.

Original comment by dxj19831...@gmail.com on 21 Feb 2012 at 6:45

Attachments: