_binary From 4606f7010c9f6393a27bda8f089330ca7e6597b3 Mon Sep 17 00:00:00 2001
From: Mangesh Dahale <mangeshadahale@gmail.com>
Date: Thu, 8 May 2014 20:14:21 -0700
Subject: [PATCH] Resolved space between words in summary issue

---
 lib/centroid.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/centroid.php b/lib/centroid.php
index 874d0b8..ea4a0e9 100644
--- a/lib/centroid.php
+++ b/lib/centroid.php
@@ -272,7 +272,6 @@ class CentroidSummarizer
             '/\[(.*?)\]/', '/\t\n/'
         );
         $page = preg_replace($substitutions, ' ', $page);
-        $page = preg_replace('/\s{2,}/', '', $page);
         $new_page = preg_replace("/\<br\s*(\/)?\s*\>/", "\n", $page);
         $changed = false;
         if($new_page != $page) {
@@ -287,6 +286,7 @@ class CentroidSummarizer
         if($changed) {
             $page = preg_replace("/(\r?\n[\t| ]*){2}/", "\n", $page);
         }
+        $page = preg_replace('/\s{2,}/', ' ', $page);
         $page = preg_replace("/(\r?\n[\t| ]*)/", "\n", $page);
         $page = preg_replace("/\n\n\n+/", "\n\n", $page);
         return $page;
-- 
1.9.0.msysgit.0

