edu.iastate.jtm
Class EntityFinder

java.lang.Object
  extended by edu.iastate.jtm.gui.DefaultMonitorable
      extended by edu.iastate.jtm.EntityFinder
All Implemented Interfaces:
Monitorable
Direct Known Subclasses:
Highlighter, MedCrawler

public class EntityFinder
extends DefaultMonitorable

Author:
dingjing

Nested Class Summary
 class EntityFinder.Hit
           
 
Field Summary
protected  TrieDictionary globalDic
           
protected  EntityFinder.Hit[] hits
           
protected  AbstractDictionary localDic
           
protected  AbstractDictionary peekDic
           
protected  java.util.LinkedHashMap peekRegex
           
protected  PluralDetector pluralDetector
           
 
Fields inherited from class edu.iastate.jtm.gui.DefaultMonitorable
message, monitorable, progress
 
Constructor Summary
EntityFinder()
           
EntityFinder(int ml, boolean skipSpace)
          Creates a new instance of EntityFinder
 
Method Summary
 int findEntity(java.lang.CharSequence sen)
          Find entities in a string.
 java.util.Set getEntitiesFound()
           
 int getEntityCount()
           
 TrieDictionary getGlobalDictionary()
           
 EntityFinder.Hit getHit(int count)
           
 int getHitsCount()
           
 PluralDetector getPluralDetector()
           
 java.lang.String getTaggedText(java.lang.String tag, java.lang.String appendix, boolean addEqual)
           
 int getTotalHitsCount()
           
 int getTotalSenCount()
           
 void loadGlobalDictionary(java.io.File dic, boolean keyFirst)
           
 void loadPeekDefinition(java.io.File dic)
           
 void loadPluralDictionary(java.io.File dic)
           
 void loadPluralDictionary(java.net.URL dic)
           
 void outputHits()
           
 void setHitsThreshold(int t)
           
 void setMaxSentenceLength(int m)
           
 void setPeekNext(boolean p)
           
 void setRejectHits(boolean h)
           
 void setRejectLong(boolean r)
           
 void setVerbose(boolean v)
           
 
Methods inherited from class edu.iastate.jtm.gui.DefaultMonitorable
getMessage, getProgress, isDeterministic, isFinished, isMonitorable, isRunning, setMessage, setMonitorable, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

EntityFinder

public EntityFinder(int ml,
                    boolean skipSpace)
Creates a new instance of EntityFinder

Parameters:
skipSpace -

EntityFinder

public EntityFinder()
Method Detail

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.