Mining, compressing and classifying with extensible motifs