ep_readability
Advanced tools
Comparing version 0.0.14 to 0.0.15
{ | ||
"name": "ep_readability", | ||
"version": "0.0.14", | ||
"version": "0.0.15", | ||
"description": "Calculates the Flesch readability index in Etherpad, client based.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -10,3 +10,3 @@ # Click button to calculate the Flesch readability index | ||
The original Flesch index is calculated for the English language. The Amstad index is calculated for the German language. | ||
The original Flesch index is calculated for all languages. German umlauts are replaced (ä = a, ß = ss...). | ||
@@ -13,0 +13,0 @@ ## Readability |
@@ -254,4 +254,7 @@ // ---------------------------------------------------------------------------- | ||
var lang = 'en'; | ||
if(text.match(/ä|Ä|ü|Ü|ö|Ö|ß/gm).length > 0) | ||
lang = 'de'; | ||
if(text != null) { | ||
var hits = text.match(/ä|Ä|ü|Ü|ö|Ö|ß/gm); | ||
if(hits != null && hits.length > 0) | ||
lang = 'de'; | ||
} | ||
console.log('Language detected: ' + lang); | ||
@@ -271,7 +274,7 @@ return lang; | ||
+ window._('readability.info.advice'); | ||
var lang = exports.detectLangage(text); | ||
//var lang = exports.detectLangage(text); | ||
text = exports.cleanText(text); | ||
if(text.length > 0) { | ||
result = exports.fleschReadingEase( text, lang ); | ||
result = exports.fleschReadingEase( text, 'en' ); | ||
jQuery.each(colorOrder, function(index, item) { | ||
@@ -286,3 +289,3 @@ //alert(result.flesch +" - "+ item) | ||
toolTip = window._('readability.info.fleschIndex') + result.flesch + ' ' + window._('readability.info.fleschScale') + "\n" | ||
+ window._('readability.info.language') + lang + "\n" | ||
//+ window._('readability.info.language') + lang + "\n" | ||
+ window._('readability.info.sentences') + result.sentenceCount + "\n" | ||
@@ -289,0 +292,0 @@ + window._('readability.info.words') + result.wordCount + "\n" |
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
23420
382