At some point I found Morfessor toolkit quite useful for that. Given a sufficient amount of text in a morphologically rich language, it decomposes words into most morph-like units. Check docs for more details on the algorithm : http://morfessor.readthedocs.io/