Package simplenlg.lexicon

Examples of simplenlg.lexicon.XMLLexicon


    // below is a simple complete example of using simplenlg V4
    // afterwards is an example of using simplenlg just for morphology
   
    // set up
    Lexicon lexicon = new XMLLexicon();                          // default simplenlg lexicon
    NLGFactory nlgFactory = new NLGFactory(lexicon);             // factory based on lexicon

    // create sentences
    //   "John did not go to the bigger park. He played football there."
    NPPhraseSpec thePark = nlgFactory.createNounPhrase("the", "park");   // create an NP
View Full Code Here


  @Override
  @Before
  protected void setUp() {
    //this.lexicon = new NIHDBLexicon("A:\\corpora\\LEX\\lexAccess2011\\data\\HSqlDb\\lexAccess2011.data"); // NIH lexicon
    //lexicon = new XMLLexicon("E:\\NIHDB\\default-lexicon.xml");    // default XML lexicon
    lexicon = new XMLLexicon()// built in lexicon
    this.phraseFactory = new NLGFactory(this.lexicon);
    this.realiser = new Realiser(this.lexicon);
   
    this.man = this.phraseFactory.createNounPhrase("the", "man"); //$NON-NLS-1$ //$NON-NLS-2$
    this.woman = this.phraseFactory.createNounPhrase("the", "woman")//$NON-NLS-1$//$NON-NLS-2$
View Full Code Here

   */
  public void setUp() {
    long startTime = System.currentTimeMillis();
    //this.lexicon = new XMLLexicon(XML_FILENAME); // omit, use default
                            // lexicon instead
    this.lexicon = new XMLLexicon();
    long stopTime = System.currentTimeMillis();
    ;
    System.out.format("Loading XML lexicon took %d ms%n", stopTime
        - startTime);

View Full Code Here

      lexicon = null;
      lexiconType = null;
    }

    if (lexType == LexiconType.XML) {
      lexicon = new XMLLexicon(lexFile);
    } else if (lexType == LexiconType.NIHDB) {
      lexicon = new NIHDBLexicon(lexFile);
    } else if (lexType == LexiconType.DEFAULT) {
      lexicon = Lexicon.getDefaultLexicon();
    }
View Full Code Here

  MultipleLexicon lexicon;


  @Before
  public void setUp() throws Exception {
    this.lexicon = new MultipleLexicon(new XMLLexicon(XML_FILENAME), new NIHDBLexicon(DB_FILENAME));
  }
View Full Code Here

TOP

Related Classes of simplenlg.lexicon.XMLLexicon

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.