Skip to content

Commit

Permalink
fix(treewide): fix analyzer issues
Browse files Browse the repository at this point in the history
Signed-off-by: Sphericalkat <[email protected]>
  • Loading branch information
SphericalKat committed Jun 22, 2023
1 parent 99d282b commit 47e3094
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions lib/algorithms/token_set.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class TokenSet {

var sortedInter = (intersection.toList()..sort()).join(' ').trim();
var sorted1to2 =
(sortedInter + ' ' + (diff1to2.toList()..sort()).join(' ')).trim();
('$sortedInter ${(diff1to2.toList()..sort()).join(' ')}').trim();
var sorted2to1 =
(sortedInter + ' ' + (diff2to1.toList()..sort()).join(' ')).trim();
('$sortedInter ${(diff2to1.toList()..sort()).join(' ')}').trim();

var results = <int>[];

Expand Down
12 changes: 6 additions & 6 deletions lib/algorithms/weighted_ratio.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import '../applicable.dart';
import '../fuzzywuzzy.dart';

class WeightedRatio implements Applicable {
static const UNBASE_SCALE = 0.95;
static const PARTIAL_SCALE = 0.90;
static const TRY_PARTIALS = true;
static const unbaseScaleConst = 0.95;
static const partialScaleConst = 0.90;
static const tryPartialsConst = true;

const WeightedRatio();

Expand All @@ -19,9 +19,9 @@ class WeightedRatio implements Applicable {
return 0;
}

var tryPartials = TRY_PARTIALS;
var unbaseScale = UNBASE_SCALE;
var partialScale = PARTIAL_SCALE;
var tryPartials = tryPartialsConst;
var unbaseScale = unbaseScaleConst;
var partialScale = partialScaleConst;

var base = ratio(s1, s2);
var lenRatio = max(len1, len2) / min(len1, len2);
Expand Down
26 changes: 13 additions & 13 deletions lib/diffutils/diff_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class DiffUtils {

pos--;
ops[pos] = eop;
eop.type = EditType.INSERT;
eop.type = EditType.insert;
eop.spos = i + o1;
eop.dpos = --j + o2;
ptr--;
Expand All @@ -135,7 +135,7 @@ class DiffUtils {

pos--;
ops[pos] = eop;
eop.type = EditType.DELETE;
eop.type = EditType.delete;
eop.spos = --i + o1;
eop.dpos = j + o2;
ptr -= len2;
Expand All @@ -149,7 +149,7 @@ class DiffUtils {
var eop = EditOp();
ops[pos] = eop;

eop.type = EditType.REPLACE;
eop.type = EditType.replace;
eop.spos = --i + o1;
eop.dpos = --j + o2;

Expand All @@ -162,7 +162,7 @@ class DiffUtils {
pos--;
var eop = EditOp();
ops[pos] = eop;
eop.type = EditType.INSERT;
eop.type = EditType.insert;
eop.spos = i + o1;
eop.dpos = --j + o2;
ptr--;
Expand All @@ -176,7 +176,7 @@ class DiffUtils {
var eop = EditOp();
ops[pos] = eop;

eop.type = EditType.DELETE;
eop.type = EditType.delete;
eop.spos = --i + o1;
eop.dpos = j + o2;
ptr -= len2;
Expand Down Expand Up @@ -271,7 +271,7 @@ class DiffUtils {
EditType type;

for (i = n; i != 0;) {
while (ops[o].type == EditType.KEEP && --i != 0) {
while (ops[o].type == EditType.keep && --i != 0) {
o++;
}

Expand All @@ -286,7 +286,7 @@ class DiffUtils {
type = ops[o].type!;

switch (type) {
case EditType.REPLACE:
case EditType.replace:
do {
spos++;
dpos++;
Expand All @@ -298,7 +298,7 @@ class DiffUtils {
dpos == ops[o].dpos);
break;

case EditType.DELETE:
case EditType.delete:
do {
spos++;
i--;
Expand All @@ -309,7 +309,7 @@ class DiffUtils {
dpos == ops[o].dpos);
break;

case EditType.INSERT:
case EditType.insert:
do {
dpos++;
i--;
Expand Down Expand Up @@ -337,7 +337,7 @@ class DiffUtils {
var mbIndex = 0;

for (i = n; i != 0;) {
while (ops[o].type == EditType.KEEP && --i != 0) {
while (ops[o].type == EditType.keep && --i != 0) {
o++;
}

Expand All @@ -358,7 +358,7 @@ class DiffUtils {
type = ops[o].type!;

switch (type) {
case EditType.REPLACE:
case EditType.replace:
do {
spos++;
dpos++;
Expand All @@ -370,7 +370,7 @@ class DiffUtils {
dpos == ops[o].dpos);
break;

case EditType.DELETE:
case EditType.delete:
do {
spos++;
i--;
Expand All @@ -381,7 +381,7 @@ class DiffUtils {
dpos == ops[o].dpos);
break;

case EditType.INSERT:
case EditType.insert:
do {
dpos++;
i--;
Expand Down
2 changes: 1 addition & 1 deletion lib/diffutils/structs/edit_type.dart
Original file line number Diff line number Diff line change
@@ -1 +1 @@
enum EditType { DELETE, EQUAL, INSERT, REPLACE, KEEP }
enum EditType { delete, equal, insert, replace, keep }
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: "fuzzywuzzy"
version: "1.1.3"
version: "1.1.4"
homepage: "https://github.com/sphericalkat/dart-fuzzywuzzy"
description: An implementation of the popular fuzzywuzzy package in Dart, to suit all your fuzzy string matching/searching needs!
repository: "https://github.com/sphericalkat/dart-fuzzywuzzy"

environment:
sdk: ">=3.0.0"
sdk: ">=3.0.0 <4.0.0"

dependencies:
collection: ^1.16.0
Expand Down

0 comments on commit 47e3094

Please sign in to comment.