edu.iastate.jtm
Class EntityFinder
java.lang.Object
edu.iastate.jtm.gui.DefaultMonitorable
edu.iastate.jtm.EntityFinder
- All Implemented Interfaces:
- Monitorable
- Direct Known Subclasses:
- Highlighter, MedCrawler
public class EntityFinder
- extends DefaultMonitorable
- Author:
- dingjing
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
pluralDetector
protected PluralDetector pluralDetector
globalDic
protected TrieDictionary globalDic
peekDic
protected AbstractDictionary peekDic
localDic
protected AbstractDictionary localDic
peekRegex
protected java.util.LinkedHashMap peekRegex
hits
protected EntityFinder.Hit[] hits
EntityFinder
public EntityFinder(int ml,
boolean skipSpace)
- Creates a new instance of EntityFinder
- Parameters:
skipSpace -
EntityFinder
public EntityFinder()
loadPluralDictionary
public void loadPluralDictionary(java.io.File dic)
throws java.io.IOException
- Parameters:
dic -
- Throws:
java.io.IOException
loadPluralDictionary
public void loadPluralDictionary(java.net.URL dic)
throws java.io.IOException
- Throws:
java.io.IOException
getPluralDetector
public PluralDetector getPluralDetector()
loadGlobalDictionary
public void loadGlobalDictionary(java.io.File dic,
boolean keyFirst)
throws java.io.IOException
- Parameters:
dic - keyFirst -
- Throws:
java.io.IOException
getGlobalDictionary
public TrieDictionary getGlobalDictionary()
loadPeekDefinition
public void loadPeekDefinition(java.io.File dic)
throws java.io.IOException
- Throws:
java.io.IOException
setVerbose
public void setVerbose(boolean v)
- Parameters:
v -
setRejectLong
public void setRejectLong(boolean r)
setRejectHits
public void setRejectHits(boolean h)
setPeekNext
public void setPeekNext(boolean p)
setMaxSentenceLength
public void setMaxSentenceLength(int m)
setHitsThreshold
public void setHitsThreshold(int t)
getTotalHitsCount
public int getTotalHitsCount()
getHitsCount
public int getHitsCount()
getHit
public EntityFinder.Hit getHit(int count)
getTotalSenCount
public int getTotalSenCount()
getEntityCount
public int getEntityCount()
getEntitiesFound
public java.util.Set getEntitiesFound()
outputHits
public void outputHits()
getTaggedText
public java.lang.String getTaggedText(java.lang.String tag,
java.lang.String appendix,
boolean addEqual)
- Parameters:
tag - appendix -
- Returns:
findEntity
public int findEntity(java.lang.CharSequence sen)
- Find entities in a string. Abbreviations may be added into the local
dictionary.
- Parameters:
sen - String to be searched
- Returns:
- Number of entities found, not number of hits.