All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.utah.bmi.nlp.context.common.ConTextSpan Maven / Gradle / Ivy

Go to download

FastContext is an optimized Java implementation of ConText algorithm (https://www.ncbi.nlm.nih.gov/pubmed/23920642). It runs two orders of magnitude faster than previous two popular implementations: JavaConText and GeneralConText. Version 2.0 includes UIMA wrapper

The newest version!
/*
 * ******************************************************************************
 *  * Copyright  2017  Department of Biomedical Informatics, University of Utah
 *  * 

* * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * *

* * http://www.apache.org/licenses/LICENSE-2.0 * *

* * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * ****************************************************************************** */ package edu.utah.bmi.nlp.context.common; import edu.utah.bmi.nlp.core.Span; import edu.utah.bmi.nlp.context.common.ContextValueSet.TriggerTypes; /** * This is a class to store the span information of either Concept or ConText. *

* "id" is an optional field that can be used to store the rule id information, which is easy to be mapped to a score or rule name. *

* * @author Jianlin Shi on 6/24/15. */ public class ConTextSpan extends Span { public int winBegin, winEnd, ruleId; public TriggerTypes matchedDirection; public ConTextSpan(int begin, int end) { super(begin, end); initiate(-1, -1, -1); } public ConTextSpan(int begin, int end, int id) { super(begin, end); initiate(-1, -1, id); } public ConTextSpan(int begin, int end, int id, int winBegin, int winEnd) { super(begin, end); initiate(id, winBegin, winEnd); } protected void initiate(int winBegin, int winEnd, int ruleId) { this.ruleId = ruleId; this.winBegin = winBegin; this.winEnd = winEnd; } public String toString() { return "begin=" + begin + "\tend=" + end+ "\twinBegin=" + winBegin+ "\twinEnd=" + winEnd + "\truleId=" + ruleId; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy