Browse Source

commented temporarily because of problems with utf8 remove 'words' that don't consist of alphanumerical characters or punctuation, and remove one-letter 'words' that consist only of punctuation

Juan Carlos Raña 15 years ago
parent
commit
1bbed635fe
1 changed files with 4 additions and 4 deletions
  1. 4 4
      main/wiki/wiki.inc.php

+ 4 - 4
main/wiki/wiki.inc.php

@@ -958,12 +958,12 @@ function word_count($document) {
   	# strip all html tags
   	$wc = strip_tags($document);
 
+	//remove words and remove one letter words commented temporarily because of problems with utf8 support
   	# remove 'words' that don't consist of alphanumerical characters or punctuation
-  	$pattern = "#[^(\w|\d|\'|\"|\.|\!|\?|;|,|\\|\/|\-|:|\&|@)]+#";
-  	$wc = trim(preg_replace($pattern, " ", $wc));
-
+  	//$pattern = "#[^(\w|\d|\'|\"|\.|\!|\?|;|,|\\|\/|\-|:|\&|@)]+#";
+  	//$wc = trim(preg_replace($pattern, " ", $wc));
   	# remove one-letter 'words' that consist only of punctuation
-  	$wc = trim(preg_replace("#\s*[(\'|\"|\.|\!|\?|;|,|\\|\/|\-|:|\&|@)]\s*#", " ", $wc));
+  	//$wc = trim(preg_replace("#\s*[(\'|\"|\.|\!|\?|;|,|\\|\/|\-|:|\&|@)]\s*#", " ", $wc)); //
 
   	# remove superfluous whitespace
   	$wc = preg_replace("/\s\s+/", " ", $wc);