You can use ChaSen library to put ChaSen's module into other programs. ChaSen is a morphological analysis system. It can segment and tokenize Japanese text string, and can output with many additional information (pronunciation, semantic information, and others).