Comments (4)
Thanks for responding, @Yomguithereal. I think either of those is reasonable. As a user, I'd expect consistency with the other functions exposed in clj-fuzzy.metrics
, most (though not all) of which seem to treat nil
as the empty string:
(use '[clj-fuzzy.metrics])
(levenshtein nil nil) ; => 0
(levenshtein "" "") ; => 0
(dice nil nil) ; => 1.0
(dice "" "") ; => 1.0
(sorensen nil nil) ; => 1.0
(sorensen "" "") ; => 1.0
(mra-comparison nil nil) ; => NullPointerException
(mra-comparison "" "") ; => {:minimum 5, :similarity 6, :codex ["" ""], :match true}
(jaccard nil nil) ; => ArithmeticException Divide by zero
(jaccard "" "") ; => ArithmeticException Divide by zero
(hamming nil nil) ; => 0
(hamming "" "") ; => 0
(jaro nil nil) ; => 0
(jaro "" "") ; => 0
(tversky nil nil) ; => ArithmeticException Divide by zero
(tversky "" "") ; => ArithmeticException Divide by zero
from clj-fuzzy.
Hello @mhuerster. I guess it's not. Do you think it should throw or do you think it should return 1
? Broadly speaking, should nil
be considered as an empty string or should we refuse to take it as a valid argument?
from clj-fuzzy.
Consistency would be good indeed. I don't have much time right now to dedicate to this issue but I'll gladly accept a pull request.
from clj-fuzzy.
Great, thanks! I'll take a stab at it if I have some free time this/next week.
from clj-fuzzy.
Related Issues (20)
- dice algorithm NaN HOT 7
- Fix Levenshtein ortographe
- Switch to gulp
- Fix the cljx pb
- Lovins stemmer
- Rework headers and descriptions
- Repo needs `index.js` so that it can be invoked with `require` HOT 3
- Switch to cljx or feature expressions
- Levenstein distance performance HOT 6
- issue using this project as a dependency in clojurescript HOT 17
- Cologne phonetic will drop the first place 0 erroneously
- Something seems to be amiss with Jaro distance & long strings
- Levenshtein Distance Error On Empty Sequence HOT 1
- Clojurescript should be a dev dependency HOT 5
- Spanish support? HOT 13
- Documentation website outdated HOT 6
- Big-O Performance HOT 2
- interferes with other modules, do NOT use this module unless it's fixed HOT 1
- Is it appropriate to add a non-formal algorithm? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clj-fuzzy.