lib/pragmatic_tokenizer/processor.rb in pragmatic_tokenizer-0.3.3 vs lib/pragmatic_tokenizer/processor.rb in pragmatic_tokenizer-0.3.4

- old
+ new

@@ -88,11 +88,11 @@ text.gsub!(/([\(\[\{\}\]\)])/o) { ' ' + $1 + ' ' } || text end def shift_colon(text) return text unless text.include?(':') && - text.partition(':').last[0] !~ /\A\d+/ && - text.partition(':').first[-1] !~ /\A\d+/ + (text.partition(':').last[0] !~ /\A\d+/ || + text.partition(':').first[-1] !~ /\A\d+/) # Ignore web addresses text.gsub!(/(?<=[http|https]):(?=\/\/)/, PragmaticTokenizer::Languages::Common::PUNCTUATION_MAP[":"]) || text text.gsub!(/:/o, ' :') || text text.gsub!(/(?<=\s):(?=\#)/, ': ') || text end \ No newline at end of file