# -*- coding: utf-8 -*- #!/usr/bin/python3.5 -S # python -m spacy.en.download python -m spacy.de.download # https://spacy.io/docs/#tutorials #https://www.w3.org/services/html2txt # CSS: http://codepen.io/explosion/pen/xEpgKz # CSS 2: https://explosion.ai/blog/displacy-ent-named-entity-visualizer import time #pip install --upgrade 3to2 #pip install --upgrade language-check ### grammar checker ######## https://github.com/lpenz/atdtool/blob/master/atdtool/__init__.py ###########http://stackoverflow.com/questions/10252448/how-to-check-whether-a-sentence-is-correct-simple-grammar-check-in-python --> https://pypi.python.org/pypi/grammar-check https://pypi.python.org/pypi/language-check #Statistical spell- and (occasional) grammar-checker. http://lindat.mff.cuni.cz/services/korektor #https://github.com/ufal/korektor # spell correction: http://norvig.com/spell-correct.html # grammar correct: http://www.abisource.com/projects/link-grammar/#download # python based grammar check based on learning https://www.openhub.net/p/grac # http://www.decontextualize.com/teaching/rwet/n-grams-and-markov-chains/ start_time = time.time() import os os.system('clear') import sys # import sys package, if not already imported #from textblob_de import TextBlobDE import spacy t1 = u"ich gehe spazieren und esse ein Eis." t2 = u"das warme Essen schmeckt sehr lecker, denn es ist sehr schmackhaft zubereitet." #nlp = spacy.load('de', tagger=True, parser=True, entity=True) #nlp = spacy.load('de') nlp = spacy.de.German() toks1 = nlp(t1) toks2 = nlp(t2) print(toks1), print("\n") for token1 in toks1: print(token1, token1.pos, token1.pos_) print(toks2), print("\n") for token2 in toks2: print(token2, token2.pos, token2.pos_) ft = (time.time() - start_time) print("Script Runtime: --- "), print(ft), print(" ---- Seconds") sys.exit(0)