1 | import { compareText as _compareText } from '../../utils/string';
|
2 | import { factory } from '../../utils/factory';
|
3 | import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14';
|
4 | import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13';
|
5 | var name = 'compareText';
|
6 | var dependencies = ['typed', 'matrix'];
|
7 | export var createCompareText =
|
8 |
|
9 | factory(name, dependencies, function (_ref) {
|
10 | var typed = _ref.typed,
|
11 | matrix = _ref.matrix;
|
12 | var algorithm13 = createAlgorithm13({
|
13 | typed: typed
|
14 | });
|
15 | var algorithm14 = createAlgorithm14({
|
16 | typed: typed
|
17 | });
|
18 | |
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 | var compareText = typed(name, {
|
48 | 'any, any': _compareText,
|
49 | 'DenseMatrix, DenseMatrix': function DenseMatrixDenseMatrix(x, y) {
|
50 | return algorithm13(x, y, _compareText);
|
51 | },
|
52 | 'Array, Array': function ArrayArray(x, y) {
|
53 |
|
54 | return compareText(matrix(x), matrix(y)).valueOf();
|
55 | },
|
56 | 'Array, Matrix': function ArrayMatrix(x, y) {
|
57 |
|
58 | return compareText(matrix(x), y);
|
59 | },
|
60 | 'Matrix, Array': function MatrixArray(x, y) {
|
61 |
|
62 | return compareText(x, matrix(y));
|
63 | },
|
64 | 'DenseMatrix, any': function DenseMatrixAny(x, y) {
|
65 | return algorithm14(x, y, _compareText, false);
|
66 | },
|
67 | 'any, DenseMatrix': function anyDenseMatrix(x, y) {
|
68 | return algorithm14(y, x, _compareText, true);
|
69 | },
|
70 | 'Array, any': function ArrayAny(x, y) {
|
71 |
|
72 | return algorithm14(matrix(x), y, _compareText, false).valueOf();
|
73 | },
|
74 | 'any, Array': function anyArray(x, y) {
|
75 |
|
76 | return algorithm14(matrix(y), x, _compareText, true).valueOf();
|
77 | }
|
78 | });
|
79 | return compareText;
|
80 | });
|
81 | export var createCompareTextNumber =
|
82 |
|
83 | factory(name, ['typed'], function (_ref2) {
|
84 | var typed = _ref2.typed;
|
85 | return typed(name, {
|
86 | 'any, any': _compareText
|
87 | });
|
88 | }); |
\ | No newline at end of file |