Skip to content

Commit

Permalink
Missing Link fixed
Browse files Browse the repository at this point in the history
read me updated
  • Loading branch information
Oshini committed Mar 27, 2014
1 parent a3335c7 commit f67e916
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -20,9 +20,8 @@ There are two options for installing TweeQL:
1. **from github**. After checking out this repository, run `sudo python setup.py install` to install! Note: if you do this in Ubuntu/Debian, type `sudo apt-get install python-setuptools` first.

Installing Python in Windows:
1. Download and Install pyreadline using a suitable installer from here: (https://pypi.python.org/pypi/pyreadline/2.0)
2. Modify import statement in tweeql-command-line.py
3. run `python setup.py install` on the windows command line.
1. Download and Install pyreadline using a suitable installer from here: https://pypi.python.org/pypi/pyreadline/2.0
2. run `python setup.py install` on the windows command line.

Initializing your Settings
==========================
Expand Down Expand Up @@ -162,7 +161,7 @@ The examples we have shown have used several user-defined functions (`sentiment`
runner = QueryRunner()
runner.run_query("SELECT stringlength(text) AS len FROM twitter_sample;", False)

In this example, we build the class `StringLength`, which has two methods: a `factory` method and an `strlen` method. Stricly speaking, the only method that a UDF requires is a `factory` method, which returns another method (in this case `strlen`) that performs the actual computation. The only requirement for the UDF computation method is that its first argument be `tuple_data`, a dictionary of data that is returned with all tweets (read more about this --This link is missing.[here](http://mehack.com/map-of-a-twitter-status-object)).
In this example, we build the class `StringLength`, which has two methods: a `factory` method and an `strlen` method. Stricly speaking, the only method that a UDF requires is a `factory` method, which returns another method (in this case `strlen`) that performs the actual computation. The only requirement for the UDF computation method is that its first argument be `tuple_data`, a dictionary of data that is returned with all tweets (read more about this [here](http://www.scribd.com/doc/30146338/map-of-a-tweet)).


You can include any number of arguments after `tuple_data`. In our case, we only take one: the string `val` which we wish to take the length of. Note that when we run the query on the last line of this example, we pass `text` as an argument to `stringlength`---this is the value that `val` will take on.
Expand Down
6 changes: 4 additions & 2 deletions tweeql/bin/tweeql-command-line.py
Expand Up @@ -6,8 +6,10 @@
import settings
import traceback
import readline
#Installing on Windows, uncomment the line below
#import pyreadline as readline
try:
import pyreadline as readline
except:
pass

def main():
runner = QueryRunner()
Expand Down

0 comments on commit f67e916

Please sign in to comment.