1   /*
2    *  NLGLexWordImpl.java
3    *
4    *  Copyright (c) 1998-2005, The University of Sheffield.
5    *
6    *  This file is part of GATE (see http://gate.ac.uk/), and is free
7    *  software, licenced under the GNU Library General Public License,
8    *  Version 2, June 1991 (in the distribution as file licence.html,
9    *  and also available at http://gate.ac.uk/gate/licence.html).
10   *
11   *  Kalina Bontcheva, 28/January/2003
12   *
13   *  $Id: NLGLexWordImpl.java,v 1.3 2005/01/11 13:51:36 ian Exp $
14  
15   */
16  
17  package gate.lexicon;
18  
19  import java.io.Serializable;
20  
21  public class NLGLexWordImpl extends MutableWordImpl implements Serializable {
22  
23    static final long serialVersionUID = -3076810814718212187L;
24  
25    public NLGLexWordImpl(String lemma) {
26      super(lemma);
27    }
28    public LexKBWordSense addSense(int index, MutableLexKBSynset wordSynset) {
29      MutableLexKBSynset newSynset = wordSynset;
30      if (newSynset == null)
31        throw new RuntimeException("A valid synset must be provided!");
32      NLGLexWordSense newSense = new NLGLexWordSenseImpl(
33          this, newSynset, index, newSynset.getWordSenses().size());
34      getWordSenses().add(index, newSense);
35      newSynset.addWordSense(newSense);
36      return newSense;
37    }
38  
39  
40  }