@@ -0,0 +1,2098 @@
+/*%0A * Copyright 2008 Novamente LLC%0A * Copyright 2009 Linas Vepstas%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage relex.entity;%0A%0Aimport java.io.Serializable;%0Aimport java.util.List;%0A%0Apublic abstract class EntityTagger%0A%7B%0A%09// An array of EntityInfos, ordered by their order in the sentence%0A%09private List%3CEntityInfo%3E orderedEntityInfos;%0A%0A%09public abstract List%3CEntityInfo%3E tagEntities(String sentence);%0A%0A%09// --------------------------------------------------------%0A%0A%09/**%0A%09 * Add the entity info to the list, inserting it in sorted order.%0A%09 */%0A%09public void addEntity(EntityInfo ei)%0A%09%7B%0A%09%09if (null == orderedEntityInfos)%0A%09%09%09orderedEntityInfos = new ArrayList%3CEntityInfo%3E();%0A%0A%09%09int open = 0;%0A%09%09int start = ei.getFirstCharIndex();%0A%09%09int end = ei.getLastCharIndex();%0A%09%09for (EntityInfo e: orderedEntityInfos)%0A%09%09%7B%0A%09%09%09int beg = e.getFirstCharIndex();%0A%09%09%09if ((open %3C= start) && (end %3C= beg))%0A%09%09%09%7B%0A%09%09%09%09int idx = orderedEntityInfos.indexOf(e);%0A%09%09%09%09orderedEntityInfos.add(idx, ei);%0A%09%09%09%09return;%0A%09%09%09%7D%0A%09%09%09open = e.getLastCharIndex();%0A%0A%09%09%09// If our entity overlaps with existing entities, ignore it.%0A%09%09%09if (start %3C open) return;%0A%09%09%7D%0A%09%09orderedEntityInfos.add(ei);%0A%09%7D%0A%0A%09// --------------------------------------------------------%0A%0A%09/**%0A%09 * Return all EntityInfo's ordered by their starting character%0A%09 * position.%0A%09 */%0A%09public List%3CEntityInfo%3E getEntities()%0A%09%7B%0A%09%09return orderedEntityInfos;%0A%09%7D%0A%0A%09public boolean equals(Object other)%0A%09%7B%0A%09%09if (! (other instanceof EntityTagger)) return false;%0A%09%09EntityTagger et = (EntityTagger)other;%0A%09%09return this.orderedEntityInfos.equals(et.orderedEntityInfos);%0A%09%7D%0A%7D%0A

Add the missing interface class