Skip to content

Commit 79c15b6

Browse files
committed
Remove numpy dependency
1 parent 6384ef9 commit 79c15b6

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
numpy

similarity/damerau.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
import numpy as np
22-
2321
from .string_distance import MetricStringDistance
2422

2523

@@ -38,7 +36,7 @@ def distance(self, s0, s1):
3836
da[s0[i]] = str(0)
3937
for i in range(len(s1)):
4038
da[s1[i]] = str(0)
41-
h = np.zeros((len(s0) + 2, len(s1) + 2))
39+
h = [[0] * (len(s1) + 2) for _ in range(len(s0) + 2)]
4240
for i in range(len(s0) + 1):
4341
h[i + 1][0] = inf
4442
h[i + 1][1] = i

0 commit comments

Comments
 (0)