Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
wlfxb - a library for creating and processing of TCF data streams. Copyright (C) Yana Panchenko. This file is part of wlfxb. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 
 package eu.clarin.weblicht.wlfxb.lx.xb;
 
 import java.util.List;

Author(s):
Yana Panchenko
 
 public class PosTagsLayerStored extends LexiconLayerStoredAbstract implements PosTagsLayer {
 
     public static final String XML_NAME = "POStags";
     @XmlAttribute(name = ., required = true)
     private String tagset;
     @XmlElement(name = .)
     private List<PosTagStoredtags = new ArrayList<PosTagStored>();
     private LexiconLayersConnector connector;
 
     protected PosTagsLayerStored() {
     }
 
     protected PosTagsLayerStored(String tagset) {
         this. = tagset;
     }
 
     protected PosTagsLayerStored(LexiconLayersConnector connector) {
         this. = connector;
     }
 
     protected void setLayersConnector(LexiconLayersConnector connector) {
         this. = connector;
         for (PosTagStored tag : ) {
             connect(tagconnector.lemmaId2ItsLemma.get(tag.lemRef));
         }
     }
 
     private void connect(PosTagStored tagLemma lemma) {
         if (!..containsKey(lemma)) {
             ..put(lemmanew ArrayList<PosTag>());
         }
         ..get(lemma).add(tag);
     }
 
     @Override
     public boolean isEmpty() {
         return .isEmpty();
     }
 
     @Override
     public int size() {
         return .size();
     }
 
     @Override
     public String getTagset() {
         return ;
     }
 
     @Override
     public PosTag getTag(int index) {
         PosTag tag = .get(index);
         return tag;
     }
 
     @Override
     public PosTag[] getTags(Lemma lemma) {
         if (..containsKey(lemma)) {
             List<PosTagtagsList = ..get(lemma);
             PosTag[] posTags = tagsList.toArray(new PosTag[tagsList.size()]);
            return posTags;
        }
        return null;
    }
    @Override
    public Lemma getLemma(PosTag tag) {
        if (tag instanceof PosTagStored) {
            PosTagStored tagStored = (PosTagStoredtag;
            return ..get(tagStored.lemRef);
        } else {
            return null;
        }
    }
    @Override
    public PosTag addTag(String tagStringLemma tagLemma) {
        PosTagStored tag = new PosTagStored();
        tag.tagString = tagString;
        tag.lemRef = tagLemma.getID();
        connect(tagtagLemma);
        .add(tag);
        return tag;
    }
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(" : ");
        sb.append(.toString());
        return sb.toString();
    }
New to GrepCode? Check out our FAQ X