language-monitor
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -33,3 +33,8 @@ var LanguageDetect = require('languagedetect'); | ||
languages.sort((a, b) => { return b[1] - a[1] }); | ||
return languages; | ||
var result = []; | ||
for (var language of languages) { | ||
if (result.length == limit) break; | ||
result.push({ code: language[0], rate: language[1] }); | ||
} | ||
return result; | ||
}; |
{ | ||
"name": "language-monitor", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Nodejs language monitor library using languagedetect and unicode", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -18,2 +18,31 @@ # language-monitor | ||
console.log(languageMonitor('为languagedetect添加中にほん한语言检测')); | ||
/* | ||
[ { code: 'chinese', rate: 0.3076923076923077 }, | ||
{ code: 'danish', rate: 0.11846153846153851 }, | ||
{ code: 'norwegian', rate: 0.11576923076923074 }, | ||
{ code: 'japanese', rate: 0.11538461538461539 }, | ||
{ code: 'dutch', rate: 0.09307692307692306 }, | ||
{ code: 'swedish', rate: 0.0823076923076923 }, | ||
{ code: 'cebuano', rate: 0.07346153846153847 }, | ||
{ code: 'tagalog', rate: 0.07282051282051294 }, | ||
{ code: 'german', rate: 0.062051282051282186 }, | ||
{ code: 'indonesian', rate: 0.05858974358974367 }, | ||
{ code: 'turkish', rate: 0.051794871794871855 }, | ||
{ code: 'korean', rate: 0.038461538461538464 }, | ||
{ code: 'portuguese', rate: 0.03384615384615375 }, | ||
{ code: 'azeri', rate: 0.030641025641025554 }, | ||
{ code: 'english', rate: 0.029230769230769282 }, | ||
{ code: 'estonian', rate: 0.028461538461538538 }, | ||
{ code: 'latin', rate: 0.022179487179487145 }, | ||
{ code: 'slovene', rate: 0.019230769230769273 }, | ||
{ code: 'swahili', rate: 0.016538461538461502 }, | ||
{ code: 'hungarian', rate: 0.016410256410256396 }, | ||
{ code: 'spanish', rate: 0.015000000000000013 }, | ||
{ code: 'lithuanian', rate: 0.01358974358974363 }, | ||
{ code: 'finnish', rate: 0.01358974358974363 }, | ||
{ code: 'hawaiian', rate: 0.008589743589743626 }, | ||
{ code: 'icelandic', rate: 0.007692307692307776 }, | ||
{ code: 'italian', rate: 0.0016666666666667052 } ] | ||
*/ | ||
``` | ||
@@ -20,0 +49,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6048
37
76