|
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: |
|
124 | 124 | #include <assert.h> |
125 | 125 | #include "_levenshtein.h" |
126 | 126 |
|
127 | | -/* FIXME: inline avaliability should be solved in setup.py, somehow, or |
| 127 | +/* FIXME: inline availability should be solved in setup.py, somehow, or |
128 | 128 | * even better in Python.h, like const is... |
129 | 129 | * this should inline at least with gcc and msvc */ |
130 | 130 | #ifndef __GNUC__ |
@@ -2327,7 +2327,7 @@ lev_edit_distance(size_t len1, const lev_byte *string1, |
2327 | 2327 | } |
2328 | 2328 | else { |
2329 | 2329 | /* in this case we don't have to scan two corner triangles (of size len1/2) |
2330 | | - * in the matrix because no best path can go throught them. note this |
| 2330 | + * in the matrix because no best path can go through them. note this |
2331 | 2331 | * breaks when len1 == len2 == 2 so the memchr() special case above is |
2332 | 2332 | * necessary */ |
2333 | 2333 | row[0] = len1 - half - 1; |
@@ -2506,7 +2506,7 @@ lev_u_edit_distance(size_t len1, const lev_wchar *string1, |
2506 | 2506 | } |
2507 | 2507 | else { |
2508 | 2508 | /* in this case we don't have to scan two corner triangles (of size len1/2) |
2509 | | - * in the matrix because no best path can go throught them. note this |
| 2509 | + * in the matrix because no best path can go through them. note this |
2510 | 2510 | * breaks when len1 == len2 == 2 so the memchr() special case above is |
2511 | 2511 | * necessary */ |
2512 | 2512 | row[0] = len1 - half - 1; |
@@ -5436,7 +5436,7 @@ lev_opcodes_check_errors(size_t len1, size_t len2, |
5436 | 5436 | if (!nb) |
5437 | 5437 | return 1; |
5438 | 5438 |
|
5439 | | - /* check completenes */ |
| 5439 | + /* check completeness */ |
5440 | 5440 | if (bops->sbeg || bops->dbeg |
5441 | 5441 | || bops[nb - 1].send != len1 || bops[nb - 1].dend != len2) |
5442 | 5442 | return LEV_EDIT_ERR_SPAN; |
@@ -5691,7 +5691,7 @@ editops_from_cost_matrix(size_t len1, const lev_byte *string1, size_t off1, |
5691 | 5691 | j = len2 - 1; |
5692 | 5692 | p = matrix + len1*len2 - 1; |
5693 | 5693 | while (i || j) { |
5694 | | - /* prefer contiuning in the same direction */ |
| 5694 | + /* prefer continuing in the same direction */ |
5695 | 5695 | if (dir < 0 && j && *p == *(p - 1) + 1) { |
5696 | 5696 | pos--; |
5697 | 5697 | ops[pos].type = LEV_EDIT_INSERT; |
@@ -5880,7 +5880,7 @@ ueditops_from_cost_matrix(size_t len1, const lev_wchar *string1, size_t o1, |
5880 | 5880 | j = len2 - 1; |
5881 | 5881 | p = matrix + len1*len2 - 1; |
5882 | 5882 | while (i || j) { |
5883 | | - /* prefer contiuning in the same direction */ |
| 5883 | + /* prefer continuing in the same direction */ |
5884 | 5884 | if (dir < 0 && j && *p == *(p - 1) + 1) { |
5885 | 5885 | pos--; |
5886 | 5886 | ops[pos].type = LEV_EDIT_INSERT; |
|
0 commit comments