SphericalKat / dart-fuzzywuzzy

A dart port of the popular fuzzywuzzy package
https://pub.dev/packages/fuzzywuzzy
GNU General Public License v2.0
42 stars 7 forks source link

Unsupported operation: Infinity or NaN toInt #21

Closed rudenkoRD closed 3 months ago

rudenkoRD commented 3 months ago

Code to reproduce:

import 'package:fuzzywuzzy/fuzzywuzzy.dart';

void main() {
  print(weightedRatio('\n \n  ', 'test'));
}

Result:

Unsupported operation: Infinity or NaN toInt
#0      double.toInt (dart:core-patch/double.dart)
#1      double.round (dart:core-patch/double.dart:194:34)
#2      SimpleRatio.apply (package:fuzzywuzzy/ratios/simple_ratio.dart:7:47)
#3      TokenSet.apply (package:fuzzywuzzy/algorithms/token_set.dart:24:23)
#4      tokenSetRatio (package:fuzzywuzzy/fuzzywuzzy.dart:41:21)
#5      WeightedRatio.apply (package:fuzzywuzzy/algorithms/weighted_ratio.dart:42:22)
#6      weightedRatio (package:fuzzywuzzy/fuzzywuzzy.dart:60:26)
#7      calc (package:benchmarks/test_fuzzywuzzy.dart:4:9)
#8      main (file:///Users/ruslanr/SolidProjects/benchmarks/bin/benchmarks.dart:7:19)
#9      _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:295:33)
#10     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
SphericalKat commented 3 months ago

@rudenkoRD Thanks for the bug report! Version 1.1.7 has been published with the fix.