Changes between Version 11 and Version 12 of Justext


Ignore:
Timestamp:
02/06/19 16:03:16 (5 years ago)
Author:
admin
Comment:

Justext v1.5.1

Legend:

Unmodified
Added
Removed
Modified
  • Justext

    v11 v12  
    1111
    1212== Installation ==
    13 1. Make sure you have Python and lxml library version 2.2.4 or later installed.
     131. Make sure you have Python and lxml library version 4.1 or later installed.
    14142. Download the sources:
    1515{{{
    16 wget http://corpus.tools/raw-attachment/wiki/Downloads/justext-1.4.tar.gz
     16wget http://corpus.tools/raw-attachment/wiki/Downloads/justext-1.5.tar.gz
    1717}}}
    18183. Extract the downloaded file:
    1919{{{
    20 tar xzvf justext-1.4.tar.gz
     20tar xzvf justext-1.5.tar.gz
    2121}}}
    22224. Install the package (you may need sudo or a root shell for the latter command):
    2323{{{
    24 cd justext-1.4/
     24cd justext-1.5.1/
    2525python setup.py install
    2626}}}
     
    3737
    3838== Python API ==
     39Python 3.6 & Python 2.7 compatible
    3940{{{
    40 import urllib2
    4141import justext
     42import requests
     43page = requests.get('http://planet.python.org/').text.encode('utf-8')
    4244
    43 page = urllib2.urlopen('http://planet.python.org/').read()
    4445paragraphs = justext.justext(page, justext.get_stoplist('English'))
    4546for paragraph in paragraphs:
    4647    if paragraph['class'] == 'good':
    47         print paragraph['text']
     48        print(paragraph['text'])
     49
    4850}}}
    4951