Closed tlack closed 10 years ago
+1
I'll see about getting this taken care of over the weekend.
ah i see i think this fixed the issue https://github.com/NaturalNode/natural/issues/94
so this issue is actually in the apparatus code (line 37) It happens when getClassifications returns an empty array (should only be when the classifier hasn't been trained).
I see two possible ways to improve this:
Personally, I'm leaning towards 2.
So I've fixed this over in the apparatus code It should now throw an exception if the classifier is not trained.
If one forgets to call .train() on their classifier, here is the error you get from .classify():
This is a pretty common mistake; it might be nice to throw an exception in this case instead of just bombing out.