CountGlyphs-Talk
This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.
Comments
The algorithm considers a "word" to be any sequence of non-whitespace characters, thus Hello.World
and !#@#$
are both counted as a single word.
Note also that the number of glyphs reported may be slightly different from a direct count, because of the existence of the {$Glyphs}
and {$Words}
markups themselves in the page being counted. The {$Glyphs}
markup may report an incorrect number of international characters.
PHP5.5 Compatibility Issue
M. Denning, 20170729: Ruleset is throwing the following compatibility error. Please, can this be addressed ASAP? Base site is battzion.org and WebMaster contact is at the bottom. Thanks!
glyphs <{$var} B=>>< ! file: /cookbook/countglyphs.php, line: 24, pat: /{\$Glyphs}/e words <{$var} B=>>< ! file: /cookbook/countglyphs.php, line: 27, pat: /{\$Words}/e
Update: | I have updated lines 24 and 27 |
---|---|
FROM | 024: Markup('glyphs', '<{$var}', '/{\\$Glyphs}/e', "'$GlyphToken'.PZZ(\$countglyphs=1)"); |
TO | 024: Markup_e('glyphs', '<{$var}', '/{\\$Glyphs}/', "'$GlyphToken'.PZZ(\$countglyphs=1)"); |
FROM | 027: Markup('words', '<{$var}', '/{\\$Words}/e', "'$WordsToken'.PZZ(\$countglyphs=1)"); |
TO | 027: Markup_e('words', '<{$var}', '/{\\$Words}/', "'$WordsToken'.PZZ(\$countglyphs=1)"); |
RESULTS: | Before change - Letters: 2037 Words: 440 After change - Letters: glyphs Words: words (and 6 hidden characters - see this page in edit mode.) |
TakeAway: | This seems to have taken away the error generated in Rule Table. However, the results are not correct at all. I am holding off on this change until I get an update from the developer. |
AfterThought: | However, I would still be more comfortable if I obtained positive word from the other developers that this was the only updated necessary. |
I've updated the recipe, should work in PHP 5.5 and PHP 7.2. --Petko August 01, 2017, at 02:09 AM
Talk page for the CountGlyphs recipe (users?).