Hunpars

Hunpars is a syntactic parser for the Hungarian language. It takes a file with
sentences, and produces the syntactic trees of them in a simple bracketing 
notation and in GraphViz dot language (easily comprehensible jpg tree images can
be generated from these dot files).

Software requirements:
- Python 2.4 or higher
- hunmorph morphological analyser
- GraphViz (http://www.graphviz.org)

It can be used in two different ways:

1. With hunmorph morphological analyser (recommended):

This way the words of the sentences are analysed by hunmorph, and a dictionary
file is created from the results. Then Hunpars uses this dictionary to
parse the sentences. The usage of the programs is simplified with a shell script
(for UNIX systems) and with a batch file (for Windows systems) 

Usage:

  UNIX:

    ./szhparser_morph.sh HUNMORPH_BIN_FILE SENTENCE_FILE OUTPUT_NAME DEBUG_LEVEL

  Windows:

    Command line usage:
      szhparser_morph.bat HUNMORPH_BIN_FILE  SENTENCE_FILE OUTPUT_NAME DEBUG_LEVEL
    
    You can also click on the szhparser_morph_def.bat file, which contains the
    default values for these parameters (and of course you can also edit this
    file to suit your own needs).
    
Description of the command line parameters:

  Please note that all text files used by Hunpars must be in UTF-8 encoding.
  
  HUNMORPH_BIN_FILE
    Name of the hunmorph (ocamorph) resource file (see ocamorph documentation).

  SENTENCE_FILE
    Input file, it contains one sentence in each line.
  
  OUTPUT_NAME
    The output files are put in a directory called OUTPUT_NAME_output.
    For every sentence some dot files are created.
    Naming of the dot files:
      OUTPUT_NAME_sentence_I_sentvar_J_analysis_K.dot
        This is the dot file of the Kth analysis (there can be multiple
        syntactic analyses of a sentence) of the Jth sentence variation
        (sentence variations are created using the multiple morphological
        analyses of the words) of the Ith sentence in the input file.
    A log file is also created for every sentence (the contens of the log file
    is controlled by the debug level):
      OUTPUT_NAME_sentence_I.log
    If the compilation of a dictionary line has been failed than it is
    logged in the OUTPUT_NAME_dict_read.log file.
    All results are printed in OUTPUT_NAME_results.txt.
  
  DEBUG_LEVEL
    Possible values: ERROR, WARNING, INFO, DEBUG.
  
Description of the resource files:

  verblist
    A verb list text file containing one verb in each line. It is used for
    matching verbs and preverbs.
  
  argstore.xml
    An xml file containing the possible arguments of adjectives and
    postpositions.

Generating the tree image files:

  You can generate image files from dot files using the GraphViz package. A
  small python script is included in the parser for simplifying this job: with
  dot2jpg.py you can generate jpg files from all dot files found in the current
  directory.
  
2. With a dictionary file:

  If you do not have the hunmorph morphological analyser installed then you can
  use Hunpars with a dictionary file. The dictionary file must contain every
  word forms found in the sentences.
  
Usage:

  UNIX:
  
    ./szhparser_dict.sh SENTENCE_FILE DICT_FILE OUTPUT_NAME DEBUG_LEVEL
    
  Windows:

    Command line usage:
      szhparser_dict.bat SENTENCE_FILE DICT_FILE OUTPUT_NAME DEBUG_LEVEL
    
    You can also click on the szhparser_dict_def.bat file, which contains the
    default values for these parameters (and of course you can also edit this
    file to suit your own needs).
  
Description of the command line parameters:
  
  Same as above, and:
  
  DICT_FILE
    The dictionary file containing a word and its morphological analysis in
    every line.
    
Tip: if you have an other machine with hunmorph installed, you can generate
a dictionary file for your sentences with the createKRDic.py script.
