function buildNodes (segs) {
  const nodes = []
  for (let i = 0; i < segs.length; i++) {
    const seg = segs[i]

    switch (seg.mode) {
      case Mode.NUMERIC:
        nodes.push([seg,
          { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },
          { data: seg.data, mode: Mode.BYTE, length: seg.length }
        ])
        break
      case Mode.ALPHANUMERIC:
        nodes.push([seg,
          { data: seg.data, mode: Mode.BYTE, length: seg.length }
        ])
        break
      case Mode.KANJI:
        nodes.push([seg,
          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
        ])
        break
      case Mode.BYTE:
        nodes.push([
          { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }
        ])
    }
  }

  return nodes
}
Generates a list of all possible nodes combination which
will be used to build a segments graph.

Nodes are divided by groups. Each group will contain a list of all the modes
in which is possible to encode the given text.

For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.
The group for '12345' will contain then 3 objects, one for each
possible encoding mode.

Each node represents a possible segment.

@param  {Array} segs Array of object with segments data
@return {Array}      Array of object with segments data