コード例 #1
0
ファイル: Synset.java プロジェクト: cyrilmhansen/ExtJWNL
 private void removeFromIndexWords(Word word) {
   if (null != dictionary && dictionary.isEditable()) {
     try {
       // take care of IndexWords
       IndexWord indexWord = dictionary.getIndexWord(getPOS(), word.getLemma());
       if (null != indexWord) {
         indexWord.getSenses().remove(Synset.this);
       }
     } catch (JWNLException e) {
       if (log.isErrorEnabled()) {
         log.error(JWNL.resolveMessage("EXCEPTION_001", e.getMessage()), e);
       }
     }
   }
 }
コード例 #2
0
ファイル: Synset.java プロジェクト: cyrilmhansen/ExtJWNL
 private void addToIndexWords(Word word) {
   if (null != dictionary && dictionary.isEditable()) {
     try {
       // take care of IndexWords
       IndexWord iw = dictionary.getIndexWord(word.getPOS(), word.getLemma());
       if (null == iw) {
         dictionary.createIndexWord(word.getPOS(), word.getLemma(), Synset.this);
       } else {
         iw.getSenses().add(Synset.this);
       }
     } catch (JWNLException e) {
       if (log.isErrorEnabled()) {
         if (log.isErrorEnabled()) {
           log.error(JWNL.resolveMessage("EXCEPTION_001", e.getMessage()), e);
         }
       }
     }
   }
 }