Package nltk :: Package wordnet :: Package browser :: Module browserver
[hide private]
[frames] | no frames]

Module browserver

source code

BrowServer is a server for browsing the NLTK Wordnet database It first launches a browser client to be used for browsing and then starts serving the requests of that and maybe other clients

Usage:

   browserver.py -h
   browserver.py [-s] [-p <port>]

Options:

   -h or --help
       Display this help message.

   -l <file> or --log-file <file>
       Logs messages to the given file, If this option is not specified
       messages are silently dropped.

   -p <port> or --port <port>
       Run the web server on this TCP port, defaults to 8000.

   -s or --server-mode
       Do not start a web browser, and do not allow a user to
       shotdown the server through the web interface.
Classes [hide private]
  MyServerHandler
Functions [hide private]
 
uc_updated_page(page, old_uc)
Returns the page with old unique counters changeed to new ones
source code
 
encode_icon() source code
 
favicon_data()
Return the data for the favicon image.
source code
 
get_unique_counter_from_url(sp)
Extract the unique counter from the URL if it has one.
source code
 
demo(port=8000, runBrowser=True, logfilename=None)
Run NLTK Wordnet Browser Server.
source code
 
startBrowser(url, server_ready) source code
 
usage()
Display the command line help message.
source code
Variables [hide private]
  page = None
  word = None
  firstClient = True
  viewed_pages = {}
  curr_page_num = 1
  uc_to_pn = {}
  uc_pat = re.compile(r'(%23\d+">)')
  server_mode = None
  logfile = None
  FAVICON_BASE64_DATA = ['AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAA...
Function Details [hide private]

get_unique_counter_from_url(sp)

source code 

Extract the unique counter from the URL if it has one. Otherwise return null.

demo(port=8000, runBrowser=True, logfilename=None)

source code 

Run NLTK Wordnet Browser Server.

Parameters:
  • port (int) - The port number for the server to listen on, defaults to 8000
  • runBrowser (boolean) - True to start a web browser and point it at the web server.

Variables Details [hide private]

FAVICON_BASE64_DATA

Value:
['AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAAAAAAAAAAA\
AAAA',
 'AAAAAAAAAAD___8A9___ANb3_wDO9_8AjPf_ALXv_wCc7_8AjO__AHvv_wBz7_8Aa-__\
AKXn',
 '_wCc5_8AlOf_AITn_wBz5_8Aa-f_AGPn_wBa5_8Ac97_AGve_wBj3v8AWt7_AFLe_wBK\
3v8A',
 'Qt7_AFrW_wBS1v8AStb_AELW_wA51v8AMdb_ACnO_wAhzv8AGM7_ABjG_wD___cA__f3\
APf3',
...