Friday, January 6, 2017

Understanding Python

I wanted to understand how to build a search engine. Daniel Shiffman implements his TFIDF index in JavaScript. Arden Dertat implements his search engine with TFIDF in Python.

I want to implement everything in JavaScript. To use Arden's code, it might be useful to learn Python. I found "How to Learn Python in Five Minutes - Daniel Moniz" on YouTube. (https://www.youtube.com/watch?v=ohr6O78jGzs) .

His code gives me the idea to try to implement the waypaver scraping script in python https://github.com/bshambaugh/waypaver-lsi/blob/master/scraper-four.php . I don't need it in Python, but such an exercise would teach me a bit about python in addition to making refactoring the PHP script to a more OOP scheme more interesting. Python is all about objects. Everything in Python is an object. If I wanted to go further, he mentioned coderbyte (https://coderbyte.com/) which offers some challenges as well as asking and answering questions on stackoverflow.

Resolving the programmers page at python.org (https://wiki.python.org/moin/BeginnersGuide/Programmers) leads me to a resource at (http://www.afterhoursprogramming.com/tutorial/Python/Overview/).  I even found a tutorial about a web crawler if I want it (https://code.tutsplus.com/courses/crawl-the-web-with-python).

Looking at my scraper tells me I need to retrieve web pages. The Requests gives me some idea: http://docs.python-requests.org/en/master/ . If I believe the good words about it, it may be a good idea.

Doing this would also lead me to understand the code in SWAP (if I care to understand it). http://www.w3.org/2000/10/swap.doc




No comments:

Post a Comment