jekyll / classifier-reborn

A general classifier module to allow Bayesian and other types of classifications. A fork of cardmagic/classifier.
https://jekyll.github.io/classifier-reborn/
GNU Lesser General Public License v2.1
548 stars 109 forks source link

Problem with certain characters? #194

Open sixtyfive opened 2 years ago

sixtyfive commented 2 years ago

This is only for the LSI; the Bayes handles it fine:

[12] pry(main)> lsi = ClassifierReborn::LSI.new
=> #<ClassifierReborn::LSI:0x0000562e8ecd5e48 @auto_rebuild=true, @word_list=#<ClassifierReborn::WordList:0x0000562e8ecd5cb8 @location_table={}>, @items={}, @version=0, @built_at_version=-1, @language="en", @cache_node_vectors=nil>
[13] pry(main)> lsi.add_item("Manṣūr", :content)
=> nil
[14] pry(main)> lsi.add_item("ʿAbd", :content)
ZeroDivisionError: divided by 0
from /usr/lib/ruby/gems/3.0.0/gems/classifier-reborn-2.2.0/lib/classifier-reborn/extensions/vector.rb:34:in `/'