Commits

Anonymous committed ff3c3da

add two spaces after sentence-final period

  • Participants
  • Parent commits dcf48b5

Comments (0)

Files changed (1)

         quote_stack = []
         self.edited_text = u''
         for i, token in enumerate(self._tokens[:-1]):
-            # if we have a paragraph break, insert that and go on to next token
+            # if we have a paragraph break, insert that and go on to
+            # next token
             if token.is_para:
                 self.edited_text += u'\n\n'
                 continue
                 continue
             self.edited_text += token.str
 
-            # now figure out if a space should follow it
-            append_space = True
+            # now figure out how many spaces should follow it
+            append_space = ' '
             next_token = self._tokens[i + 1]
 
             if (token.is_open or
                 next_token.is_close or
                 next_token.is_nonspacing_punc or
                 next_token.is_eof):
-                    append_space = False
+                    append_space = ''
+            elif token.str == '.':
+                append_space = '  '
             elif token.is_quote:
                 if quote_stack and quote_stack[-1] == token.str:
                     # space after close quote
                 else:
                     # no space after open quote
                     quote_stack.append(token.str)
-                    append_space = False
+                    append_space = ''
 
-            if append_space:
-                self.edited_text += u' '
+            self.edited_text += append_space
 
     def _process_tokens(self, infile):
         all_rules = rules.get_rules()