tml.annotators
Class AnnotatorManager

java.lang.Object
  extended by tml.annotators.AnnotatorManager

public class AnnotatorManager
extends java.lang.Object

This class implements the management of meta information in sentence level. It searches the lucene index where the sentences are stored, and then parsed the sentence and insert the annotated sentence into Mysql database. The setting for lucene index file path and Mysql database are read from TML property file

Author:
Ming Liu

Constructor Summary
AnnotatorManager()
           
 
Method Summary
 void dbinsert(java.lang.String sentenceid, java.lang.String docid, java.lang.String annotatedtext, java.lang.String type, double time)
          insert meta info into Mysql database
 void getAnnotators()
          get all the annotators configured in TML property file
 java.util.ArrayList<java.lang.String> getMetaInfoBydocId(java.lang.String docid, java.lang.String type)
          retrieve metainfo by documentid and annotation type from Mysql database
 java.util.HashMap<java.lang.String,java.lang.String> getSentenceFromLucene(java.lang.String documentid)
          retrive sentence id and value in pair from lucene index by documentid
 void insertDocTable(java.lang.String docid)
           
 void insertMetainfoToDB()
          insert the annotated text into Mysql DB.
 java.util.ArrayList<java.lang.String> searchDocTable()
           
 void updateDocTable(java.lang.String docid, java.lang.String status)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotatorManager

public AnnotatorManager()
                 throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

insertMetainfoToDB

public void insertMetainfoToDB()
insert the annotated text into Mysql DB.


getSentenceFromLucene

public java.util.HashMap<java.lang.String,java.lang.String> getSentenceFromLucene(java.lang.String documentid)
retrive sentence id and value in pair from lucene index by documentid

Parameters:
documentid -
Returns:
a Hashmap where the key contains sentenceid and the value contains its content.

getMetaInfoBydocId

public java.util.ArrayList<java.lang.String> getMetaInfoBydocId(java.lang.String docid,
                                                                java.lang.String type)
retrieve metainfo by documentid and annotation type from Mysql database

Parameters:
docid -
type -
Returns:
an ArrayList which contains the annotation information of each sentence

dbinsert

public void dbinsert(java.lang.String sentenceid,
                     java.lang.String docid,
                     java.lang.String annotatedtext,
                     java.lang.String type,
                     double time)
insert meta info into Mysql database

Parameters:
sentenceid -
docid -
annotatedtext -
type -

getAnnotators

public void getAnnotators()
get all the annotators configured in TML property file


insertDocTable

public void insertDocTable(java.lang.String docid)

searchDocTable

public java.util.ArrayList<java.lang.String> searchDocTable()

updateDocTable

public void updateDocTable(java.lang.String docid,
                           java.lang.String status)