from TreeTaggerWrapper import treetaggerwrapper #1) build a TreeTagger wrapper: tagger = treetaggerwrapper.TreeTagger(TAGLANG='en',TAGDIR='D:/Programme/TreeTagger') #2) tag your text. tags = tagger.TagText("This is a very short text to tag.") #3) use the tags list... (list of string output from TreeTagger). print tags # Check, whether the format of the tagged postings is good for the tagged corpus reader # p.51 NLTK Cookbook input_directory = path from nltk.corpus.reader import TaggedCorpusReader reader = TaggedCorpusReader(input_directory, r'.*\.txt') reader.words() # ['The', 'expense', 'and', 'time', 'involved', 'are', ...] reader.tagged_words() reader.sents() reader.tagged_sents() reader.paras() reader.tagged_paras() # testing the import # #import sys import myMath print myMath.add(4,5) print myMath.division(4, 2) print myMath.multiply(10, 5) print myMath.fibonacci(8) print myMath.squareroot(48)