A WordNet Browser application which launches the default browser (if it is not already running) and opens a new tab with a connection to http://localhost:port/ . It also starts an HTTP server on the specified port and begins serving browser requests. The default port is 8000. (For command-line help, run "python wordnet -h") This application requires that the user's web browser supports Javascript.
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.
Class |
|
Undocumented |
Class |
|
A reference to a page that may be generated by page_word |
Function | app |
Undocumented |
Function | get |
Get synset relations data for a synset. Note that this doesn't yet support things such as full hyponym vs direct hyponym. |
Function | get |
Get the static index page. |
Function | get |
Return a static HTML page from the path given. |
Function | get |
Return the upper frame page, |
Function | get |
Return the static web help page. |
Function | get |
Get the static welcome page. |
Function | get |
Extract the unique counter from the URL if it has one. Otherwise return null. |
Function | lemma |
Undocumented |
Function | make |
Undocumented |
Function | page |
Returns a tuple of the HTML page built and the new current word |
Function | page |
Returns a tuple of the HTML page built and the new current word |
Function | page |
Return a HTML page for the given word. |
Function | pg |
Return a HTML page of NLTK Browser format constructed from the word and body |
Function | rebuild |
Undocumented |
Function | start |
Undocumented |
Function | usage |
Display the command line help message. |
Function | wnb |
Run NLTK Wordnet Browser Server. |
Constant | ALSO |
Undocumented |
Constant | ANTONYM |
Undocumented |
Constant | ATTRIBUTE |
Undocumented |
Constant | CAUSE |
Undocumented |
Constant | DERIVATIONALLY |
Undocumented |
Constant | ENTAILMENT |
Undocumented |
Constant | FRAMES |
Undocumented |
Constant | HYPERNYM |
Undocumented |
Constant | HYPONYM |
Undocumented |
Constant | INDIRECT |
Undocumented |
Constant | INSTANCE |
Undocumented |
Constant | INSTANCE |
Undocumented |
Constant | MEMBER |
Undocumented |
Constant | MEMBER |
Undocumented |
Constant | PART |
Undocumented |
Constant | PART |
Undocumented |
Constant | PERTAINYM |
Undocumented |
Constant | SIMILAR |
Undocumented |
Constant | SUBSTANCE |
Undocumented |
Constant | SUBSTANCE |
Undocumented |
Constant | VERB |
Undocumented |
Variable | CLASS |
Undocumented |
Variable | CLASS |
Undocumented |
Variable | CLASS |
Undocumented |
Variable | explanation |
Undocumented |
Variable | first |
Undocumented |
Variable | full |
Undocumented |
Variable | html |
Undocumented |
Variable | html |
Undocumented |
Variable | logfile |
Undocumented |
Variable | server |
Undocumented |
Function | _abbc |
abbc = asterisks, breaks, bold, center |
Function | _bold |
Undocumented |
Function | _center |
Undocumented |
Function | _collect |
Return a HTML unordered list of synsets for the given word and part of speech. |
Function | _collect |
Returns the HTML string for one synset or word |
Function | _get |
The synset key is the unique name of the synset, this can be retrived via synset.name() |
Function | _hlev |
Undocumented |
Function | _italic |
Undocumented |
Function | _li |
Undocumented |
Function | _pos |
This function returns the complete pos tuple for the partial pos tuple given to it. It attempts to match it against the first non-null component of the given pos tuple. |
Function | _pos |
Undocumented |
Function | _synset |
Builds the HTML string for the relations of a synset |
Function | _ul |
Undocumented |
Get synset relations data for a synset. Note that this doesn't yet support things such as full hyponym vs direct hyponym.
Return the upper frame page,
If with_shutdown is True then a 'shutdown' button is also provided to shutdown the server.
Returns a tuple of the HTML page built and the new current word
Parameters | |
href:str | The hypertext reference to be solved |
Returns | |
A tuple (str,str) | A tuple (page,word), where page is the new current HTML page to be sent to the browser and word is the new current word |
Returns a tuple of the HTML page built and the new current word
Parameters | |
href:str | The hypertext reference to be solved |
Returns | |
A tuple (str,str) | A tuple (page,word), where page is the new current HTML page to be sent to the browser and word is the new current word |
Return a HTML page for the given word.
Parameters | |
word:str | The currently active word |
Returns | |
A tuple (str,str) | A tuple (page,word), where page is the new current HTML page to be sent to the browser and word is the new current word |
Return a HTML page of NLTK Browser format constructed from the word and body
Parameters | |
word:str | The word that the body corresponds to |
body:str | The HTML body corresponding to the word |
Returns | |
str | a HTML page for the word-body combination |
Run NLTK Wordnet Browser Server.
Parameters | |
port:int | The port number for the server to listen on, defaults to 8000 |
run | True to start a web browser and point it at the web server. |
logfilename | Undocumented |
Returns the HTML string for one synset or word
to display. :type synset_relations: dict(synset_key, set(relation_id)) :return: The HTML string built for this synset :rtype: str
Parameters | |
word:str | the current word |
synset:synset | a synset |
synset | information about which synset relations |
This function returns the complete pos tuple for the partial pos tuple given to it. It attempts to match it against the first non-null component of the given pos tuple.
Builds the HTML string for the relations of a synset
Parameters | |
word:str | The current word |
synset:Synset | The synset for which we're building the relations. |
synset | synset keys and relation types for which to display relations. |
Returns | |
str | The HTML for a synset's relations |