henry_flower: A melancholy wolf (Default)
henry_flower ([personal profile] henry_flower) wrote2013-06-30 02:41 pm
Entry tags:

Случай, когда знаменитое (c++'шная часть cld сковырнута из

Случай, когда знаменитое (c++'шная часть cld сковырнута из недр гоогла) не всегда лучше скромной и не очень известной библиотеки:

  $ npm install cld
  $ coffee
  coffee> cld.detect 'корабли лавировали лавировали да не вылавировали'
  { name: 'SERBIAN',
    code: 'sr',
    reliable: true,
    details:
     [ { name: 'SERBIAN',
         code: 'sr',
         percent: 100,
         score: 37.90087463556851 } ] }
  coffee> cld.detect 'what the fuck'
  { name: 'Unknown',
    code: 'un',
    reliable: true,
    details: [] }

Да уж. Зато:

  $ npm install languagedetect
  $ coffee
  coffee> lang = new (require 'languagedetect')
  coffee> lang.detect 'корабли лавировали лавировали да не вылавировали', 2
  [ [ 'russian', 0.3860493827160494 ],
    [ 'bulgarian', 0.3748148148148148 ] ]
  coffee> lang.detect 'what the fuck', 2
  [ [ 'english', 0.5333333333333333 ],
    [ 'pidgin', 0.2564102564102565 ] ]

Permalink: https://plus.google.com/115290581164606462017/posts/hdvNMVzEXUV


Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting