OLD | NEW |
1 library levenshtein; | 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
2 | 4 |
3 import 'dart:math' as math; | 5 import 'dart:math' as math; |
4 | 6 |
5 /** | 7 /** |
6 * The value returned by [levenshtein] if the distance is determined | 8 * The value returned by [levenshtein] if the distance is determined |
7 * to be over the specified threshold. | 9 * to be over the specified threshold. |
8 */ | 10 */ |
9 const int LEVENSHTEIN_MAX = 1 << 20; | 11 const int LEVENSHTEIN_MAX = 1 << 20; |
10 | 12 |
11 const int _MAX_VALUE = 1 << 10; | 13 const int _MAX_VALUE = 1 << 10; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 124 } |
123 | 125 |
124 return LEVENSHTEIN_MAX; | 126 return LEVENSHTEIN_MAX; |
125 } | 127 } |
126 | 128 |
127 void _setRange(List<int> a, int start, int end, int value) { | 129 void _setRange(List<int> a, int start, int end, int value) { |
128 for (int i = start; i < end; i++) { | 130 for (int i = start; i < end; i++) { |
129 a[i] = value; | 131 a[i] = value; |
130 } | 132 } |
131 } | 133 } |
OLD | NEW |