Repository: pndurette/gTTS

Issue:
Adjust Tokenizer
Hello, very often the gTTS Speech Synthesis does not spell the current time correctly since the tokenizer splits it. Example: 
> ... the current time is 08:30 o'clock.

The text is it is split on ":"
Is there a possibility to prevent a split on ":" in general?
Thanks!

Comments:

Patch:
diff --git a/MANIFEST.in b/MANIFEST.in
index 82ac039..6527eaa 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,4 +1,4 @@
-include README.rst
+include README.md
 include CHANGELOG.rst
 include CONTRIBUTING.rst
-include LICENSE
+include LICENSE
\ No newline at end of file
diff --git a/gtts/tokenizer/symbols.py b/gtts/tokenizer/symbols.py
index 253aae7..1670360 100644
--- a/gtts/tokenizer/symbols.py
+++ b/gtts/tokenizer/symbols.py
@@ -14,3 +14,5 @@ ALL_PUNC = u"?!？！.,¡()[]¿…‥،;:—。，、：\n"
 TONE_MARKS = u"?!？！"
 
 PERIOD_COMMA = u".,"
+
+COLON = u":"
diff --git a/gtts/tokenizer/tokenizer_cases.py b/gtts/tokenizer/tokenizer_cases.py
index 1d4f6ba..e48cae0 100644
--- a/gtts/tokenizer/tokenizer_cases.py
+++ b/gtts/tokenizer/tokenizer_cases.py
@@ -31,6 +31,18 @@ def period_comma():
         pattern_func=lambda x: r"(?<!\.[a-z]){} ".format(x)).regex
 
 
+def colon():
+    """Colon case.
+
+    Match a colon ":" only if not preceeded by a digit.
+    Mainly to prevent a cut in the middle of time notations e.g. 10:01
+
+    """
+    return RegexBuilder(
+        pattern_args=symbols.COLON,
+        pattern_func=lambda x: r"(?<!\d){}".format(x)).regex
+
+
 def other_punctuation():
     """Match other punctuation.
 
@@ -38,10 +50,11 @@ def other_punctuation():
     inserts a break in speech.
 
     """
-    punc = ''.join((
+    punc = ''.join(
         set(symbols.ALL_PUNC) -
         set(symbols.TONE_MARKS) -
-        set(symbols.PERIOD_COMMA)))
+        set(symbols.PERIOD_COMMA) -
+        set(symbols.COLON))
     return RegexBuilder(
         pattern_args=punc,
         pattern_func=lambda x: u"{}".format(x)).regex
diff --git a/gtts/tts.py b/gtts/tts.py
index db20ea0..bc7ddfe 100644
--- a/gtts/tts.py
+++ b/gtts/tts.py
@@ -57,6 +57,7 @@ class gTTS:
                 Tokenizer([
                     tokenizer_cases.tone_marks,
                     tokenizer_cases.period_comma,
+                    tokenizer_cases.colon,
                     tokenizer_cases.other_punctuation
                 ]).run
 
@@ -97,6 +98,7 @@ class gTTS:
             tokenizer_func=Tokenizer([
                 tokenizer_cases.tone_marks,
                 tokenizer_cases.period_comma,
+                tokenizer_cases.colon,
                 tokenizer_cases.other_punctuation
             ]).run
     ):
diff --git a/news/135.feature b/news/135.feature
new file mode 100644
index 0000000..f692ce4
--- /dev/null
+++ b/news/135.feature
@@ -0,0 +1,1 @@
+Added new tokenizer case for ':' preventing cut in the middle of a time notation
diff --git a/news/159.misc b/news/159.misc
new file mode 100644
index 0000000..15342b0
--- /dev/null
+++ b/news/159.misc
@@ -0,0 +1,1 @@
+Updated MANIFEST.in to contain new README.md


Test patch:
diff --git a/gtts/tokenizer/tests/test_tokenizer_cases.py b/gtts/tokenizer/tests/test_tokenizer_cases.py
index 771a297..13e63f2 100644
--- a/gtts/tokenizer/tests/test_tokenizer_cases.py
+++ b/gtts/tokenizer/tests/test_tokenizer_cases.py
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 import unittest
-from gtts.tokenizer.tokenizer_cases import tone_marks, period_comma, other_punctuation, legacy_all_punctuation
+from gtts.tokenizer.tokenizer_cases import tone_marks, period_comma, colon, other_punctuation, legacy_all_punctuation
 from gtts.tokenizer import Tokenizer, symbols
 
 
@@ -17,12 +17,19 @@ class TestPreTokenizerCases(unittest.TestCase):
         _out = ['Hello', "it's 24.5 degrees in the U.K. today", '$20,000,000.']
         self.assertEqual(t.run(_in), _out)
 
+    def test_colon(self):
+        t = Tokenizer([colon])
+        _in = "It's now 6:30 which means: morning missing:space"
+        _out = ["It's now 6:30 which means", ' morning missing', 'space']
+        self.assertEqual(t.run(_in), _out)
+
     def test_other_punctuation(self):
         # String of the unique 'other punctuations'
         other_punc_str = ''.join(
             set(symbols.ALL_PUNC) -
             set(symbols.TONE_MARKS) -
-            set(symbols.PERIOD_COMMA))
+            set(symbols.PERIOD_COMMA) -
+            set(symbols.COLON))
 
         t = Tokenizer([other_punctuation])
         self.assertEqual(len(t.run(other_punc_str)) - 1, len(other_punc_str))