Poets that lasting marble seek,
Must carve in Latin or in Greek.
We write in sand, our language grows,
And like the tide, our work o'erflows.

-- Edmund Waller



Northwestern
MorphAdorner
    INFORMATION TECHNOLOGY  
    MorphAdorner Site Map  
MorphAdorner > Tech Talk > Using The Sample Servlets
 
Home
 
Announcements and News
 
Download MorphAdorner
 
Documentation
 
Licenses
 
Glossary
 
Helpful References
 
Tech Talk
 

Language Recognizer
 
Lemmatizer
 
Lexicon Lookup
 
Name Recognizer
 
Parser
 
Part of Speech Tagger
 
Pluralizer
 
Sentence Splitter
 
Spelling Standardizer
 
Text Segmenter
 
Verb Conjugator
 
Word Tokenizer
 
  Using The Sample Servlets
 
 

Using the Sample Servlets

The MorphAdorner web site offers simple online examples of a number of MorphAdorner facilities. These examples are written as Java servlets. The source code for these servlets is included in the MorphAdorner release materials. The servlet code appears in the src/edu/northwestern/at/morphadorner/servlets/ directory.

You can run these servlets on your own machine if you have more than a gigabyte of memory available (e.g., your machine has two gigabytes of memory).

  1. Make sure you have installed recent working copies of Sun's Java Development Kit and Apache Ant on your system.

  2. Open a command line window (on Windows) or a terminal window (on Unix).

  3. Move to the directory to which you installed the MorphAdorner release.

  4. Type the following command to build a servlet container to hold the MorphAdorner servlets.

    ant servlets

    When this command completes, the subdirectory jetty will contain a tiny web site consisting of a minimal version of the Jetty servlet server, the MorphAdorner code, and supporting libraries.

  5. You may now run the servlets by executing the runservlets batch file (Windows) or script (Unix/MacOSX) in the main MorphAdorner release directory. Wait until you see a message like

    INFO: Started SelectChannelConnector@0.0.0.0:8200

    This may take several minutes on a slow machine.

  6. Start a web browser and load the page:

    http://localhost:8200/morphadorner/

    You should see a page with links to each MorphAdorner servlet. Click on any one of the links to use the corresponding servlet.

  7. To stop the Jetty server, press <ctrl>C in the command line window in which you started Jetty.

You can read more about the Jetty server at http://www.mortbay.org/jetty/.

If you are already running another program which uses TCP port 8200, you can either stop that other program or use a different TCP port for the MorphAdorner servlets. To do that, edit the runservlets.bat or runservlets script file in the main MorphAdorner directory and change 8200 to an unused TCP port on your machine.

If you encounter any "out of memory" errors, you can raise the memory size allocated to the jetty server from 900k to, say, 1 gigabyte. To do that, edit the runservlets.bat or runservlets script file in the main MorphAdorner directory and change 900k to 1g.

All of the servlets extend the base class BaseAdornerServlet. Each servlet generates plain HTML output. There are no template libraries, template files, or JSP files used. All input uses plain HTML forms. All output is plain HTML. The cascading style sheet mstyle.css found in jetty/webapps/morphadorner/styles/mstyle.css sets the font and margins for the servlet output. You can modify that file to add any other kind of styling you prefer.

 

Information Technology | Academic Technologies | Scholarly Technologies 2East Resource Center |
Northwestern Home | Calendar: Plan-It Purple | Sites A-Z | Search
Academic Technologies  NU Library 2East  1970 Campus Drive  Evanston, IL 60208
E-mail: pib@northwestern.edu
Last updated Wed Apr 29 15:04:04 2009   World Wide Web Disclaimer and University Policy Statements   © 2007, 2008 Northwestern University