Sha256: b804dd5c98f9e50a8ebe322e2ecb3eac907e218429d65ff65c1b907b0395bc27
Contents?: true
Size: 1003 Bytes
Versions: 19
Compression:
Stored size: 1003 Bytes
Contents
# -*- encoding : utf-8 -*- module PragmaticSegmenter module Rules # This class searches for ellipses within a string and # replaces the periods. # http://www.dailywritingtips.com/in-search-of-a-4-dot-ellipsis/ # http://www.thepunctuationguide.com/ellipses.html module EllipsisRules # Rubular: http://rubular.com/r/i60hCK81fz ThreeConsecutiveRule = Rule.new(/\.\.\.(?=\s+[A-Z])/, '☏.') # Rubular: http://rubular.com/r/Hdqpd90owl FourConsecutiveRule = Rule.new(/(?<=\S)\.{3}(?=\.\s[A-Z])/, 'ƪ') # Rubular: http://rubular.com/r/YBG1dIHTRu ThreeSpaceRule = Rule.new(/(\s\.){3}\s/, '♟') # Rubular: http://rubular.com/r/2VvZ8wRbd8 FourSpaceRule = Rule.new(/(?<=[a-z])(\.\s){3}\.(\z|$|\n)/, '♝') OtherThreePeriodRule = Rule.new(/\.\.\./, 'ƪ') All = [ ThreeSpaceRule, FourSpaceRule, FourConsecutiveRule, ThreeConsecutiveRule, OtherThreePeriodRule ] end end end
Version data entries
19 entries across 19 versions & 1 rubygems