This directory contains examples of running 
   ltchunk (the syntactic chunker)


Make shure that you successfully run
ltinstall as explained in  ../README file.

================================================================
III. RUNNING THE CHUNKER
================================================================
You can run the chunker to handle plain ASCII or (n)SGML/XML
marked-up texts. 

------------------------------------------
A. Running the chunker over ASCII texts
------------------------------------------
An example of chunking an ASCII text is

 >> cat text | /LTCHUNK/bin/ltchunk

The output of the program will contain noun groups enclosed into [[ ]]
brackets and verb groups enclosed into (( )) brackets:

  [[ A Pentagon study  ]](( re-affirmed  ))[[ the conclusion  ]]of [[ previous
government investigations  ]]that [[ both Rear Admiral Husband E. Kimmel
 ]]and [[ his Army counterpart ]], [[ Maj. Gen. Walter C. Short ]], ``(( committed
 ))[[ errors  ]]of [[ judgment  ]]''.  

You can also output part-of-speech information with every word using the flag -show_tags:
  >> cat EXAMPLES/text   | ltchunk -show_tags

In this mode the chunker will output words as word_TAG structures:

  [[ A_DT Pentagon_NNP study_NN  ]](( re-affirmed_VBD  ))[[ the_DT conclusion_NN  ]]of_IN [[ previous_JJ
government_NN investigations_NNS  ]]that_IN [[ both_DT Rear_NNP Admiral_NNP Husband_NNP E._NNP Kimmel_NNP
 ]]and_CC [[ his_PRP$ Army_NNP counterpart_NN ]],_, [[ Maj._NNP Gen._NNP Walter_NNP C._NNP Short_NNP ]],_, ``(( committed_VBD
 ))[[ errors_NNS  ]]of_IN [[ judgment_NN  ]]''._.

For the explanation of Penn Treebank  TAGS look at:
   http://www.ltg.ed.ac.uk/~mikheev/tagger_demo.html#PennTagset


-----------------------------------------
B. Running the chunker over XML texts
------------------------------------------
An example of chunking XML text is:


 >> cat /LTCHUNK/EXAMPLES/text.xml | /LTCHUNK/bin/ltchunk -q ".*/TEXT" -qs ".*/P" 
 >> cat /LTCHUNK/EXAMPLES/text.xml | /LTCHUNK/bin/ltchunk -q ".*/TEXT" -qs ".*/P" -show_tags


Here you specify a LTNSL query (".*/P") which says that only content of P
elements should be chunked and all other fields will be outputted without
modification. The XML format allows you to apply processing only to that
parts of your documents which are relevant e.g. P elements contain text but
SLUG elements of the file text.xml would require specialized
processing. 

In xml mode input file might have an appropriate Document Type Definition
(DTD).  If input file and its DTD are located in different directories
you can use -u option which sets the URL (absolute or relative) for the
DTD file. When input file and its DTD are located in the same directory
but you use input file as a stream i.e. you pipe it to the chunker you
should use -u option if your current directory is different from the
directory of the DTD file. Remember that the URL should always be ending
by "/". Example: -u /home/mikheev/LTCHUNK/EXAMPLE/ or -u EXAMPLE/



For more information on  the advantages of explicit markup look at
  http://www.ltg.ed.ac.uk/~mikheev/papers.html#anlp-97

For extended specification of the LTNSL query language look at 
  http://www.ltg.ed.ac.uk/~dmck/nsldoc/node40.html 


-----------------------------------------------
C. Running the chunker in the client/server mode
------------------------------------------------
The chunker spends a considerable time to load all necessary resources
on initialization. It is possible, however, to run it in the client/server
mode where some of the chunker's modules are pre-loaded and hence
do not require initialization every single time the chunker is called.
To load the server do:

  host>>/LTCHUNK/ltpos     -server   #PORT_NUMBER  resource_file
for example
  galloway>>/LTCHUNK/ltpos -server  4243          /LTCHUNK/data/resource.xml

where  galloway is the name of your machine where 4243 port to be
used as Internet socket.

Now, when you want to run the chunker you should provide it with the
information about the host and the port. For the examples above this
will be:

 >> cat /LTCHUNK/EXAMPLES/text     | /LTCHUNK/bin/ltchunk -host galloway -port 4243                     
 >> cat /LTCHUNK/EXAMPLES/text     | /LTCHUNK/bin/ltchunk -host galloway -port 4243 -show_tags           
 >> cat /LTCHUNK/EXAMPLES/text.xml | /LTCHUNK/bin/ltchunk -host galloway -port 4243 -q ".*/TEXT" -qs ".*/P"            
 >> cat /LTCHUNK/EXAMPLES/text.xml | /LTCHUNK/bin/ltchunk -host galloway -port 4243 -q ".*/TEXT" -qs ".*/P" -show_tags 




