lib/megahal/megahal.rb
# This takes a string and decomposes it into three arrays representing
# word-separators, capitalised words and the original words.
This takes a string and decomposes it into three arrays representing
word-separators, capitalised words and the original words.
This takes a string and decomposes it into three arrays representing word - separators capitalised words and the original words .
def _decompose(line, maximum_length=1024)
    return [nil, nil, nil] if line.nil?
    line = "" if line.length > maximum_length
    return [[], [], []] if line.length == 0
    puncs, words = _segment(line)
    norms = words.map(&:upcase)
    [puncs, norms, words]
  end
def _decompose ( line , maximum_length = 1024 ) return [ nil , nil , nil ] if line . nil? line = "" if line . length > maximum_length return [ [ ] , [ ] , [ ] ] if line . length == 0 puncs , words = _segment ( line ) norms = words . map ( & :upcase ) [ puncs , norms , words ] end
This takes a string and decomposes it into three arrays representing
word-separators, capitalised words and the original words.
This takes a string and decomposes it into three arrays representing word - separators capitalised words and the original words .
line
maximum_length