Once I enable the module and save a content type I get the error

Notice: Undefined variable: file in readability_analyzer() (line 113 of modules/all/readability/readability.module).

Comments

jimi’s picture

# Download the TextStatistics.php class at http://code.google.com/p/php-text-statistics (or copy the code from http://code.google.com/p/php-text-statistics/source/browse/trunk/TextSta...) - you should have a file path of "php-text-statistics/TextStatistics.php" when done.
# Create a directory called "php-text-statistics" under the Readability module directory and upload the php-text-statistic package file into it.

SocialNicheGuru’s picture

Does it integrate with library module?

mgifford’s picture

You want this code here don't you?
https://github.com/DaveChild/Text-Statistics

SocialNicheGuru’s picture

works. thanks
#3 is the right code

mgifford’s picture

The project page definitely needs an update https://drupal.org/project/readability

bradweikel’s picture

Issue summary: View changes

I can't seem to get this working at all. What should the library file structure actually look like?

I've got /sites/all/libraries/php-text-statistics/... and I've tried putting the files from github in that folder directly as well as in various subfolders. What's the magic structure?

LeT’s picture

The version on https://github.com/DaveChild/Text-Statistics doesn't seem to work (missing an end php tag %> and something else) but the version at http://code.google.com/p/php-text-statistics/source/browse/trunk/TextSta... works for me.

The file can be placed either in the libraries folder or the readability module folder once you have the right code. Only the TextStatistics.php is needed:

/sites/all/modules/readability/php-text-statistics/TextStatistics.php

or

/sites/all/libraries/php-text-statistics/TextStatistics.php

Francis47’s picture

I can confirm that the DaveChild version does not work.

https://code.google.com/p/php-text-statistics/source/browse/trunk/TextSt... reports: "SVN hosting has been permanently disabled".
So thats no good either.

However I found this working example.
https://raw.githubusercontent.com/alexstolz/wikimeter/master/TextStatist...

imperator_99’s picture

#8 from @Francis47 worked for me too after spending quite a while trying to figure this out. Project page definitely needs an update.