org.hops.lg.pg
Class PhrasesGenerator

java.lang.Object
  extended by org.hops.lg.pg.PhrasesGenerator

public class PhrasesGenerator
extends java.lang.Object

This class gets an xml file containing a Language Descriptor FOR ONE LANGUAGE and generates the phrases file feed by the HopsLang


Constructor Summary
PhrasesGenerator()
          Creates a new instance of PhrasesGenerator
 
Method Summary
 void generatePhrases()
          Generates all the phrases for all the LanguageDescriptors in the system
 void PrintHopsPhrases(java.io.OutputStream oout)
          all_phrases is a HashMap of rules.
 void PrintLexicon(java.io.OutputStream oout)
           
 void PrintPhrases(java.io.OutputStream oout)
           
 boolean ProcessFiles(java.lang.String[] files)
          Process the specified files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PhrasesGenerator

public PhrasesGenerator()
Creates a new instance of PhrasesGenerator

Method Detail

ProcessFiles

public boolean ProcessFiles(java.lang.String[] files)
Process the specified files. Is the same result as calling first SetFilesProcessFiles()

Parameters:
files - contain the name of the files. They will be stored internally (and previous ones will be removed)
Returns:
boolean. True if all the input files are correct, otherwise returns false.

generatePhrases

public void generatePhrases()
Generates all the phrases for all the LanguageDescriptors in the system


PrintPhrases

public void PrintPhrases(java.io.OutputStream oout)
                  throws java.io.IOException
Throws:
java.io.IOException

PrintHopsPhrases

public void PrintHopsPhrases(java.io.OutputStream oout)
                      throws java.io.IOException
all_phrases is a HashMap of rules. Indexes are: type-name Each field in the hash has an arraylist that in the pair position the order and in the oddposition the arraylist of phrases: - order + arraylist of phrases

Throws:
java.io.IOException

PrintLexicon

public void PrintLexicon(java.io.OutputStream oout)
                  throws java.io.IOException
Throws:
java.io.IOException