|
75 | 75 | * BUT: The algorithm seems to be advantageous only in the case of very |
76 | 76 | * large sets -- if my estimates are correct (the article itself is quite |
77 | 77 | * `asymptotic'), say 10^5 at least. On smaller sets either one would get |
78 | | - * only an extermely rough median estimate, or the number of distance |
| 78 | + * only an extremely rough median estimate, or the number of distance |
79 | 79 | * computations would be in fact higher than in the dumb O(n^2) algorithm. |
80 | 80 | * |
81 | 81 | * - Improve setmedian() speed with triangular inequality, see: |
|
123 | 123 | #include <assert.h> |
124 | 124 | #include "Levenshtein.h" |
125 | 125 |
|
126 | | -/* FIXME: inline avaliability should be solved in setup.py, somehow, or |
| 126 | +/* FIXME: inline availability should be solved in setup.py, somehow, or |
127 | 127 | * even better in Python.h, like const is... |
128 | 128 | * this should inline at least with gcc and msvc */ |
129 | 129 | #ifndef __GNUC__ |
@@ -2263,7 +2263,7 @@ lev_edit_distance(size_t len1, const lev_byte *string1, |
2263 | 2263 | } |
2264 | 2264 | else { |
2265 | 2265 | /* in this case we don't have to scan two corner triangles (of size len1/2) |
2266 | | - * in the matrix because no best path can go throught them. note this |
| 2266 | + * in the matrix because no best path can go through them. note this |
2267 | 2267 | * breaks when len1 == len2 == 2 so the memchr() special case above is |
2268 | 2268 | * necessary */ |
2269 | 2269 | row[0] = len1 - half - 1; |
@@ -2442,7 +2442,7 @@ lev_u_edit_distance(size_t len1, const lev_wchar *string1, |
2442 | 2442 | } |
2443 | 2443 | else { |
2444 | 2444 | /* in this case we don't have to scan two corner triangles (of size len1/2) |
2445 | | - * in the matrix because no best path can go throught them. note this |
| 2445 | + * in the matrix because no best path can go through them. note this |
2446 | 2446 | * breaks when len1 == len2 == 2 so the memchr() special case above is |
2447 | 2447 | * necessary */ |
2448 | 2448 | row[0] = len1 - half - 1; |
@@ -5372,7 +5372,7 @@ lev_opcodes_check_errors(size_t len1, size_t len2, |
5372 | 5372 | if (!nb) |
5373 | 5373 | return 1; |
5374 | 5374 |
|
5375 | | - /* check completenes */ |
| 5375 | + /* check completeness */ |
5376 | 5376 | if (bops->sbeg || bops->dbeg |
5377 | 5377 | || bops[nb - 1].send != len1 || bops[nb - 1].dend != len2) |
5378 | 5378 | return LEV_EDIT_ERR_SPAN; |
@@ -5627,7 +5627,7 @@ editops_from_cost_matrix(size_t len1, const lev_byte *string1, size_t off1, |
5627 | 5627 | j = len2 - 1; |
5628 | 5628 | p = matrix + len1*len2 - 1; |
5629 | 5629 | while (i || j) { |
5630 | | - /* prefer contiuning in the same direction */ |
| 5630 | + /* prefer continuing in the same direction */ |
5631 | 5631 | if (dir < 0 && j && *p == *(p - 1) + 1) { |
5632 | 5632 | pos--; |
5633 | 5633 | ops[pos].type = LEV_EDIT_INSERT; |
@@ -5816,7 +5816,7 @@ ueditops_from_cost_matrix(size_t len1, const lev_wchar *string1, size_t o1, |
5816 | 5816 | j = len2 - 1; |
5817 | 5817 | p = matrix + len1*len2 - 1; |
5818 | 5818 | while (i || j) { |
5819 | | - /* prefer contiuning in the same direction */ |
| 5819 | + /* prefer continuing in the same direction */ |
5820 | 5820 | if (dir < 0 && j && *p == *(p - 1) + 1) { |
5821 | 5821 | pos--; |
5822 | 5822 | ops[pos].type = LEV_EDIT_INSERT; |
|
0 commit comments