python code for automatic morphological analysis