Class POSAnnotator
- java.lang.Object
-
- org.apache.uima.analysis_component.AnalysisComponent_ImplBase
-
- org.apache.uima.analysis_component.Annotator_ImplBase
-
- org.apache.uima.analysis_component.JCasAnnotator_ImplBase
-
- de.julielab.jcore.ae.jpos.postagger.POSAnnotator
-
- All Implemented Interfaces:
org.apache.uima.analysis_component.AnalysisComponent
public class POSAnnotator extends org.apache.uima.analysis_component.JCasAnnotator_ImplBase
-
-
Constructor Summary
Constructors Constructor Description POSAnnotator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SentencecreateUnitSentence(ArrayList<de.julielab.jcore.types.Token> tokenList, org.apache.uima.jcas.JCas JCas)Takes all info about meta data and generates the corresponding unit sequence represented by a Sentence object.voidinitialize(org.apache.uima.UimaContext aContext)Initialisiation of UIMA-JNET.voidprocess(org.apache.uima.jcas.JCas aJCas)process current CAS.voidwriteToCAS(Sentence unitSentence, org.apache.uima.jcas.JCas aJCas, ArrayList<de.julielab.jcore.types.Token> tokenList)creates the respective uima annotations from JPOS's predictions.-
Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_ImplBase
getRequiredCasInterface, process
-
Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase
getCasInstancesRequired, hasNext, next
-
-
-
-
Method Detail
-
initialize
public void initialize(org.apache.uima.UimaContext aContext) throws org.apache.uima.resource.ResourceInitializationExceptionInitialisiation of UIMA-JNET. Reads in and checks descriptor's parameters.- Specified by:
initializein interfaceorg.apache.uima.analysis_component.AnalysisComponent- Overrides:
initializein classorg.apache.uima.analysis_component.AnalysisComponent_ImplBase- Throws:
org.apache.uima.resource.ResourceInitializationException
-
process
public void process(org.apache.uima.jcas.JCas aJCas) throws org.apache.uima.analysis_engine.AnalysisEngineProcessExceptionprocess current CAS. In case, abbreviation expansion is turned on, the abbreviation is replaced by its full form which is used during prediction. The labels of this full form are then applied to the original, short form.- Specified by:
processin classorg.apache.uima.analysis_component.JCasAnnotator_ImplBase- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
-
createUnitSentence
protected Sentence createUnitSentence(ArrayList<de.julielab.jcore.types.Token> tokenList, org.apache.uima.jcas.JCas JCas)
Takes all info about meta data and generates the corresponding unit sequence represented by a Sentence object. Abbreviation is expanded when specified in descriptor. Only abbreviations which span over single tokens can be interpreted here. Other case (which is very rare and thus probably not relevant) is ignored!- Parameters:
tokenList- a list of Token objects of the current sentenceJCas- the CAS we are working onmetaList- a Arraylist of meta-info HashMaps which specify the meta information of the respective token- Returns:
- an array of two sequences of units containing all available meta data for the corresponding tokens. In the first sequence, abbreviations are expanded to their fullform. In the second sequence, the tokens are of their original form.
-
writeToCAS
public void writeToCAS(Sentence unitSentence, org.apache.uima.jcas.JCas aJCas, ArrayList<de.julielab.jcore.types.Token> tokenList) throws org.apache.uima.analysis_engine.AnalysisEngineProcessException
creates the respective uima annotations from JPOS's predictions. Therefore, we loop over JPOS's Sentence objects which contain predictions/labels for each Unit (i.e., for each token).- Parameters:
unitSentence- the current Sentence objectaJCas- the cas to write the annotation totokenList-- Throws:
org.apache.uima.analysis_engine.AnalysisEngineProcessException
-
-