add getSegment  for get lib

use messages from xml