module Hansa
Overview
Hansa is a port of go-enry's language classification algorithm It uses a naive bayes classifier to classify the language of a given text based on the corpus from Linguist
The most surprising bit is that ... it mostly works?
Extended Modules
Defined in:
hansa.crConstant Summary
-
CLASSIFIER =
Classifier.from_json((BakedData.get("/frequencies.json")).gets_to_end) -
DEFAULT_TOKEN_PROBABILITIES =
{} of String => Float64 -
DEFAULT_TOKEN_PROBABILITY =
Math.log(1 / 2316853) -
Default probability for tokens not present in a language's token table, inherited from go-enry's training corpus size
-
VERSION =
{{ (`shards version /srv/crystaldoc.info/github-ralsina-hansa-v0.1.4/src`).chomp.stringify }}