app/models/timed_script2/split_processor.rb
##
# When a word is split between 2 segments, move the shorted spit to the other segment
#
When a word is split between 2 segments, move the shorted spit to the other segment
When a word is split between 2 segments move the shorted spit to the other segment
def unite_words
      _, a_rest, a_word = %r{^(.* )?(\w+)$}.match(a.text).to_a 
      _, b_word, b_rest = %r{^(\w+\s*)(.* )?$}.match(b.text).to_a 
      if a_word && b_word
        if a_word.length > b_word.length
          shift_backward(b_word)
        else
          shift_forward(a_word)
        end
      end
    end
def unite_words _ , a_rest , a_word = %r{ ^(.* )?( \w +)$ } . match ( a . text ) . to_a _ , b_word , b_rest = %r{ ^( \w + \s *)(.* )?$ } . match ( b . text ) . to_a if a_word && b_word if a_word . length > b_word . length shift_backward ( b_word ) else shift_forward ( a_word ) end end end
When a word is split between 2 segments, move the shorted spit to the other segment
When a word is split between 2 segments move the shorted spit to the other segment
# a ends with word character # b starts with word character