def soft_hyphens(input, lang = "en_us", left = 2, right = 2, char = "­")
      l = Text::Hyphen.new(:language => lang, :left => left, :right => right)
      words = input.split(/[ ]+/m)
      result = []
      words.each_with_index do |w, n|
        if !(w.length < 6 || n == words.size - 1 || w =~ URI::REGEXP || w =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i)
          w = l.visualise(w, char)
        end
        result << w
      end
      result.join(" ")
    end
def soft_hyphens(input, lang = "en_us", left = 2, right = 2, char = "­")
      l = Text::Hyphen.new(:language => lang, :left => left, :right => right)
      words = input.split(/[ ]+/m)
      result = []
      words.each_with_index do |w, n|
        if !(w.length < 6 || n == words.size - 1 || w =~ URI::REGEXP || w =~ /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i)
          w = l.visualise(w, char)
        end
        result << w
      end
      result.join(" ")
    end
Adds soft hyphens to the input.

 @param input [String] The paragraph which will be converted.
 @param lang [String] Sets the language of hyphenation. One of the languages a {http://www.rubydoc.info/gems/text-hyphen/ text-hyphen gem} can use.
 @param left [Integer] Number of characters on the beginning of the words which cannnot be hyphenated.
 @param right [Integer] Number of characters on the beginning of the words which cannnot be hyphenated.
 @param char [Integer] The character which will be added to hyphenation places.
 @return [String] Paragraph with added hyphenation characters.