opennlp.grok.lexicon
Class LexiconAdapter

java.lang.Object
  |
  +--opennlp.grok.lexicon.LexiconAdapter
All Implemented Interfaces:
opennlp.common.parse.Lexicon
Direct Known Subclasses:
LMRLexicon

public abstract class LexiconAdapter
extends java.lang.Object
implements opennlp.common.parse.Lexicon

A helpful class which lexicons can extend so that the string can be preprocessed. At this moment, the string is sentence detected, tokenized, and name tagged. Names are automatically given NP categories and all other tokens are retrieved from sub-lexicon.

Version:
$Revision: 1.11 $, $Date: 2002/08/06 16:45:56 $
Author:
Gann Bierner

Constructor Summary
LexiconAdapter(java.util.Properties g)
           
 
Method Summary
 java.util.List getWords(opennlp.common.xml.NLPDocument doc)
          Given a string, preprocesses it and gets lexical entries for individual components.
 java.util.List getWords(java.lang.String s)
           
protected  void snarfTokens(opennlp.common.xml.NLPDocument doc, java.util.List entries)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface opennlp.common.parse.Lexicon
getWord
 

Constructor Detail

LexiconAdapter

public LexiconAdapter(java.util.Properties g)
Method Detail

getWords

public java.util.List getWords(opennlp.common.xml.NLPDocument doc)
                        throws opennlp.common.parse.LexException
Given a string, preprocesses it and gets lexical entries for individual components. Right now, this can only handle a single sentence.

Specified by:
getWords in interface opennlp.common.parse.Lexicon
Returns:
a list of WordHashes
opennlp.common.parse.LexException

getWords

public java.util.List getWords(java.lang.String s)
                        throws opennlp.common.parse.LexException
Specified by:
getWords in interface opennlp.common.parse.Lexicon
opennlp.common.parse.LexException

snarfTokens

protected void snarfTokens(opennlp.common.xml.NLPDocument doc,
                           java.util.List entries)
                    throws opennlp.common.parse.LexException
opennlp.common.parse.LexException


Copyright © 2003 Jason Baldridge and Gann Bierner. All Rights Reserved.