tech.monk
Guide
Well you needed sample code, do you think I'll give you production ready code. You can run as many analysis on it and go on to compare with Ruby or C or anything else as you like. You can suit yourself with your assumptions.I'd rather not diverge from the threads goal and indulge in idle speculation not related to learning python - trolls generally want to go off-topic, typically on Freenode's #python which is quite a nice place.
matplotlib is a Python library to graph/plot data.
I find studying other people's code to be quite useful: for example, "Flask" is a Python library/framework that allows a programmer to quickly display/process data via the web. I prefer YAML but for web-apps JSON is the norm. Not that I am an expert on Flask - I've forgotten a bit.
@app.route is a Flask python-decorator that basically maps the URL to a function - it's event driven. When the Flask framework/code receives the URL request (the '/home.html' or whatever) on port/whatever, it will call your function with data as arguments to it. In fact Flask will wrap all the HTTP Headers and such in an object for you to use within your code.
"from flask import request"
One thing I found very different from Perl/C was this:
nlp = Nlp.NLP() #basically you are calling a class in the module Nlp and instantiating/creating an object but in perl you can always tell what a var-name is because it'll be $foo for scalar - the '$' indicates scalar/single-value variables - so in python figuring out the type is quite tricky and extremely annoying! Why? Because the methods you can call on the object depend on the type - in Python you can't tell what 'word' is.. so I have to make it 'words' vs 'word' or sometimes do l_x for list_x.
Another curious thing is
> if Text is None: #in python 'None' is an object - 1 object - there is only one "None" no matter the number of times you use it, so you are not doing a numerical comparison - it's not a variable! Typically in C we do numeric comparisons (checking for NUL/NULL) which is an integer value/macro/direct integer comparison. With None we are actually checking it's physical address (pointer address - kind off) - because there's only one None object ever, you can do that.