d(Z?d)Z,d*Z?d+Z>d,Z@d-ZAd.ZBd/ZCd0ZDd1ZEd2ZFd3ZGd4ZHd5ZId6ZJd7ZKd8ZLd9ZMd:ZNd;ZOeNeLeKd<d=ZPd>ZQd?ZReSd@ZTdAZUdBeVfdCYZWdDZXdEZYdFZZdGZ[dHZ\dIZ]dJZ^dKZ_dLZ`dMZadNZbecdOkrebndPgZddS(QsX 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 ] Options:: -h or --help Display this help message. -l or --log-file Logs messages to the given file, If this option is not specified messages are silently dropped. -p or --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. i(tprint_function(tpathN(targv(t defaultdict(tcompat(twordnet(tSynsettLemma(t HTTPServertBaseHTTPRequestHandlertMyServerHandlercBs/eZdZdZddZdZRS(cCs|jdS(N(t send_head(tself((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytdo_HEAD\sc Csm|jd}tj|dkrQtr7d}d}qCtdtjdn|dkrd}t rtrtat t }n t t}d }n|j d rGd}tj|}|d kr2d }tjj |r t |d }|j}WdQXqDt|d|ddddt}qC|}t|}n|jdrd}|jddjd}g|D]4}|jdr|jddjdd^qd}t|\}}nq|jdr d}|td}t|\}}n7|dkr3d}td\}}nd}d|}|j||jj|jddS(NisSHUTDOWN THE SERVERs#Server must be killed with SIGTERM.s text/plainsServer shutting down!its text/htmltgreens.htmls'NLTK Wordnet Browser Database Info.htmls* Database Info *trs

The database info file:

ss

was not found. Run this:s

python dbinfo_html.pys

to produce it.tsearcht?t&tnextWordt=t+t tlookup_t start_pageRsCould not parse request: '%s'tutf8(RRt unquote_plust server_modetprinttost_exitt firstClienttFalsetget_static_index_pagetTruetendswithtisfiletopentreadt html_headert html_trailertget_static_page_by_patht startswithtsplittreplacetpage_from_wordtlentpage_from_hrefR twfiletwritetencode( R tsptpagettypetwordtusptinfiletpartstp((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytdo_GET_sT        )B   cCs+|jd|jd||jdS(Nis Content-type(t send_responset send_headert end_headers(R R6((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR s cGs7tr3tjd|j|j||fndS(Ns%s - - [%s] %s (tlogfileR2taddress_stringtlog_date_time_string(R tformattargs((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt log_messages   N(t__name__t __module__R R<tNoneR RE(((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR Zs  A cCs5|jd}|dkr-t||dSdSdS(s\ Extract the unique counter from the URL if it has one. Otherwise return null. s%23iiN(trfindtintRH(R4tpos((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytget_unique_counter_from_urls i@cCs3| a|r_yt|ddaWqetk r[}tjjd||tjdqeXndadt |}d}d}|rt j }t ||}nt d|ft}trtjd|n|r|jny|jWntk rnX|r|jntr/tjndS(s' Run NLTK Wordnet Browser Server. :param port: The port number for the server to listen on, defaults to 8000 :type port: int :param runBrowser: True to start a web browser and point it at the web server. :type runBrowser: bool tais Couldn't open %s for writing: %sshttp://localhost:Rs0NLTK Wordnet browser server running serving: %s N(RR&R@tIOErrortsyststderrR2texitRHtstrt threadingtEventt startBrowserRR tsett serve_forevertKeyboardInterrupttjointclose(tportt runBrowsert logfilenameteturlt server_readytbrowser_threadtserver((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytwnbs:      cs2fd}tjd|}|j|S(Ncs4jtjdtjdddddS(Nitnewit autoraise(twaitttimetsleept webbrowserR&((R`R_(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytruns  ttarget(RStThreadtstart(R_R`Rjtt((R`R_sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRUs cCs@tjddftjddftjddftjddfgS( NtNtnountVtverbtJtadjtRtadv(twntNOUNtVERBtADJtADV(((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt _pos_tuples"scCs|ddkr*d|d|df}nx*t|D]\}}|dk r7Pq7q7Wx)tD]}||||kra|SqaWdS(s 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. itsRMiiN(t enumerateRHR|(t pos_tupletntxtpt((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt _pos_match)s iiiiiiiiii i i i iiiiiiiiiiii iicsDfdg|jD]!}|j|kr||^qS(Ncs*|gkrgS|d|dSdS(Nii((tl(tflattern(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR[s (tlemmastname(R7tsynsettfuncR((Rsf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytlemma_propertyYscCs7|d}|d}|g|D]}t|^qfS(Nii(t rebuild_tree(t orig_treetnodetchildrenRn((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRds  cCs|jtjkr7td|jftd|jftd|jft dt |j ddft d|j ftd|jftd |jftd |jftd |jftd |jftd |jftd|jftdt||dftdt||dffS|jtjkrtdt||dftd|jftd|jft dt |j ddft d|j!ft"d|j#ft$d|j%ft&d|j'ftdt||dff S|jtj(ks;|jtj)krtdt||dft*d|j+ft,dt||dftd|jft$d|j%ffS|jtj-krtdt||d ffSt.d!t/|jd"S(#s Get synset relations data for a synset. Note that this doesn't yet support things such as full hyponym vs direct hyponym. tHyponymssInstance hyponymssDirect hypernymssIndirect hypernymscSs |jS(N(t hypernyms(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytwsisInstance hypernymss Part holonymss Part meronymssSubstance holonymssSubstance meronymssMember holonymssMember meronymst AttributestAntonymscSs |jS(N(tantonyms(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRssDerivationally related formcSs |jS(N(tderivationally_related_forms(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRstAntonymcSs |jS(N(R(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRstHyponymcSs |jS(N(R(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRst EntailmentstCausessAlso sees Verb GroupscSs |jS(N(R(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRscSs |jS(N(R(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRss Similar tot PertainymscSs |jS(N(t pertainyms(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRscSs |jS(N(R(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRssUnhandles synset POS type: N(0RKRwRxtHYPONYMthyponymstINSTANCE_HYPONYMtinstance_hyponymstHYPERNYMRtINDIRECT_HYPERNYMSRttreetINSTANCE_HYPERNYMtinstance_hypernymst PART_HOLONYMt part_holonymst PART_MERONYMt part_meronymstSUBSTANCE_HOLONYMtsubstance_holonymstSUBSTANCE_MERONYMtsubstance_meronymstMEMBER_HOLONYMtmember_holonymstMEMBER_MERONYMtmember_meronymst ATTRIBUTEt attributestANTONYMRtDERIVATIONALLY_RELATED_FORMRyt ENTAILMENTt entailmentstCAUSEtcausestALSO_SEEt also_seest VERB_GROUPt verb_groupsRztADJ_SATtSIMILARt similar_tost PERTAINYMR{t TypeErrorRR(R7R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytget_relations_datajs~                 '  su NLTK Wordnet Browser display of: %s s s

Search Help

  • The display below the line is an example of the output the browser shows you when you enter a search word. The search word was green.
  • The search result shows for different parts of speech the synsets i.e. different meanings for the word.
  • All underlined texts are hypertext links. There are two types of links: word links and others. Clicking a word link carries out a search for the word in the Wordnet database.
  • Clicking a link of the other type opens a display section of data attached to that link. Clicking that link a second time closes the section again.
  • Clicking S: opens a section showing the relations for that synset.
  • Clicking on a relation name opens a section that displays the associated synsets.
  • Type a search word in the Word field and start the search by the Enter/Return key or click the Search button.

cCsd|S(Ns %s((ttxt((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_boldscCsd|S(Ns
%s
((R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_centerscCsd|||fS(Ns %s((RR((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_hlevscCsd|S(Ns %s((R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_italicscCsd|S(Ns
  • %s
  • ((R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_liscCst||tS(s: Return a HTML page of NLTK Browser format constructed from the word and body :param word: The word that the body corresponds to :type word: str :param body: The HTML body corresponding to the word :type body: str :return: a HTML page for the word-body combination :rtype: str (R(R)(R7tbody((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytpgs cCs d|dS(Ns
      s
    ((R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_ulscCs(ttdddd|ddS(s0 abbc = asterisks, breaks, bold, center s
    i t*Rs **********s **********(RR(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_abbcss(has full hyponym continuation)s cCs tj|S(se The synset key is the unique name of the synset, this can be retrived via synset.name() (RwR(t synset_key((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt _get_synsetsc sWt|trtdnd}t|jddf}|dk satd|j|d}tjt |}|j ||d}|j |krt |}ndt |||f}fd|djfd |jD7}d |jd jd |jDf} || t||d S(s| Returns the HTML string for one synset or word :param word: the current word :type word: str :param synset: a synset :type synset: synset :param synset_relations: information about which synset relations to display. :type synset_relations: dict(synset_key, set(relation_id)) :return: The HTML string built for this synset :rtype: str s)word not supported by _collect_one_synsettSs#pos_tuple is null: synset.pos(): %sit;s
  • %s (%s) csK|jdd}|jkr.t|St|}t||SdS(Nt_R(R-tlowerRt Referencetmake_lookup_link(twtref(R7(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt format_lemma%s   s, c3s!|]}|jVqdS(N(R(t.0R(R(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys -ss (%s) %s s; css|]}d|VqdS(s"%s"N((RR^((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys 1ss
  • N(t isinstancettupletNotImplementedErrorRRKRHtAssertionErrortcopytdeepcopyRt toggle_synsetRRRRYRt definitiontexamplest_synset_relations( R7Rtsynset_relationsttypRtdescrRt synset_labelR}tgl((RR7sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_collect_one_synset s$"   ) #cs0ddjfdtj|DS(s\ Return a HTML unordered list of synsets for the given word and part of speech. s
      %s
    Rc3s!|]}t|VqdS(N(R(RR(RR7(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys :s(RYRwtsynsets(R7RKR((RR7sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt_collect_all_synsets4scs}j|krdSt||fdfdddjfdt|Dd}|S(s Builds the HTML string for the relations of a synset :param word: The current word :type word: str :param synset: The synset for which we're building the relations. :type synset: Synset :param synset_relations: synset keys and relation types for which to display relations. :type synset_relations: dict(synset_key, set(relation_type)) :return: The HTML for a synset's relations :rtype: str Rcst|tr6tt|jd|jdSt|trU|jSt|trd|ddjfd|dDfSt dt ||fdS(Nis%s
      %s
    Rc3s|]}d|VqdS(s
  • %s
  • N((Rtsr(t relation_html(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys Zsis?r must be a synset, lemma or list, it was: type(r) = %s, r = %s( RRRRt lemma_namesRRRRYRR6(R(R(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRPs' %csudttjj|j|}|jjkrq|ddjfd|D7}n|S(Ns %s s
      %s
    Rc3s|]}d|VqdS(s
  • %s
  • N((RR(R(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys fs(RRRttoggle_synset_relationR3RRRY(tdb_namet disp_nametrelst synset_html(RRR(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytmake_synset_html^s $s
      s c3s/|]%}|dgkrd|VqdS(is
    • %s
    • N((Rtrel_data(R(sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pys kss
    (RRRYR(R7RRthtml((RRRRsf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR>s)RcBsGeZdZedZdZedZdZdZ RS(sB A reference to a page that may be generated by page_word cCs||_||_dS(s1 Build a reference to a new page. word is the word or words (separated by commas) for which to search for synsets of synset_relations is a dictionary of synset keys to sets of synset relation identifaiers to unfold a list of synset relations for. N(R7R(R R7R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt__init__xs cCs1tj|j|jfd}tj|jS(sJ Encode this reference into a string to be used in a URL. i(tpickletdumpsR7Rtbase64turlsafe_b64encodetdecode(R tstring((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR3scCs7tj|j}tj|\}}t||S(sB Decode a reference encoded with Reference.encode (Rturlsafe_b64decodeR3RtloadsR(RR7R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRscCsT||j|jkr6|j|jj|n|j|jj||S(s Toggle the display of the relations for the given synset and relation type. This function will throw a KeyError if the synset is currently not being displayed. (RRtremovetadd(R Rtrelation((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRscCsB|j|jkr(|j|j=nt|j|j<|S(sN Toggle displaying of the relation types for the given synset (RRRV(R R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRs( RFRGt__doc__tdictRR3t staticmethodRRR(((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRss   cCsd|j|fS(Ns%s(R3(Rtlabel((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRscCstt|S(s- Return a HTML page for the given word. :param word: The currently active word :type word: str :return: 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 :rtype: A tuple (str,str) (tpage_from_referenceR(R7((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR.s cCsttj|S(sQ Returns a tuple of the HTML page built and the new current word :param href: The hypertext reference to be solved :type href: str :return: 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 :rtype: A tuple (str,str) (RRR(thref((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR0s c Cs|j}tt}|jd}gg|D]$}|jjjdd^q.D]}|dkrV|^qV}t|dkrd Sxs|D]k}xbtj tj tj tj gD]B}tj ||}|r|||kr||j|qqWqWd}xtD]{\}}} ||kr|td| d7}xF||D]7}y|t|||j7}WqMtk rqMXqMWqqW|sd |}n||fS( sQ Returns a tuple of the HTML page built and the new current word :param href: The hypertext reference to be solved :type href: str :return: 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 :rtype: A tuple (str,str) t,RRRis$Please specify a word to search for.is s8The word or words '%s' where not found in the dictonary.(Rs$Please specify a word to search for.(R7RtlistR,tstripRR-R/RwRxRyRzR{tmorphytappendR|RRRtKeyError( RR7t pos_formstwordsRRKtformRtpos_strR((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRs2  2 %   cCs|dkrttS|dkr,ttS|dkr<dS|dkrRttS|dkrhttS|dkr{tS|dkrtSd |Sd S( s8 Return a static HTML page from the path given. s index_2.htmls index.htmls'NLTK Wordnet Browser Database Info.htmls7Display of Wordnet Database Statistics is not supporteds upper_2.htmls upper.htmls web_help.htmls wx_help.htmls4Internal error: Path for static page '%s' is unknownN(R"R!R#tget_static_upper_pagetget_static_web_help_pagetget_static_wx_help_page(R((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR*s           cCsdS(s* Return the static web help page. s NLTK Wordnet Browser display of: * Help *

    NLTK Wordnet Browser Help

    The NLTK Wordnet Browser is a tool to use in browsing the Wordnet database. It tries to behave like the Wordnet project's web browser but the difference is that the NLTK Wordnet Browser uses a local Wordnet database.

    You are using the Javascript client part of the NLTK Wordnet BrowseServer. We assume your browser is in tab sheets enabled mode.

    For background information on Wordnet, see the Wordnet project home page: http://wordnet.princeton.edu/. For more information on the NLTK project, see the project home: http://nltk.sourceforge.net/. To get an idea of what the Wordnet version used by this browser includes choose Show Database Info from the View submenu.

    Word search

    The word to be searched is typed into the New Word field and the search started with Enter or by clicking the Search button. There is no uppercase/lowercase distinction: the search word is transformed to lowercase before the search.

    In addition, the word does not have to be in base form. The browser tries to find the possible base form(s) by making certain morphological substitutions. Typing fLIeS as an obscure example gives one this. Click the previous link to see what this kind of search looks like and then come back to this page by using the Alt+LeftArrow key combination.

    The result of a search is a display of one or more synsets for every part of speech in which a form of the search word was found to occur. A synset is a set of words having the same sense or meaning. Each word in a synset that is underlined is a hyperlink which can be clicked to trigger an automatic search for that word.

    Every synset has a hyperlink S: at the start of its display line. Clicking that symbol shows you the name of every relation that this synset is part of. Every relation name is a hyperlink that opens up a display for that relation. Clicking it another time closes the display again. Clicking another relation name on a line that has an opened relation closes the open relation and opens the clicked relation.

    It is also possible to give two or more words or collocations to be searched at the same time separating them with a comma like this cheer up,clear up, for example. Click the previous link to see what this kind of search looks like and then come back to this page by using the Alt+LeftArrow key combination. As you could see the search result includes the synsets found in the same order than the forms were given in the search field.

    There are also word level (lexical) relations recorded in the Wordnet database. Opening this kind of relation displays lines with a hyperlink W: at their beginning. Clicking this link shows more info on the word in question.

    The Buttons

    The Search and Help buttons need no more explanation.

    The Show Database Info button shows a collection of Wordnet database statistics.

    The Shutdown the Server button is shown for the first client of the BrowServer program i.e. for the client that is automatically launched when the BrowServer is started but not for the succeeding clients in order to protect the server from accidental shutdowns.

    ((((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRs,cCsdS(s& Get the static welcome page. s

    Search Help

    • The display below the line is an example of the output the browser shows you when you enter a search word. The search word was green.
    • The search result shows for different parts of speech the synsets i.e. different meanings for the word.
    • All underlined texts are hypertext links. There are two types of links: word links and others. Clicking a word link carries out a search for the word in the Wordnet database.
    • Clicking a link of the other type opens a display section of data attached to that link. Clicking that link a second time closes the section again.
    • Clicking S: opens a section showing the relations for that synset.
    • Clicking on a relation name opens a section that displays the associated synsets.
    • Type a search word in the Next Word field and start the search by the Enter/Return key or click the Search button.
    ((((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytget_static_welcome_messageHscCs#d}|rd}nd}||S(s$ Get the static index page. sT NLTK Wordnet Browser s upper.htmls upper_2.html((t with_shutdownttemplatet upper_link((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyR"`s  cCs#d}|rd}nd}||S(s Return the upper frame page, If with_shutdown is True then a 'shutdown' button is also provided to shutdown the server. s Untitled Document
    Current Word:  Next Word: 
    Help %s s*ShutdownR((RRt shutdown_link((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyRs  cCsttdS(s0 Display the command line help message. N(RR(((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytusagescCstjtddddddg\}}d}t}t}d}x|D]\}}|dksn|d kr}t|}qJ|d ks|d krt|}qJ|d ks|d krt}qJ|dks|dkrJt}qJqJW|rtnt|| |dS(Nisl:p:shslogfile=sport=s server-modethelpi@s-ls --logfiles-ps--ports-ss --server-modes-hs--help( tgetoptRR!RHRRRJR#RRc(toptsRR[Rt help_modeR]topttvalue((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pytapps$   t__main__R"(eRt __future__RRORRRt collectionsRRitdatetimetreRSRgRRRRtnltkRt nltk.corpusRRwtnltk.corpus.reader.wordnetRRtPY3t http.serverRR tBaseHTTPServerR#R RHRR@R RLRcRUR|RRRtCLASS_REGIONALRRRRRRRRRRRRRRRtFRAMESRtCLASS_CATEGORYt CLASS_USAGERRRRRR(R)t explanationRRRRRRRRtfull_hyponym_cont_textRRRRRtobjectRRR.R0RR*RRR"RRR"RFt__all__(((sf/private/var/folders/cc/xm4nqn811x9b50x1q_zpkmvdjlphkp/T/pip-build-FUwmDn/nltk/nltk/app/wordnet_app.pyt*s            V I     X          * 5A  1  /   )