1 | import { compareText as _compareText } from '../../utils/string.js';
|
2 | import { factory } from '../../utils/factory.js';
|
3 | import { createAlgorithm14 } from '../../type/matrix/utils/algorithm14.js';
|
4 | import { createAlgorithm13 } from '../../type/matrix/utils/algorithm13.js';
|
5 | var name = 'compareText';
|
6 | var dependencies = ['typed', 'matrix'];
|
7 | export var createCompareText = factory(name, dependencies, _ref => {
|
8 | var {
|
9 | typed,
|
10 | matrix
|
11 | } = _ref;
|
12 | var algorithm13 = createAlgorithm13({
|
13 | typed
|
14 | });
|
15 | var algorithm14 = createAlgorithm14({
|
16 | 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 | return 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 this(matrix(x), matrix(y)).valueOf();
|
55 | },
|
56 | 'Array, Matrix': function ArrayMatrix(x, y) {
|
57 |
|
58 | return this(matrix(x), y);
|
59 | },
|
60 | 'Matrix, Array': function MatrixArray(x, y) {
|
61 |
|
62 | return this(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 | });
|
80 | export var createCompareTextNumber = factory(name, ['typed'], _ref2 => {
|
81 | var {
|
82 | typed
|
83 | } = _ref2;
|
84 | return typed(name, {
|
85 | 'any, any': _compareText
|
86 | });
|
87 | }); |
\ | No newline at end of file |